#unix

1 messages · Page 6 of 1

narrow fern
#

Is there any way to access these functions without using C?

summer trail
narrow fern
#

I need this function in golang

shy yokeBOT
#

Modules/timemodule.c line 1344

_PyTime_t total = utime + stime;```
narrow fern
#

So that would be correct, right?

summer trail
#

Well, it is utime+stime, but it's getting it from getrusage, not from procfs

#

But sure, I suppose getting it from procfs works too, at the expense of portability

narrow fern
#

Portability is not a problem, only needs to run on Linux

#

Are the values from getrusage and procfs the same?

#

I believe there is also a wrapper for getrusage in Go

summer trail
narrow fern
#

Should be fine

craggy kite
#

Does anyone use Python CLI tools which are annoyingly slow? E.g. I find the AWS CLI annoying, it never responds in less than about half a second.

main olive
#

unrelated but I just did speed testing on curl vs wget vs certutil vs other system commands and never realized how slow curl is relatively

craggy kite
radiant kraken
#

for my raspberry pi it takes a couple minutes for poetry to resolve dependencies, which is my main gripe with it

#

but looking at other commands they all seem to have about a 1s delay minimum

#

the main bottleneck for a recent CLI i made was the imports so i had to work around it by moving imports inside functions and not importing certain submodules in __init__.py

prime magnet
keen barn
#

one way to quickly profile how long imports take: python3 -v 2>&1 | ts -i "%H:%M:%.S"| grep '.*import'

misty meteor
#

Anyone knows if there is a way to usee the 'ping' command through python?

knotty sentinel
misty meteor
craggy kite
warped nimbus
spark mulch
craggy kite
craggy kite
wise forge
#

network communicating CLI is a network communicating CLI

#

it is not really for python to solve it

#

plus, there is already perfect tool for CLI tools, named Golang.
Any tool is made as fast as possible, lightweight as possible, with minimum dependencies, and maximum possible multihtreading if necessary and at the same time as maintainable as possible.
kind of no point for smth else in terms of CLI, if u already learned golang in my opinion

#

i choose for CLI not golang, only if projects are written in another language and i am forced to choose another language

craggy kite
#

@wise forge

in my opinion AWS CLI will not be improved by any kind of CLI interface [...] because network latency is unavoidable
Yes, JumpTheGun isn't going to resolve network latency, but it can avoid long startup times, which are often an issue even without network latency.
plus, there is already perfect tool for CLI tools, named Golang.
I have two main responses to this:

  1. The effort to rewrite many such tools in Go (or Rust etc.) would be immense. In some cases it is worth it, see for example Ruff, but those are the exception to the rule. JumpTheGun makes existing tools faster with zero development or maintenance effort.
  2. The first time I ran into such an issue was actually with a CLI tool written in Go, which did not suffer from network latency: go-license-detector. It simply does a lot of setup every time it is run. I ended up forking it and creating a version which worked as a simple HTTP server; with something like JumpTheGun I could have trivially done something similar with zero development.
    https://github.com/go-enry/go-license-detector
wise forge
#

comparing network delays with startup times is supposed to be many times different values

#

i would expect, network delays being way higher to notice any startup delays

craggy kite
wise forge
#

although to be honest, for my human eye, 250ms is not very noticable

craggy kite
wise forge
#

i am more horrified by Java CLI tools delays... their delays are measured in seconds...

craggy kite
#

Maybe Java should be my next target language then 😎

wise forge
#

Java ecosystem has no choices. Maven and Gradle

#

slow as f stuff for any, any command launch

#

launching unit tests, is many many seconds adventure for hello world program

craggy kite
#

Ah, yes, launching tests is a great use case! I'm aiming to do something about that for pytest to making running tests as near-instant as possible.

#

(It already shaves off ~100ms of every run of pytest, but there's likely more that can be achieved.)

wise forge
craggy kite
#

Not yet, but I don't use VSCode. Still, whether it could be used with a debugger attached is an excellent question. At the moment I don't think that will work, unfortunately.

wise forge
# craggy kite Maybe Java should be my next target language then 😎
naa@naa-MS-7C89:~/repos/pet_projects/darklab_avorion_api$ grad test

BUILD SUCCESSFUL in 2s
19 actionable tasks: 9 executed, 10 up-to-date
naa@naa-MS-7C89:~/repos/pet_projects/darklab_avorion_api$ grad test

BUILD SUCCESSFUL in 672ms
19 actionable tasks: 19 up-to-date

launching tests for hello world

#

first launch 2s, second launch 672s

#

for hello world, Carl!

main olive
#

How to make a command? Have different permissions everytime?

Like when running a command how to specify for only that time it is ran it has only read permissions?

ember quiver
humble falcon
heavy scroll
#

So i was just messing around slightly and this issue kept popping up

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Which made me use a venv instead

#

That was fine till I had to use a jupyter notebook for a project, for some reason the venv never really worked for vs-codes jupyter notebook extension

#
----> 1 import pandas as pd

ModuleNotFoundError: No module named 'pandas'

I kept getting this so I just ended up

sudo apt remove python3

Than reinstalled it, hoping that would fix it but same issue

#

Now kinda out of ideas in fixing it

#

The same issue also pops up in jupyter-notebook

main olive
main olive
#

I do not want it was just curious if there was a way

heavy scroll
#
sudo apt install python3-packageName

This solution works for now but is there a better way to fix the train-wreck that's known as the external environment

ember quiver
# heavy scroll So i was just messing around slightly and this issue kept popping up ```bash er...

You should definitely be using a virtual environment of some sort instead of messing up your system. See if this helps? https://stackoverflow.com/questions/58119823/jupyter-notebooks-in-visual-studio-code-does-not-use-the-active-virtual-environm

tulip dock
#

Is there a way to pass a specific file descriptor to a process using subprocess? I see the pass_fds argument but you can't remap file descriptor numbers with it, only pass them through

#

I have a script that expect something as fd 7, this is done currently from another shell script (using 7>), I want to rewrite that script from bash to Python

#

I can call dup2 but there might already be something as fd 7, really I want to to dup2 after fork and before exec, but preexec_fn seems deprecated, I'm not sure how to do this

#

I just want to translate cmd 7> output.log to Python Popen(['cmd'], ???)

crystal granite
#

Hello guys and girls.
any ideas how to fix this (whatever the reason) ?

im not familiar with python (just average 3d designer) but i ran in such issue when tried to launch UI for image generator.
in other words i would appreciate any help with installing missing dependencies - tried allready on my own but i failed

#

PS. Running on latest fedora linux

ember quiver
odd sage
#

What is Unix?

fallow tusk
#

It's an operating system. Or rather, a whole swathe of operating systems that conform to a similar set of ideas and ideals. Linux is a Unix operating system (or at least Unix-like), BSD is another, and there are many realtime OSes which are Unixen or Unix-like

rugged sentinel
#

Unix (; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and others.Initially intended for use inside the Bell System, AT&T licensed Unix to outside parties in the lat...

main olive
#

i use endeavourOS btw

vague ginkgo
#

Got any shell experts here? Is there a more concise way, that doesn't use the temp variable to do this sort of variable expansion?

export foo1=2
export num=1

echo $(tmp=foo$num; echo ${!tmp})

It does what I want but I'm trying to use this in qsub command being submitted through drmaa python interface

summer trail
fickle granite
#

can you explain in simple English what it does? 😕

#

[also, if at all possible, do that computation in Python, not shell]

fallow tusk
#

You can have arrays in bash...

vague ginkgo
#

Cannot export arrays or associated arrays and this needs to be evaluated by the shell before it's passed to qsub to be ran on a SGE cluster

fallow tusk
#

The bane of all programmers - incomplete or unclear or just downright misleading requirements.

summer trail
#

maybe you're looking for ```bash
export foo1=2
export num=1

declare -n the_foo="foo$num"
echo "${the_foo}"

modern fog
#

hello, im using ubuntu wsl and i am tryna uninstall python3.10.6 and install python 3.9 instead, how do i do this?

summer trail
modern fog
fickle granite
#

huh, I have that binary

❯ whence add-apt-repository
/usr/bin/add-apt-repository
❯ apt-file search add-apt-repository
software-properties-common: /usr/bin/add-apt-repository
#

this is Ubuntu 22.04 "Jammy"

modern fog
#

i dont have apt-file either

#

lmao

fickle granite
#

well, "apt-file" itself is not installed by default. But "software-properties-common" sure sounds like it ought to be installed by default

modern fog
#

i installed it

#

i think it should work now

fickle granite
#

huh, good

vague ginkgo
#

So associative arrays and arrays are out of the picture

#

I'm gonna be making a full blown stack overflow post with more info because I cannot access discord at work

summer trail
#

well, does the declare -n option I suggested work?

modern fog
#

i have a feeling my ubuntu corrupted cause now apt-get install isnt working

#

its giving some lock error

summer trail
#

what error?

summer trail
modern fog
#

Pythonx.y -m pip install

summer trail
#

did you install the pythonX.Y-pip package via apt-get?

modern fog
#

I tried using the cmd on the website for deadsnake

#

The curl one

modern fog
summer trail
#

ok, so try doing sudo apt install pythonX.Y-pip and see if that helps anything

vague ginkgo
# summer trail well, does the `declare -n` option I suggested work?

I've seen that as a solution but I think I have a bigger issue and this is a red harring. https://unix.stackexchange.com/questions/747692/shell-variable-expansion-in-qsub-command-through-drmaa

vague ginkgo
summer trail
#

you switched from bash to zsh?

vague ginkgo
#

Yes, but the shell scripts are functionality equivalent

#

My shell at work is zsh, home is bash

summer trail
#

I have a guess that this might result in files being created named $foo1.o and $foo1.e - and if so, that would strongly suggest to me that the $SGE_TASK_ID isn't being expanded by the shell at all, but by something else

#

I've never used (or even heard of) SGE before, but my educated guess is that it's expanding the $SGE_TASK_ID in the output filename itself, and then using the rest as a literal string, without the shell having any ability to further expand it

#

https://docs.oracle.com/cd/E19957-01/820-0699/i999036/index.html says:

To build custom but unique redirection file paths, use dummy environment variables together with the qsub -e and -o options. A list of these variables follows.

HOME – Home directory on execution machine
USER – User ID of job owner
JOB_ID – Current job ID
JOB_NAME – Current job name; see the -N option
HOSTNAME – Name of the execution host
TASK_ID – Array job task index number

The use of the word "dummy" there strongly suggests to me that you can't use arbitrary variables, and instead only these fake variables can be used - and if they're "dummy", the shell wouldn't be able to expand them, so SGE must do so itself

vague ginkgo
#

Ah

vague ginkgo
summer trail
#

well, it's just an educated guess at this point - but it's the only way I can think of that you could have wound up with $(tmp=SUFFIX_TASK_ID1; echo ${(P)tmp}).e as a file name - I can't think of any way that the shell could have expanded one of the $ and not the other 2.

vague ginkgo
#

I don't recall what SHELL was but I recorded SGE_O_SHELL in the SE post. Maybe it's executing it as a different shell...I can only hope

#

I'm not specifying the -S option

dapper gust
#

I am looking to automate the creation of ubunutu machine images using Packer, however while executing commands like "sudo apt-get upgrade" I'm both asked to enter Y/n and to restart services. Are these things going to interfere with the commands sent in Packer? If so, how could I set the default behavior/bypass them?

ember quiver
wise forge
wise forge
dapper gust
#

Just something I noticed while trying a dry run manually executing everything myself. I also tried the export command and it didn't seem to actually do anything

wise forge
dapper gust
#

I'll give that a shot, thanks!

crystal venture
#

That's what my bash prompt gets set to

main olive
crystal venture
#

Nice!! That's real simple, I like it

main olive
#

ty

crystal venture
#

I do mine with two colours because it looks cyute

fickle granite
#

I use zsh fanciness

crystal venture
fickle granite
#

Fency Shmency

fallow tusk
#

So....is fencepost your alter ego? The thing that causes offby1?

fickle granite
#

It's my "someone already got the name offby1" ego

#

bastard

naive oasis
#

How would I go about deactivating my venv from a new shell?
I am running my code on an Ubuntu VPS and when I deploy to my github I have the server automatically update.
This is the command I am currently using to start my code in a venv and also not require the terminal to stay open at all times.
source discord_bot/bin/activate && nohup python bot/main.py & echo $! > bot.pid

This is how I am stopping the bot before I update it
kill -2 bot.pid This will leave the venv still running though.

fickle granite
#

it will?

naive oasis
#

Nevermind. I am like 85% sure this did not work before now it almost does. It is storing the pid of the venv and not the python code

#

is it okay to kill the venv? I know kill -2 allows for a clean way to kill python with KeyboardInterupt

fickle granite
#

do you mean "is it okay to kill the shell"?

#

I think that's what you're currently doing anyway

naive oasis
#

Still storing the wrong pid though.

414010 pts/0    00:00:00 bash
 420290 pts/0    00:00:00 bash
 420291 pts/0    00:00:00 python
 420304 pts/0    00:00:00 ps

bot.pid: 420290

#

When I kill the python the second bash dies with it.

wise forge
#

that is vanilla linux solution

#

if u want to be especially cool and modern, use docker to run your services
docker run --name my_service -d image_name, that will be enough to launch it in background
docker stop my_service to stop, and docker rm my_service to erase

naive oasis
wise forge
#

source discord_bot/bin/activate && nohup python bot/main.py & echo $! > bot.pid
also u can run it as
/path_to_python/bin/python bot/main.py
that will make not required venv activations despite using venv

wise forge
#

+having frozen its python dependencies in addition (kind of alternative to lack of compiling)

#

ability to build and test once, and deploying already confident being valid application

prime magnet
#

easier env spin up for local dev and reduce "but works on my machine" cases

naive oasis
wise forge
#

.service is automatically ommited from name

naive oasis
wise forge
#

also could u remove --user from your command

naive oasis
#

I put it in ~/.config/systemd/user/ as per the tutorial you sent

naive oasis
wise forge
#

when u will grasp how to use it with root

#

feel free to modify to work without

naive oasis
#

Failed to start surveywolfbot.service: Unit surveywolfbot.service not found.

wise forge
naive oasis
#

Not found

wise forge
#

make file with configs available at /etc/systemd/system/surveywolfbot.service

naive oasis
#

now it does not give any errors but it does not appear to be running

wise forge
digital cairn
#

Xcode updates for Apple M1 broke my Django projects.  (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')) I have arm64 installed. “ arch command returns ‘arm64’  on the terminal ”. How can I re-build my projects using ‘arm64’?

naive oasis
naive oasis
#

Also it does not seem to be running in my venv with this command
/home/statwolfbot/discord_bot/bin/python3.10 /home/statwolfbot/bot/main.py
It is not properly accessing the environment variables.

wise forge
naive oasis
#

Is there somthing similar I have to do to set up the DNS server? I cannot connect to outside websites
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host discord.com:443 ssl:default [Temporary failure in name resolution]

rotund girder
#

Wow, do we have this channel? 😮 hello!

woeful flint
#

where do i download the apt-pkg for python 3.9

rotund girder
woeful flint
#

shows version 3.10

rotund girder
#

What about apt show python3.9?

woeful flint
#

where do i download the apt-pkg for python 3.9

rotund girder
#

Wow, do we have this channel? 😮 hello!

#

great, apt install python3.9, you might need sudo

woeful flint
#

i did but still get ModuleNotFoundError: No module named 'apt_pkg'

rotund girder
#

oh, I misunderstood your question

#

you want to interact with apt in your python code?

woeful flint
#

i wanted to download heroku and got this error

#

i wanted to download heroku and got this error

#

tried installing apt-pkg specifically but got this

wise forge
naive oasis
#

The thing is ping -c 4 discord.com works just fine

#
[Unit]
Description=Survey Wolf Bot
After=network-online.target

[Service]
ExecStart=/home/statwolfbot/discord_bot/bin/python3.10 /home/statwolfbot/bot/main.py
Restart=no
Environment=bot_token=
Environment=db_name=
Environment=db_user=
Environment=db_host=
Environment=db_password=

[Install]

This is my updated file (with passwords removed)

wise forge
naive oasis
#

curl not found :/

rotund girder
woeful flint
#

yeah

#

is there any other way to externally download the apt-pkg of python3.9

naive oasis
wise forge
rotund girder
#

@woeful flint What are you running when you get ModuleNotFoundError: No module named 'apt_pkg' ?

naive oasis
wise forge
wise forge
#

You can specify the directives User= and Group= in the [Service] section of the unit file.

rotund girder
wise forge
#
User=deepak
Group=admin

just a matter of adding to [Service] section, few lines

#

You can specify the directives User= and Group= in the [Service] section of the unit file.

rotund girder
#

so what command was that, brew install heroku?

woeful flint
#

no its curl https://cli-assets.heroku.com/install-ubuntu.sh | sh since i'm on ubuntu

rotund girder
#

oh right, the guide only showed mac and windows

rotund girder
#

why would it be running python o.O

#

oh right, the guide only showed mac and windows

#

oh right, the guide only showed mac and windows

finite crater
#

I miss when heroku had free tier 😢

rotund girder
#

it's some cloud thingy?

#

Is it Japanese or just trying to play the part?

fickle granite
#

the latter iirc 🙂

#

yes, it's a cloud thingy -- someone once described it as "like AWS, but comprehensible"

light haven
naive oasis
rotund girder
#

Anyone noticed that git diff hunk headers for python are kinda broken? Even when turning on the builtin python diff - that one is just bad in different ways 😢

wise forge
#

bug reports without evidence are useless

#

and preferably with version of OS, software and etc and steps to reproduce it

rotund girder
#

It's just a git thing, so OS is uninteresting. Yeah I might do a writeup in the coming weeks. It's a bit annoying to collect examples. Was hoping that someone else had already done an inventory.
Perhaps anyone has gotten tips about how to effectively collect hunk header examples. My idea approach would be:

  1. Produce example python code with classes/methods/multiline strings, commit
  2. Make changes to the code git diff
    repeat 2 about 20 times
rotund girder
#

The problem I have seen is with methods inside classes, when there are also multiline strings in the mix. Perhaps decorators can cause problems too.
But a systematic inventory is probably needed to understand it 🙂

main olive
#

what distro do you recommend

ember quiver
main olive
#

i am compiling gentoo atm

fickle granite
#

"whichever distro your favorite cloud provider supports"

#

which in my case means Ubuntu and AWS Linux

humble falcon
#

Personally for servers, I like debian. I'm also exited for debian 12 in a few days, there's some nice upgrades and improvements

fickle granite
#

true; I was thinking for server use

vagrant fern
#

Late to the party.
Debian Stable for desktop and server.

main olive
#

i use endeavourOS

#

which is basically arch linux with gui installer and several other stuff

#

and im not touching ubuntu since it stinks

dense kernel
#

what is the difference between a path that starts with backslash and one that dosent in Linux?
i.e. /some_directory/file.txt vs some_directory/file.txt

spark mulch
#

The difference is that on unix, all drives are mounted somewhere on /; as if D:\ was instead at C:\drives\D\ or something like that.

dense kernel
#

oh so / is basically the root node, and you cal always create a new sub-tree under it by adding a new child, is that correct?

spark mulch
spark mulch
#

There's a bit of magic here as well: What's at / is not only the main drive, but the kernel also injects other magical directories into / that don't correspond to data on disk, e.g.:

  • /proc, containing information about running processes
  • /dev containing "device files" (those are the things you then mount to a different location
dense kernel
#

I'm not talking about mounting different devices, I'm just trying to understand how this works, cause its kind of like you are adding the path to PATH and you can access it from everywhere, but now I understand that you are placing it under the root node of all paths so it becomes an absolute path that you can access from anywhere.

#

but how do you create it? because when I do Path('/code').mkdir() it gives me an error (PermissionError: [Errno 13] Permission denied: '/code')

spark mulch
#

Since / is so important, you can only do that as root

dense kernel
#

so with sudo ig

#

ok thanks

wise forge
spark mulch
#

But... with (Path("/") / "code").mkdir() you still hardcode that it's a unix path. If you want it to be injectable, you'll have to change this line regardless. So I disagree about this being an anti-pattern.

wise forge
#

less code riples.

shrewd stratus
#

AFAIK, either way pathlib will resolve it appropriately

spark mulch
#

Especially here, where they were explicitly experimenting with a Linux system and how one adds folders to the root.

wise forge
# spark mulch YAGNI, do it when needed

YAGNI is not applied to everything. if u capture errors handling like

try:
  # code
except Exception:
  pass

it will be already not a YAGNI to do it better from a start.

south fossil
#

silent supress of Exception is not good

dense kernel
main olive
#

does someone have written python script to execute a command in the bash before?

#

if so, can u share me a code? im trying to make it so i can play my music directly from clicking a file on desktop. i partially succeeded, but its still isnt something i wanted

neat jasper
main olive
neat jasper
main olive
ember quiver
fallow tusk
#

Subprocess on linux tends to prefer the list form of a command than the string form, too.

muted fossil
#

Hi, I'm looking for help with a couple of linux libraries at #1118810078422777946 message
If anyone knows how I could get a pyudev observer to make threads to watch devices with evdev, (or if anyone can suggest a better approach) help would be appreciated.

vagrant fern
#

Morning folks, what's the clean way to run CGI scripts these days?
I have a static website and want to add a tiny bit of dynamic content to it. cgi from the stdlib deprecated and I'm on NGINX so only FastCGI is an option anyways.
Would be happy for good alternatives 🙂

vagrant fern
#

Some things I found:

  • Twisted's .rpy functionality is very similar
  • wsgiref still includes a CGI handler that could be used with fcgiwrap
keen wraith
#

fr

north briar
#

Hi all, Please refer me to a better channel if my question is better placed there. I have a program that I want to record the peak memory usage. I want to create a line plot with the peak memory. Any recommended libraries to get the peak memory. Ideally, I would be able to reset the peak memory counter during the execution of the program since I have the input sizes programmed as a for loop.

north briar
#

emacs

main olive
#

in xfce i think there is already program for that

main olive
north briar
#

please behave respectfully, I don't appreciate that

main olive
#

since when "u dummy" is smth derogatory? but well, im sorry if u didnt liked that

main olive
main olive
# north briar emacs

oh, im sorry. there is actually a de like that. i thought u were referring to text editor

main olive
#

hmm, wrong library

river raptor
#

Should i Put Swap before or after /

fickle granite
#

after

#

are you talking about the order of entries in /etc/mtab ?

south fossil
daring seal
#

Ok, so I have an odd question revolving around X11, matplotlib qt windows and ipython, I hope this is the right place. I need the x11 window class name (to set a floating window rule in bspwm), if I create a plot from a python terminal this is "matplotlib", but if I do it from ipython its a single space " " and I'm not sure how to set a bspc rule otherwise (I tried on the name, but don't think it supports wildcards "Figure*"). Any ideas?
The problem seems to be specifically with the plt.ion() option, but again, only in ipython...
This ipython -i -c "from matplotlib import pyplot as plt; plt.ion(); plt.plot(0,0)" works and so do subsequent interactive calls to plot, while
this ipython -i -c "from matplotlib import pyplot as plt; plt.ion()" with subsequent plots does not.

I guess for now, as a hack, I can start ipython -i -c "from matplotlib import pyplot as plt; plt.ion(); plt.plot(); plt.close(plt.gcf())" instead of ipython and maybe create an alias.

wispy ingot
#

I've been running sudo mount /dev/sda1 /media/t5 to mount an external drive to an Rpi. The SSD is exFAT. Writing to it from the dan user is impossible, I just get permission denied, e.g. mkdir /media/t5/foo yet prepending sudo works.
Not sure what to do to resolve this, as sudo chown -R dan:dan /media/t5 just spams Operation not permitted.

fallow tusk
fickle granite
#

I'd also try changing ownership of the mount point before mounting the file system on it

#

don't honestly know if that'd work, but it should be easy to try

fallow tusk
#

I don't think it does. I recall it being something I used to do, but I think that's for being able to mount, it doesn't affect the perms of the mounted partition

#

(One of those - got it working, now, leave well enough alone; now forgotten how I got it working - things!)

wispy ingot
#

aye -o uid=1000,gid=1000 worked, tyvm!

fallow tusk
#

You might also want/need to set exec and/or other options

tulip vortex
#

hahahahahahah

#

no Mac channels here

#

lol

#

does anybody here has access to a MacOS machine ??
I want to test something

lavish storm
#

This channel does include MacOS

#

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

tulip vortex
#

wow

#

I thought Unix only refers to linux-ish things

#

do you guys think this is a good code to determine which OS my app is being executed?

#

I don't have access to a mac device so I won't know if it's exectuing correctly

lavish storm
#
Traceback (most recent call last):
  File ".../some/dir/test.py", line 1, in <module>
    from common.names import *
ModuleNotFoundError: No module named 'common'

@tulip vortex

tulip vortex
#
import os
import sys
import time
import random
import subprocess
import traceback

put these instead of the common.name one

lavish storm
tulip vortex
#

dam

lavish storm
#

I think it's because version_info is defined only for windows

tulip vortex
#

do you know the correct way?

tulip vortex
#

funny fact:
in my language, Seaman means cement

lavish storm
#

under IS_MAC: I'd do:
version_info = platform.mac_ver()

#

but it won't show the build number

tulip vortex
#

does it show the os version?

lavish storm
#

yes

#
❯ python3 test.py
Current platform:  Darwin
macOS Version: 12.6.6
Build Number:
tulip vortex
#

it seems that there are three outputs for the mac version

#

def mac_ver(release: str = ...,
versioninfo: tuple[str, str, str] = ...,
machine: str = ...) -> tuple[str, tuple[str, str, str], str]

#

can you print them all?

lavish storm
#
In [1]: import platform

In [2]: v = platform.mac_ver()

In [3]: v
Out[3]: ('12.6.6', ('', '', ''), 'arm64'

here's my output from ipython

tulip vortex
#

MACOS_VERSION
MACOS_BUILD_NUMBER
these are the two I'm using right now

#

what is the name of the third one

lavish storm
#

architecture

tulip vortex
#

so I should say MACOS_ARCHITECTURE ?

lavish storm
#

sure

tulip vortex
#

are they in correct order?

mac_version = platform.mac_ver()

MACOS_VERSION = mac_version[0]
MACOS_BUILD_NUMBER = mac_version[1]
MACOS_ARCHITECTURE = mac_version[2]
        
print("macOS Version:", MACOS_VERSION)
print("Build Number:", MACOS_BUILD_NUMBER)
print("Architecture:", MACOS_ARCHITECTURE)
lavish storm
#

yes

#

though, as you can see above, the tuple for build number was empty

#

might be different for intel-based macs

tulip vortex
#

maybe it's the case only with your machine

#

could it be a permission issue-ish thing?

#

try running the code as sudo

lavish storm
#

No difference 😄

tulip vortex
#

dam

#

Thanks for the help!

lavish storm
#

np!

fallow tusk
#

Does the mac have an /etc/os_release file? Most of that info should be in there, and should be parsed by platform (although the interface in platform has changed over various Python versions)

fallow tusk
#

:/

#

I guess that is lsb, not usb :D

spark mulch
#

There is the sw_vers command though

covert bramble
#

I've got terminalexia. I've got a terminal in vscode, one in docker app, one in terminal app, screen terminals, python env terminals. Hard to find the right one.

sonic pendant
wise forge
#

I use default one Konsole from Kubuntu ^_^

shrewd stratus
#

tmux 👍🏼

covert bramble
#

it's hard to get away from from the integrated terminal in VScode when using Platformio

river raptor
#

How do i remove Partition 2 and move Partition 3 and make It füll size

fickle granite
main olive
#

im trying to run snekbox on my rpi, ive installed amd64 support or well i tried with this command: sudo docker run --privileged --rm tonistiigi/binfmt --install amd64 and then i installed snekbox with this command as per the docs sudo docker run -d --rm --platform linux/amd64 --ipc=none --privileged -p 8060:8060 ghcr.io/python-discord/snekbox, however, i get an error ```
2023-06-26 12:45:43,649 | 13 | snekbox.nsjail | ERROR | Couldn't launch the child process

2023-06-26 12:45:43,671 | 13 | snekbox.nsjail | INFO | nsjail return code: 255``` which leads me to believe theres some shenanigans going on. I would like to know if i should try to mess around with it more or if its just useless to try stuff out because it wont work i also tried to build it locally and run it that way but still doesnt work
i get this error: https://paste.pythondiscord.com/ovadovetet

south fossil
soft dawn
#

guys i need help with my shellscript

#

someone can help me

#

dm me

lavish storm
#

Could you provide code samples or error messages

river raptor
#

Can anyone Help with OpenBSD? I somehow overwrote my Linux Partition and only have a USB with OpenBSD, If i Plug in a USB WiFi Thing, it Shows a blue Message saying it isnt configured

#

Please mention If Response

river raptor
#

Okay nvm

#

I'll use my Sisters Laptop to Install alpine in my usb

fallow tusk
#

That was going to be my suggestion, too ;) Use another machine (or even the same machine if you have two USB ports) to write an ISO liveboot of your distro to a USB stick

empty barn
#
[root@archi system]# systemctl status http-drop
× http-drop.service - Dropbox-http
     Loaded: loaded (/etc/systemd/system/http-drop.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Tue 2023-07-04 22:28:06 CEST; 3min 17s ago
   Duration: 194ms
    Process: 3319 ExecStart=/usr/bin/python3 /home/user/code/filenet.py (code=exited, status=1/FAILURE)
   Main PID: 3319 (code=exited, status=1/FAILURE)
        CPU: 189ms

Jul 04 22:28:06 archi systemd[1]: http-drop.service: Scheduled restart job, restart counter is at 5.
Jul 04 22:28:06 archi systemd[1]: Stopped Dropbox-http.
Jul 04 22:28:06 archi systemd[1]: http-drop.service: Start request repeated too quickly.
Jul 04 22:28:06 archi systemd[1]: http-drop.service: Failed with result 'exit-code'.
Jul 04 22:28:06 archi systemd[1]: Failed to start Dropbox-http.
#

Trying to run an Tornado web server

#

this is on arch linux

slate crypt
#

check journalctl -u http-drop

#

that should show the full log of http-drop

empty barn
#
[root@archi system]# journalctl -u http-drop
Jul 04 22:28:01 archi systemd[1]: Started Dropbox-http.
Jul 04 22:28:03 archi python3[3313]: Traceback (most recent call last):
Jul 04 22:28:03 archi python3[3313]:   File "/home/user/code/filenet.py", line 61, in <module>
Jul 04 22:28:04 archi python3[3313]:     app.listen(100)
Jul 04 22:28:04 archi python3[3313]:   File "/usr/lib/python3.11/site-packages/tornado/web.py", line 2134, in listen
Jul 04 22:28:04 archi python3[3313]:     server.listen(
Jul 04 22:28:04 archi python3[3313]:   File "/usr/lib/python3.11/site-packages/tornado/tcpserver.py", line 183, in listen
Jul 04 22:28:04 archi python3[3313]:     sockets = bind_sockets(
Jul 04 22:28:04 archi python3[3313]:               ^^^^^^^^^^^^^
Jul 04 22:28:04 archi python3[3313]:   File "/usr/lib/python3.11/site-packages/tornado/netutil.py", line 162, in bind_sockets
Jul 04 22:28:04 archi python3[3313]:     sock.bind(sockaddr)
Jul 04 22:28:04 archi python3[3313]: PermissionError: [Errno 13] Permission denied
Jul 04 22:28:03 archi systemd[1]: http-drop.service: Main process exited, code=exited, status=1/FAILURE
Jul 04 22:28:03 archi systemd[1]: http-drop.service: Failed with result 'exit-code'.
#

eh

#

thanks for helping ig

#

ill try to figure out the rest on my own

#

thanks

#

it gave me a lecture

#

💀

#
Jul 04 22:42:54 archi sudo[3919]: pam_systemd_home(sudo:auth): systemd-homed is not available: Unit dbus-org.freedesktop.home1.service not found.
Jul 04 22:42:54 archi sudo[3919]: pam_unix(sudo:auth): conversation failed
Jul 04 22:42:54 archi sudo[3919]: We trust you have received the usual lecture from the local System
Jul 04 22:42:54 archi sudo[3919]: Administrator. It usually boils down to these three things:
Jul 04 22:42:54 archi sudo[3919]:     #1) Respect the privacy of others.
Jul 04 22:42:54 archi sudo[3919]:     #2) Think before you type.
Jul 04 22:42:54 archi sudo[3919]:     #3) With great power comes great responsibility.
Jul 04 22:42:54 archi sudo[3919]: For security reasons, the password you type will not be visible.
Jul 04 22:42:54 archi sudo[3919]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Jul 04 22:42:54 archi sudo[3919]: pam_unix(sudo:auth): auth could not identify password for [user]

#

i dont have recieved lecture from system admin

slate crypt
#

you are the system admin

empty barn
#

yeah

#

eh

#

any ideas on

#

eh

slate crypt
#

Is that binding to port 80 or something?

empty barn
#

100

slate crypt
#

use a higher port

empty barn
#

but i have been using

#

85 86 87 89 90 100 45

#

without issue

#

except 100 one

slate crypt
#

did you change the config to allow users to bind lower ports?

empty barn
#

how

slate crypt
#

users can bind to ports 1024-65535

#

only root can bind to 1-1023

#

and technically 49152-65523 is or dynamic port assignment.

#

8080 is a common port to use

empty barn
#

eh

#

that would need to

#

can i do it in systemctl?

slate crypt
empty barn
#

oh

#

uh

#

it fix

#

thank u

valid stream
#

arch btw

lavish storm
#

I see, thank you

main olive
#

I think I'm going to use Redhat as my main OS, and use windows for a little gaming on a vm

#

I tried ubuntu for a little bit (a few projects) and I've been really liking it

humble falcon
main olive
main olive
main olive
#

🙏

main olive
main olive
#

apt install blender

main olive
valid ibex
#

preventing any think to be done

#

i am on ssh server, what to do?

fallow tusk
#

Defunct processes should (iirc) eventually time out.

#

I've not had much luck in getting them cleaned up beyond waiting or rebooting, unfortunately. However, if they're defunct, they won't be using up processor time

#

If they're owned by you, you may be able to just log out from all seats and get them cleaned up that way (I believe…I could be wrong!)

valid ibex
#

it hangs on doing python ... or nvidia-smi etc

spark mulch
#

I know about synchronize-panes, but is there also a way to synchronize tmux sessions? Currently I'm using a weird setup with nested sessions :/

summer trail
#

you can't even submit bug reports without a subscription, AFAIK

main olive
summer trail
#

that's definitely way more targeted at personal use than Redhat Enterprise Linux is.

main olive
#

RH is in it for the money

summer trail
#

well, yeah - selling support is literally their business model

main olive
#

But I believe at enterprises, they have a large Linux server, and everyone just SSH’s into it

#

I have an uncle who’s an IT Director for a hedge fund and he told me this is how they operate

summer trail
main olive
#

Mint looks good, 3 weeks until I build the pc 👍

reef token
#

Although yeah we are looking to migrate to individual VMs at some point

main olive
languid vortex
#

Im a student and am learning programming.
I wonder would u install an Ubuntu dual boot system for getting used to linux/learning linux commands?

warped nimbus
languid vortex
wise forge
#

And switching to Linux as primary OS 😊

#

That is how I started to be more and more familiar with it every month for last years

languid vortex
#

as I cant find many softwares on ubuntu

wise forge
# languid vortex didnt u feel any inconvenience?

The only inconvenience I feel after some time... I fell in love so hard with how developer friendly environment in it, that I can't force myself opening windows back more than for very tiny amount of time

wise forge
languid vortex
wise forge
languid vortex
#

thank you!

#

do you have plans to uninstall windows someday?

#

I dont like dual boot personally tbh

wise forge
languid vortex
#

I see, thanks

wise forge
#

It is nightmare how badly 😔 this legacy project setup. Not automatable at current state to build and unit test.

#

All my projects at Linux usually do it all on their own in CI tools, since they all run Linux too

languid vortex
wise forge
#

Windows at one SSD without awareness Linux exists (plugged out Linux drive during installation)

#

Linux at another, with grub and discovered both oses
Linux drive is main to boot

#

Makes simple to reinstall stuff to me

#

In case I delete windows, repairing grub is easy to remove no longer present windows

#

Doing same in windows would be unreliably hard to me ^_^

languid vortex
#

thank you, I see

#

this seems to be a pretty good way

ember quiver
# languid vortex it's mainly the interface which is called GRUB2 I think I had problems with that

Yeah, dual boot is hell for so many reasons and getting Windows to behave with GRUB2 is one of them. I have a dedicated Linux box and I use XRDP to connect to it from my various Windows devices. You quickly forget you're on Windows with no need to worry about certain hassles of Linux (like the wifi drivers that always seem to break). If you ever do need Windows, just close RDP and no need to reboot.

I also use WSL on my company laptop and it's pretty great too

languid vortex
#

another reason is most laptop I bought only has one SSD I think

main olive
fallow tusk
#

Nvidia drivers sometimes get "blips" in their update cycle. It doesn't seem to have happened much recently, but it has in the past. Usually, though, it's just a matter of waiting a day for someone to fix the repository

south fossil
runic goblet
#

any tmux user in the house?
is there a way to move only the cursor to the top of the page without moving the page content itself in copy mode? (this is H in vim in case it's not clear)
the closest i can find is ctrl+b in copy mode (i have vi mode on if that matters at all) but that changes the content of the page which is disorienting to me

spark mulch
#

The corresponding command is called top-line, you might want to bind that to something more reachable. At least for me the whole meta key stuff never works consistently.

runic goblet
#

interesting, looks like it's an issue with my config then.

Command                                      vi              emacs
top-line                                     H               M-R

implies H should have worked for me

#

thanks!

spark mulch
#

Oh, that's why it didn't work for me :D

river raptor
#

When i started with Linux i Just overwrote the Disk with Windows

#

Entirely

river raptor
#

@ivory moat lets talk here

ivory moat
#

Have you tried ubuntu previously?

#

I'm trying to look for a comparative experience to decide

river raptor
#

then switched to arch and now i use opensuse

ivory moat
#

but does opensuse have better support for proprietary softwares?

#

like ubuntu

river raptor
south fossil
river raptor
#

why?

#

i don't want to risk breaking my installation just by not doing pacman -Syu every day

#

and i dont really like the AUR, too much malware

spiral yoke
#

hi o/

#

i've made a package manager in python

#

currently, i'm working on 0.1.0 fractal

ivory moat
kindred tartan
#

yo uh

#

getting this issue

#

any way to downgrade the driver so it supports chromium v113?

#

running raspbian on Raspberry pi 4b with box86 emulation for linux64-based packages

#

which in my instance is chromium webdriver

#

Doing this in python btw*

upper notch
#

yeah there is

#

@kindred tartan just download the correctly driver

#

In your code or application just specify this executable. Alternatively export it to PATH 🙂

kindred tartan
#

I found the fix

#

yeah i downgraded the driver

upper notch
#

Oh cool

kindred tartan
#

all good

#

many thanks

upper notch
#

sweet

kindred tartan
#

just had an issue doing it through the manager

#

instead did it manually

upper notch
#

Ah, makes sense

#

what distro?

#

Debian, Arch, Gentoo?

kindred tartan
#

oh uh

#

Raspbian

#

apparently it had some form of x86 emulation

#

but it didn't so i had to install box86

#

worked like a charm

#

I needed it for some python scripts i had

#

@upper notch

upper notch
#

I see

patent mural
#

Why is pip not installing anything... im using arch btw

shrewd stratus
patent mural
#

Im really sorry for not giving the error message to begin with

$ python3 -m pip install -U discord
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
    python-xyz', where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Arch-packaged Python package,
    create a virtual environment using 'python -m venv path/to/venv'.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.
    
    If you wish to install a non-Arch packaged Python application,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. Make sure you have python-pipx
    installed via pacman.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
shrewd stratus
#

as mentioned in the error output, you should use a virtual environment

patent mural
#

What if i want something for system config

shrewd stratus
#

do you have an example?

patent mural
#

Like for a window manager named Qtile

#

It need some optional dependencies

#

I dont remember the specifics

shrewd stratus
#

you would install qtile using pacman

patent mural
#

Is there any fix to this pip issue tho?

#

Like why is it happening all of a sudden

shrewd stratus
#

because a lot of Linux distros make use of Python for their core functionality

patent mural
#

Ic

vernal kayak
#

anyone here use docker-compose on linux and have experience with setting up a MYSQL DB through it?
Mine keeps wiping the DB and creating a new file structure once I use docker-compose down

#
mysql:
    container_name: **
    environment:
      - MYSQL_ROOT_PASSWORD=**
      - MYSQL_DATABASE=**
      - MYSQL_USER=**
      - MYSQL_PASSWORD=**
    command: 
      --character-set-server=utf8
    volumes:
      - my_volume:/var/lib/mysql  # path in the container where MySQL stores its data
    ports: 
      - 3306:3306
    image: "docker.io/mysql:latest"
    restart: always
    networks:
      - mynetwork
volumes:
  my_volume:
networks:
  mynetwork:

Example structure of my file

wise forge
vernal kayak
shrewd stratus
vernal kayak
shrewd stratus
#

no, just checking, because with --volumes the volumes get deleted as well.

vernal kayak
#

I'm just a bit worried about the stability of things, i'm importing a lot of backdated API data etc now and don't want my data team to randomly message me saying "where did all the data go" one day 😅

#

I've been thinking about using AWS or Google Cloud Platform to host a DB and to just update it remotely instead

#

definitely open to any recommendations

wise forge
#

using stuff like AWS RDS MySQL (or usually better postgresql) for example

#

it allows to go fully immutable regrading deployments

#

deploying straight containers into AWS elastic beanstalk / or AWS ECS or AWS EKS and etc

#

or just wiping servers without care and deploying from zero each time (some people deploy as immutable built AMI images)

#

allows managed RDS db, easy to update in terms of engine and any params

#

easy to backup

#

easy to replicate

#

everything easy

vagrant fern
#

yeah, except your bill.

#

or, you know, the fact that cloud providers (azure at least) actively recommend you add retries to every single one of your queries, because "due to the cloud, sometimes requests fail". super easy

#

just add a retry to each of your queries.

vernal kayak
#

I work for a big e-commerce agency so the bill is fine

#

As long as I can justify it

#

I don’t like the sound of retries though

#

Amazon is a pain in the ass when it comes to large amounts of data as it is

#

I suppose I could store it in my DB on the server I’m renting, then retry to there

#

Then have a daily push to AWS

vagrant fern
#

the retry pain bit me badly in my previous place. I ended up quitting

#

The problem is that devs don't expect their world of databases and caches to suddenly vaporize themselves

vernal kayak
#

I understand it all too well

#

I woke up one day right before a meeting with my commercial director and data team to find my database just vanished

#

That’s what I want to avoid moving forward

#

I want to be able to change everything, constantly

#

But for the DB to remain there

#

Like a roman toilet

fickle granite
#

🤔

fickle granite
#

unless you don't want it to actually be reliable.

wise forge
vernal kayak
#

Even when it comes to calls with one variable, I just trust that it does every one of them correctly

#

Need to find a better way to checking that everything is done and repeating x amount of times until everything is done

fickle granite
vernal kayak
#

anyone know why I would be getting the following when using docker, i'm trying to not use root and create a user with specific perms:

flask-celery-worker-1       | PermissionError: [Errno 13] Permission denied: '/usr/src/app/project/logs/celery.log'

the command in docker-compose file:

celery --app project.server.tasks.celery worker --uid=celeryworker --loglevel=info --logfile=project/logs/celery.log

my DockerFile:

WORKDIR /usr/src/app
RUN adduser --disabled-password --gecos '' celeryworker
RUN mkdir -p /project/logs/
RUN chown celeryworker:celeryworker /project/logs/
south fossil
#

/project/logs/ and project/logs/ are different directories

vernal kayak
#

thank you

#

0 errors and im no longer using root ⭐

formal schooner
#

i greatly dislike that docker volumes don't allow you to mount relative to WORKDIR

#

it's one of the only places where you must use absolue paths

wise forge
formal schooner
#

the left hand side needing to be an absolute path is a separate annoyance

wise forge
fallen jasper
#

How do I get the gid (group id) of a group given it's name? For example, on a university computer I have three groups 'student', 'faculty', 'staff' and want the gid for each of them. One option is to import grp and use grp.getgrname('staff').gr_gid, but the getgrname call also tries to populate the gr_mem field of the struct and if i use it with 'student', it tries to pull the name of all students which takes quite a long time

fickle granite
#

oops! didn't read closely enough

#

damn, looks like there's no portable way. I'd just parse the damned file by hand 😐

#
def get_gid(name: str) -> str:
    with open("/etc/group") as inf:
        for line in inf:
            fields = line.split(":", maxsplit=3)
            if fields[0] != name:
                continue
            if len(fields) >= 3:
                return fields[2]


get_gid("certusers")
``` wfm
#

if your group database is remote, like on a Windows server or something, this won't work 😕

fallen jasper
#

hmm. thanks, then! looks like i'll have to stick with the slow solution

minor cypress
#

I want install python on Windos and Linux with Commands

fickle granite
prime magnet
#

I think MSI packages can be automated on Windows

minor cypress
fickle granite
#

...

spark mulch
shy yokeBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

wise forge
# minor cypress Because I want to write malware and I don't know how to install python on my vic...

It ends badly.

Discord hackers are the most powerful beings to exist, even greater than mods. Full power, complete control, nothing gets in their way.

Twitter ➤ https://twitter.com/beluga1000
Join My Discord ➤ https://discord.gg/CETznntGeQ

╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝

#Discord

▶ Play video
minor cypress
opaque ginkgo
#

and how can we prove that that's the case

south fossil
#

script kiddie

tiny terrace
#

U sound middle school ngl

spiral yoke
#

as i mentioned a week to two ago, fpkg is my project and it's developed into quite something

#

(it does somewhat break pep8, with the line limits and stuff)

#

but the code in of itself is pretty much functional

shy yokeBOT
#

6. Do not post unapproved advertising.

normal dagger
#

what files does the scanner generate exactly?(wayland)

spiral yoke
river raptor
normal dagger
languid vortex
#

What (graphical) text editors do you use on linux? I like notepad++ on Windows.
Im currently using notepadqq on Ubuntu

languid vortex
#

thank you
oh I think I mean a pure text editor
I use VS Code for codes and syntax highlight

wise forge
#

Simple, yet with syntax highlight for all langs

#

Default in KDE plasma GUI (like Kubuntu)

#

Not an ide at all

languid vortex
flint rover
#

This is a dumb question, but does linux/*nix actually stop you from removing a file which is being used by another program lemon_thinking

wise forge
#

database for example often created by user postgres

#

so only postgres user or root can change it

flint rover
#

fuckkkkkkkkkkkkkkkkkkk

#

Ngl was really hoping it didn't do that.

#

why should it? pithink no.
Something something, no one likes a sigbus

spark mulch
#

(And before it is closed you can also undelete the file by finding it in /proc/pid_of_process_a/fd)

#

(On macOS there's no /proc, but I believe the same can be achieved through other means)

#

In a sense, unix files work a lot like Python's names. rm a_file does something similar to del a_variable — the GC will only delete the variable if there's no references left, and same on the file system (with hard links and file descriptors both being counted as references)

frigid barn
#

shouldnt it be preinstalled sometimes? (sorry for screenshot and breaking conversation)

spark mulch
frigid barn
#

(didnt even changed home menu logo xD)

river raptor
frigid barn
#

network problems 🙂

lusty dust
silk herald
silk herald
#

i might try leap as sles might be good for my software

main olive
#

NICE

vapid notch
#

hi

#

ok to ask about access rights here of linux or must i create a help channel. its more about development of a linux-like FS rather than the actual OS

glad fiber
#

program without icon: https://paste.pythondiscord.com/WOFQ

python, tkinter

I am trying to make a simple App with tkinter and I am having a problem with looping, I have two buttons in my simple app.. and I want it to work when another loop is working in a background...

when I press "start" Button, It runs a function "main_prog" with loop, so until the the loop is not complete the window says "not responding" and I can see it printing in the terminal so it's working in background... and this is a problem because I want it to respond and when I press "Stop"
I want it to take that response and stop...

for this to happen I also tried using "threading" module but it felt really slow and unresponsive most of the time it was not responding. also it was starting the function before I wanted it to... so I think threading is not a viable option..

Do you have any idea that I might be able to fix it?

thank you

fallow tusk
normal dagger
#

how can I do mouse interactions on Wayland similar to Xlib?

sterile eagle
#

realized I probably needed to take this question here.
dumb question because I can't find a good answer. Is it possible to have anaconda installed just in a venv? I've checked the PKG-INFO and it states that I can't install with just pip, but not sure how to keep it just in the venv, since I'd have to use yay to install it from the aur?
trying to get jupyter notebooks to work with vs code having issues with kernel because I need anaconda (to my understanding anyway)

west musk
#

one of my drives just stopped mounting in linux

#
$MFTMirr does not match $MFT (record 3).
Failed to mount '/dev/nvme1n1p2': Input/output error
NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
made to NTFS by this software.

Failed to open '/dev/nvme1n1p2'.

$MFTMirr does not match $MFT (record 3).
Failed to mount '/dev/nvme1n1p2': Input/output error
NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
made to NTFS by this software.

Unable to read the contents of this file system!
Because of this some operations may be unavailable.
The cause might be a missing software package.
The following list of software packages is required for ntfs file system support:  ntfs-3g / ntfsprogs.
#

or rather, one partition, the partition after that mounts just fine, has some small error about the name but i guess thats related to this

#

do i need to install windows to fix this or what?

#

really hope its not dying or anything, quite new ssd, but i think its mounted under my gpu...

#

ah ntfsfix seemed to have solved it

#

time to migrate to a different filesystem i guess

fickle granite
#

I certainly wouldn't use NTFS unless I was sharing the partition with Windows

#

the Linux driver code is almost certainly incomplete and buggy

river raptor
#

how to check which window manager i am running (both wayland and X)? should i check for all processes to check for the window manager?

#

in python

light haven
#

check for the WAYLAND_DISPLAY environment variable

#

if it exists you are on Wayland, if not fall back to checking if it's X or a tty

river raptor
#

Not either wayland or X or tty

#

I wanna Know which WM i am using on both wayland and X

light haven
#

right

#

I think you can check who's using the display with lsof but if it requires root I think you just need to basically list all processes and have a hardcoded list of the options

river raptor
#

Alright

#

And then Check to which Display it belongs to to Check for the current display

frigid barn
cunning nexus
#

sudo apt install tktinter should be sufficent

river raptor
#

olkay thanks

rustic crater
#

hello

#

Is unix has only terminal in ?

fickle granite
#

try asking again, I didn't understand that

south fossil
#

So in modern world UNIX is just a specification / standard. However, we have lots of unix-like OS'es, and they definitely include not only terminal

wise forge
#

it is always an option to install missing GUI if desired though and connect over RDP

#

there is just no point in it

#

it is enough doing actionvs over ssh

#

or even if desired u could connect IDE over ssh/sftp and etc

#

there is even Linux GUI with RDP offered to be run as container somewhere 😅

#

that makes pressence of GUI temporal at server if necessary

#

but there is no point in it

#

the most used option is usually just SSH tunneling through server, in order to access local/private network resources via your dev machine
(Sometimes people set VPN as an option too)
that makes forwarded resources accability to local dev machine

#

there are always an option to use programmatic tools to configure server, like Docker/Ansible and etc

#

people are too used to linux terminal of doing things over console, and not really needing GUI at servers. which would be just consuming extra resources for nothing

fallow tusk
#

That's a lot of words to answer a questioo that has yet to be clarified…

south fossil
#

yeeeeee

mint sage
#

To summarize, Unix is not an OS, and it doesn't only carry out only a terminal either.

tribal finch
#

AIX, Solaris, HP-UX, they are all still in existence and updated, and are proper Unix Operating Systems rather than just "Unix-like"

#

but they are primarily used in large (and usually old!) enterprises, and not very much in smaller business, clouds, consumer environments, etc.

#

AIX is based on UNIX System V with 4.3BSD-compatible extensions. It is certified to the UNIX 03 and UNIX V7 marks of the Single UNIX Specification, beginning with AIX versions 5.3 and 7.2 TL5 respectively
...
Latest release: 7.3 TL1 / December 2, 2022; 7 months ago
https://en.wikipedia.org/wiki/IBM_AIX

#

HP-UX (from "Hewlett Packard Unix") is Hewlett Packard Enterprise's proprietary implementation of the Unix operating system, based on Unix System V
...
Latest release: HP-UX 11i v3 2023[1] / May 2023; 2 months ago
https://en.wikipedia.org/wiki/HP-UX

west musk
#

anyone here familiar with grub the bootloader? guy in ot0 needs some help, maybe grub can help

frigid barn
#

i have problems with installing requires for some script.
my OS is solydx 10 (debian). python yet 3.7
here error log:

      x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.7/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
       #include <ffi.h>
                ^~~~~~~
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
      ----------------------------------------
  Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kw4hzj5w/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-25eidkg7/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-71uy8s1h --compile" failed with error code 1 in /tmp/pip-install-kw4hzj5w/cffi/
  
  ----------------------------------------
Command "/usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-71uy8s1h --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=61.0.0 wheel "cffi>=1.12; platform_python_implementation != 'PyPy'" setuptools-rust>=0.11.4" failed with error code 1 in None
#

command: pip3 install impacket==0.9.23

frigid barn
#

k

fickle granite
lean blaze
#

What's a lightweight linux distro with a graphical environment which runs python well (&tkinter)?

ember quiver
#

If you want extremely light, maybe Alpine (it does include tkinter in it's main repo apparently). If you just mean something that doesn't need 8gb of ram to be useable, I'd try any normal distro with a lighter window manager (Lubuntu or Xububtu for example)

main olive
formal schooner
#

yeah the distro usually matters less than choosing the right desktop

#

debian with xfce is an old staple

#

lately i've been enjoying endeavour, it's very nicely set up. i believe xfce is one of its default options

sleek swan
#

I'm trying to output a string like this echo "string" > file.txt but when I cat the string it's not the same as what I put inbetween the quotes. Why is this?

formal schooner
sleek swan
#

This was the string "$y$j9T$dDRO50LNqijRmgC4eO4TA/$MbRSqDrgELP1JjxbW/BslB4Qtumg.nipkMsGg3ffhM4"

formal schooner
#
echo '$y$j9T$dDRO50LNqijRmgC4eO4TA/$MbRSqDrgELP1JjxbW/BslB4Qtumg.nipkMsGg3ffhM4' > file.txt
cat file.txt
#

i also hope you didn't just share an actual API key or something

sleek swan
#

nah just a hash of the word test lmao

formal schooner
sleek swan
formal schooner
#

double quotes mostly protect against whitespace being interpreted as an argument separator

#

single quotes stops all expansion, including parameter expansion and escape sequences

sleek swan
#

aha! thank you so much!

south fossil
fickle granite
#

mmm corned beef hash

hexed rose
#

Anyone here understand swap partitions on Linux? I was wondering if I even needed it and wanted to free up the space and use for other partitions.

fickle granite
#

you probably don't need it

#

you only need it if there's a real risk that you'll run out of RAM, and if you're willing to accept a 1000x slowdown to prevent that

#

(ok, ok, maybe it's only 100x)

hexed rose
fickle granite
#

you have a swapfile, but it's not being used.

#

unless you're low on disk space, don't worry about it.

main olive
#

parts are arriving in 3 days, still debating on mint or ubuntu

#

my only issue with ubuntu is the desktop and i can change that

#

idk about mint though

hexed rose
fickle granite
#

looks like it's 2GB, not 20GB

#

I mean, sure, get rid of it if you want.

#

I think you need to run sudo swapoff /swapfile or something, then sudo rm /swapfile

#

now, "using it for other partitions" might be tricky.

ember quiver
# main olive my only issue with ubuntu is the desktop and i can change that

You can use Ubuntu with pretty much any desktop environment you want. There are official spin offs like Kubuntu, or you can install the server version which comes with no desktop and add whatever you want. Then there are unofficial spinoffs like Regolith (which is Ubuntu with i3 window manager and no real desktop).

If you're a Windows user and just want something intuitive and easy by default Linux Mint is a good bet

formal schooner
formal schooner
formal schooner
main olive
formal schooner
#

endeavour kde has also been excellent but i don't recommend rolling release to someone who isn't prepared to deal with rolling release

main olive
#

I have some experience with ubuntu

west musk
#

is drag an drop worse on linux in general? or is it just kde/plasma?

#

i was an avid drag and dropper on windows, but theres a lot more friction on linux

#

could just be that im not used to it ofc

fickle granite
#

I personally gave up on Linux guis ages ago.

west musk
#

ijust tried to drop a file into vscode, and every time i mouse over vscode in the taskbar it darted away to the other side of the task bar

#

actually all non-terminal items on the taskbar does that, how strange

#

gotta investigate if its a stupid feature or a bug to report

ember quiver
west musk
#

i probably just use it 100 times more than the average person

#

dont really use my left click normally when browsing, most links i open i just drag and drop into the tab bar

hexed rose
fickle granite
#

oh, well those are entirely separate

#

they solve the same problem, but they're otherwise unrelated

hexed rose
#

I am asking about the orange one.

fickle granite
#

sure

#

same answer: if you're not worried about running out of RAM, then sure, use it for something else

hexed rose
fickle granite
#

yes, I understand that

#

the swap file and the swap partition solve the same problem. If you don't have that particular problem (running out of RAM) then you don't need either.

hexed rose
fickle granite
#

it might; I haven't repartitioned in so many years that I assume the technology is now different

fallow tusk
#

If you're moving the system partition, yes, you'll need a live system to do that from.

#

Installs will often automatically give you a swap partition, unless you actively ask them not to

#

Although I'm surprised that you got both a swap partition and a swapfile from an installer (I'm assuming that's where they both came from)

#

I'm also a tad surprised it bothered with an extended partition for the ext4 (system?) partition. You only have three partitions. You don't need one in an extended partition.

#

(Not that I know of any downsides to that, beyond having the extra partition entry)

hexed rose
fallow tusk
#

Well, it didn't ignore that. You got both

#

Oh - memory, not drive space?

hexed rose
#

drive

hexed rose
fallow tusk
#

An extended partition allowed you to have more than four partitions on a drive (I don't think that's a limitation now, either)

hexed rose
#

Well! I'll have to find a way to safely backup the linux partition first and then try to GParted resizing thing.

fallow tusk
#

Do you have 100 Gigs of storage somewhere else?

#

The easiest is to use dd to create a raw image of the partition

hexed rose
west musk
#

is it a hdd?

hexed rose
west musk
#

resizing isnt an issue on ssds is it?

hexed rose
west musk
#

im not 100%

fallow tusk
#

If it's running the current system? I think it still is

west musk
#

but theres just no way it would take forever like an hdd

#

even if data had to be moved, its so much faster

hexed rose
west musk
#

it probably doesnt have to be moved either

#

yeah i mean its shuffling data around for wear levelling anyways

hexed rose
west musk
#

depends on what type of image

#

but not necessarily

fallow tusk
#

If you found you needed the backup, it's either that your partition is borked, in which case you just write the data to a new 100G partition and start over. Or it's that you need some of the data, in which case you mount the image and grab what you need

hexed rose
#

I hope resizing the linux partition isn't going to mess up the data partition

fallow tusk
#

The NTFS partition? No, it shouldn't

#

If it does, something more major is going wrong!

hexed rose
#

From all the gparted tutorials I've seen, it doesn't look like people are usually afraid of resizing.

fallow tusk
#

I'm always tentative - I've had things go wrong enough times in the past that I am just extra cautious, however much things have improved over the years ;)

hexed rose
finite crater
#

I've definitely observed people having disaster situations after messing with the partitons to where I would say no matter how much more feasible it is than it use to be, it's not something you should do without backing up unless you are prepared to lose the partition.

#

I think it often has to do with, they downloaded some piece of junk free trial crapware to do it, or...they just didn't understand what they were doing enough and did the wrong thing

#

But it happens

fickle granite
#

'"The servers in today's data center are like puppies -- they've got names and when they get sick, everything grinds to a halt while you nurse them back to health," Joshua McKenty, co-founder of Piston Cloud, is quoted as saying in a recent company press release. "Piston Enterprise OpenStack is a system for managing your servers like cattle -- you number them, and when they get sick and you have to shoot them in the head, the herd can keep moving. It takes a family of three to care for a single puppy, but a few cowboys can drive tens of thousands of cows over great distances, all while drinking whiskey."

#

sounds like y'all treating your ubuntu box like a pet

#

or else you're not drinking enough whiskey, or saying "yee-haw" loudly enough 🙂

fallow tusk
#

Yeah. I treat my data with tenderness because I never get around to backing it up until it's possibly too late.

finite crater
#

my nginx containre uses FROM nginx:latest
my python container uses FROM python:3.11.3-alpine

if I shell into the nginx, I will not have features like tab completion or ANSI colored output. However if I shll into the python one, I will.

Specifically for the tab completion; what is missing that makes it not available on the nginx container?

fallow tusk
#

My /etc/bash.bashrc references /usr/share/bash-completion/bash-completion, but while I have /usr/share/bash-completion/ with content underneath it, I don't appear to have /usr/share/bash-completion/bash-completion itself, which seems a bit odd.

#

(I'm running xonsh, though, so things may not all be tied up for bash)

finite crater
#

ah its probably as simple as just installing that in the Dockerfile.

harsh willow
#

do anyone has idea abount knn?

#

@finite crater

finite crater
west musk
#

but i dont know much about it

#

didnt seem that interesting

#

i cant open links from discord, this happened before too, but the solution last time doesnt seem to work now

#

last time i had to uninstall wslu im pretty sure

#

googling now says something about setting some dbus variable to autolaunch

#

anyone had the issue? how do i fix it?

long burrow
#

When I do rsync -avP, I get a copy of the files I rsynced in a directory that's named as the ssh user@ip. Is there a way for me to modify the files in that file so it automatically links to the file in the VM I sshed into?, e.g changes I make to the file in my local directory is reflected to those files in the VM?

fickle granite
#

no

#

that's not what rsync does

#

you might be able to get something like that with sshfs though

tribal finch
scenic fjord
#

is unix especially great for programming?

south fossil
scenic fjord
#

cool

fallow tusk
#

It is a bit more oriented towards having tooling for programming easily available

#

You are expected to want to tinker with Linux, less so with Windows

fickle granite
#

To a first approximation, the only programming that works well on WIndows is: writing Windows apps.

scenic fjord
#

thats right to an extent, but what about cross-platform languages?

#

or tools

fickle granite
#

what about them?

scenic fjord
#

they can work outside windows

fickle granite
#

sure. I don't see how that relates to your original question, though.

scenic fjord
#

so if you use unix, is it more useful?

fickle granite
#

depends what for

scenic fjord
#

ok then thanks

finite crater
#

Never stepping outside of windows is similar to never leaving your home country. You can live your whole life that way... but youll be missing perspective of the world.

main olive
#

ubuntu on da floor

main olive
#

i’m a masochist so im going to game on ubuntu

#

it’s not as bad as i remember it

main olive
#

it's not LTS lmao

south fossil
#

because of LTS

neat jasper
latent topaz
#

vim moment

neat jasper
#

I have fedora but have not been able to get Steam working on it. Do you have to use Ubuntu for gaming ?

#

ive tried converting the deb package to redhat package but just its not easy

humble falcon
#

And no, you don't need ubuntu

neat jasper
#

or are you using apple core

neat jasper
neat jasper
main olive
#

pc specs are going to be good for programming and a little gaming

#

gpu hasnt come yet but it still performs well with everything i threw at it

shy elm
lapis cloud
fickle granite
#

is this something weird like wsl?

#

I imagine the file system's limit is only one of many; the kernel has a say in the matter, too

lapis cloud
#

ah-ha, got it maybe. If I write to /tmp/filename, I can get all 255 chars of length.

#

So it's only for my home directory. And it's encrypted, IIRC my decisions from like a year ago.

#

so maybe it's an encryptfs weirdness.

fickle granite
#

likely

#

betcha they encrypt the plaintext filename, then tell the kernel to use that encrypted wozzit as the file's name; and the encrypted wozzit probably has some header

normal dagger
#

My cibuildwheel runs on Alma_Linux but this building process fails. what could be wrong?

[tool.cibuildwheel.linux]
before-all = [
    "git clone https://gitlab.freedesktop.org/libinput/libei.git",
    "cd libei",
    "pip install Jinja2",
    "pip install attrs",
    "yum install -y pkgconfig systemd-devel libxkbcommon-devel libxml2 doxygen python3-pytest",
    "yum install -y meson",
    "meson --prefix=/usr builddir/",
    "ninja -C builddir/ ",
    "ninja -C builddir/ install"
]
ninja: build stopped: subcommand failed.
#

I only can do 2 things, find a way to install it from the source by using AlmaLinux or go with an image which supports the package.

#

yeah....

fickle granite
#

perhaps "ninja -C builddir/ " should have a verb? Disclaimer: I have no idea what any of this stuff is 🙂

#

I'd spin up an Alma VM and try those commands by hand

normal dagger
#

What's wrong with the ninja command?

fickle granite
# normal dagger What do you mean?

Well, you've got two invocations of the "ninja" command. The second of them has a "verb" -- "install" -- but the first one doesn't. I was wondering if that first one might be wrong.

normal dagger
silk herald
main olive
#

it’s nice that amd drivers were engraved in the kernel

silk herald
main olive
#

this was first build so it was nice not to have to worry abt drivers

silk herald
#

ah

silk herald
main olive
#

why not c++?

silk herald
main olive
#

it is as bad as everyone says

#

i did python for 2 years

#

and c++ was a HUGE transition for me

#

everyday it is something new that makes my brain mushier

normal dagger
#

Anyone knows how can I get this folder-sharing work in a vm(Fedora)?

main olive
#

how do I activate the venv on macos?

#

I created the virtual environment

#

now I have to activate it

fallow tusk
#

Should just be django_test/bin/activate, I think. Might want to check whether the activate script in bin needs any suffix…probably not

#

doesn't Mac :D

lapis cloud
#

might need to do something like source django_test/bin/activate but the path should just be that

main olive
#

now I am at this part, but I want to use VSCode

#

should I've done all these steps on VSCode tho?

fallow tusk
#

No, VSCode will pick up that venv

main olive
#

or if I just open the project it will work just fine?

#

that's the project I've created, like this?

fallow tusk
#

Yes, if you start a project in that directory, it should find the venv Python. If it doesn't, you just select it from the menu on the bottom-right (or Select Python Interpreter in the…shift-ctr-p menu (whatever that might be on Mac! shift-cmd-p?)

fallow tusk
#

Yep

ebon dove
#

some_command > /dev/null 2>&1 & is the standard way to run something in the background without being bothered by stderr and stdout right?

fallow tusk
#

Yep.

ebon dove
#

thanks!

ebon dove
#

is there a unix-interpretable character that has no unicode representation?