#unix

1 messages · Page 62 of 1

slender plank
#

ok thanks

#

and am i limited to ethernet now

#

?

fallow tusk
#

Until you work out how to get those extra files to enable your wifi

slender plank
#

yeah okay

fallow tusk
#

I'd google debian <name of stuff in that image> that should be good enough to find what you need

#

I hardly ever use a graphical package manager!

#

Aptitude, maybe…

#

Linux has come a long way. When I last used Debian I didn't get a graphical desktop.

slender plank
#

how old are you guys?

fallow tusk
#

Mainly because X was a pain to set up

#

Older than I care to let on!

slender plank
#

15 here ✋

fallow tusk
#

Hehe…

#

This server does seem to have quite a wide age range.

dry sapphire
#

last time i used was 2 yrs ago ( any kinda gui package manager )

slender plank
#

what do you guys think of the crash course 2nd edition book for beginners?

dry sapphire
slender plank
#

i started learning less than a month ago and so far ive been satisfied by how everything is explained

#

Also tried codewars aswell a couple days ago and i really like it

dry sapphire
#

nice

dry sapphire
fallow tusk
#

You got to san kyu, said sankyu and left? (Multilingual puns...probably doesn't work with this crowd)

slender plank
#

i train martial arts :)

#

I get it

fallow tusk
#

:D

#

What art?

slender plank
#

ninjutsu

fallow tusk
#

Ooh?

#

Who under?

#

I teach Bujinkan

slender plank
#

oo yeah

#

same

#

Are you in the US?

fallow tusk
#

UK

slender plank
#

okay

#

thats really nice

#

never thought id meet someone from bujinkan online :D

#

im from Macedonia btw

fallow tusk
#

Let me have a look. I may have met your instructor, then.

slender plank
#

Igor

#

its his name

fallow tusk
#

Maybe not. I'll have to dig out the business card

slender plank
#

try to find me on the site :D

#

Soon we will have guests from Turkey at our dojo

#

maybe you know Ercan

fallow tusk
#

That name rings a bell.

oak forum
#

how do i trigger my script when a new file is detected in folder

dry sapphire
fallow tusk
#

Sorry - should move off topic stuff off the channel.

oak forum
fallow tusk
#

No, I meant my conversation which wasn't

#

You're good!

oak forum
#
import os
import zipfile
import threading

directory = '//home//hardman//archives//'
extractdir = '//home//hardman//extracts//'


def runit():
    threading.Timer(1.0, runit).start()
    # listdir returns a list of files in the directory
    for filename in os.listdir(directory):
        if filename.endswith('.zip'):  # if the file ends with .zip
            # join the directory and the filename
            zippath = os.path.join(directory, filename)
            zfile = zipfile.ZipFile(zippath)  # open zip file
            # extracts all files in the zip file to the specified directory
            zfile.extractall(extractdir)
            zfile.close()  # close the zip file
            os.remove(zippath)  # delete the zip file


if __name__ == '__main__':
    runit()
#

sex my luck worked

#

ugh no clue

dry sapphire
oak forum
#

anyway thanks alot even tho im dumb

trail sapphire
royal barn
#

I'm not sure if this is the right channel, but I'll give it a shot: I've got a discord bot that runs on a VPS and I'd like for it to write its log files like the rest of the system's log files do: owned by the process user and the adm group... I have a systemd unit that runs the bot with the bot user and group (which is how other services like mysql do it), but it ends up creating the log file as bot:bot instead of bot:adm

prime magnet
royal barn
#

It’s not really a bot question, though. More of a “I’m running this thing as a daemon and I want it to write a log file with these permissions and ownership”

prime magnet
# royal barn It’s not really a bot question, though. More of a “I’m running this thing as a d...

yeah I noticed it though not sure if bot daemon has an option to setup user/group. If you are doing it manually, check step 4 - https://www.golinuxcloud.com/run-systemd-service-specific-user-group-linux/

GoLinuxCloud

run service as user linux. systemd allow user to start service. systemd start service as user on boot run systemd service as specific user group CentOS/RHEl 7/8

formal schooner
#

systemd is an option as well, but i don't know if you want to use systemd

royal barn
royal barn
royal barn
formal schooner
#

yeah no i was not suggesting running the bot as root

royal barn
formal schooner
#

oh, i see

#

the bot user is a member of adm though, right?

royal barn
#

No

formal schooner
#

ah

royal barn
#

(None of the other service users are either)

formal schooner
#

can you show your service unit file? just so i can see

royal barn
#

Will you be around later? I’m out at dinner right now.

formal schooner
#

depends on how late, you can @ me

#

i specifically wanted to know how you set up the logs

royal barn
#

I’m using python’s logging module with the watched file handler

#

Nothing special in the systemd unit file

#

@formal schooner I’ll be back home in about an hour or two

formal schooner
#

ah ok, that's what i wanted to know, thanks

#

mysql might start itself as root and then de-privilege itself

#

i know nginx does that

royal barn
#

Ah, that makes sense

#

Ok, then using sgid seems to be my best bet

formal schooner
#

otherwise a program definitely can't make a file owned by a group that it isn't a member of. and i don't think systemd has any provision for this (it sounds like you aren't using systemd to manage the log file anyway)

#

yeah, write the logs to a separate directory and use sgid or acl on the directory

royal barn
#

@formal schooner thanks for your help earlier... I went with sgid on the directory for the log files

gloomy lava
#

I hope i am at the right place here, so i wrote a small application to create template .html files and they are written inside the same directory the app is in. I changed the code to create a folder called "html" first and then put the .html files inside it to have it cleaner. It work fine on Linux, but when compiling an .app file and using it on Mac, the application crashes. Does anyone know why it crashes when compiled into a binary?

the line i used was: os.makedirs("./html") and the executable is compiled with pyinstaller --windowed --onefile tool.py

#

While compiling besides the app there is also an executable created that i can run from the terminal that doesn't crash when creating the directory

trail sapphire
gloomy lava
#

compiled it on the mac ofc

main olive
#

Hello guys i need help i am using pycharm on ubuntu and i am trying to run my script speechrecognition with sphinx and pyaudio but i get the errors
alsa lib pcm errors many
please can someone help me thanks

#

this is the error code

#
import speech_recognition as sr


def recordAudio():
    r = sr.Recognizer()
    r.energy_threshold=592.788971
    r.dynamic_energy_threshold=True
    with sr.Microphone() as source2:
        print('Rec.')
        r.adjust_for_ambient_noise(source2)
        audio=r.listen(source2)
    #data=''
    try:#sphinx is so so and offline
        print(r.recognize_sphinx(audio))

    except sr.UnknownValueError:
        print('I could not understand the audio, unknown error.')
    except sr.RequestError as e:
        print('Request results from Speech Recognition service error '+ e)

while True:
    recordAudio()
main olive
ionic goblet
#

Does anyone know why CPUs can only perform instructions in a register and not directy in memory

fallow tusk
#

I think the short, easy answer is "because that's how they're designed". The slightly longer answer is "memory supports read/write in byte-sized chunks; the ALU only performs bitwise operations on its own register(s)."

trail sapphire
ionic goblet
# trail sapphire registers is just memory as well, only that it's extremely little but fast memor...

Thanks, I researched further and this is what I took away

  1. Speed and efficiency: System memory is physically far away from the CPU thus directly interacting with the RAM itself is slow. Copying memory that needs to be mutated, writing to the registers then ultimately flushing the bytes-stream back to the system memory overwriting the original memory is faster than reading then directly reading and writing with every cycle one by one. A single assembly instruction might translate to multiple CPU cycles (because it might translate to multiple instructions for the cpu itself [figured out via microcode]) thus writing every cycle which would be very expensive. Acting on the fast registers and waiting for the last moment the set of instructions are completed to flush the memory. Overall, this reduces the frequency of writes as every CPU cycle the state is altered.

  2. Thread safety: A copy must be required to be safely acted on, multiple cores writing to the same address concurrently could corrupt and garble the memory

#

Tl;dr Memory is physically far away from the CPU's execution unit making writing to it expensive. Writing to the copy in register then writing and overwriting the final outcome back to the orignal memory address reduces write frequency thus making it faster

trail sapphire
trail sapphire
ionic goblet
trail sapphire
# ionic goblet Why is register mem the fastest?

to make the cpu as fast as possible the maker of the cpu implements the fastest memory for the registers that they can get there hands on as long as it's also viable (space, power, thermal and economical constraints) and as they don't need so much of that type of memory those constraints aren't to restrictive most of the time
this goes for cache memory as well, the closest (L1) to the execution units are the smallest (in terms of storage capacity) and fastest, but also most expensive, power hungry and sometimes bigger in terms of per byte, but as it isn't so much of it they can fit it in there anyways... and then it goes up from there with the L2 cache and so on

fallow tusk
# ionic goblet Why is register mem the fastest?

https://stackoverflow.com/a/62204316/2098827 This is a nice answer that covers both usage and physical implementation aspects, as well as "complicating factors" as he puts it. I'm also curious about the differences in the underlying electronics. What is it that's making the memory fast (beyond just distance and selection concerns), and why is that more expensive. Is it materials used, is it power usage? Presumably both in combination. This is stuff I probably touched on at uni, but has been lost to the lack of need to use it :)

main olive
#

module docstring before or after shebang?

trail sapphire
sudden socket
fallow tusk
# sudden socket what do you mean "making the memory fast"? the question is about why registers a...

No, I read the question was "what makes register memory faster than other types of memory" i.e. what is it that makes SRAM faster than DRAM? I was looking beyond the "cos it's closer" and "cos there's less of it" to the physical structure. While there is a difference in how many components (typically) make up SRAM and DRAM, I'm still not sure the differences account for anything speed related. There are a couple of 1-transistor SRAM designs out there, but they don't seem to be commercially viable; the commercially viable designs are (mostly?) 6-transistor cells, yet DRAM uses only a capacitor and a transistor per cell. I think the main difference is the need to periodically refresh the DRAM cells, and (back to how much is available) the amount of addressing infrastructure needed (much more in the case of the more plentiful DRAM)

#

I think the SRAM circuit behaves faster despite being made up of more components, but I'm not sure, and if that is the case, I don't know why that is (unless it is purely due to addressing and refresh needs)

#

I'm not sure this is #unix related, either :D

sudden socket
#

yeah, this is probably not the right server to find this expertise :P

fallow tusk
#

Well, it was part of my degree, so it ought to be in my remit... :)

sudden socket
#

and I learned discrete maths but here I am writing SaaS in python

fallow tusk
#

Eww ;)

#

But then, what else are you going to do with a maths degree :D

sudden socket
#

(my degree was CS)

fallow tusk
#

TV show host is one career route for maths grads, right?

#

I did Electronic Systems Engineering, but my first job was writing C, and I don't think I've done anything close to elec eng in my job beyond maybe a little soldering.

subtle fossil
#

I got tasked with porting a couple Python2 scripts to [practically anything else]. I was looking at duplicating some functionality in Rust, and I realized that shell things suddenly became non-trivial. Is the typical use of os/subprocess.XXX a dirty hack [edit: for interactive child processes like SSH]? It lies at the heart of invoke, too. For what I am working on, I don't need to control the shell. I am making a few API calls to process some data that is passed to anther command. Would a better approach be $ some_cmd $(my_bin)? The Python approach I have seen is subprocess.run("some_cmd" + API_STUFF) that is run under the parent process.

quick sun
#

I wrote some stuff with subprocess recently just because I needed run some commands--I could have done it all with API libraries (accessing secrets etc), but couldn't count on those libraries being installed where the python program was likely to be run.

#

To me, this is an area where our beloved python falls through the cracks. If a script relies heavily on other shell tools, well, bash is really quite capable. If it's more complicated, toolchains that blob all dependencies, like Rust and Golang, eliminate the dependency hunt step.

#

But that all depends on how much control you have of your environment. Sorry, this may be a tangent from your practical question!

#

In the end, I did what you said and used my python script to grab and format the input I needed for another command. $ some_cmd $(my_python_program), yes

trail sapphire
trail sapphire
quick sun
trail sapphire
quick sun
#

Oh cool! That's a fun list. I'm trying out Poetry for dependency management too--wonder how / if that integrates.

trail sapphire
#

these can be very good to know about if one needs to be able to run stuff in a more or less unknown environment (remote linux server, anyone?)

#

just beware of the ones that package a binary, they are tied to the type of system that it was created for because of the binary that is packaged with it (if that is even a concern of yours)
is is how ever true to some extent with the leaner ones too if one isn't careful to only use libraries that are written in pure python and only has such dependencies down the whole dependency tree, so you need to be extra careful about that if you still want it to be more platform independent even if you are diligent about writing your own code as such

trail sapphire
subtle fossil
#

Thanks for all the feedback! Platform isn't a concern as I'm in a 100% Debian shop.

trail sapphire
subtle fossil
#

CI takes care of most of that. I run over a matrix of arch/release. If it builds on CI, it will [probably 🙈] deploy.

round onyx
#

Say I want to write a code.. it’s a easy enough to either write it as bash script or python code.. which one is preferable and why?

trail sapphire
round onyx
#

Mostly file related operations.. checking files in directory, moving them here and there splitting data into multiple files and archival of those etc.. nothing fancy

prime magnet
round onyx
prime magnet
round onyx
#

what about performance, cpu usage?

#

If task is possible in both

prime magnet
#

unless is something that eats a lot of resources and/or, I put "comfortable to read and write" over performance

#

also. It depends on the operation. I have found interesting comparison of different ways to do stuff by searching in stackoverflow

prime magnet
#
round onyx
formal schooner
#

gnu grep specifically has a lot of options, but basic grep usage is pretty straightforward and worth learning how to use

#

no shame in switching to python for a less trivial task, though

fallow tusk
#

It may also depend on what the target system you expect them to be used in has available. If it's a minimal system, it may not have python (although most distros include it by default, now). There used to be a rationale for writing scripts for sh rather than bash, as everything was expected to havesh, but bash was not always available.

formal schooner
#

indeed. although nowadays as you point out, it's often easier and better to install a portable runtime/interpreter than to try to write portable scripts 🙂

fallow tusk
#

Yeah, it's only on really minimal systems that you're likely to run into issues nowadays.

#

Quick question of my own:
I am running diff -q filea fileb and seeing the expected returns of $? = 0 for no diff and $? = 1 for differences. That's good. But I thought if I did diff -q filea fileb && echo "DIFF" I would get DIFF only for those which returned 1. I appear to be getting it for files without differences, too. What am I forgetting?

formal schooner
#

&& is for "success" (i.e. return status 0), like boolean-and

fallow tusk
#

sigh Yeah.

#

I'm looking at it like a boolean on the 0, not on "success"

#

! diff -q ... worked, though.

formal schooner
#

yep it's reversed, easy to get confused

#

and yes, the ! builtin inverts the return code. 0 -> 1, nonzero -> 0

icy jolt
#

can i ask question about bash scripting here i need some help?

#
#!/bin/bash
PATH=/bin:/usr/bin

if [[ $# -ne 2 ]]
then
    echo "Usage: $0 <source-directory> <destination-directory>"
    exit 1
fi
if [[ ! -d $1 ]]; then
    echo "No such source directory $1"
    exit 1

elif [[ ! -d $2 ]]; then
    echo "Creating destination directory $2"
    mkdir $2
fi
for folder in $1/*
do
    for img in "$folder"/*
    do
        convert -resize 100 "${img}"
        echo "Creating thumbmnail for "`realpath $img`"as"`dirname $2`"/"`basename $img`
    done
done
#

i just need help on resizing the img and trasferring it over to the destination directory

buoyant cedar
#

What's wrong with what you have now?

icy jolt
#

it needs to return this when i run
./make-thumbnails <source-directory> <destination-directory>

formal schooner
#

it's also not clear what you're asking, your code looks fine other than the style issues above

icy jolt
#

i'm not sure how to transfer the resized image to the destination folder

#

and im not sure how to format echo "Creating thumbnails for <sourcedirectory> + (/name of img file) as <destinationdirectory>+(/name of img file)"

formal schooner
icy jolt
#

that makes sense

#

i literally started learning about bash today im still confused

trail sapphire
# icy jolt that makes sense

it's also recommended to stop using ticks for execution and use $(command goes here) like @formal schooner showed in the example above

trail sapphire
#

they are kind of legacy

icy jolt
#

so for converting the size do i just
mv convert -resize 100 "${img}" $2

trail sapphire
#

no, you must do them as separate commands, but you can just specify the output file instead to the convert command and forgo the mv

#

at the command prompt just type man convert and you have the manual for the command (if the man pages are installed on that system)

icy jolt
#

so
convert -resize 100 "${img}" mv $2

trail sapphire
icy jolt
#

im getting this error

#

what does the thumb_ do?

formal schooner
north jasper
#

Quick question

#

Does anyone know how to pass a variable from on BASH script to another if I call said BASH script from within the BASH script the variable originated from?

sudden socket
#

(why are you capitalizing bash?)

#

the first arg you pass is $1. see the arguments section of https://devhints.io/bash @north jasper

north jasper
#

thanks

desert plank
#

so that it gets inherited?

sudden socket
#

ohhhhhhhhh, good call

desert plank
#

both methods have their pros and cons I guess

sudden socket
#

@icy jolt consider adding set -euo pipefail to the top of the script

trail sapphire
#

looks pretty good at this point, but have you tried to run it with directory names that contains a space?
i think you need to be much more diligent on using double quotes around variables when dealing with strings that is treated as file paths or filenames, i see at least six instances where i think i will be needed

sudden socket
#

(also, obligatory "have you considered not writing a bash script and writing a python script instead?")

trail sapphire
sudden socket
#

every shell monstrosity starts off as a cute, "pretty simple" script

#

also, nothing here is even invoking anything else besides convert, so bash doesn't even seem suitable. all you're benefiting from is not writing subprocess.check_call(['convert', '-resize', '100', filename, os.path.join(sys.argv[2], bname)])

trail sapphire
sudden socket
#

no because by the time you notice it's becoming a monstrosity, people are too afraid to rewrite it for fear of breaking something (I don't understand bash arrays/these random options/this weird substitution syntax/this weird redirection/these weird [[]] checks)

#

it's always lower risk to add new functionality to something than to remove/replace it

trail sapphire
#

have you enclosed all the variables in double quotes yet and tested the script with both source and destination paths as well as filenames that contains space to catch any such blunders?

trail sapphire
#

in just that snippet i still see one variable that is unquoted and would give you trouble if the source directory contains at least one space

#

and did you fix all the other ones higher up in the code as well?

#

you don't want for filename in $1/* or for filename in "$1/*", but for filename in "$1/"* or for filename in "$1"/*

#

if the path had been /csse/misc/seng-workshop/nature images/ instead for example

trail sapphire
#

i don't know if they are strictly necessary, but i would add "" around $1 in the if statement and the $2 in the elif statement

trim cedar
#

Is it a good practice to run your python bot as a systemctl service on linux?

small wing
#

how do i make my code only start during a unix time?

formal schooner
formal schooner
#

but definitely make sure you don't run your service as root @trim cedar

formal schooner
small wing
fallow tusk
#

What do you mean by "during" a unix time/epoch? Start at an exact time? Or (be allowed to?) run only during a certain range of times?

formal schooner
sudden socket
#

systemd generally runs as init which is root. if you're not careful, it'll run your random python bot as root, which gives it elevated privileges

formal schooner
#
[Unit]
Description=My Bot
After=network.target

[Service]
User=discord-bot-user
Group=discord-bot-user
Type=simple
WorkingDirectory=/var/www/discord-bot
ExecStart=/var/www/discord-bot/run.py
prime magnet
#

how accurate is comment now? https://stackoverflow.com/questions/40216311/reading-in-environment-variables-from-an-environment-file#comment101007686_40216465.
Basically I want to use one file to setup envvars with following features:

  1. easy to read it from Python (without extra lib or ugly code). e.g. using configparser
  2. easy to read from bash, e.g. convert to array somehow
lapis finch
#

Hey, so I made a web app and now I am trying to set it up with nginx and unicorn. I cant seem to be able to serve static files
Heres my nginx file

server {
        listen 80;
        server_name 137.184.102.59;

        location /static {
                alias /root/portafolio/app/static;
        }

        location / {
                proxy_pass http://localhost:8000;
                include /etc/nginx/proxy_params;
                proxy_redirect off;
        }

}
#

Heres the project structure

portafolio
├── app
│   ├── __init__.py
│   ├── static
│   │   ├── css
│   │   │   └── style.css
│   │   ├── img
│   │   │   ├── api.jpg
│   │   │   ├── datamodel.jpg
│   │   │   ├── favicon.ico
│   │   │   ├── report.jpg
│   │   │   ├── report2.jpg
│   │   │   ├── toddy.jpg
│   │   │   └── woods.jpg
│   │   └── js
│   │       └── main.js
│   ├── templates
│   │   ├── crime.html
│   │   ├── layout.html
│   │   ├── main.html
│   │   └── projects.html
│   └── views.py
├── data.py
├── decorators.py
├── main.py
├── record.log
└── requirements.txt

And when inside static pwd returns /root/portafolio/app/static

#

Not sure what I am doing wrong, but when firing gunicorn i get plain html with no css and no imgs

#

Please tag me if you reply, thanks :)

trail sapphire
lapis finch
trail sapphire
lapis finch
trail sapphire
#

defensively, can you login on a local console on one of the four unix machines?

lapis finch
candid dove
prime magnet
lilac latch
#

hello

formal schooner
#

e.g. it does not cover the possible use case of embedded line break characters in the env var

prime magnet
deep dune
#

What’s unix??

covert glade
fallow tusk
#

A. It's not linux }:)

unique tundra
#

So I installed anaconda

#

but python3 normal config is used

kind coral
# deep dune What’s unix??

Unix did start of as an operating system which is now pretty much dead and many other operating systems are based off such as the bsd's and linux based operating systems and unix is just used as a catch all term for these derivatives.

deep dune
#

oh alright

finite crater
#

Most important powershell ive ever typed

(Get-ChildItem -Path $env:HOMEPATH | where { 
    $_.Name -match '^[.]' }
).Attributes='Hidden'
finite crater
#

it imitates unix behavior on windows

trail sapphire
finite crater
#

it's just a script that grabs all the files that have names with leading periods and makes them hidden. I accumulate a lot of files that are dotfiles in my windows home user dir.

#

Windows doesn't treat these files like dotfiles though because it has a different system for doing that.

#

The above code makes the files behave as you would expect them to on linux, as in being hidden by default

#

you could technically install powershell on unix if you wanted to lol

#

i use both operating systems so for me, the most relevant things are how things work differently between the two and how to find a middle ground of desired behavior from both

light gorge
wise forge
#

Best laptop companies for Linux? pithink

trail sapphire
marsh tusk
main olive
#

And you can get a pretty cheap one and upgrade it to be a decent computer.

light gorge
wise forge
#

Lenovo IdeaPad5

#

A working horse of a web dev

#

Too bad, the battery is not external

#

hmm... ThinkPads are available too, but I don't like their price and screen size

#

I think the found IdeaPad5 is ideal. The price for hardware definitely is

trail sapphire
wise forge
#

I'll just check the laptop in shop before buying xD

#

if Linux is launching from USB (even without installation) and internet is working out of the box, then everything is ok

trail sapphire
wise forge
#

if docker and KVM virtualization works, then it is already ok to me

#

i can make a test during the buying too for that

trail sapphire
trail sapphire
shut nebula
#
creat_user() {
    if id -u $1;
    then userdel $1;
    fi
    useradd $1
    
  here I need to call passwd $1 and get user input to pass it to passwd
}
``` how can I do that
main olive
#

can you replicate the error, now, after you've restarted your machine?

#

no no

#

can you replicate with the old variable?

#

or is the old variable available after the restart - after xport SOMEVAR="itsvalue" >> ~/.zshrc

#

there's a couple of things that could be here

#

can you try in the same terminal session (window):

export SOMEVAR="itsvalue"
start your jupyter notebook
import os; os.environ['SOMEVAR']. 
#

?

#

was the notebook main process running when you ran these commands?

#

from where?

#

the same terminal session?

#

did you run all commands and then restart notebooks within the same frame?

#

👍 gl

#

can someone more knowledgeable correct me, if I'm wrong. my instructions above should work, no? if you export a variable in a terminal session and you start a new process in the same session, it should have access to that variable?

sudden socket
#

yes

fresh path
#

What is the bes unix/linux distro to work with python?

#

*best unix/linux

sudden socket
#

doesn't really matter at all. use whatever you're comfortable with. if you don't have any familiarity, ubuntu is a popular starting point

main olive
#

agreed

#

also, don't use your distro for your python dev needs

#

use a manager like pyenv (asdf) and virtual environments

wise forge
main olive
#

python is in a lot of distros ;)

wise forge
main olive
#

yep

wise forge
#

Alpine distro has debuff: building python packages (including during pip install) 50x times slower

main olive
#

wait

#

nope

#

that's another issue

#

that's docker

#

any chance you're using macos?

#

any chance you have the latest and greatest mac based on m1? :)

wise forge
#

Regular PC and kubuntu distro

#

And yeah, it is in docker, but who cares

#

If it is in docker alpine, it means everywhere

main olive
#

no, it means you have different issues :)

#

Not every distro does it painlessly

#

I agree

wise forge
#

Well. It is 7 AM and I still haven't slept. Time to sleep

wise forge
#

That is it

#

Somewhere article is easily googled about it

main olive
#

alpine is a minimal distro. it has a lot of problems :)

wise forge
main olive
#

I did not know that. thanks

main olive
#

hello i currently have python 3.7.3 on my vps installed and i want to install python 3.8 but when i do sudo apt install python3.8 it fails
output:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.8
E: Couldn't find any package by glob 'python3.8'
E: Couldn't find any package by regex 'python3.8'
trail sapphire
main olive
trail sapphire
trail sapphire
main olive
trail sapphire
trail sapphire
# main olive this is my vps

what kind of vps, is it your own vm so that you can reinstall it?
you may be able to pick another os image that you want your vps to be based on

main olive
trail sapphire
patent osprey
#

hello

#

when I run /usr/share/discord/resources/app.asar command on linux it says bash permissions denied

#

cna someone help me with this pls

#

I even tried root /usr/share/discord/resources/app.asar but it didn't work

#

bash: /usr/share/discord/resources/app.asar: cannot execute binary file: Exec format error

proud nova
#

It means you're trying to run app.asar which is not an executable your computer can run

#

Where did you get this?

trail sapphire
trail sapphire
# main olive i think its shared

but i'm also starting to suspect that we have a xy-problem here, why did you want to upgrade from python 3.7.x to 3.8.x and what is your ultimate goal?

main olive
trail sapphire
main olive
trail sapphire
main olive
trail sapphire
main olive
#

yeah

trail sapphire
# main olive yeah

you don't have to be running a system python, you could install a new python version in parallel with the system one
where you able to run sudo apt update?

main olive
#

and yeah i can run sudo apt update

trail sapphire
# main olive and yeah i can run sudo apt update

that is a very good thing, then you have root privileges on the vps, and that means that the vps instance at least isn't shared with other customers, because that would be unsecure for all of you

main olive
#

i heard something of pyenv and that you can install python3.8 with it

trail sapphire
main olive
trail sapphire
#

that was what I meant by installing another python version in parallel with the one provided by thr system/os

main olive
#

ohh okay

trail sapphire
#

I think pyenv is the best, cleanest and easiest way to do that

main olive
#

yeah

trail sapphire
#

you don't even need root to install a new python version using pyenv, but you might need root access to install a few build tools if they aren't already installed on your system

main olive
#

what are the build tools?

trail sapphire
#

to be able to compile stuff if pyenv needs to

main olive
#

yeah i know that, i meant the name of the build tools

trail sapphire
#

i would suggest you first do a sudo apt dist-upgrade to update the system if you aren't up to date already

main olive
#

yeah im up to date

trail sapphire
#

good, then you can try sudo apt install build-essential

#

but if you have played with pyenv before chances are you already have that installed as well

main olive
#

i did that i already have it

trail sapphire
#

git clone https://github.com/pyenv/pyenv.git ~/.pyenv

main olive
#

i have that installed too

trail sapphire
#

try echo $PYENV_ROOT and echo $PATH | grep -c $PYENV_ROOT and command -v pyenv to see if your environment is setup correctly

trail sapphire
main olive
#

from build essentials:


Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.6).

trail sapphire
# main olive i have that installed too

i would also recommend to update pyenv by running the following commands as it was a little while since you installed it the last time:

pushd ~/.pyenv
git fetch --all
git reset --hard origin/master
popd
main olive
#

okay i did that

#

so i did echo $PATH | grep -c $PYENV_ROOT but it says Usage: grep [OPTION]... PATTERNS [FILE]...

trail sapphire
#

and from just the first command?

#

because it sounds like your environment variables isn't setup right yet

main olive
#

wheen i enter command -v pyenv the output is just pyenv

trail sapphire
#

okay, only the output from echo $PYENV_ROOT

main olive
#

its nothing

trail sapphire
#

okay, then we are missing some stuff

#

try:

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n\teval "$(pyenv init -)"\nfi' >> ~/.bashrc
exec "$SHELL"
#

that should get that solved for you

main olive
#

okay

#

i accdidentally closed putty and i logged back in into my vps and there is no enter

#

i did strg + c and now it appeared

#

but it was very weird

trail sapphire
#

wow, got scared there for a while, hoping you had not used a single > somewhere instead of a double>> because such a mistake would be really bad

#

so, back on track?

main olive
#

yeah but i also cant connect per filezilla to my vps

#

it just says timed out

trail sapphire
#

then it still sound like something when very wrong with the commands, did you copy them exactly as i wrote them?

main olive
#

yeah i did

trail sapphire
#

i'm starting to suspect that your ~/.bashrc got corrupted in some way in the previous step

main olive
#

oh

trail sapphire
#

are you comfortable with nano or vi as an editor?

main olive
#

not really

#

i mostly used filezilla

#

uhm

#

it says sudo comand not found

#

and nano doesnt work anymore too

trail sapphire
#

your path is probably broken due to a broken .bashrc file, we'll try to fix it

main olive
#

oh okay

trail sapphire
#

/usr/bin/nano -w ~/.bashrc

#

should get you in to nano

main olive
#

yeah

trail sapphire
#

do you see anything there or is it empty?

main olive
#

i seee something

trail sapphire
#

as in?

#

screenshot maybe?

main olive
trail sapphire
#

doesn't look totally broken at least 👍
can you comment out all the lines from the export and down?

main olive
#

yeah i can

trail sapphire
#

and then save the file, just undoing anything that we might have done

#

there looks like it's many copies of the same commands in that file right now

main olive
#

okay i saved the file

#

okay i can connect trough filezilla in my vps now

#

through*

#

and i can use sudo again

trail sapphire
#

can open another putty window (keep the one you have for now) now and see if it works better using sudo and stuff from that window

main olive
#

oh i already closed it and opened a new on

#

but it didnt work

trail sapphire
#

good, then we are back in business 😅

main olive
#

i needed to restart putty

#

yeah haha

trail sapphire
#

i was thinking that you would start a new putty window and session and keep the old one around just as a precaution until we know that the new one works better, but we seem to be fine again

main olive
#

yeah its fine now

#

maybe the error could be that i entered the shell thing a few times lmao

trail sapphire
#

your .bashrc looked very different then the one i have on debian 10 (trying everything on a system over here in parallel)

main olive
#

oh okay

trail sapphire
#

you might have everything in your .bash_profile instead of things in .bashrc on your system

main olive
#

oh, okay does it matter?

trail sapphire
#

it shouldn't matter much

main olive
#

okay

trail sapphire
#

this is getting a bit longer than i had expected, should we occupy a help channel instead of flooding this channel?
do you want to go grab a help channel for your self and then write in here which channel you ended up getting?

main olive
#

okay no problem

trail sapphire
#

just wanted to fix what was broken before i suggested it, since your broken environment was the first priority to fix

main olive
#

okay thank you

#

im gonna get a channe lnow

shell crypt
#

Hey anyone could translate this command from unix to windows?
curl -XPOST -H "Content-type: application/json" -d '{"name": "catty mcCatFace", "price": 5000, "breed": "bengal"}' '127.0.0.1:5000/add'

fickle granite
#

that's not exactly a "unix command"; it's a particular program named "curl"

#

easiest thing is to see if it's available on Windows

#

if so I don't think you'd need to do any translation

sleek remnant
main olive
#

I'm assuming you're on a unix based system, just ssh user@IP.

trail sapphire
main olive
#

👍

#

Good thing you can use ssh on the Windows command line.

trail sapphire
light gorge
#

Windows terminal is nice.

reef walrus
#

what even is unix

brisk vigil
#

Hi guys, who uses linux ubuntu? I wanted to know what is latest release of tensorflow for ubuntu?

kind coral
#

!pypi tensorflow

shy yokeBOT
brisk vigil
kind coral
#

And 22.04 should be the latest ubuntu version

#

This one was quite a good release

trail sapphire
vital bay
#

i would say ubuntu is an easy one to start with, though. no need to play around with the apt repos for the most part, and no need to update or reinstall for another 5 years

kind coral
#

There are so many good beginner distributions now

trail sapphire
kind coral
#

The docker image should be the easiest way to get it running on any distro

trail sapphire
light gorge
#

Ubuntu is default distro for ML/DL for many

idle nacelle
#

Hi, any know any pre-built phone app GUI (connect by wifi) to control any ros ubuntu robot with scanner? If not, any link for easy to make GUI guide i can follow? Purpose is for user to use the phone to command the robot to move to its waypoint when command while avoiding collision.

wind latch
#

yo i dont know if i am in the right channel for this but i am on ubuntu and i get this message every time i try to make a window with tkinter ModuleNotFoundError: No module named 'tkinter'

wind latch
#

Like another way to fix it

trail sapphire
wind latch
#

I tried pip and apt

trail sapphire
trail sapphire
trail sapphire
# wind latch No

so, both installations (apt and pip) when well as far as you know?

trail sapphire
trail sapphire
# wind latch Wdym?

i mean: what does the top of your code look like where you import modules/libraries in to your code?

wind latch
#

I just put import tkinter

trail sapphire
wind latch
wind latch
trail sapphire
trail sapphire
wind latch
#

but why does pycharm say no modlue named tkinter

trail sapphire
#

oh pycharm... it's probably just the python installation that pycharm is trying to use that doesn't have it
you can reconfigure pycharm to use another python to run things then the one it's using right now
i think people in #editors-ides will be able to help you with that part

wind latch
trail sapphire
vital bay
#

you can try and hunt them down by checking the output of whereis python, which python, which python3, etc

#

in particular, you want to hunt down the one for which you installed tkinter, so use which [whatever python you used pip with]

main olive
#

Hey, I'm having some problems with python in Linux. Can anyone check my problem here #help-peanut ?

brisk vigil
trail sapphire
fickle granite
#

it's a stretch to say Linux is "beginner friendly". But Ubuntu is definitely the right choice.

vital bay
#

it's a shame that 22.04 still doesn't have miktex (lest you compile from source; then again, tex live is an alternative) nor the nice dcv remote desktop client though. if you want stability and wide access to software, 20.04 is still better than 22.04 and will probably remain so for the rest of the year. on the other hand, you're also behind a couple of versions

marble otter
#

Hello

#

Is the Linux first installed on a mobile and then Android as a layer on top of it?

trail sapphire
marble otter
#

To remove camera, microphone, other modules

#

And install pure Linux server

#

And an extra rj45 port

trail sapphire
marble otter
gilded valve
#

The day has come

marble otter
#

And mobile phones these days come with octa core nd other gpu processing (ml)>

#

Nd shet ton of ram

trail sapphire
marble otter
#

At cheeaaap price

marble otter
#

Like octa core, with 8 gb ram for 20k inr or around 270 dollars

#

It'd be waaay cheap if you remove cam modules

#

Bluetooth

#

Android licenses etc ;(

#

Right?

trail sapphire
marble otter
#

Tried searching like crazy. But found none. My primary purpose is easy self hosting.

trail sapphire
#

and you really really want/need arm specifically because?

marble otter
kind coral
#

I would probably just buy a vps

marble otter
trail sapphire
marble otter
#

Especially for gunicorn

#

The intel one's hardly come at 2 cores for cheap

kind coral
marble otter
#

Everything else costs an arm

marble otter
kind coral
#

then you lost a little bit of money, big deal

marble otter
#

Anything as a service is not OWNED by you

marble otter
#

Or 100s of dollars

kind coral
#

business is just a gamble and there is really nothing you can do about that

gilded valve
#

If you have a credit card you can sign up for GCP or AWS free trial, that’ll give you a bigger window to work with

marble otter
#

Also

gilded valve
#

Not sure why your complaining about it costing an arm then?

marble otter
#

I don't want to rent database as a service

gilded valve
marble otter
trail sapphire
marble otter
#

Octa core costs a shit ton low than any cloud provider in like in 6 months

gilded valve
trail sapphire
marble otter
#

...umm...why not?

trail sapphire
marble otter
#

I read papers and they said the speed is same

#

If not arm is faster

trail sapphire
marble otter
trail sapphire
trail sapphire
marble otter
#

I ideally want more cores. Than threads.

#

So as to not block the workers.

trail sapphire
#

if you don't like intel, go amd instead then, there you'll get more cores as well typically

marble otter
#

Yup, but the cores is still around 4/6/8 in a consumer pc. And costs more than a mobile

#

But ig, it supports more ram and disk space ig.

trail sapphire
#

you have no traffic now and you are already optimizing
you know what they say about premature optimization, right?

kind coral
#

it's just an endless loop of not actually putting a product out and instead optimising it to the moon and back

marble otter
#

But it is owned by me, so I can keep testing forever too

marble otter
#

I am searching for chheeeeap deployments under my control

#

/owned

#

I don't wanna lose stuff cause, I can't pay.

trail sapphire
#

if you get hang up on optimization you will never get to market
instead optimize when you see the need for it

kind coral
#

whats your main issue with it not being hosted by you?

marble otter
#

Compared to self hosting.

#

And I am a devops engineer, so I know how to setup the infra. Okay just graduated.

trail sapphire
#

nothing wrong with a db on a vm, a lot of big companies do it
but sure, if you want ultimate performance you should skip the virtualization layer

marble otter
#

Also, it's a happiness to have your data with you.

trail sapphire
#

they have some arm stuff

kind coral
#

however you also mentioned "Imagine the service never making money" which suggests you are also careful with how much you are spending and if your service is a flop this is a much better position to be in than having bought a lot of physical hardware since you are renting and not buying

marble otter
#

I am just stumped by why no one is using these ridiculous number of cores for self hosting.
A few years back, sure low cores and crappy performance.

#

But today, those chips are crazy good.

#

And flask is arm compatible

#

So no issues on that end for me

kind coral
#

you can't invest €5.88 per month in a product you expect to be making a bit of money just to get it going for 2 cores and 4GB of mem?

marble otter
kind coral
#

yes, but it's also very cheap

#

you could probably spend a more money to get better hardware

marble otter
#

Yup, I did have tons of cloud experience. Thanks to my thesis.
The price to performance is good in the short term. And even better if the product is making money.

#

For a startup, it is a death sentence to scale.

#

I expect my service to not make any more for at least a year.

#

Money*

kind coral
#

how much traffic are you actually expecting?

marble otter
#

A 1000 users. Initially. And also gotta calculate for marketing

#

not deployed no official stats yet concurrent users maybe 10/12

#

Let me know if you guys come across how to flash a smartphone and install Ubuntu server.
Or any other arm cheap way. But with performance:)

trail sapphire
# marble otter I am just stumped by why no one is using these ridiculous number of cores for se...

if this was easy and cheap someone would have made the product and sold it to get rich
or you might just go for that business your self if you think you can make it cheap and still make a good buck on it by stripping away screen, battery, cameras, speaker, microphone, bluetooth, wifi, gsm/ltm connectivity and all the other stuff from a phone that you don't need, and the pesky android licensing that must be expensive to uphold

marble otter
#

I believe so.

#

But again, maybe I'm just naive. Just wish contacting manufacturers and making prototypes is easy

#

Seriously, octa core. 8gb ram. Ridiculous consistency. Inbuilt battery backup.

#

Like, what else could you ask for

#

Maybe expandable ram and hdd/sdd support ig.

trail sapphire
marble otter
#

True ig. But it'll be on power any way.

trail sapphire
#

and it would be cheaper without the battery on each unit

marble otter
#

True

trail sapphire
#

you might have a business right there if you believe strongly in that idea

marble otter
#

Yup. I mailed multiple manufacturers

#

But who knows

#

Self hosting may come back :)

trail sapphire
#

reliability with the internet connection and such will be a problem with self hosting unless you set that up in one or more data centers on your own

marble otter
#

True. Networking could be an issue. but ISPs shouldnt have a problem laying fiber line to homes

#

We are in the future, fiber is everywhere!

trail sapphire
ionic burrow
#

hi guys! I need to help. I want install pip into ubuntu core. But i couldn't do this. I installed python38 with use sudo snap install python38 but ı couldn't install wit hsudo snap install pip. How can ı do?

fickle granite
#

sudo snap install python38-pip

shrewd stratus
ionic burrow
# fickle granite `sudo snap install python38-pip`

I tried python38 -m pip install ...

root@ubuntu:~# python38 -m pip --version
pip 19.3.1 from /snap/python38/22/lib/python3.8/site-packages/pip (python 3.8)


root@ubuntu:~# sudo pip install virtualenv
sudo: pip: command not found
Collecting virtualenv
  Downloading https://files.pythonhosted.org/packages/9e/34/e86fc6a8f84329b49321a532b3c1fef103c67765df957fbb3852eea39d00/virtualenv-20.14.1-py2.py3-none-any.whl (8.8MB)
     |████████████████████████████████| 8.8MB 1.3MB/s 
Collecting platformdirs<3,>=2
  Downloading https://files.pythonhosted.org/packages/ed/22/967181c94c3a4063fe64e15331b4cb366bdd7dfbf46fcb8ad89650026fec/platformdirs-2.5.2-py3-none-any.whl
Collecting six<2,>=1.9.0
  Downloading https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
Collecting filelock<4,>=3.2
  Downloading https://files.pythonhosted.org/packages/cd/f1/ba7dee3de0e9d3b8634d6fbaa5d0d407a7da64620305d147298b683e5c36/filelock-3.6.0-py3-none-any.whl
Collecting distlib<1,>=0.3.1
  Downloading https://files.pythonhosted.org/packages/ac/a3/8ee4f54d5f12e16eeeda6b7df3dfdbda24e6cc572c86ff959a4ce110391b/distlib-0.3.4-py2.py3-none-any.whl (461kB)
     |████████████████████████████████| 471kB 95.1MB/s 
Installing collected packages: platformdirs, six, filelock, distlib, virtualenv
ERROR: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '/snap/python38/22/usr/local'

WARNING: You are using pip version 19.3.1; however, version 22.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Usage:   
  /snap/python38/22/usr/bin/python3.8 -m pip <command> [options]

no such option: --upgrade
``` 
And ı was trying ```pip install --upgrade pip``` ı'm getting same error
fickle granite
#

do python38 -m pip install virtualenv

#

everything that you want to do with a pip command, you can do with python38 -m pip instead. This is a good thing, since you'll never wonder about which version of python you installed a package into

ionic burrow
fickle granite
#

I am not recommending that you run sudo pip; I'm recommending that you run sudo python38 -m pip, which you've already demonstrated works

ionic burrow
# fickle granite I am not recommending that you run `sudo pip`; I'm recommending that you run `su...

My fault. I was searching this fault since a long time. Yes , I tried. Also ı'm trying again ı get same err```Collecting virtualenv
Downloading https://files.pythonhosted.org/packages/9e/34/e86fc6a8f84329b49321a532b3c1fef103c67765df957fbb3852eea39d00/virtualenv-20.14.1-py2.py3-none-any.whl (8.8MB)
|████████████████████████████████| 8.8MB 1.3MB/s
Collecting platformdirs<3,>=2
Downloading https://files.pythonhosted.org/packages/ed/22/967181c94c3a4063fe64e15331b4cb366bdd7dfbf46fcb8ad89650026fec/platformdirs-2.5.2-py3-none-any.whl
Collecting six<2,>=1.9.0
Downloading https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
Collecting filelock<4,>=3.2
Downloading https://files.pythonhosted.org/packages/cd/f1/ba7dee3de0e9d3b8634d6fbaa5d0d407a7da64620305d147298b683e5c36/filelock-3.6.0-py3-none-any.whl
Collecting distlib<1,>=0.3.1
Downloading https://files.pythonhosted.org/packages/ac/a3/8ee4f54d5f12e16eeeda6b7df3dfdbda24e6cc572c86ff959a4ce110391b/distlib-0.3.4-py2.py3-none-any.whl (461kB)
|████████████████████████████████| 471kB 95.1MB/s
Installing collected packages: platformdirs, six, filelock, distlib, virtualenv
ERROR: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '/snap/python38/22/usr/local'

WARNING: You are using pip version 19.3.1; however, version 22.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Usage:
/snap/python38/22/usr/bin/python3.8 -m pip <command> [options]

no such option: --upgrade``` Btw ı tried upgrade but not working

fallow tusk
#

Read-only file system: '/snap/python38/22/usr/local' would be indicative. Might need to use --user

#

Although that then evades the snap compartmentalisation.

fickle granite
#

ah, ok the read-only file system thing is a mystery to me; I know nothing about snap

fallow tusk
#

snap creates something like a chroot for each application

#

I think there are ways to open parts up, but I have no idea how to do that

dull spear
#

yo

median igloo
#

Yo

dull spear
#

so yea currently its being installed

median igloo
#

Ok so

dull spear
#

wait mint got installed les go

median igloo
#

Mint comes with MATE iirc

#

Ok so mint has windows executables support

dull spear
#

I already downloaded

#

LETS GOOOO

#

MINT IS HERE

median igloo
#

Pog

#

Also wait

#

Are u running it in VirtualBox?

#

Or VMware?

dull spear
#

DONE

dull spear
livid scroll
livid scroll
dull spear
#

can someone help me

#

why is everything on linux so small

#

all icons all stuff all font size everything

#

so smol

#

even in full screen

livid scroll
dull spear
#

from where

#

btw can i close the oracle virtual box manager while the vm is running

livid scroll
dull spear
#

system settings?

#

when i type scaling nothing happens

boreal pasture
dull spear
#

no

#

i mean idk

#

everything is so so small

boreal pasture
#

what's your monitor size?

#

like the resolution?

dull spear
#

its a laptop

boreal pasture
#

yeah whatever

#

what's its resolution

dull spear
#

1980 x 1080

boreal pasture
#

open up terminal and try xrandr -s "1980x1080"

dull spear
#

um oka

boreal pasture
#

worky?

dull spear
#

1980x1080 not found in available modes

#

@boreal pasture

boreal pasture
#

oh

#

I see

#

try

cvt 1980 1080 60
#

lemme know the output

dull spear
#

mk

#

lotta stuff printed out

boreal pasture
#

paste it here

#

!paste

shy yokeBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

dull spear
#

I cant

#

I need to type it out

#

I cant copy paste

boreal pasture
#

why

dull spear
#

thats linux this is windows

boreal pasture
#

try ctrl shift c

dull spear
#

bruh

#

it wont work

#

thats another os

boreal pasture
#

why wont it

dull spear
#

yup not working

boreal pasture
#

I'm on arch as well

dull spear
#

cause thats another os

boreal pasture
#

oh you using VM?

#

and not dual booting?

dull spear
boreal pasture
#

send a pic

#

hey

#

did you manage to ss?

dull spear
boreal pasture
#

yeah that's good

dull spear
#

?

boreal pasture
#

now type in

#
xrandr --newmode Modeline ....
dull spear
#

im on linux mint btw

boreal pasture
#

copy that whole Modeline thing

#

all that's after Modeline

dull spear
#

bruh

boreal pasture
#

or write it down

dull spear
#

oh i can copy paste

#

cause in linux

stuck shadow
#

let me start my mint and see how to make it big

main olive
dull spear
dull spear
boreal pasture
#

weird

dull spear
#

ye

main olive
#

@dull spear run xrandr -q and show output

dull spear
#

too much stuff

#

a lotta numbers

main olive
#

just show screenshot

dull spear
#

bruh

main olive
#

bruh

dull spear
#

for that

#

wait lemme ss

main olive
#

run xrandr -s 1920x914

#

wait

dull spear
#

i dont want that

main olive
#

its already on highest

#

nvm

dull spear
#

I want same as windows which is 1920 1080

main olive
#

just select any resolution from the list and run xrandr -s resolution

dull spear
#

ok lemme try

#

done

#

still the same

#

barely any difference

main olive
#

xrandr -s 2560x1600

dull spear
#

breh

#

still the same

#

the command ran

#

but same

main olive
#

cringe

#

well u r running it in a vm

dull spear
#

so?

main olive
#

ig it wont be possible to have the same res as windows

dull spear
#

bruh

#

wdym

#

cant i just make it look normal

main olive
#

dunno, never used a vm with linux

#

but it will probably be smaller than ur real os

stuck shadow
#

also

dull spear
stuck shadow
#

the only thing which i got working is making the font size bigger 💀

dull spear
#

If i open terminal the text is so smol

#

everything so smol

#

might look normal rn

main olive
main olive
#

ig

dull spear
#

no bruh

#

all icons as well

stuck shadow
#

@dull spear this is what i got (excluding the text size)

#

i was able to increase the panel size

dull spear
#

nope

#

so smol

main olive
#

boot on real hardware 👍

dull spear
#

bruh

stuck shadow
#

ok

dull spear
#

it is

#

idk

#

:/

stuck shadow
#

just set the scaling from display to 2x

#

👍

main olive
#

i feel like youll probably find something if u fuck around in display settings

dull spear
#

how

stuck shadow
#

or custom > 0.9

dull spear
#

this is so small omg

#

@stuck shadow wdym

stuck shadow
dull spear
#

where

stuck shadow
#

custom

dull spear
#

is it in system settings

dull spear
stuck shadow
dull spear
stuck shadow
dull spear
#

only 3 options

stuck shadow
#

set to double

#

hi-dpi

dull spear
#

no thats too much

stuck shadow
#

damn

dull spear
#

guys I instaledl spotify using the command but when I search for it i dont see it

#

@stuck shadow do u know why

stuck shadow
#

💀

dull spear
#

@stuck shadow ^

stuck shadow
#

damn

#

idk tbh i never installed spotify on linux

dull spear
#

OOF

stuck shadow
#

try getting snap store

#

it works

dull spear
#

whats that

#

how do i install it'

main olive
#

i feel like u didnt install snap

livid scroll
#

mint doesn't like snap

kind coral
#

Any package manager whilst you have another package manager is normally a bad idea unless that's just what you need to get it working

#

Luckily my distros repo comes with Spotify

dull spear
#

how do i install spotify on linux

barren rock
dull spear
#

ty

#

already did it using sofrtware manager

barren rock
#

ok

kind coral
dull spear
#

worked

lost panther
#

Yo guys ! Coud anyone help me add 1 more query option to an existing bash script ? I will not buy you a coffee 😄

fallow tusk
#

What do you mean by "a query option". And how do I get this coffee? ...but Rule 9 :(

fickle granite
#

just saying: whenever my bash script becomes complex enough that it's hard to modify ... that's when I rewrite it in python

fallow tusk
#

Whenever my bash script doesn't fit on a single line, and I can't rewrite that line in Perl....

#

(You should see some of the perl one-liners I used to write....)

trail sapphire
lost panther
#

Just to be clear , im a noob in every language , https://github.com/magenta-aps/check_prometheus_metric there is this script,
I use it to check some prometheus metrics. if I run it with the -q , it gives me the prometheus query result. Thats good. But I want to whats the maximum available space:

Close your eyes, I did this :
NUM=1073741824 PROMETHEUS_RESULT_GB=$(($PROMETHEUS_RESULT/$NUM)) if [ ${IS_CRITICAL} -ne ${CRITICAL_INVERTED} ]; then NAGIOS_STATUS=CRITICAL NAGIOS_SHORT_TEXT="${METRIC_NAME} is ${PROMETHEUS_RESULT_GB}Gb / 500Gb"

GitHub

Nagios plugin for alerting on Prometheus query results. - GitHub - magenta-aps/check_prometheus_metric: Nagios plugin for alerting on Prometheus query results.

#

i just want a -q2 or whatevery that replaces the 500Gb I wrote there 😄

fickle granite
#

honestly I'd rewrite it

lost panther
#

I tried to snip it together but because I dont know what im doing , its not working 😄

fickle granite
#

the bash syntax is something like if [ ${IS_CRITICAL} -ne ${CRITICAL_INVERTED} ] || [ ${THIS} -ne ${THAT} ]; but it's awful

grizzled bay
#

Can I ask Linux questions here? As in which linux distro to use?

fickle granite
#

ubuntu 🙂

grizzled bay
#

okay to provide a bit more context:
I'm looking for suggestions for a linux distro that I can run with Windows Substem for Linux. I have a coding project which has got to the point where it needs to use a redis databse howver redis is not supported on Windows natively so I need to set up a linux enviroemnt but I have no idea where to start in regards to picking a distro. Any suggestions andor advice related to the topic would be appreciated.

vital bay
#

since it'll be mostly command line based, the biggest differences will be things like package manager (how up to date software versions are, how to add new repos if needed) and peculiarities on how the directory structure is handled. ubuntu is usually a safe bet, since you don't have to fiddle around too much

grizzled bay
vital bay
#

ubuntu should be fine, since the spinoffs mainly differ in the desktop environment, which you won't be using. you won't see any difference from kubuntu, xubuntu, etc

grizzled bay
#

okay thank you again

minor hull
#

ive dualbooted my system with ubuntu and windows. but yesterday i was trying to run yolo on ubuntu and did reload command. since then ubuntu isnt starting. how do i fix this?

fallow tusk
#

First - see if you can boot into non-graphics mode. At the Grub prompt, press "e" to "edit" the configuration and shove a "3" right at the end of the linux (iirc! I do it all the time, but can't remember - I recognise it when I see it, now!) line. Then press F10 to boot that.

#

@minor hull ^

#

If that works you may just be able to do a sudo apt update && sudo apt upgrade; It may just be that something's out of sync in your packages.

#

If not, then you can resort to a live disc USB stick, boot from that, then try to recover the system by mounting it and maybe chrooting into it...but it might just be as easy at that point (especially if what I just said sounds like gobbledegook!) to re-build the system. You should at least be able to mount the drive and recover anything that needs recovering (if anything) from the live USB system.

proud nova
#

I dusted off an old machine (1GB RAM, Intel Atom CPU, ~160GB HDD) and installed Alpine Linux on it in data disk mode (root filesystem is created as tmpfs and populated at boot). So now I have a working but very underpowered Linux server sitting around and I don't know what to do with it

fickle granite
#

obviously mine bitcoin

#

🙄

#

run pihole on it?

proud nova
#

Hmm actually a local DNS server would be nice

#

And probably something this old machine could actually handle

#

I'm pretty pleased that Alpine hosts its entire fs in RAM on this machine, with plenty of room to spare.

main olive
#

question, i just installed garuda and when i try to install packages i get this error
failed to prepare transaction (could not find database)
can anyone help me?

tiny lava
#

have you tried googling it

main olive
#

Nvm its working

shadow kindle
#

Hi!
I have a few questions about Virtual machines. Anyone here who i can dm or write here?

fickle granite
#

just ask

#

if people know, they'll answer

#

if not, not

trail sapphire
shadow kindle
#

OK

#

First question:
Does kali Linux run on any windows machine? So could I buy any laptop with Windows and run Kali from a SSD or does it have to be a certian model/os/version…?

#

Second:
Where do files created in Kali safe?
On the external SSD or on the laptop itself?

trail sapphire
# shadow kindle First question: Does kali Linux run on any windows machine? So could I buy any l...

linux runs on a lot of hardware, and that doesn't mean that all the hardware is working fully, you can't be sure until you tried it your self or found reliable sources online
some hardware such as wifi chips and stuff like that might have buggy drivers when not using the proprietary windows drivers, you will really need to research such topics
where it saves files if depends on the configuration and if you are running it as a live os or if you do a properly installtion on the computer

shadow kindle
#

I was thinking about a live version on an external ssd

trail sapphire
# shadow kindle I was thinking about a live version on an external ssd

most of the time files aren't even persisted when running live os, sometimes you can configure them to persist data on the same media as the live os, i don't know if that is the case with kali
otherwise you just have to mount your storage that you want to use under some path to be able to persist data

vital bay
#

wdym by "any laptop with windows"? kali would run instead of windows

shadow kindle
vital bay
#

all right, but still, only one of the two can run at a time. you can't open windows programs on kali (unless they have a compatible linux version), and the opposite is also true

shadow kindle
#

I know

vital bay
#

even using a VM, you can't run one operating system's software on the other

#

at any rate, what i mean is that the windows part is not important

shadow kindle
#

But what you recommend me doing? Using a hard drive to boot from it or installing a VM to work with (daily)

vital bay
#

that would depend on the type of work you're doing. if it's not very intensive, VM is fine. if you need all the memory and cpu power, you'd have to use it directly instead of from a VM

trail sapphire
#

VM is usually fine, but can sometimes be a problem if you want to do something hardware dependent such as putting the wifi chip in monitor mode

shadow kindle
#

And what about programming? I have to store a lot of files

vital bay
#

hmm yeah, now that you mention it. especially with kali, it doesn't make much sense to VM if you want to use the tools it brings

#

if you're only coding, i would recommend not using kali, and either using a VM or WSL

trail sapphire
#

programming will be just fine, but kali might not be the best choice of distro for general programming

shadow kindle
#

And the best choice for learning hacking? Kali brings a lot of tools for that

vital bay
#

then yes, kali. and not on vm

#

well. hacking is a broad term. kali is more for security and network infrastructure testing, but i guess it falls under the umbrella

shadow kindle
#

Yeah I know. I just didn't now how to say it

trail sapphire
#

you should learn security rather then "hacking"

shadow kindle
#

That's what I meant

trail sapphire
#

!rule 5

shy yokeBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

shadow kindle
#

Hacking is most of the time legale

#

If you have the license to do so

#

But thanks a lot to both of you.

slate crypt
#

just pip install hacking

barren rock
#

i have 4 linux distros and I can’t use any of them properly

#

👍

trail sapphire
formal schooner
#

i think fedora is great for getting started with linux

#

the filesystem layout and config system is well-organized, which makes it easy to find things

#

debian and debian-based distros can be pretty chaotic by comparison once you start digging into config files

trail sapphire
humble falcon
#

I just use ubuntu, works well enough for me

proud nova
#

Kubuntu + vscode + python/numpy/scipy/matplotlib, running from tmpfs

#

I paid for all this RAM, may as well use it

humble falcon
#

Lol

proud nova
#

Why does this boot so much faster on Linux hosts than Windows

#

idk maybe Virtualbox is just bad on Windows hosts

#

This VM performs quite nicely with NixOS as a host but when I put it on Windows, it's terrible...

fallow tusk
#

iirc, there are extra layers that sit between a VM on Windows and the hardware that Linux can get around, so you do tend to get better performance under Linux. (This may be me mapping recollected Docker knowledge to VMs, although the principles are much the same)

shrewd stratus
#

Docker Desktop does use a Linux VM, not sure about Virtualbox

fallow tusk
#

Ah, yes, it sets up a HyperV VM, doesn't it? Which caused issues with running VirtualBox and Docker at the same time because one wanted one set of virtualisation OS settings and the other another set...

proud nova
raven kindle
#

macOS (intel) - Anyone know how to fix this?

myterminal % brew link python@3.10 
Linking /usr/local/Cellar/python@3.10/3.10.4... 
Error: Could not symlink bin/pip3
Target /usr/local/bin/pip3
already exists. You may want to remove it:
  rm '/usr/local/bin/pip3'

To force the link and overwrite all conflicting files:
  brew link --overwrite python@3.10

To list all files that would be deleted:
  brew link --overwrite --dry-run python@3.10

A python@3.9 was already linked. I just unlinked it, but didn't expect that to be a problem with pip. Should I just ovewrite?

#

fukkit, did it. rekted my pip env, but whatever

torpid cipher
raven kindle
tall sphinx
#

Python shell interaction?

#

Pyshell

wet folio
#

#!/bin/bash for i in 1 2 3 4 5 do dd if=/dev/zero bs=4096 count=1024 of=ext4-${i}.image mke2fs -t ext4 -F ${i}.image done

#

Anyone please help me if i am correct on this loop, So i was using DD command line to create 5 .image file, then using mke2fs I am trying to create 5 ext4 file system of that .image file that I created from dd command

trail sapphire
# wet folio `#!/bin/bash for i in 1 2 3 4 5 do dd if=/dev/zero bs=4096 count=1024 of=ext4...

the file name isn't the same, it's ext4-{1,2,3,4,5}.image as the argument to the of parameter of dd
while it's only {1,2,3,4,5}.image to the -F parameter of the mke2fs command
you might also want to change for i in 1 2 3 4 5 to for i in $(seq 1 5) or for i in {1..5}
it's also a good habit to surround filenames and paths with "" to handle spaces and other special characters

wet folio
#

#!/bin/bash for i in $(seq 1 5) do dd if=/dev/zero bs=4096 count=1024 of=ext4-${1,2,3,4,5}.image mke2fs -t ext4 -F ${1,2,3,4,5}.image done

#

Does this now look correct?

trail sapphire
trail sapphire
wet folio
#

Thanks a lot, that make sense now

trail sapphire
wet folio
#

Yes now I understand. Thanks for correcting me.

#

Bash script seems little hard to me:(

#

cmd = 'AFL_SKIP_BIN_CHECK=1 ./combined/afl-image-syscall/afl-fuzz -S {0} -b {1} -s fs/{2}/{2}_wrapper.so -e samples/oracle/{2}-'+str(i)+'.image -y seed -i {3} -o {4} -u {5} -- lkl/tools/lkl/{2}-combined-consistency -t {2} -i samples/oracle/{2}-'+str(i)+'.image -e emulator/emulator.py -l /tmp/mosbench/tmpfs-separate/{6}/log -d "/tmp/mosbench/tmpfs-separate/{6}/" -r -p @@'.format(instance_name, shm_name, args.fstype, in_dir, out_dir, args.cpu_id, args.log_id)

#

I am actually tring to pass those 5 .image file into this command line i used +str(i)+ to do that

trail sapphire
wet folio
trail sapphire
wet folio
#

Thats what i got when i asked the owner of the code

trail sapphire
wet folio
#

haha

#

Thats scary code, long line and I am still trying to understand it

#

I envy people who are so good at writing code haha, I wish I can be good enough one day

trail sapphire
wet folio
wet folio
trail sapphire
# wet folio ` cmd = 'AFL_SKIP_BIN_CHECK=1 ./combined/afl-image-syscall/afl-fuzz -S {0...

with f-strings (format strings) you interpolate the variables right in the string
and you might even want to break it out on more lines so that you have one argument per line for better readability and overview of the options you pass

cmd = (
    f'AFL_SKIP_BIN_CHECK=1 "./combined/afl-image-syscall/afl-fuzz"'
    f' -S "{instance_name}" -b "{shm_name}"'
    f' -s "fs/{args.fstype}/{args.fstype}_wrapper.so"'
    f' -e "samples/oracle/{args.fstype}-{i}.image" -y seed'
    f' -i "{in_dir}" -o "{out_dir}" -u {args.cpu_id}'
    f' -- "lkl/tools/lkl/{args.fstype}-combined-consistency"'
    f' -t "{args.fstype}" -i "samples/oracle/{args.fstype}-{i}.image"'
    f' -e "emulator/emulator.py" -l "/tmp/mosbench/tmpfs-separate/{args.log_id}/log"'
    f' -d "/tmp/mosbench/tmpfs-separate/{args.log_id}/" -r -p @@'
)

you don't even need any concatenation as python auto-concatenates strings within parentheses like this

#

@wet folio what do you think, does the above make sense?

wet folio
#

So those image file i keep in this directory samples/oracle/{args.fstype}-{i}.image, do you think this will iterate all the image file one after another

#

for i in range(1,6): cmd = ( f'AFL_SKIP_BIN_CHECK=1 "./combined/afl-image-syscall/afl-fuzz"' f' -S "{instance_name}" -b "{shm_name}"' f' -s "fs/{args.fstype}/{args.fstype}_wrapper.so"' f' -e "samples/oracle/{args.fstype}-{i}.image" -y seed' f' -i "{in_dir}" -o "{out_dir}" -u {args.cpu_id}' f' -- "lkl/tools/lkl/{args.fstype}-combined-consistency"' f' -t "{args.fstype}" -i "samples/oracle/{args.fstype}-{i}.image"' f' -e "emulator/emulator.py" -l "/tmp/mosbench/tmpfs-separate/{args.log_id}/log"' f' -d "/tmp/mosbench/tmpfs-separate/{args.log_id}/" -r -p @@' ) time.sleep(3600)

wet folio
#

@trail sapphire do you think my logic is ok here to set this up like this

trail sapphire
# wet folio <@936769916072259654> do you think my logic is ok here to set this up like this

that won't work for several reasons
first you are not even executing the command, you are just putting strings in a variable called cmd, so you will need to run those commands as well in one way or another
second, if you where to run it like that the command would run until completion how ever long that takes (if it even ever really completes on its own accord) and then it will sleep for for an hour before continuing to the next iteration of the loop, it's not like a timeout for the command