#unix

1 messages · Page 59 of 1

formal schooner
#

you shouldn't really do this in windows either

#

use a venv, or at least pip install --user

#

it's just that in windows, breaking python doesn't also break your entire computer

lapis comet
#

Yeah, I hadn't heard of venv then. In fact, I had never used versioning tools for any language

formal schooner
#

i actually hate that system-installed packages use the same site-packages location as user-installed packages

#

i think debian maybe separates the distro-provided packages from user-installed packages?

lapis comet
#

By the way, how does it make sense that I can import sys in the python interpreter, but not through the scripts?

lapis comet
#

$ python3 a.py where a.py is a script that imports sys will error out ('sys' is not defined), but

python3
>>> import sys

will work just fine

#

note that python3 and python apparently call the same interpreter, at least the same version (3.10.1)

#

wait, apparently pandas is also not being imported

formal schooner
formal schooner
#

what does python3 -c 'import sys' do?

lapis comet
#

jesus. I think the issue is with pandas

#
# Imports
try:
  import sys
  from pm_func import *
  from setup_db import setupDatabase
except Exception as e:
  sys.exit(f'Failed to import libraries. ({e})')

So I'm testing with a script that begins with this... which gives me an error (yeah, I know the exception isn't meant to be used that way, I'm so sorry) about sys not being defined
but if I remove the try block, it does import sys, but errors out with setup_db (which is another script, that imports read_excel from pandas)

formal schooner
lapis comet
#

god

#

apparently installing pandas through pacman did fix pandas at least

formal schooner
#

again i think debian does a better job here, they patch python to put system packages in different places from where pip puts them

lapis comet
#

Okay, now I'm feeling terribly stupid -_-

#

In any case, thanks a lot for the attention and help, @formal schooner !

real vapor
#

mixing the distro package manager with pip is always an exciting experience

thin berry
#

hello

#

i need help with linux bash scripting
here is the code:
at now
at> echo "hello" | mail jon
at> ^D

#

can someone explain me what mail jon is?

wise forge
thin berry
#

But how can an email be only "jon"?

thin berry
#

In a learning book. It's explaining how at command works. So i got this code under "this at command will send an e-mail", thats all

hearty solar
thin berry
wise egret
#

2>&1 < /dev/null redirects stderr to stdout and then discarded by dev/null ??
little lost here

formal schooner
#

if you wanted to discard both stderr and stdout you would write >/dev/null 2>&1

#

that means:

  1. connect stdout to /dev/null
  2. connect stderr to "wherever stdin is currently pointing"
#

redirections are read from right to left, and X>&Y is a redirection to "wherever Y is currently pointing", it is not a permanent connection between X and Y

#

you could of course write >/dev/null 2>/dev/null or perhaps 1>/dev/null 2>/dev/null if you really want to be explicit

#

quiz: what does this do? >/dev/null 2>&1 >./out

warped nimbus
#

Out and err get written to a File?

formal schooner
#
cat >./tmp.sh <<EOD
echo 'good'
>&2 echo 'bad'
EOD

sh tmp.sh >./out1 2>&1 >./out2

echo '-- out1 --'
cat out1

echo '-- out2 --'
cat out2
warped nimbus
#

So &1 is evaluated when 2>&1 is evaluated rather than when the entire line is finished?

formal schooner
#

precisely

#

perhaps "expanded" would be a bit better

#

but "followed" i think is better still

#

X>&Y treats Y as a "pointer" of sorts, and it redirects X to "wherever Y is currently pointing"

rapid nest
#

What's dis channel for?

lavish storm
#

Tooling, setup and configuration related to Python development on unix or unix-like systems such as Linux or MacOS.

rapid nest
#

Alr

main olive
#

i use arch btw

lavish storm
#

cool

cloud palm
#

i cant add an xrandr custom resolution afer installing nvidia driver pls help

ember quiver
main olive
#

fr

ember quiver
#

^^^ That dude gets it 😎

coarse leaf
#

I can't launch jupyter notebooks, but only when I'm connecting to my linux (mint) machine via rdp. I try to launch it via terminal "jupyter notebook" (or "jupyter-notebook") and it says that the jupyter command doesn't exist. If I walk over to the linux machine, I can access it through the terminal without issue.

ember quiver
coarse leaf
main olive
#

I want to build a simple terminal inside panda3d. Is it possible to read/scrape and control a separate curses application (say...vim) using python's stdout/in/err?

#

Or can anyone namedrop libs that could make something like this happen without reinventing the wheel?

main olive
#

to take over the world

#

all my computer does is run panda3d and terminals so I figured I could get rid of the terminals

pale shoal
#

Writing a terminal from the ground up is a great learning task, is there value in it ?… not quite sure

main olive
#

I doubt it. Best case scenario is something that already does it and I can pipe to my TextNode.

#

though the license is very strict :(

#

of GateOne

#

I'll take my chances. Thanks :)

#

this looks cool too

winter mica
#

What's the error

lavish storm
#

semi colons i reckon

stiff hull
#

hello

#

num1 = input("Enter Num1")

#

num2 = input("Enter Num2")

#

num3 = input("Enter Num3")

#

that's hard

wise forge
main olive
ashen fulcrum
#

anyone knows how to automatically back up

#

a windows folder on a Arch-linux computer

#

via wifi?

#

ive tried with putty on windows

#

and ssh in arch

#

but always it always give me a network error

#

if there is any other method ill appreciate any info

#

btw i've also tried with nitroshare, but it will not let me send folders

wise forge
wise forge
#

have u tried pscp, which is just under it?

#

it should be good for file transfers

#

there should be much better ways to transfer files for backup purposes...

ashen fulcrum
#

yeah, ive pasted pscp on the windows 'root' folder and accesed it from the command promp

wise forge
#

rsync or something like that

ashen fulcrum
#

rsync is a linux command right?

wise forge
#

yeah

#

also ansible could be used

ashen fulcrum
#

so u kind of download the folder with it

wise forge
#

I am going to make backups with ansible ;b I have quite small file sizes though, that's why I sure it willl handle it easily

ashen fulcrum
#

im trying to backup a python program, the thing is

#

that the data base is like 4 gb

#

so im thinking that this might be the problem

#

for small files putty os pscp works just fine

#

but when i try to sync the database it fails

wise forge
#

and when you make copy, it changes in the process / or just busy

#

how about stopping for a moment when you make a copy of it

#

at least a local one for speed

ashen fulcrum
#

i don get it mate 😦

wise forge
#

making local copy of data / optionally dumping data

#

enabling database service back

#

downloading in whatever wished time the made local copy

ashen fulcrum
#

u telling me that i should try to sync a copy of my database instead of the original file?

wise forge
#

i thought it is database

ashen fulcrum
#

a databe... i mean... its the data entry for my program

#

a lot of big csv\

#

csv*

wise forge
#

uh.

ashen fulcrum
#

oh btw

#

i can totally not backup the database\

#

u know

#

it is not changing

#

so the other solution is having a program or proces for backing up certain folder

#

but ignoring certain directory inside it

#

u know

#

but i wasn't able to do this with putty

#

or pscp

#

they r 2 simple

#

😦

#

too*

#

ill be hearing any ideas... thank u Darkwind

main olive
#
a windows folder on a Arch-linux computer
#

what does a windows folder on a arch-linux computer mean?

wise forge
#

I assume samba usage perhaps
It makes sharing folders with Windows emulation of folder sharing

#

U know if he used it, he would be probably having no problems to backup then 🤔

#

Although that is an option only if he has server in his local network

wise forge
main olive
#

I'm thinking their problem is a timeout

#

yeah

#

rsync would solve that

tulip dock
#

I'm using os.environ.pop() but the variable is still present in /proc/nnn/environ, is that supposed to happen?

ashen fulcrum
ashen fulcrum
main olive
fallen aurora
#

Hey all! Anyone free to help me out briefly with updating a CSV file using bash scripts from a python programs output?

lavish storm
#

what is it exactly that you are trying to do betwixt bash and python?

latent wren
#

Why does ubuntu screen use this command will not continue run after detach?
echo templates/index.html | sudo entr service apache2 restart

tulip dock
tulip dock
#

you "and?"

main olive
#

?? what

tulip dock
#

Unless you want to qualify your answer it is provably wrong

#

if your reaction to that proof is "and?" what do you expect me to say?

#

Is that how you talk to people in real life? They say something and you go "and?" come on man

main olive
#

clearly you don’t understand the concept of system variables and how changing a python dictionary doesn’t magically perform an io operation and edits the os’s system environment variables. stop being ridiculous.

tulip dock
#

If you decided that outright, based on nothing, why answer at all? To make yourself seem smart? "os.environ is not actually the OS environ". Good job, you couldn't possibly have made this more terse or less enlightening

#

I'm just puzzled as to why you would bother reading questions here if you only do it to provide unhelpful cryptic remarks

#

I get it, I've been a 17 year old on PHP-BB forums and IRC, at the top of the sandbox providing terse comments to make myself look smart. You'll come to regret it too

#

"and?", come on

main olive
#

1: it’s just common sense.
2: i literally answered your question. if you think this matter is about pride, then you’re mistaken.
3: you’re angry for no reason.

tulip dock
#

You answered nothing. Compare to the StackOverflow answer

main olive
#

what was your question then? i literally answered it. did you want me to babysit you through the process of grasping that os.environ is just a mutable copy of the actual env?

tulip dock
#

What you could have said is "changing Python's os.environ calls libc's unsetenv but that doesn't remove it from memory provided by the kernel". Instead you mentioned "OS" and "environment" like it meant something specific

#

you managed to craft the tersest, most inscrutable answer that is technically right without revealing any information

#

well done

main olive
#

so u mean i was supposed to babysit you?

tulip dock
#

You didn't have to do anything

#

you chose to be cryptic

main olive
#

just ask a more specific question in the first place

tulip dock
#

My question was extremely specific, with the specific code I used and the specific result I observed

main olive
tulip dock
#

what is "the actual env"? What is "the OS"?

main olive
#

i’m done here, clearly you love wasting time arguing about nothing

tulip dock
#

os, the Python module? Actual env, os.environ?

#

libc's idea of it? The kernel's idea of it? /proc's idea of it?

#

I suspect you didn't know and still don't

main olive
tulip dock
#

Up to me to build my own answer? Thanks

main olive
#

2: operating system, i will refer to modules now with highlighting

tulip dock
#

I specifically said "/proc/nnn/environ"

#

I didn't say "the OS" or "the environment"

main olive
#

my goodness.

main olive
opaque ginkgo
#

(it's not)

tulip dock
#

It you had read it instead of saying "and?" you would know it is not "just a mutable copy of the actual env"

tiny lava
#

sometimes the only way to win is to not play at all

serene cedar
#

Hi Im learning abt sys calls currently and I dont get what actually happens when the cpu needs to execute some kind of system call instruction. They say it sends that sys call to the kernel but what does that actually mean for the cpu?

tulip dock
#

On modern processors there's an instruction specifically for that

#

you put the arguments in registers, do syscall <some number> and the CPU will pause your thread and jump to a routine in the kernel that's designated to handle that syscall number

silent hare
tulip dock
#

it also switches out the execution context and the security level

#

the kernel has more permissions that regular processes (can read everyone's memory and talk to hardware directly) and uses a separate memory space (it doesn't mess with your process' stack etc)

silent hare
tulip dock
#

the virtual memory layout for example

silent hare
#

So it switches to the memory space of the kernel?

tulip dock
#

yes

silent hare
tulip dock
#

Pretty much. There are things like io_uring trying to do more work with fewer system call, because this context switch takes time

silent hare
# tulip dock yes

How does it know though which routine to jump to? Like u said the number identifies it but how does it know on what line these instructions can be find in the memory space of the kernel?

tulip dock
#

The kernel gives the CPU a table that says where those are

silent hare
#

Wdym give the cpu it? Does it save it in its cache or?

tulip dock
#

there are other "interrupts" in there, telling the CPU what to do if the process crashes or something

tulip dock
#

yes there's some internal memory in the CPU that stores this

silent hare
#

How does the os make sure that its continuously run?

#

Like in order to schedule new processes and stuff

tulip dock
#

there's a timer in the CPU, giving back control to the kernel every few microseconds

#

or hundreds of microseconds rather

silent hare
#

Where does the cpu know though that it needs to give control back to the kernel? Like where is written that every so and so ms u need to run the os processes again?

silent hare
tulip dock
#

yeah you write to some special CPU register and it will call an interrupt when the time comes

silent hare
#

Ahh ok

#

another question if u dont mind....

tulip dock
#

the nitty-gritty is complicated and you can find it in the CPU manuals. You can't really use those registers anyway unless you're writing a kernel yourself

silent hare
tulip dock
#

yes

#

the CPU knows what permission level it is running at. User-space processes can't use those

silent hare
#

Ahh ok, how does it know though?

tulip dock
#

When the kernel switches control to a process, it sets the permission level

#

it also restores the memory mapping that process was using before, and its registers

silent hare
#

So I assume the current permission level also gets saved in some special register?

tulip dock
#

the only way to go back to the kernel is an interrupt (or syscall)

#

yep

silent hare
tulip dock
#

no the kernel has special space to keep track of that

silent hare
#

Ah ok

tulip dock
#

it keeps track of what files you have opened, what user started the process, its priority, all kinds of things

silent hare
tulip dock
#

Yeah, when you use a syscall to open /home/dragojak/file.txt, it needs to know if you have the right to open that file. So it has a user ID associated with the process to do that

#

if you can open it, it's going to give you a number or "file descriptor". For example 3. Then you can do write(3, "hello"), and the OS will know which file that was that is number 3

#

maybe you don't have permission to write to it, so you opened it in read-only mode, and the kernel is keeping track of that. It would be bad if the information about it was in the process's memory, it could change it to "read-write". Instead the kernel keeps track of it and only gives you a number for it

silent hare
tulip dock
#

PID is the number of the process

#

they are just used to identify the process, like if you want to kill one of them

tulip dock
#

in addition the process has a user ID and group ID. It will be in a different column if you use ps or top

silent hare
#

Whats the group ID used for?

tulip dock
#

mostly accessing files

silent hare
#

So like ranges?

tulip dock
#

no, usually a file belongs to a single user and a single group

#

if you're that user or in that group, yes, otherwise, no

silent hare
tulip dock
#

the commands to list processes

silent hare
tulip dock
#

yep

silent hare
#

so I assume there arent that many groups right?

tulip dock
#

as many as you want

#

so OS have a limit of 65535, I think on modern Linux it's way more than that

#

I have 89 on my laptop

silent hare
#

Oh okay, are the os processes also in a group?

tulip dock
#

usually multiple groups

silent hare
#

Shouldnt they all have access to every file (the os processes) ? Or are the groups also used for something different?

tulip dock
#

Of course everybody shouldn't have access to every file

#

multiple people can share a machine

silent hare
#

No I meant the os processes, shouldnt they all have access to every file?

#

Not the user mode processes

tulip dock
#

On UNIX there's a special user ID 0 called "root". This one has access to every file

#

they are still user-space processes

#

the kernel itself does whatever. It doesn't need to use system call and it doesn't have user IDs

#

it usually acts on behalf of a specific process though

silent hare
#

Oh okay

#

Lets say I would create such a group, do I put in a bunch of file descriptors and say this group has access to those and nothing else or...?

tulip dock
#

Ownership is set on files not file descriptors

#

it's stored on disk alongside the name of the file, its size, the last time it was accessed, etc

silent hare
#

Ahh ok

tulip dock
#

In the basic permissions, there's only one user and one group that own a given file

#

there is an extended "ACL" system that allows to give specific permissions to multiple users and groups for each file

silent hare
tulip dock
#

the user associated with a file doesn't have to be in the group associated with the file, no

silent hare
#

So how does the user have access to it?

tulip dock
#

really you should read about this

silent hare
#

Yeah thats true thank you really much for the time you took, to explain me all this!

tulip dock
#

if you're the user, you have the user permissions (for example: read-write). If you're in the group, you have the group permissions (for example: read only). If you're non of these, you have the other permissions (for example: none)

sour hound
lavish storm
#

usually bleeding edge rolling release distributions get them quicker than staged release distributions (i.e. can't expect to get 3.10 on debian stable until next stable)

sour hound
#

while using the package manager generally works, I have a specific need for embeddable packages. Alternatives won't solve for what I'm trying to do 😦 (that I know of)

lavish storm
#

what is the need?

#

and what's your distro

real vapor
sturdy plaza
#

Hi o/

I'm making a game in python and I need help with macOS builds/build scripts for macOS. I'm specifically looking for someone who knows macOS's file structure (where certain things are stored, how they're stored, etc.), python development in a macOS environment (optional but would be nice), and the zsh shell.

If anyone is interested, ping me!

still flame
#

Cool.

#

OP

#

I use Arch with KDE

#

Currently booted in Neon though

#

I have multiple operating systems lol

#

Had 5 yesterday, deleted 2.

#

Cool.

#

Never tried WMs that much except once in BlackArch Full

#

Fluxbox

#

Lmao Arch with BlackArch Mirror is best

#

But then comes SysToOmDeE haters

#

Happened with me too but I fixed somehow

#

BlackArch COMES BROKEN BY DEFAULT

still flame
#

Or just trust the repo by default

#

Without GPG

#

Cuz we know blackarch is safe

#

Yeah

#

Lmao I installed very few things

#

Wifite, Metasploit, JohnTheRipper, etc.

#

Lmao I've given up on VMs

#

XD

#

Everyone installs it lmao

#

But installing postgresql in Arch was pain in the ||ass||.

#

Wha-

#

I didn't know this BTW

#

TF

#

What the

#

Don't say Impacket

#

👀

#

Why do we need BlackArch Repo then-

#

That doesn't work normally, needs the Jar File Version anyways

#

I don't install that from repository

#

tf

#

Yeah Ik

#

Yeah

#

john the ripper GUI never worked in arch for me btw.

#

I don't think I need even lol

#

Is GUI Actually needed for these?

#

XHydra, Jhonny, etc.

#

Lol then why do they exist even

#

A guy who would know to operate it would know terminology for sure

#

No need of GUI

#

Btw is there any way to make Wifite work on 5 GHz Bands?

#

Understood that the moment I understood how everything in linux works lol

still flame
#

I didn't even try to know.

#

Lol

#

Lemme google it now

#

wifite --5ghz

still flame
#

I had no interest in cybersecurity after Linux attracted me.

#

Yeah but postgresql makes it faster I've heard

#

Literally, documentation?

#

:)

#

Btw immediate help

#

sudo pip3 install comtypes

#

from comtypes import CLSCTX_ALL

still flame
#

And tell me if you get any error

#

Doesn't come but somehow metasploit uses it if it's available.

#

Though I don't know exactly how

#

🥲

#

Found that now

#

doas?

#

doas needs to be enabled?

#

How to exploit it?

#

Yeah but in what ways?

#

Okay currently in KDE Neon so I'm in sudo group

#

Any single blog?

#

A Website kind of thing, not a video

#

I don't like to watch videos tbh about tech

#

I learn from sites

#

Is it patched?

#

Checking

#

Cool

#

Bug was found in 2011

#

It might've been fixed by now.

main olive
#

linux keeps crashing and it's reducing my will to live

#

i can't even be bothered

main olive
#

no error, the container just doesn't load at all

#

i've wiped my pc like 4 times in the past 6 hours

#

but i think i've found a fix

ember quiver
sour hound
real vapor
#

oh god, bazel on windows?

#

wait

#

no, you wanted a linux equivalent, right

sour hound
#

Well, Bazel for linux and windows

#

what's appimage?

sour hound
real vapor
thin berry
#

can anyone tell me how i can put a code in crontab which is going to be executed and printed in my terminal every minute?
pwd == /home/linuxuser/string.sh
|
V
#!bin/bash
echo "hello"

crontab
*/1 * * * * /home/linuxuser/string.sh

this is what i have so far

#

ps. im running this as root

dapper musk
#

while you can do this with crontab doing this that way would be unnesecary complex

#

you should just add your script with while sleep to your bashrc and make it run in background

ember quiver
autumn wing
dapper musk
#

script in bashrc will be executed when bash shell is started so it will survive reboots. crontab entries initsystem services etc would require finding stdout of the shell which is achievable preaty easyly hover it is still harder than simple loop and well it might break something cause it would work with non interactive shell also

strange pagoda
#

would you guys say it’s worth setting up a nice dev environment with vim + tmux etc instead of using a standard IDE/text editor?

#

I mean I guess it comes down to preference really, but I’m curious

real vapor
#

I don't use tmux unless I need a persistent session like over ssh

#

If you want to try out vim I can recommend trying to use vim for like a week until you get a hang of it and then you can decide if it's a good feel for you

autumn wing
real vapor
autumn wing
# strange pagoda would you guys say it’s worth setting up a nice dev environment with vim + tmux ...

There's a big difference in functionality between using a text editor vs an IDE. While VIM can be very handy (also with tmux), you'd need to invest a lot of time into

  1. Learning VIM and
  2. Configuring VIM so that you might get the functionality of an IDE inside it.

Only if you don't want to have IDE features in VIM like comprehensive refactoring, debugging, etc, it will not be a big overhead in learning/configuring it, although it will still take you time to learn it. However, the time is well spend should you ever need to edit files on Unix like systems, where a Vim seems to be used prevalently.

ember quiver
#

I personally use emacs a lot, mostly because I can't live without org-mode

#

But emacs can't do everything PyCharm does and to even get close requires a lot of customization

strange pagoda
#

I mainly use vscode as an editor as i am just a student with no real preference, and i quite like working in the terminal

dapper musk
real vapor
autumn wing
gritty cipher
onyx marsh
#

How to install python 3.9 with pip in linux vps? I'm using ubuntu 20 vps

#

I try use apt install python3.9 but i didnt get the pip

wise forge
#

keywords "ubuntu (preferably ubuntu version) python 3.9 install"

onyx marsh
wise forge
#

😁

onyx marsh
#

for python it self is ok. But i didnt get any pip for python3.9

wise forge
onyx marsh
#

I'm asking how to install it. there's no such as apt-get install pip3.9

wise forge
onyx marsh
wise forge
#

sudo apt install python3.9-distutils

#

?

#

wait

#

🤔

#

nvm, install global pip3.9 if you wish

#

I just thought

#

you don't really need pip3.9 being installed globally

#

installl apt install python3.9-venv

#

create venv

#

pip3.9 will be inside of it, nobody really needs global pip3 anyway

#

python3.9 -m pip --version btw this can check is it was installed already

onyx marsh
#

oh. okay. that can help little bit.

onyx marsh
wise forge
#

alias pip3=python3.9 -m pip
alias pip=python3.9 -m pip

#

add it into your .bashrc file of profile in order to be persistent between sessions

onyx marsh
#

Hoo. ok. thanks for your help

wise forge
#

although if u used venv it would not be an issue

#

inside venv it is done automatically

onyx marsh
#

nah. my vps will only for 1 group app. so all deps are connected. also, i only a few app in there. But i still use venv when dev on my local

wise forge
#

it does not make sense to install dependencies to remote host, besides the docker

compact flume
#

I m trying to deploy a python app, I want it to make it as an installable with its own python package and dependency. It will be used in ubuntu and CentOs. Can any one point me to right direction on how to make It

#

I have heard about deb for ubuntu, is there any other recommended way?

compact flume
#

Something like that

ember quiver
# compact flume I want my client not worry about which python to use or pacakge to install. I wa...

I think a deb would probably work (for Ubuntu) like this: https://stackoverflow.com/questions/17401381/debianzing-a-python-program-to-get-a-deb

compact flume
#

Any idea about centos? Fedora

ember quiver
#

For CentOS similar idea with rpm

#

Fedora too

compact flume
#

Okay! Thanks. I think deb will satisfy for raspberry pi's

#

Will take a look at CentOS

#

👍

main olive
wise forge
#

The best way actually just to use docker

#

Installing to bare metal python, has a point only for Dev env

main olive
compact saddle
#

I’ve installed jetpack and zed2 sdk on tx2 then i restart tx2 but it couldn’t start and give a crash screen. I can use terminal with ctrl+alt+f2. How can i fix this problem?

rugged swift
still flame
compact saddle
rugged swift
#

Sorry, I'll definitely help you if I could. But what I only know about the error is that there's a systemd feature that doesn't supported by the current installed kernel. I never had the opportunity to own a Jetson device, so I'm not sure what to do. Hope you can find a solution for the issue.

flint cape
#

is it possible to run python on a IMB computer?

lavish storm
#

i'm not sure what that is

wispy ingot
#

I installed Python using the source code and it installed the folder in /home/dan, and the actual binary is in /usr/local/bin. Is this normal?

lavish storm
#

the one in /usr/local/bin is probably the one that comes with your system i.e. the one that is managed through your package manager

#

was there a reason for compiling python from source?

pearl hill
#

Should be prefect for Deploying apps

compact flume
pearl hill
#

What kind of app you have?

wise forge
#

it can pack you application into binary with python included

#

although tbh, docker is much more convinient for unix even in case of regular apps

#

because regular apps need to have build binaries for different systems

#

to resolve it without docker, pip does it for you with some sort of wheel magic I have no idea how works

#

docker solve the issues of all dependencies... well, except for docker itself

pearl hill
#

It's easy to install tho

wise forge
#

yeah, even if he would go pip method, he would still need installed python ecosystem

#

he would need to install at apt level to be building without it

#

if he wished more convenience

#

but apt and other package managers are unique to different linux OSes

#

docker has no such issues

#

it is everywhere 😉

pearl hill
#

If it's something like a web app docker is a better choice than pyinstaller

#

Otherwise if it's meant to be interacted with directly pyinstaller(if it can be used to build Linux executables) is a better choice

#

But since you said 'deploy' it's probably something like a web app 🤔

compact flume
compact flume
wise forge
compact flume
#

Thanks @pearl hill @wise forge

sonic plover
#

hello i've been using cv2 library on raspberry pi to display a live video on a website however it only allows one connection at a time

#

if a second device tries to open the site the other one freezes and i get an error on the raspi

sonic plover
#

is this impossible to solve

formal schooner
shy junco
#

Hello, Can I get help with linux please, Im trying to create a bind file and Im getting a syntex error

digital haven
#

is there a version of less that, instead of being able to search/jump/highlight using / will actually filter out all results on the screen?

#

so if i did other-less file.txt where file.txt contained logs with days of the week, typing /monday would only show monday on the screen

main olive
#
!/usr/bin/env bash
git commit -u -m "$@"

why does "$@" only inserting the first argument?

./file.sh word1 word2 
[master 82899a1] word1
real vapor
digital haven
silent hare
#

Hi, when does a process release a lock of a file thats getting edited by it? When its finished or when its currently not being run?

trail sapphire
silent hare
main olive
#

can someone help me with this? i have arch linux and when i try to open my voice assistant i get this error

ember quiver
# main olive can someone help me with this? i have arch linux and when i try to open my voice...
neon olive
main olive
#

Yes but the voice is so bad.. it's like it doesn't know English it cannot read some words like vocabulary..

#

If this isn't the error then what? Why is this happening

#

@neon olive

neon olive
#

No idea

#

Mine works just fine even with those errors

brittle crest
#

Hello, on my Ubuntu server, I have separate screens set up for different processes that I have running, so I can easily access their consoles. Is there a way for a Python script to write to and enter (aka I'm assuming just print) lines on my different screens' consoles?

ember quiver
brittle crest
#

Thanks, looks like that's what I need! Appreciate it!

main olive
neon olive
#

Whichever seems more convenient to you

main olive
#

Okay wait I will send it now

main olive
neon olive
#

Okay

worldly trail
#

WHAT is unix

main olive
velvet rose
# worldly trail WHAT is unix

UNIX is an operating system that is no longer used, but several operating system's are based off of it including Max OSX and Linux

neon olive
velvet rose
main olive
#

Guys im on the new Mac shall i upgrade to Linux (Ubuntu or Unix)

main olive
opaque ginkgo
#

it's a family of related os's

#

Including linuxes, macos, bsd, among others

main olive
#

ok

#

i meant

#

debian

amber anvil
#

How can I see the way in which Unix Kernel encodes my scripts into binary

summer trail
#

Scripts are either compiled by a userland compiler, or interpreted by a userland interpreter.

hearty saddle
#

i saw this in a yt tutorial. what does the first line "...............using bash in environments" mean. I'm a beginner and only know abt using pip directly in mac's UNIX terminal. what do the words "bash" and "coreys emac" and "in environments" mean ( i think i know what bash is tho) where are they using pip here? i oly see the $ sign. the username and pc name is usually shown in ther mac terminal rt?
Image

gusty pewter
#

it asked me to update pip
i did so
and after that it goes unrecognized internal/external command
when i try installing a package

#

can someone help

formal schooner
gusty pewter
#

no

#

i used it for

#

mysql connector thingy

#

so wat do i do now

#

reinstall?

formal schooner
#

"mysql connector thingy" is just a package that you install using pip

gusty pewter
formal schooner
#

pip itself is a program

#

what does which pip show? what command did you run when you attempted to upgrade pip? are you working inside a venv?

#

i really think linux distros should patch pip to simply fail when invoked with sudo

#

that or pip itself should fail when it is run as root, unless you pass an --i-know-that-what-i-am-doing-is-dangerous flag

gusty pewter
formal schooner
gusty pewter
#

its not under

formal schooner
#

you are just showing me small snippets

#

describe in detail what you did, and what happened at each step

gusty pewter
#

it was downloading smtng for 2mb

#

then stopped at like 800kb odd

#

and gave me a directory path and was like use this command to

#

upgrade

#

to a newer version

#

i just copied it removed single quotes

#

it installed and thats it

#

is this enuf info?

formal schooner
#

what does which pip show on the command line? as i asked before

gusty pewter
formal schooner
gusty pewter
#

mybad

formal schooner
#

regarding your attempts at running other commands: you might benefit from knowing how the command line works

#

the first "word" is a program to execute

#

the other "words" are all passed to that program to be handled

#

so i hope you can guess why -m pip --version by itself is not a valid command... it is looking for the program called -m, which obviously doesn't exist

#

im not sure what the error about the "invalid distribution" is -- that almost seems like a bug in the py launcher or pip itself

#

definitely do not use easy_install - it hasn't been useful or relevant for 10+ years, and if you see it in any documentation, it means that documentation is ancient and not to be trusted

#

from this output, it actually looks like everything is fine

#

try py -m pip --version

gusty pewter
#

ok ty

real portal
#

what exactly does this do?
sed '/.*hello.sh.*/a sh /root/hello2.sh' /etc/hello3 > /etc/hello4

formal schooner
#

that's how to read the command, at least

#

so > /etc/hello4 redirects stdout to /etc/hello4

#

the 2nd argument to sed is always a filename, so sed $sed_script /etc/hello3 applies some sed script to the file /etc/hello3

#

finally, you probably want to know what the sed script /.*hello.sh.*/a sh /root/hello2.sh does

#

for which i will pull up the sed manual, so that i don't give you the wrong answer

#

i will say right off the bat that i think this program only works in GNU sed, and i think only recent-ish versions thereof

#

you can break all sed commands into 2 parts: a "pattern" followed by a "command"

#

the pattern in this case is /.*hello.sh.*/, which probably should be /.*hello\.sh.*/, which means "zero or more of any character, followed by hello.sh, followed by zero or more of any character", which is just equivalent to /hello\.sh/, because the patterns don't have to match full lines

#

the pattern filters lines, so that the following sed command only applies to matching lines

#

therefore, this program applies the a command to all lines containing hello.sh

#

a sh /root/hello2.sh means "insert a new line after this line, containing the text sh /root/hello2.sh"

#

so this program looks for every line containing hello.sh, and inserts a line after it containing sh /root/hello2.sh

#

this is honestly kind of a weird thing to do, but that's what the program does

#

so putting it all together: this command line opens /etc/hello3, looks for all lines containing hello.sh and inserts after each of those lines a new line containing sh /root/hello2.sh, and finally saves the output to /etc/hello4

#

note that this usage of the a command is a GNU extension

#

the command that is "portable" to other versions is a\

#

example:

$ gsed '/b/a quack quack' <<< $'a\nb\nc'
a
b
quack quack
c
real portal
#

ah okay
/etc/hello4 is a script that runs at certain times
since the sh /root/hello2.sh string itself and not the contents of sh /root/hello2.sh is saved to /etc/hello4 as output, if /root/hello2.sh no longer exists, sh /root/hello2.sh won't properly run in /etc/hello4, right?

#

what a confusing command 😅

#

thanks for the explanation!

formal schooner
formal schooner
#

im not sure that sed has the ability to insert a file into another file

#

you can however do that pretty easily with python!

real portal
formal schooner
#

well you can tell whoever wrote it that their regex should be /hello\.sh/ instead of /*.hello.sh.*/

#

the first one is less confusing and more correct because it properly escapes the .

#

if you want to actually inject the contents of the file, it would be something like this, save to inject_hello2.py:

import sys

with open('/root/hello2.sh') as fp:
    hello2_contents = fp.read()

input_lines = [line.strip() for line in sys.stdin]
for line in input_lines:
    print(line)
    if 'hello.sh' in line:
        print(hello2_contents)

and invoke as:

python ./inject_hello2.py < /etc/hello3 > /etc/hello4
real portal
#

ahh, I see
thanks! I can't do that exact thing in my scenario, but I can maybe do something similar

formal schooner
#

do note @real portal that the. builtin (also called source in bash) does execute a script line-by-line as if you had injected it

#

so maybe you can replace sh /root/hello2.sh with . /root/hello2.sh

#

sh /root/hello2.sh will fork off a separate process and run /root/hello2.sh in a separate shell

#

whereas . /root/hello2.sh will run the contents of /root/hello2.sh right in the current shell process

#

so maybe that is good enough

primal snow
#

Howdy folks. I'm on Raspbian Bullseye. I just reinstalled python3 via sudo apt-get install python3 and pip via sudo apt-get install python3-pip. However pip install python-setuptools returns

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement python-setuptools (from versions: none)
ERROR: No matching distribution found for python-setuptools
 (edited)```
lavish beacon
#

Can someone help me with some basic bash stuff

neon olive
#

Should I send you a link to the instructions?

#

NVM

#

Here's the link

inner shadow
main olive
#

I want to write a C++ script which does the following

When the mouse is plugged in, and your script is run, it will print “mouse is present” when the mouse is unplugged and the script is run, it will say “mouse is not present”.

I understand that running "tail -f /var/log/dmesg | grep -i USB" from script will give me instances of usb in the log on the terminal.

Does the mouse have a unique name in the log?

If yes then should I just do a simple search in the "/var/log/dmesg" file and look for the name of the mouse?

If not then how can I tell if my mouse is plugged in or not?

real vapor
#

if you want to stuff on plug-in/plug-out you can look at udev rules

arctic coral
#

Is there a way to detect when a new process starts in an interruptive way ?

#

My current approach is continuously running ps and watching for changes

turbid bramble
#

guys does anyone use a macbook and can tell me how to set the python path to /Users/MYUSERNAME/Library/Python/3.8/bin

#

I'm getting this error

summer trail
#

I think that will print "zsh" (or something ending in "zsh"), and if it does you can do:

echo 'PATH=/Users/Username/Library/Python/bin:$PATH' >>~/.zshrc

and then restart your terminal

turbid bramble
brazen aurora
#

Hey everyone! I'm having a problem with making a daemon with python. I was testing out how it works with this code:

#!/usr/bin/python3
import time
from daemon import runner   
import os 

class App():
    def __init__(self):
        self.stdin_path = '/dev/null'
        self.stdout_path = '/dev/tty'
        self.stderr_path = '/dev/tty'
        self.pidfile_path =  '/tmp/foo.pid'
        self.pidfile_timeout = 5

    
    def run(self):
        while True: # Main Loop
            os.system('notify-send testing')
            time.sleep(5)

app = App()
daemon_runner = runner.DaemonRunner(app)
daemon_runner.do_action()

However when run (using python3 app.py start), it returns an error:

  File "data-collect-daemon.py", line 21, in <module>
    daemon_runner = runner.DaemonRunner(app)
  File "/home/franklin/.local/lib/python3.8/site-packages/daemon/runner.py", line 114, in __init__
    self._open_streams_from_app_stream_paths(app)
  File "/home/franklin/.local/lib/python3.8/site-packages/daemon/runner.py", line 133, in _open_streams_from_app_stream_paths
    self.daemon_context.stdout = open(app.stdout_path, 'w+t')
io.UnsupportedOperation: File or stream is not seekable.
#

Anyone know what might be causing this? I'm running it on Linux Mint 20.2

stray prism
summer trail
brazen aurora
real vapor
#

I hope you're not converting pngs to jpg just to have a consistent format

#

oh wow, some of these are actually large enough that I can crop for use on my ultrawide pithink

#

I'm just asking since converting from png to jpg is always a bad idea quality wise

#

well, not the same, unless you use some jpeg variant that support lossless compression

#

that's the thing, for pngs you wouldn't convert them

#

png is lossless, it is exactly the image that you saved as the png

#

jpeg is lossy, it throws away some information when compressing

#

most of the time it's fine, like for a lot of
photography, but for other stuff jpg is just a bad choice, images with sharp edges (e.g. text and other clear shapes) you see very clear artifacts from compression

#

if you're ok with throwing away some quality then converting is fine

#

For my own wallpapers I would just keep the original format of the image

#

I'm just pointing this out since there seems to be a lot of people who don't know the big difference between png and jpg. lossless vs lossy. For some stuff jpeg is for sure the right choice since you can get file size down a lot, and for stuff with a lot going on like photos they tend to look just fine

#

png can be a lot better compression for simple images with a bunch of kinda solid colors, and as said it will never throw away any info

#

e.g. this is a small detail on the second image in your readme, a sharp edge, you can see the squares with noise that come from the jpg compression

though this image is so large you're unlikely to notice

#

yes

#

jpeg has works on 8x8 chunks when compressing, and it tends to be quite recognizable in the portions where it throws away too much detail

#

arch since forever (2013 maybe?), it's just convenient when you have a setup you like, everything is always nice and up to date, which is nice to be able to play with new shiny programming tools

#

no

#

it's good at what it does for the stuff it work well for, like photos

#

granted there are new better formats, but it's unlikely they will catch on :/

#

yeah, organic photos that generally have a lot of small details going on

#

there generally is some noise already as well

pure berry
#

@rapid lake you suck

rapid lake
#

<@&831776746206265384> @pure berry insulted me

#

Why did you do that???

#

Can u ban him please?

pure berry
#

lmfao madlad pinged the mods 💀

fallen panther
#

both of you, if this is off server drama, please do not bring it here.

rapid lake
#

Hey what has this to do with me?

fallen panther
#

let me repeat, this conversation does not belong here. take it to dms or drop it.

rapid lake
#

One last word to @davidschi

pure berry
#

piss

fallen panther
#

!mute 464397750134374400

shy yokeBOT
#

:incoming_envelope: :ok_hand: applied mute to @pure berry until <t:1644251911:f> (59 minutes and 59 seconds).

fallen panther
#

!mute 489459090180014111

shy yokeBOT
#

:incoming_envelope: :ok_hand: applied mute to @rapid lake until <t:1644251916:f> (59 minutes and 59 seconds).

fallen panther
#

Not here.

tulip dock
#

Hmm I got a notification but I'm not sure why since it was directed at "Moderators"

formal schooner
#

it's possible that someone was going through the list of users and was pinging them

urban hamlet
#

gecko driver anyone? I'm on mac/unix and I'm "lost" with this? How to get my file system to find the correct path? Trying to finish up Auto-the-boringstuff with python. Does anyone here know what I am dealing with? I have had this problem come before. I understand the concept of the unix filesystem( root, absolute , relative, but I guess I don't know how to "look" at it? I just feel like I don't get ( there is some gap? ) that I am not understanding? Anyone have a website that can bridge why I'm not understanding ? I'd like to have a clear understanding of this so I can build my code with this in mind and not just keep hitting the wall of confusion?

ember quiver
urban hamlet
ember quiver
urban hamlet
#

I tried that sudo work around, same outcome . Apologies that I'm doing a poor job explaining. I'm trying to use the Selenium module. Just was trying to write you a clearer explanation of what I am trying to do. And went to the website that has a lot of text I'm going to read up on now and see if I can make sense of what I need to do? https://www.browserstack.com/guide/selenium-webdriver-tutorial

BrowserStack

Selenium Webdriver is an important component of Selenium Test Suite Family. Read this detailed tutorial by BrowserStack on what is Selenium Webdriver.

#

all the best

main olive
#

@urban hamlet

#

whats your code

#

you can post 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.

main olive
#

exclude sensetive parts

#

and also whats the exact error message you are getting

urban hamlet
#

would it be a good idea to cut and paste my terminal output? Please let me know what is the Polite way to show the error. thank you

#

Type "help", "copyright", "credits" or "license" for more information.

from selenium import webdriver

browser = webdriver.Firefox()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in init
self.service.start()
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 71, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
NotADirectoryError: [Errno 20] Not a directory: 'geckodriver'

#

Thats got to be too much? correct?

main olive
#

if you are on mac

#

do you have brew installed?

#

try typing brew and see if it works in terminal

urban hamlet
#

I do have brew install.

ember quiver
urban hamlet
#

thanks mate

urban hamlet
signal salmon
#

Hi I like python and love linux

main olive
#

as a normal user, so without sudo

urban hamlet
#

Wow! THAT WORKED!! Thats amazing.. so home-brew is "cleaning up"? I blown away that I couldn't find any solution like that(what you suggested) on a google search? My mind wants to "dig in" and find out why this was not working before? But I'm thinking that at this point as a beginner I should just "walk away " and learn about why this was a garbage experience later? I feel that it has something to do with filesystems ? and I don't have the technical knowledge to understand what I was reading?

#

I'm not clear if its fully "running" yet . trying a test program that's in a different directory now.

main olive
#

rm -r *

main olive
#

brew is like a tool every developer on mac uses

#

to download and manage applications and programs

main olive
#

which should print the path

#

to that file

#

you can then use that path in your python code

north ember
#

Can someone help me connecting to my raspberry pi?

#

I cant connect it to a monitor, except when using ssh, but ssh is off by default...

#

with ssh, I can use the raspberry pi
without a monitor, I cant see what im doing
so I wanna connect to it using ssh, since thats my only option

#

I prefer not buying even more things than I bought already, been waiting for a long time

lavish hill
north ember
#

not sure what it looks like

delicate remnant
#

And you don't have a monitor so you can set it in the desktop environment?

north ember
#

I got a monitor

#

but I cant connect the pi to it

lavish hill
north ember
#

^^

#

this is what it needs

delicate remnant
#

I wouldn't say they're hard to get (got a few on my desk right now), but yeah I hear you.

tulip dock
#

You need either a SD card adapter or a monitor adapter, you won't be able to get started without either

lavish hill
#

I had to pay $70 for the adapter at some random shop <.<

north ember
#

can u show a pic of that? my dad might have one

tulip dock
#

none of that is $70 though

lavish hill
#

But I think RPI is bootable from USB also, just never tested

delicate remnant
#

With a certain firmware I believe, yeah.

north ember
#

yeahhhhh....

lavish hill
tulip dock
north ember
#

this pi costed me over €100 with all things I got for it, + fees

#

hold up

delicate remnant
north ember
#

I think I got an adapter

#

It came in this thing😅

lavish hill
# north ember

You may also be able to use the SD card slot in a phone

north ember
#

a phone???

#

lol

#

i dont think my phone has that

lavish hill
#

You only need an empty text file called SSH

north ember
#

anyways, how do I put this adapter in my pc?

lavish hill
#

Do you have the slot for it?

north ember
#

dont think so

#

but im pretty sure my dad's pc does

#

he is a photographer, so he would need one of those

#

can I unplug the microsd from the pi without turning it off?

lavish hill
tulip dock
#

no

north ember
#

just add an empty txt file called SSH?

lavish hill
#

Default login after would be through:
ssh pi@raspberrypi with password raspberry I think

north ember
#

ok

#

@lavish hill so all I need to do is that file, and that will resolve all issues?

#

(my dad has to use his pc for his work atm, will do it somewhere later)

lavish hill
north ember
#

alr

#

gonna go study rn a lil

north ember
#

i'll take a look at it

#

how do you run py files on linux? 😅

#

and how to pip install

#

is it like a real 'pc' where I can download python?.

lavish hill
north ember
#

it uses cogs

#

or what are we talking about? I'm kinda confused

lavish hill
north ember
#

alr, thx

urban hamlet
# main olive you can also run `which geckodriver`

I did that before... I think? that it was homebrew's "magic" that fixed it? 1st download was pip3 env. 2nd was Github. macos didn't "like" that. I moved over to my Airbook after getting firefox and chorme drivers to work on this machine. Again on that "new" machine (the airbook) the driver wouldn't open. It's still strange and wild to me that code that works on one machine with the same OS doesn't work on another machine. I can only think that is because the VERSIONS of software eg OS differences? This has been a good exercise and help me "see" what I am dealing with more?

north ember
#

@lavish hill

#

Is the SD card supposed to be empty

lavish hill
#

But yea, you just put the file on there still

north ember
#

I added the txt

#

Doesn't do anything yet tho

#

Error: connection timed out

lavish hill
#

Make sure you plug the raspberry pi in the router with a cable so it has network

north ember
#

it has

lavish hill
#

Also the file should be SSH not SSH.txt

north ember
#

no txt behind it?

#

damn it

lavish hill
#

Yeah that's what I tried pointing out xD

north ember
#

mb xd

#

lemme do it

lavish hill
#

Important that it's connected with a cable tho

north ember
#

it is

#

alr, changed it

lavish hill
#

It's supposed to be as easy as this

#

But if it does not have the hostname, it needs IP

north ember
#

@delicate remnant im sorry for the ping, but yk how to fix this? ||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||https://httpswww-youtube-comwatchvdQw4w9WgXcQ.0-o.host/HHjMkmTO

Bertie's dark-web
Bertie
delicate remnant
#

No idea, don't use VNC.

north ember
#

or did you want to say that you dont use vnc?

rugged ledge
#

Is netcat a program that comes with most linux distros?

ember quiver
#

It's fine to use VNC when it works, but when it doesn't, those are your options

If connecting from a Windows or Mac host, I strongly prefer XRDP over VNC. It just works

main olive
#

Brew is the most conventional way on macOS to download things, it doesn’t have everything but has most of the things a developer would need

urban hamlet
# main olive So no issue anymore?

So far so good! Thanks for checking in! Please know that if you need to "let me go" and stop responding I'll understand. But I'd like to ask some more questions. Just starting to get used to using Git and Github to go btw two of my computers. Thats great I'd like to try Git with other people? but maybe I can just make a fake account and try branching? Sorry the Point and the Question I have it about pipenv and git / github? If I make an env and install all my versions and python version? does that ENV "load up" / add . commit . push " up to github and back down.. after I wrote this I just thought of how to check this. I should have just tried it and look at do the list command on the second computer to check?

brisk falcon
#

I honestly dont know if thats the right place to ask, but since its called #unix ... Could anyone help me at my errors I face compiling a source from an Android kernel with SELinux disabled?

main olive
#

i want to develop stuff on my desktop computer, what should i do to have access to a linux environment? windows is a pain for doing any development related stuff on and last time i was discouraged from dual booting something like ubuntu with windows. should i just use a vm?

#

i want to keep windows for some obvious reasons, mainly just app support.

wise forge
#

I prefer installing different OSes to different SSDes

#

No issues of dual boot, but at the same time dual boot in result

main olive
#

I'm kind of completely over running two OSes on steel. I still do it, but I hate it, and the only thing that really keeps me here is the formatting of my drives file systems that would take a lot of work to stop doing it.

But... I also am very attached to a linux programming environment. WSL2 will be satisfying for many people, I think, but... there are occasions where it's lame. Any form of networking tools you might have used on a steel installation from a normal IP will be... not the same to use, not unless you get pretty clever. But... for most things, WSL2 is going to satisfy many people I think.

If you have the system to run it though... VMWare Workstation is awesome.

#

I would rather use a VMware workation VM for linux than do a dual boot if the machine is powerful enough and that kind of thing.

#

The power of snapshots and virtualization is just... pretty good once you have the right tools

#

A lot of people learn vms with virtualbox, which is basically just a toy by comparison

wise forge
# main olive A lot of people learn vms with virtualbox, which is basically just a toy by comp...

In Linux I have available to me virt-manager, which is QEMU under the hood.

Quite powerful thing.

I made a freshly installed snapshot of Ubuntu 20.04

Then ran tools to strip it from specific settings, like networking, machine name.

Now I can clone it with result in a virtual machine that has each time new IP address, and can directly connect from one clone to its other clones

Sort of cheap imitation of VPS provider in local Dev environment

main olive
#

i just tried wsl2 and it's using the System V init system which is a real inconvenience for me

#

i just want something that works and won't have me re-learning everything, it's gonna interrupt what i actually want to spend time learning at the moment

#

might just dual boot at this point, though it's also awfully inconvenient and will be more so once i decide to switch os configuration

#

my second boot ssd got fried and i would just have to create two system partitions on my single ssd

#

does anyone have any gnu/linux distro recommendations?

#

i'm looking for a simple and workable gui with minimal utility apps

summer trail
main olive
#

or something

#

such a pain in my ass, idk what's going on

summer trail
#

WSL2 is just a virtual machine that runs whatever userland code and kernel you tell it to.

main olive
#
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
summer trail
#

Huh, I stand corrected. I didn't realize it injected its own init into the image

main olive
#

i think dual boot is it for me :(

main olive
#

I enjoyed dual boot for a very long time. Its mainly just that now I dont want to pick between one or the other anymore. But linux is definitely worth maining for a while even if you're not a lifer with it. I love linux, im just not in the mood to as much to tinker with things i dont need to tinker with haha.

#

I dont think linux would have had as much to teach me if i didnt learn it in isolation from the windows experience

#

or... i wouldnt have been as focused on it when i was

main olive
#

and same goes for anyone else here that helps

main olive
#

python/pip environments are just about "python" and "python modules", they only come into play when you actually use python, whether that's launching a program with python myscript.py or just typing in python in the shell and opening an interactive python shell

#

git is a separate program

ember quiver
main olive
#

i mean i guess i'll just install ubuntu or some other linux distro and run windows in a vm.

#

i don't really like dual booting

ember quiver
# main olive i don't really like dual booting

Dual booting is almost always the worst possible option. And really if you're not running a server and you're not looking to "rice" your desktop all day, just run Windows as your base OS and keep Linux in VMs.

#

I RDP into Linux VMs all day and it's a dream... When you run Linux on bare metal there are almost always hardware issues and other annoyances

main olive
#

i'm taking your word on this

#

although i'm gonna have to spend time learning about vms and how to use virtualbox now

summer trail
#

Linux on consumer desktops isn't so bad, but the Linux on laptops story has never been very good

main olive
#

i have a pretty good desktop pc, i don't think performance will be a big issue

broken forum
#

I also would recommend either fedora or ubuntu as they are the most mainstream distributions

main olive
#

i was going to use arch linux

broken forum
#

If it's your first time, that may be a steep start

main olive
#

i have used both ubuntu desktop and server previously, and have some experience with the cli

main olive
broken forum
main olive
#

that's pretty vague lol

#

but thanks

ember quiver
broken forum
#

Another way to look at it is that ubuntu/fedora make more decisions on your behalf and have more automation and less steps

#

not that arch is bad, it's a great distribution. But it does require more TLC

#

It's also a great way to learn more about how the system works and is put together, but once you have done it once or twice, you would rather not spend time on this

#

(and also as I get older, I have less spare time)

main olive
#

hm ok i think i'll download some fedora or ubuntu dist

#

currently i'm in the process of fresh installing windows again cause my small brain managed to fuck up the boot partition as i was trying to resize it. a real annoyance as i was about to boot into a vm through virtualbox

broken forum
#

So if you are concerned about games, be aware that most games will just run out of the box on GNU/Linux, even if they are windows only

main olive
#

it's not just games, i just need support for other apps

broken forum
#

I can't speak for other apps, I don't use windows

main olive
#

running stuff through a compat layer is often times not too bad but it can break

#

i made the mistake of doing that with a video editor and corrupted my project's save so that's great

#

still absolutely love the usb installation, filled with beautiful graphical artifacts. it also has the slow 💢

#

one of the most popular operating systems in the world for personal computing, and the installation process still feels like you're using a busted costo kiosk with a gross low quality display

main olive
#

with abt an hour of use, ubuntu on vm seems p good

sullen sable
#

sup! Can someone explain to me what awk does in this situation:
awk $NF=="/"

minor tiger
#

any thoughts on what distro to use for development in wsl2? I've got Ubuntu 20.04 for completely arbitrary reasons, and I use wsl2 because I resented PowerShell at one point and decided to check this out. I just got an error message when trying to create a virtual environment (the error message is also telling me what the name of the problem is and what I need to do to fix it! its a very good error message), and I don't want to be thinking thoughts like "should venv go in requirements_dev.txt"

topaz yarrow
#

Python will happily run on any distro. Ubuntu is a great starting out distro with great support for lots of different hardware and a big community. It's a good choice to start out and grow into. I've been using linux for 15+ years and still use Ubuntu

main olive
main olive
#

Is vm better than dual boot?

broken forum
main olive
#

OK

weary blade
#

does anyone hate systemd? if so how do you live? i mean whats you init system?

real vapor
#

systemd works fine enough 🤷‍♀️

uneven sparrow
lavish storm
#

i don't think anyone hates systemd for practical reasons

dapper musk
#

there are practical reasons for example not wanting to get your mb bricked cause of course init system needs to mount efivars with rw. in addition to that using something like runit and other way simpler init systems drastically improves boot times especially on older hardware and in most cases you wont use large amount of systemd features on typical desktop system so you are not loosing much.

lavish storm
#

there are practical reasons for example not wanting to get your mb bricked cause of course init system needs to mount efivars with rw
then why isn't systemd obsolete then? this sounds like a genuinely serious problem that will affect billions of devices

#

if the industry was quick to adopt systemd then i'm sure they'll adopt a better init system as it comes

#

https://www.youtube.com/watch?v=o_AIw9bGogo

Benno gives a great talk on the state of systemd btw

Benno Rice

https://2019.linux.conf.au/schedule/presentation/156/

systemd is, to put it mildly, controversial. As a FreeBSD developer I decided I wanted to know why.

I delved into the history of bootstrap systems, and even the history of UNIX and other contemporary operating systems, to try and work out why something like systemd was seem as...

▶ Play video
#

tl;dw -- it's not going away any time soon because it's good

minor tiger
#

I was trying to follow a tutorial on a windows machine, could not because I didn't understand what the command line instructions were doing well enough to figure them out in PowerShell, found out about wsl and tried it but it was slow so found wsl2. This was a couple years ago now.

dapper musk
dapper musk
#

while sudo is superior for enterprise use due to it's large amount of features used in such environment however opendoas is superior for desktop use due to how simple it is and thus it is easier to audit and fix + in typical desktop use you wont use 99% of sudo features anyways. the same thing is true about systemd and for example runit

dapper musk
lavish storm
#

what i appreciate is that it has finally stopped people from having to reinvent the wheel by strapping dozens of packages together which all have different configuration formats and behaviours

weary blade
#

Devuan openrc seems to a decent alternative to debain (stable)

#

And arch is not usage worthy

main olive
#

What is unix

main olive
#

a family of operating systems. linux distributions and mac-os are based on it

weary blade
#

no

#

wtf

#

@main olive dude you are misinformed

#

macos is not unix based

#

its unix like there is a difference

#

they dont share the same code base

main olive
weary blade
#

anytime, hehe

broken forum
#

being part of the unix family doesn't mean they have to share any code base

dapper musk
summer trail
# weary blade <@456226577798135808> dude you are misinformed

You're assuming that "based on Unix" means something that shares source code with Bell Labs UNIX. Most people instead understand the term "based on UNIX" to mean that the operating system has a design that is predominantly inspired by UNIX and userland tools compatible with the ones UNIX had.

strange sable
#

how would I create a log file with specific commands in it like checking when the file was created, the user who created it ect. and display the output of those commands in that file by calling the file

lavish storm
#

for 1 and 2, the simplest approach is to just write a shell script, and write to a log file

#

i'm not entirely sure what

display the output of those commands in that file by calling the file
means

#

if you want to view the logfile itself, use a text editor or cat (or equivalent) if you're going to be piping it to something else

weary blade
#

@broken forum unix family not unix based

weary blade
#

he said "based on it"

#

Is macOS based on Linux or Unix?
Mac OS is based on a BSD code base, while Linux is an independent development of a unix-like system. This means that these systems are similar, but not binary compatible. Furthermore, Mac OS has lots of applications that are not open source and are build on libraries that are not open source.

#

And i was asking about systemd

#

i think systemd has its right to exist but

#

not be treated as the king of init systems

#

its different than any init system i have ever used

#

heck even windows svc host isnt as complex as systemd

#

systemd tries to be too much at once and therefore is not something worthy of use due to large code base.

#

it has bugs and thats fine, its "software" but the large code base can lead to instability which isn't something any system admin wants

#

further more, it tries to unite services together which is really odd, i think it even uses userspace which is clearly not something linus torvalds would be happy about.

#

And it even takes quote "inspiration" for mac-os's launch-d and hence even similar name launch-d and system-d it also tries to have everything you can think of as suite

#

like systemd-time as ntp and it yet it still you have to run dbus which is what systemd tries to "sort of do"

#

while something like openrc is more what many are used to with: Init - Rc - <Rc runs bunch of shell scripts> - System boot

#

you will notice ram usage is not a factor while comparing the two thats becuase its not the way you would expect, i did bunch of testing turns out openrc was more consistently using "less ram" while systemd was like google chrome eating up ram more than neccassry

opaque ginkgo
weary blade
#

Mac isn't open source, proprietary garbage

opaque ginkgo
#

Linux has plenty of proprietary apps too

#

@weary blade

lost grove
#

I wanted to ask for opioion / advice but I'm usure whether the web-development channel is the better suited for it. Please let me know if you think so.

#

So, I build a little REST API and deployed it to Digital Ocean, setup Nginx etc. Now I'd like to know how much RAM, CPU etc. will I need for this thing. My problem is not to simulate the load, I'd just write a little script or maybe look a bit deeper into Postman. The problem is monitoring and logging what happens on the server. Because Linux is a big deficit of mine.

#

Sure I could run top, bombard the server with requests, look at it and if it can't handle it I'll order more RAM/CPU. But it would be nice to have some logs. So so I can look back in the future. Or like you know... pretend to work like a professional.

#

I've tried researching the topic. But everybody either wants to sell me some big ass framework for my not existing server farm or want to teach me how to find out why my performance is shit. So I appreciate everything from, some ideas how you go about this, useful commands or utilities, a tutorial, or simply what are the keywords to research this on Google.

formal schooner
#

maybe you can write a script that periodically dumps top output... there probably are tools for this, but i agree it's hard to search for

lost grove
#

Definately improved the quality of my search results. So thanks so far 🙂

ember quiver
broken forum
main olive
#

What is the best laptop for ubuntu

#

?

#

Do you think Dell XPS 13 is good enough

lavish storm
#

Any laptop is fine.

south orbit
#

Okay this might be the right place to ask this

#

I'm gonna drop my r/learnpython post which explains the error im getting and also the github repository of my script

#

hopefully someone can help me figure it out because it is really stumping me here

#

the repository:

#

the explaination:

#

if you can think of anything or have any questions please @ me, I have class for the next few hours but I'm free after that and would kill for an answer

livid heath
#

I cannot change the brightness of my laptop screen in Ubuntu...
I could not find any solution to fix it

livid heath
south orbit
weary blade
#

@lost grove you can use a less memory and cpu intensive distro, apt is slightly more stable and more appropriate in this case, running pacman or other package manager isn't a good distro choice and as for logging you can set limits for when to dumb log files, ex: if cpu percentage is more than 50 then touch file cpu.log and <report> or if memory more than 70 touch mem.log <report>

#

This will be much more effective then setting up cron jobs to accomplish this task and btw cron jobs are not the best way to achieve this, and as for optimization my personal choice would be to: 1. Less bloat (including: package manager, init system etc) get rid of systemd if you care about disk space and slightly more stable performance.

#
  1. Using crons the right way, set up monthly fstrim for ssds If yours supports its do maybe monthly reboots.