#unix
1 messages · Page 4 of 1
i am trying to do it now with racket and guile(because of guix)
heh, I followed guile for a long time. There used to be an effort to retrofit guile into emacs, but iirc that fizzled
i stumbled upon it (because it was in guix repos and i was curious) however i did't play long with it.
best way to run unix/linux on windows is ubuntu?
nvm apparently its WSL
oh, WSL installs Ubuntu
anyone can help me set up a WSL / Ubuntu / Linux? I tried
wsl --install and it installed on my hard drive, but running WSL from the start menu does nothing and I cannot find the Ubuntu install
tried as admin, get this:
this is right after restarting
i got it. had to enable virtualization of CPU
cries in lua neovim
tbh Lua isn't that bad, it is just error-prone + it implements quite annoying "feature" that is supposed to make it easier while it does quite the opposite ie indexing from 1
whats the most popular python linux?
What's a python Linux?
Hi, I have a question. I'm trying to use the linux tool perf on my machine to measure the cache stats (about L1, L2, LLC cache stats), but I have a problem. The tool perf only applies to a x86 linux machine. I use wsl2, and, while having installed it (manually from a git repo), the stats I want to measure are not supported, as the wsl2 is being identified as a VM. Does anyone know a way to use it on a Windows machine, maybe a vs code extension (as it has a huge variety), or a third party app, or something similar in order to measure these stats? Thanking you for your time!
Hey, I have used xperf a while ago to get windows metrics, not really sure if it has cpu cache stats but here it is: https://learn.microsoft.com/en-us/windows-hardware/test/wpt/xperf-command-line-reference
Thank you very much!
I mean any linux distro made with python?
What do you mean by "made in Python"? The Linux kernel is written primarily in C
right, curious which linux distro has the highest % of python code used for its OS
depends how you define "OS"
the only bits of python I'd expect to find in any distro would be the package manager, and I can't think offhand of any distro that uses python for its package manager
Gentoo off the top of my head?
Also I think a lot of distros ship with python by default as well
"shipping with python" is very different from "used for its OS"
You can see where python is used in the Linux kernel
https://www.openhub.net/p/linux/analyses/latest/languages_summary
This is a rather difficult question, it depends on where your definition of OS starts and ends. There are definitely distros out there that use python for programs that are shipped with the distro itself, but do they count as being part of the OS?
For example, Arch Linux has a new official installer made in Python. Does that count? Consider that it isn't the only installer (there are many unofficial ones) and you don't need an installer for Arch especially (it encourages you to install it the classic way so that you learn what goes into it)
Also it seems that the Gentoo package manager and some other tools are also made in Python
https://wiki.gentoo.org/wiki/Python
does anyone use systemd sockets to run their website? I'm going to deploy a website soon and I'm debating on whether to use a systemd socket to only run the website when someone accesses it, versus just using a regular systemd service to always keep it on. Are there any cons to using a systemd socket?
I would imagine the latency for that first request would be high, if your web service has to spin up
hmm that's true
what's the benefit you expect to get from using a socket, instead of just keeping it up all the time?
the vm I'm using doesn't have a lot of resources, so the socket activation could potentially save those resources until they're needed
not 100% sure if its worth the effort tho
I'd be surprised
if your web server is just sitting there doing nothing, the only resource it's gonna use is RAM
and it's not gonna use more when it's idle than it'd need when it spins up
if you don't mind bending your brain, you could consider turning your web service into "lambda functions", as AWS calls them, or whatever the Azure or Google Cloud equivalents are. Those use no resources whatever when idle, and spin up on first contact; the infrastructure takes care of the spinning up and down. On the other hand, it's a really unusual style of programming. Disclaimer: I've either never done it, or done it so long ago that I no longer remember the details
that is certainly an idea yea
just simply using one of those serverless services to run the website
there are a few timers that would have to be run for the site tho
if you actually wanted to use lambda functions, then you could probably use "cloudwatch events" as your timers, and have them trigger some lambda function or other to do ... whatever you need
Hi all, I have a case where my FileRotatingHandler is being sent to the journal (service running with systemd). This is not the desired result (only the StreamHandler should be sent to the journal). Any ideas on how to properly configure to avoid seeing the FileHandler on the stdout?
I am trying to install python3.9 with "loadable sqlite extensions." I accidentally installed it before sqlite-devel. Now I am trying to reinstall it. I run sudo ./configure --enable-optimizations --enable-loadable-sqlite-extensions then sudo make and get this error: ```
Could not import runpy module
Traceback (most recent call last):
File "/home/adankert/Python-3.9.13/Lib/runpy.py", line 15, in <module>
import importlib.util
File "/home/adankert/Python-3.9.13/Lib/importlib/util.py", line 2, in <module>
from . import abc
File "/home/adankert/Python-3.9.13/Lib/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/adankert/Python-3.9.13/Lib/typing.py", line 21, in <module>
import collections
SystemError: <built-in function compile> returned NULL without setting an error
generate-posix-vars failed
make[1]: *** [pybuilddir.txt] Error 1
make[1]: Leaving directory `/home/adankert/Python-3.9.13'
make: *** [profile-opt] Error 2
example?
oi
ello
so basically, i have an issue on linux’s apt install python3-azure.
if anyone can help me, that’d be cool.
it’s stuck here
also this is debian, but this is the closest channel i can find to that
are you on stable?
i mean it’s a debian based system, parrot os
but i eventually somewhat fixed it using dpkg’s --purge --force-remove-reinstreq stuff
Hi,
I think this could be the best section to ask this query.
How can we store a user input with escape sequence in python?
I am trying something like this:
>>> dt = input("Enter: ")
Enter: \x03\x12
>>> dt + "\x00"
'\\x03\\x12\x00'
>>> dt
'\\x03\\x12'
Just like the last null byte went, I need the result for \x03\x12
git push permission denied 403 did anyone had this problem before?
Someone guide me with the steps to install Linux pls
Step 1. Choose distro
Tip: there are plenty https://distrowatch.com/
News and feature lists of Linux and BSD distributions.
You can sort by most downloaded for example or just choose Ubuntu 😜
Ok I'll try this first
Thanks man
Welp i messed up, I just killed ibus-daemon as it was taking up 90% of the cpu for some reason than updated the distro (using kubuntu) and restarted
Now that im logging in the entire login is different (i would assume because i killed the main interface) and I cant login
This is the ui i ended up on but am unable to login
Different distro provide different difficulty level.
https://kubuntu.org/getkubuntu/
Install Kubuntu 22.04. it is easy and well supported
And just beautiful
Yea kubuntu is fantastic as long as you dont mess with stuff you are not supposed
That can be said about any Linux distribution
In any Linux u can self destruct OS if wishing
Yea true
hey is anyone here familiar with firewalld, specifically around trying to allow one source/IP on http port 80 and drop all other requests?
Be sure to not lock yourself away by removing ssh access via 21 port 😆
lol already did that, 22
TRying to understand how installing python on centOS works: ```
- wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz
- tar -xvf Python-3.9.13.tgz
- cd Python-3.9.13
- ./configure --enable-optimizations --enable-loadable-sqlite-extensions
- make
- make install
``` What is happening during 'make'? What is happening duringmake installand how would it be different thanmake altinstall?
Are u planning running web application?
Or some CLI interfaced application?
If yes, then use Docker
Inside of image u can use normal Debian or something
And to run it at centos without configuration problems
That isn't an option for now time being. Is using python on centOS not very common?
@drowsy seal tinha q ser o xasdo, bloqueou os #memes
Hm?
no blox
Não achei que iria achar alguém do bf aqui.
💀
!rule 4
4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.
hello, These 3 empty files are being created in my home directory, They are created every time I delete them, probably after a reboot. I've no idea where are these coming from. It'd be great If anyone could help me regarding this 😃
I am just wondering if i can get a quick help on bash script?
whats the problem?
#!/bin/bash
# This script will run the three programs that play the game and evaluate the accuracy of the programs
interval=60*1 # Set the interval for evaluating accuracy to 1 hour
num_hours=5 # Set the number of hours to run the program
# Start the program that will play both single play and parallel play for given duration
# start the single_play in the background
python3 $PWD/python2/single/single_self_play.py &
# start the parallel_play in the background
python3 $PWD/python2/parallel/jax_async_play.py &
# Start the program that will evaluate the accuracy of the programs (run every hour)
counter=0 # set the counter to 0
while [ $counter -lt $num_hours ]
do
echo "Starting evaluation program $counter"
python3 $PWD/python2/evaluations/eval_programs.py & # start the evaluation program in the background
sleep $interval # wait for the interval
counter=$((counter+1)) # increment the counter
done
# Kill the programs that are running in the background
killall python3
I have this bash command
which is supposed to run single_self_play, jax_async_play, and then another eval_program every time interval defined by interval variable
Everything seems to be working fine, and I get this log in my terminal
Starting evaluation program 0
usage: sleep seconds
Starting evaluation program 1
usage: sleep seconds
Starting evaluation program 2
usage: sleep seconds
Starting evaluation program 3
usage: sleep seconds
Starting evaluation program 4
usage: sleep seconds
run_play_and_eval.sh: line 26: 9778 Terminated: 15 python3 $PWD/python2/single/single_self_play.py
run_play_and_eval.sh: line 26: 9779 Terminated: 15 python3 $PWD/python2/parallel/jax_async_play.py
run_play_and_eval.sh: line 26: 9780 Terminated: 15 python3 $PWD/python2/evaluations/eval_programs.py
run_play_and_eval.sh: line 26: 9782 Terminated: 15 python3 $PWD/python2/evaluations/eval_programs.py
run_play_and_eval.sh: line 26: 9784 Terminated: 15 python3 $PWD/python2/evaluations/eval_programs.py
run_play_and_eval.sh: line 26: 9786 Terminated: 15 python3 $PWD/python2/evaluations/eval_programs.py
run_play_and_eval.sh: line 26: 9788 Terminated: 15 python3 $PWD/python2/evaluations/eval_programs.py
whcih I am assumingg is working as expected.
But i dont understand if the programs are running in the background?
none of the programs seems to be running
how do u execute them in the background?
i don't see any way u r doing to execute them in the background
hmm interesting, wouldn't bash automatically run the scripts on background since I am using & at the end of the string?
oh, didn't see that
or would it be sequential, like it would wait till itt would finish the first program?
why are you putting the code in sleep in between?
oh i want that program to be run in certain intervals
say for example an hour, I justt used 60*1 just to test
oh i think i found the issue lol
it was probably the & at the end of the third python script
what does that mean?
python3 $PWD/python2/evaluations/eval_programs.py &
in this line i was using &, so i gues it was executing the rest of the script too,
but i think, the scripts are getting ran quick, as u r just putting them to sleep for 60 seconds
but still the script should sleep for 60 seconds before running the next iteration
and yup you are right, the sleep is not working too
hmmm
i think you have to put the sleep statement below the incrementing statement
hmm i just tried to interval with 60 instead of doing 60*1, and its sleeping for a minute
cuz u can just write these 2 lines
python3 $PWD/python2/evaluations/eval_programs.py & # start the evaluation program in the background
sleep $interval # wait for the interval
into like this
python3 $PWD/python2/evaluations/eval_programs.py & sleep $interval
both does the same job
cuz bash still treats the python3 line as incompleted (i guess)
so it just adds the next sleep statement with that line, so that both those lines are now getting executed concurrently in the background
thats just my assumption
as i've tried something related to that in my pc
lett me try that quickly
nope, i was wrong, nvm my bad
yup didnt work in my end too
so ig the issue was with interval
I used interval=60, instead of using operators like interval=60*1
thats so interesting tho
Anyways thank you so much for your help @hushed quail 🙂
hi
Im
Newbie
Here
i
want
to
be
a hacker
what
i
need
to
do
if
i
have
just
got
start
First of all please write ur words on the same line. Secondly, start with learning python and the Ubuntu terminal(by using a virtual machine)
thank u 🤩
Didn't read it. Looks like spam.
does the the .htaccess file(s) or the Apache config files you are editing have the correct permissions to be read and executed by the Apache server?
Use the terminal and wear sunglasses
Ethical? 
OK so for my second semester in CS I'm taking a Linux course--only, I've never so much as approached Linux. I learn best by doing, so I wanna make one of my computer's primary OS Linux--but is this gonna mess up my existing suite of windows programs? From a software user standpoint, I have gone with windows primarily because its the most widely supported by programs, with Linux am I gonna run into the issue of suddenly finding a ton of software I can't use?
its really gonna depend on what software you currently use on windows as to whether you can find either its linux version or an equivalent linux app
this is my recreational computer, so primarily gaming of various flavors, plus some game modding when the mood strikes.
for games, it will also depend on what games you play
steam has proton, which will work with some games
haven't looked into how other game stores work
if you're lucky, you can find a linux native version of a game you play
otherwise, the experience could range from flipping the proton switch on a game and it just working, to moderate amounts of tinkering, to your game being impossible to play
or if it works, maybe some performance loss, which would prob require some tinkering to get the performance back if its even possible
I did find a gaming section on the fedora discord, and it has some tools I can use but I'm definitely not going to go full switch--maybe dual boot for a while. Wish you could kinda tab back and forth between them.
could go the virtual machine route
its easier to try out different distros that way
and you don't risk potentially blowing up your windows install
Are you still able to fully learn and utilize the OS that way?
for an intro Linux course in college, yes
linux is great for software developers, particularily for developers developing for web, embedded stuff probably too
linux is great for work essentially, and for regular home life.
what for linux is not great at the moment? definitely not for games in my opinion. It becomes fixed but far from reaching good point yet. I just have Windows installed as secondary OS for games
some programms can be installed for all OSes, some programms work only for Linux, for Windows or for macOS :/
different OSes have different ecosystems of programs behind them with some intersection in between
I would recommend having a Linux VM and force yourself to use it as much as you reasonably can. This is much easier and less disruptive IMHO then dual booting. If you use XRDP it's really smooth and you can easily forget it's not running on bare metal
You can even run a Linux desktop in a Docker container, but VirtualBox is probably the easiest way to start
I typically have Windows as my primary OS but spend at least 90% of my time in Linux.... You can have RDP connected to a Linux VM across multiple monitors on one Desktop and then just press CTRL + ALT + HOME to foreground windows and then CTRL + WIN + ARROW to go to a Windows desktop.... then CTRL + WIN + ARROW again and your back in the Linux world. Or you can have Linux on one screen and Windows on another seamlessly use both at the same time
@queen jacinth Acer: F2 or DEL
ASUS: F2 or Del
Dell: F2 or F12
HP: ESC or F10
Lenovo: F2 or Fn + F2
Lenovo Desktops: F1
Lenovo ThinkPads: Enter + F1.
MSI: DEL for motherboards and PCs
Microsoft Surface Tablets: Press and hold the volume-up button.
Origin PC: F2
Samsung: F2
Sony: F1, F2, or F3
Toshiba: F2
do this when starting up computer
what
LINUX MINT BOOTABLE USB DRIVE QUICK AND EASY GUIDE // Would you like to have an Operating System that you can take with you anywhere you go? If yes, then you should try this LINUX-based USB drive.
In this video, we will learn how to create a portable bootable LINUX Mint USB drive step by step. There are a few reasons why you might want to try i...
Do I need a working os for that
k
the motherboard has it implemented
but my usb is corrupted rn
is it gonna clear the volume
you bitch 💀💀💀💀
@old bane
You have to get a usb
any working computers?
igtg goodnight. Go join another discord server for PC recovery
this is not the one you need to be looking for help in
thank you this is perfect, Im using VMware for class but I'll look up XDRP
not really because they let me ban evade
Anyone know how to control Android OS with python? like to automate stuff
What to automate ?
like app texting, scrolling, clicking, anything really
hi is someone here good with sed?
Don’t ask to ask 🙂
does someone know why my ping gets so high when downloading a torrent? (im not downloading something bad with torrents trust me)
from the 16th i paused my download
also the download is slow
okay nevermind i used my mobile data instead of wifi
and it was ennded
so i only had slow
64kb/s
kbit/s*
if you're on wifi, try wired
or just ping your gateway to see if that's where the problem is
no the problem is i used mobile data instead of wifi
and it got expired
so it went slower
best linux distro for rtx/cuda support?
The distro doesn't rlly affect what drivers you can install
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#id17 i dont see pop!_os listed is it just because its ubuntu
The installation instructions for the CUDA Toolkit on Linux.
Dumb question since my brain is not working today I have this command in a script (crontab -l 2>/dev/null; echo "*/5 * * * * /bin/bash -c '/usr/bin/python3 $DIR/autostop.py --time $IDLE_TIME | tee -a /home/ec2-user/SageMaker/auto-stop-idle.log'") | crontab -`)
would changing it to (crontab -l 2>/dev/null; echo "@reboot */5 * * * * /bin/bash -c '/usr/bin/python3 $DIR/autostop.py --time $IDLE_TIME | tee -a /home/ec2-user/SageMaker/auto-stop-idle.log'") | crontab -`) make it run at every reboot?
I think that is more related to default drivers and kernel available. If you are willing to verify pop!_os kernel version is same as the ubuntu one listed and you are pulling from the same repo it should not be an issue
linux file managers look too cartoony
linux mint in general looks kinda cartoony
y'all got a better file manager
other than the terminal 💀
openbox is my goto - ignore me I thought you were talking about window manager
Theres like 10, which are you referring to lol
all
re: linux file managers, you can us mc, midnight commander, in the terminal, sudo apt-get install mc
I have no idea about linux mint, never tried that one...
it should be the same
I've sworn by ranger as a terminal file browser, it's great
The cartooniness is probably more due to your theme choices. Is it "cartoony" because of soft, round edges? (I hate that trend, too)
What is Mint's default file manager, anyway? (I have a Mint box, but it's running qtile, so don't have the usual gui menus)
soft round edges yes
vim is literally the best file browser
Hi everyone, I want learn Linux kernel module programming
Can someone help me?
is anyone here willing to help me with emacs for 10 mins or so?
don't ask to ask, what's the question? If we don't know the answer here there is a StackExchange just for Emacs
Gonna try linux for the 1st time. I'm very excited to see how it works😎
try linux mint first
people recommend arch but honestly its only good if you're really big into system DIY
Yep gonna try that 1st
Mint, Ubuntu, any of the distros that provide plenty of hand-holding GUIness ;)
There are even distros that attempt to be more Windows-y or Mac-y
Recommending Kubuntu 22.04 lts. Looks good.
And Debian family is most often used for servers/Docker images and supports easy installation of any infra tools
I tend to go with Lubuntu, just because it's a little more lightweight, but yes, I like KDE, too.
Arch is great if you want to learn how a Linux is built from relatively bare bones. It has an extremely good wiki with lots of documentation, including an excellent set of installation instructions. However, even I have got lost when following the instructions because I glossed over what ended up being an important step (and I've run through the installation instructions many times :D)
If you want an even more bare bones "build Linux from the ground up", there's LFS - Linux From Scratch. I've never managed to get through to having a fully running system (either due to time or frustration or just forgetting I was in the middle of building it!)
Definitely a good read if you're into understanding it at the OS level
No point to learn something not used as servers and LTS
https://www.geekersdigest.com/updated-list-of-linux-distributions-with-long-term-support-lts/
Anything learning outside of this list is hurting your career.
Kubuntu is just Ubuntu with different GUI, therefore within list
Sure, may be there is point to learn more bare bones experience if u a embedded Dev
But for web dev I don't see point
There was no indication of the rationale for learning Linux, so why are you making any sort of assumption?
Well, we are in Python server where Linux is used in 98% cases only for web dev
Personally I use it as a general desktop and as a development environment. I don't need something to be used as a server (although I have done in the past).
Huh. U use it as development environment for what exactly platform targets / application types
For Python it's mostly auxiliary scripts. For C/C++ it's a parser
Parser? 
Will it run at Linux, or u cross compile it for other OSes?
It's not cross-compiled. The code gets built on both Windows and Linux
I needed to make program with parsing functionality for friend at Windows.
Ended up writing in Golang. Perfect low level enough language, and I was able developing from Linux with easily cross compiling to Windows
I seldom touch the Windows stuff, though. In fact, few devs do.
Sure. I touch Windows usually only for gaming 😉
I was worried that I won't be able to play on linux, but now that I can't buy any games it's totally not an issue 😄
There is website I can share that helps to top up balance on steam account (with 10% commission)
mmm, shady ahh websites
I prefer to use it over my new cards... Because it allows me to top up in... Country origin currency for which steam prices continue to be extremely cheap. (Euro prices suck)
Makes wonder how they do it though
Can you Share it with me
Clarification: this website is useful only for people of... my and opium puppy origin country. If u don't have account originally created in that country, it is useless for you.
U don't have signs showing u a from it
What Country are you from
!e
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.
By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
Kubuntu 22.04 LTS 🙂
i already installed endeavouros
this thing is really good
Arch based distro? masochist :/
i want an arch based distro because of pacman
and endeavour os is by far the best distro imo
it's really good
Debian based distros should be prefered as the most stable and used solution for infrastructure :/
Ubuntu is technically Debian based too.
I'm enjoying Linux Mint 🙂
Does someone use i3 i have problem
I install it on gnome fedora but i can't do anything in it i open it but i can't it opens but i can't do anything whole computer frezes
I fixt it
Is working
wow EndeavourOS is really nice
Pop_OS is quite nice too.
All distros are nice ♥️
if you want to use back ports for everything then sure...
I also use Kubuntu 22.04.1 LTS
What is the standard and common way of daemonizing python scripts?
Using https://linux.die.net/man/1/daemonize perhaps?
daemonize runs a command as a Unix daemon. As defined in W. Richard Stevens' 1990 book, Unix Network Programming (Addison-Wesley, 1990), a daemon is 'a ...
It seems to me like one of the many third-party solutions. Is it commonly used by python developers?
Python daemons are relatively rare, I don't think there's any particular tool or library for daemonizing that's more idiomatic than others. I've used that daemonize CLI tool before, and I've rolled my own daemonization before. There are some PyPI libraries for daemonizing, too, but I've never tried them (it was always preferable to not add a new dependency, in my case)
Well, this demonize tool is also a dependency since it's not built in.
I was wondering if there may be some systemd approach to this problem.
Possibly, at the cost of baking in a dependency on systemd 😄
Systemd is rapidly becoming a standard so it's barely a dependency nowadays. But technically you're right 🙂
There's still holdouts, though, including distros whose distinguishing feature is that they refuse to use systemd. 🤷♀️
True...
Okay, I found a poorly documented solution in PyPI: https://pypi.org/project/python-daemon
Looks like something old
https://pypi.org/project/daemonize/ has a few releases
Seems abandoned at this point, but it's probably in decent shape anyway.
python-daemon has a decent number of releases as well, and seems actively maintained
Okay, I think I'll try systemd service. It seems like a pretty good and simple solution
What are the requirements needed for a pc to run kubuntu smoothly.🥲
preferably at least 2 core-4 threaded, CPU... I3 processor or its equvalient are nice to have. Probably will work on lower processors
at least 4 GB of RAM is preferred (nice to have 8)
lol. i guessed correctly. googled.
They remain the same as for Ubuntu: a dual core 2 Ghz processor, 4 GiB of RAM and VGA video of at least 1024 x 768 pixels, plus a CD/DVD drive or a USB port for the installation media.
Got all of these. Gonna try it out.
Ty
Okay, another issue.
How do I handle virtual environments when running a service?..
Issue solved.
hello, how could i redirect fifo to programs stdin?
i already have written to fifo
how could i do something like python3 x.py < myfifo ?
Can't you open it as a file inside python script?..
exactly like that?
an example:
mkfifo test
# & is needed because write to fifo will block until it gets red
echo 123 > test &
python -c 'print(input())' < test
Hi, I want to populate the input field of a terminal with something, how could I achieve this w/ python?
I love how well this OS works (especially the fractional scaling) but I hateeee the UI lol. It looks like a mobile phone mixed with Windows 10
input("your message")
I don't want to get a users input, I want to populate the input field w/ something for the user.
can subprocess do this?
what do you mean "input field"?
While the GUI is bundled with the different variants of Ubuntu for convenience, you can install and use any particular GUI you want. The OS is completely decoupled from the Desktop Environment
(and from the Window Manager, too)
Yeah I installed KDE Plasma on vanilla Ubuntu, that's my experience with it. Other than the desktop environment, what makes Kubuntu different from Ubuntu?
Nothing. The different variants are just built to use the particular DE, afaik.
Kubuntu, Lubuntu, Xubuntu are all geared towards one or other DE
Just googled it and it looks like they have a couple different default applications as well, but yeah it's just configurable choices
The apps are often tied to the DE - KDE has its own set of office apps, for example, built on the UI
I just started running Manjaro with Sway on my laptop, I suck at it compared to Ubuntu but the tiling windows are actually pretty neat. And that makes sense
I don't know Sway, I take it it's a tiling WM. I use qtile, which is also a tiling WM, and really like it for dev work
Hello, any AI chatbot developer who can help me with a virtual assistant project in human resources?
sway is basically i3 for wayland
@spark mulch @hushed quail which volume should i choose
I'm guessing Volume 2; C. But I take no responsability for a broken system
Select the EFI volume by typing: sel vol Y where Y is the SYSTEM volume (this is almost always the EFI partition)
getting this error
DISKPART> assign letter = U
Virtual Disk Service error:
Assigning or removing drive letters on the current boot or pagefile
volume is not allowed.
this says u have to select the system volume
idk which is the system volume
so its vol3, and pls confirm that u r working with the right disk
cuz anything may happen
l3viathan said it's volume 2
vol3 has the word system straight to it
then im just assuming it that its vol3, nvm
i always thought something's wrong gonna happen as u said that u need to do something with the system partition
maybe give ur pc to a nearby service provider and let them solve ur problem
it has become a hardware problem rn i guess
and i should've said this before, never ask any problem related to boot menu firmware stuff in here
I solved it bro
Is there a way to populate the input field of a terminal with some python library? Maybe subproces? By input field I mean the where you type your commands. I want to execute a python script and have it populate the terminal with a command, BUT does not run it
@smoky snow
well, there's user password and root password
try both
maybe toggle your caps lock
did u just install a linux distro? from the DE and themes i think this is ubuntu
yea i installed ubuntu
ok trying
does anyone here perchance know how to build pytorch for the 6700xt on ubuntu?
Maybe you can do a paste operation from python, if it needs to run when the terminal window isnt active i think you would be looking at terminal emulator specific stuff like kitty, konsole or terminal program specific stuff like bash, zsh
!rule 4 @quaint portal
4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.
Y, si solo querias charlar, hay los canales offtopic…pero ahi tambien se debe hablar ingles.
(transl.) ||And, if you just wanted to chat there are the off-topic channels…but even there one should speak English.||
indeed
After that, you can use either blend, pacman, dnf, or apt in the same shell to install or remove packages, without any tricks.
Just downloaded linux on my windows machine and trying to install from my requirements.txt
I'm getting lots of can't find version warnings. What's going on? e.g
ERROR: Could not find a version that satisfies the requirement Django==4.1 (from -r requirements.txt (line 11)) (from versions: ... 3.2.16)
Is the versions available from linux different than those on windows?
that looks more like a python version thing
your python version is prob too old for django 4.1
Anyone on Linux machine with Wi-Fi and few free seconds? I need example iwgetid output but I am on Windows machine. Please replace your network name/MAC/IP with some examples.
$ iwgetid
wlp1s0 ESSID:"mywifiSSID"
$ iwgetid -a
wlp1s0 Access Point/Cell: 45:32:01:EF:CD:AB
My linux work computer is hooked up in a way, such that everthing under my home directory, /home/user, does not actually lie on the actual computer, but on some local server. My /home/user directory mounts to that server. All other folders /opt /usr etc. are stored on the actual computer. I currently have my virtual environment located at /home/user/.venv/env1 and this works. However, the server is sometimes overloaded, which causes python package imports to take forever, since all packages are located in the home directory and therefore on the server. I would like to create a virtual environment outside my home directory to avoid this problem. However, I am not sure which other place would be the best to place it. Any suggestions would be appreciated 🙂
/opt should be ok, assuming you have write access to it
Thank you! I do. I will try /opt then.
/var would be another choice
hi all,
need some help with scp
i'm trying to transfer a local file onto a server, using scp. i'm running windows subshell for linux locally in admin mode. i use a command like:
scp filename.file serverinfo
and i get an error message about no matching host key type found
nvm got it
It might me server issue
One of my frd was also experiencing this
Good evening, everyone 🙂
I'm looking to switch from Windows 11 to a Linux Distribution on my laptop (Ryzen 7 4700U, Radeon Graphics ~2gb VRAM, 16gb RAM)
I've been looking at several distros including OpenSUSE, ZorinOS, EndeavourOS, Ubuntu, Manjaro (KDE), Fedora (KDE) and ElementaryOS.
Say I were to pick OpenSUSE: they have their Tumbleweed (rolling release) and their Leap (LTS) versions.
My question is basically: Why LTS over RR or vice versa?
It's going to be my daily driver for school work (university). I'm majoring in Computer Science, if it has any effect on my choice of distro 🙂
Thanks in advance 🙂
have u tried them on a VM?
LTS doesn't change except for the odd security update; a rolling release will give you all the updates between the previous "stable" release and the next stable release as they happen (or at least as often as you ask it to run the updates). If you want something Windows-y, an LTS is probably the way to go. If you're looking to get all the latest and greatest cutting edge developments, a rolling release is the one to choose. (Although Windows does do its updates much more regularly nowadays, so is a bit more rolling release-y)
But, yes, I would attempt to install one in a VM and have a play. Grab the live ISO image, and start it up in VirtualBox (my preference, not the only option), and you can play with a "live" system before even attempting an install even onto a virtual hard drive. Doing an install on a VM will give you a testbed for trial and error before trying it on real hardware. If it goes wrong on the VM, you just delete the VM and start from scratch with minimal fuss
Hey guys, for some reason chown doesn't work on a mounted drive
what's the error message you're getting?
^^^^ this, and also, what filesystem is the drive formatted with?
Hi, It's not giving an error, the owner doesn't change when I run chown
Never mind
I was playing with disks and this happened lol
Nice
Heheh, there's your problem
😂😂😂😂
:incoming_envelope: :ok_hand: applied mute to @main olive until <t:1675391271:f> (10 minutes) (reason: duplicates rule: sent 4 duplicated messages in 10s).
The <@&831776746206265384> have been alerted for review.
Did you fixed it?
It happened once with me after splitting a portion into 2 portions
You can fix it if you searched Google
Distro: kali-linux
Nah, it turns out I f- my hard disk or something
You couldn't fix it?
happens ive done couple of times same way and one of em was by blowing it with cold air cleaner probably the electrons got discharced
The electrons, eh?
Thanks, I'll try that
good idea
ls
ls (hd0, msdos1)
ls (hd0, msdos5)
output ext2 (unix portion)
set boot=(hd0,msdos5)
set prefix=(hd0,msdos5)/boot/grub
insmod normal
normal
#After booting up
sudo update-grub
sudo grub-install /dev/sda
update-initramfs -U
update-grub
I think that's it
i have a question
i have a script in /etc/init.d
it gets executed each time machine boots up.
now if i do echo "test" in the script. where will the message get displayed or stored.
Yes that's because it's like start up apps on Windows
It will be done as bash process
You can use exec-in-shell if you want to run it in your terminal
Btw which distro do you use?
I'd guess the output shows up in a log file under /var/log/
what i did was.
i did echo "test" > /home/me/auditlog
so when i rebooted. the script got executed and i got the mssg in the file "auditlog"
So basically you write the output to a file
how to change the permission of all executable files and folders to 700 and all non executable files to 600 in bash?
@errant forge bro I had the same issue i deleted the partition , before changing to the BIOS..... whatever i just had to download the new windows 11 in my pendrive.
Easiest
Thanks bro
you can do it by using find and xarg
find <directoryToStartFrom> -executable | xargs -d '\n' -L 1 chmod 700
find <directoryToStartFrom> ! -executable | xargs -d '\n' -L 1 chmod 600
if you do it on root it will most probably break your system tho
Can I paste the YouTube tutorial this channel?
It's not in the rule so i guess I can help you https://youtu.be/xx2CFufykB0
Hi friends, I showed up in this video How to fix Grub error: no such partition Unknown File System.
Maybe, sometimes you are facing such a problem on your dual boot computer’s and laptop’s –
Like, "error : no such partition
Entering rescue mode
grub rescue
We've made a video before, for regarding this problem, but some users said that “Insmod N...
@errant forge
Sure
I deserve a raise @blissful cloud
what do people tend to use to process svgs on ubuntu 20.04 lts?
librsvg and inkscape don't really work with the full range of svg I want
would also be nice if I could get ImageMagik to be able to use it for the python library wand
What do you mean by processing? If you just want to rasterise them, then web browsers tend to have the most complete SVG implementations.
I want to render them from svg to png
Use a web browser in headless mode. There are command line arguments to specify which file to open, at what resolution, and to take a screenshot. I have had better results with Firefox, but Chromium can also work. I have noticed some inconsistencies between them regarding rendering typefaces. They're both not prefect, but overall they're pretty good about respecting even complex SVG code.
I've tied a bunch of ways: inkscape, librsvg, Illustrator, etc and found web browsers are the best by far.
Here is an example of how to use Firefox https://github.com/python-discord/branding/blob/main/events/evergreen/other_assets/banner.svg?short_path=7bee9be#L14
events/evergreen/other_assets/banner.svg?short_path=7bee9be line 14
firefox -headless -\-window-size=1920,1080 -\-screenshot 'file:///banner.svg'```
Just replace -\- with --
what os are you using. I had the same problem on kali linux and had to completely change the os to ubunto
Hi guys i had a problem with manjaro hibernation boot, how can anyone help me?
Is there a way to see the amount of memory used for caching per filesystem?
(and possibly limit it?)
When i use ls i can only see dev and some folders but gparted and fdisk dosent work
can you just reboot? Or does this happen every time?
you might have something configured wrong in fstab or whatnot. Are you using full-drive encryption?
Everytime
I not crypt anything
So you can boot your computer at all?
if you type "reboot" and enter, you get the same thing?
And this error come All the time
Yes
If you haven't solved it yet, what were you doing before this happened? Did you expand the filesystem at all or anything?
Iirc I got that when I tried resizing my root partition, turns out my partitions were explicitly using uuid rather than the relative path or whatever it's called
Please I need help in writing a script to list and delete objects that are older than 2 years in my OVH object Storage
I have a this script but not working
import swiftclient
import time
Authenticate to the OpenStack Swift API
conn = swiftclient.Connection(authurl='AUTH_URL',
user='USERNAME',
key='PASSWORD',
tenant_name='TENANT_NAME',
auth_version='2')
Define the container name
container_name = 'autopod'
Define the last modified date threshold
threshold = time.mktime(time.strptime('2022-01-01', '%Y-%m-%d'))
List all objects in the container
objects = conn.get_container(container_name)[1]
Filter the objects based on the last modified date
filtered_objects = [obj for obj in objects if int(obj['last_modified']) < threshold]
Print the filtered objects
for obj in filtered_objects:
print(obj['name'])
#❓|how-to-get-help? this is #unix
No
and without knowing 1. the user that runs the flask 2. filesystem attributes of the db - hard to help .. but doing something like chmod a+rw $your_sqlite_file might help (but is not so secure approach)
this is my db file permissions, how can I see the user that runs my flask webapp?
I fixed it, I just gave the /instance directory ownership to www-data user
@obtuse wyvern Did you try to resize your root partition? Cuz, I got a similar problem with another distro when I resized its root partition for dual booting... If so you might have altered its virtual memory size making this problem.
Try this, If you get permission denied... (Happened to me) I'm sorry bro, You might have to do a fresh install (May have fix, but IDK)
I solved @serene locust ty
I'm rly sry but how do I exit vim I'm actually serious
:q
Or :q! if you have unsaved changes you want to discard
Ah, a thought: if you're in insert mode, you'll need to esc out to command mode to be able to send that.
me kde plasma
qdbus org.kde.ksmserver /KSMServer logout 1 3 3```
:incoming_envelope: :ok_hand: applied mute to @main olive until <t:1676662831:f> (10 minutes) (reason: duplicates rule: sent 4 duplicated messages in 10s).
The <@&831776746206265384> have been alerted for review.
what
You said you were KDE Plasma…KDE Plasma would know what to do with that
I don't need to trust, I ran a test. The test failed.
Never believe anything a computer tells you :)
Would passing the test just be not responding?
Indeed
yes dont trust the test
trust me
Looks like a system fault; I'll just have to do a forced shutdown :p
…anyway. silliness aside…I take it there wasn't a unix-related question, was there?
there wasnt i just wanted to say that i am kde plasma
and that i am real
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
^ that'd be the appropriate forum :)
okay sorry
yes
How do I pre-compile the standard library when building from source?
I know the Windows installer has a "precompile standard library" checkbox, but this is not so obvious when building from source. I looked through the ./configure flags but couldn't find anything, apart from that --enable-optimizations doesn't seem to do that: https://docs.python.org/3/using/configure.html#cmdoption-enable-optimizations
"make install" compiles all the python files
kali moment
Is putting the GNU public license into your source code files (that you wrote yourself, but contain module imports from third parties) safe or am I making myself liable to lawsuits?
Sorry if this is the wrong channel, I didn't know where else to ask
Lawsuits on what? And no, imports aren't copyrighted
I don't know, I don't really understand licensing and never published code before
I just want to put GNU public license on all my source files so everyone can use it
GNU means many many people won't use it
heh
if you want everyone to be able to use it (incl closed source projects), put it under MIT
if you want to require that everyone that modifies it uses the same license (ie. derivatives must remain free), use gpl
Is this valid syntax?
for curr_run in "${RUNS_SETTINGS[@]}"
do
cd ${...} && time ${PYTHON_BIN} ${FIRST_PY}
if [ $? -ne 0 ]
then
return 1
fi
sleep 5
done
specifically the return statement
that's not python
good approach to writing long bash = not writing bash, but using python 😁
i would recommend using shell/bash stuff only to piping commands
what rmah said, and also: why not run it and see?
Yup for sure
no shit bruh
I am awesome at pointing out the obvious!
I personally agree with you, but in AWS its a mess executing python scripts with multiple arguements, and its impossible to run multiple commands one after the other (in RDS) so I have a .sh script that calls all the python scripts, but yeah I didnt write it, and I'm not sure if this is valid syntax because I've seen a similar error on Stackoveflow
python makes a very clean solution to execute its scripts with argparse
all input values are named then
and it is always possible to use sys.argv to get arguments in same way as bash scripts
or using os.environ to get arguments from env if desired
python has no restrictiosns for input 🙂
the issue is AWS RDS not Python
you pass it an array for a command, for example ["python3", "script.py", "--smth", "blah"] but how can you run multiple scripts??
have one script being facade to call other scripts
let facade to take all inputs for all scripts
let this entrypoint script call all other python script through directly invoking their run functions
you know... this is even design pattern called facade for this 🙂
thats more or less what I'm doing
but I gotta love how everybody is giving suggestions but nobody can answer if this syntax is correct or not
Wait, u can change arguments right?
For different calls
Of this script
yeah
argparse subparsers allow to have... Linked sub scripts to main script btw
https://docs.python.org/3/library/argparse.html#other-utilities
U can use it even for linking script from another file, if disabling help for linked script
That is if u need invoking multiple scripts from one entry script
Each subparser can have its own independent set of arguments
does anyone have any tricks to setting a bash env var using python?
You can set them and use them within your Python process (or subprocesses), but they won't persist back to the shell.
hey, i'm using ffmpeg-python for making videos. after making it, ffmpeg process does appear in htop, is it ok in linux to have a process with 0 for cpu and memmory?
You can use a shell script to call Python to generate a bash script that would then get called to set them
But that usually seems like more overhead than it's worth
the problem I am trying to solve it to make it multi-os
or i need somehow to remove this process
You'd need to do the same in DOS, too ;)
dang
If those all have the parent PID of 1, then they are probably processes that have not exited cleanly. You can probably kill them.
I use zsh + pyenv + poetry
If they are processses generated by another process, then they may just be idle because it's not using them, and they'll get cleaned up when it exits
when i make another video, it makes new process
"it"?
program
ffmpeg?
python calls ffmpeg
So is Python exiting cleanly?
it is web server, so it isnt exit
it receives api call, and have to return video
That suggests that the ffmpeg process that it started isn't ending, perhaps it's waiting on the Python process to exit...
If you end the Python process, do they all get tidied up? If not, then you probably need to do something in your script to ensure they actually terminate (I don't know what that might be)
i found out, that ffmpeg-python returns popen subprocess
now it is a python question
it doesnt kill a process
no errors
ofc
i tried this one
and it kinda works
after 3 requests it kills all 3 processes
however on 1 and 2 requests, processes exists
Yeah. That's probably my point 1
And also suggests that the kill is unnecessary
Since you're yielding it, I imagine it is keeping a reference to the object around until the generator actually exits
hm
Anyone familiar with blueZ?
No documentation found for the requested symbol.
hello everyone. i have a python script running in the background with pid 48139. I wish to bring it to terminal (foreground) while i'm connected with ssh, so i can display the print(' ') commands. how i can do that ?
It is called seeing logging information.
if u launch python script with systemd
Just request systemctl logs name
Or logs are also available in journalctl
If u launch script with docker.
Then just docker logs command can be seen
i run with vscode over ssh
Run in a proper way in background, u will be able requesting logs properly then
Start with simple systemd
i have on this server other scripts that are configured to run as a service with systemd with pid 555
on command fg %555
the response is no such job
do i have a package missing or something ?
systemctl status service_name
U will see short amount of latest logs
For full logs, learn how to request them with journalctl command
thanks a lot !!! i can see the short amount now.
https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs
journalctl -u nginx.service
For full
Hey guys ,
So in my ubuntu desktop , wifi is connecting only when I take my usb adapter out and reinsert it . What do I do , its not working default
That could be something along the lines of it not starting up the usb service before it's started trying to connect wifi, so it doesn't see the dongle as a wifi device. If that's the case, you may be able to make it connect by using ip to bring that interface up once you're logged in.
The order things are brought up is determined by systemd services…
I'd defining logrotate.d for my httpd log on rhel server, is there any way i can control the masking of the compressed file?
"masking"? Do you mean the permissions?
I ended up solving this by adding a trap to my zsh. Instead what I have to do is write 4 traps. bash, zsh, cmd, ps, maybe fish?
and included a function in my library that will print those hooks out, so the user only needs to source them
I'm looking for some function like umask as it shouldn't be a one off change of permission
my .py file in /var/www/vhosts/hardcore-vaughan.163-161.plesk.page/httpdocs/emadeus/ path, when i try to run by using python code.py i got error no module named numpy but when i try pip3 install numpy it says already satisfied in /usr/local/lib64/python3.6/site-packages
can someone help me
try with python3 code.py
Where did you learn how to shell script
I personally wouldn't learn too much scripting, just the basics for running commands and maybe knowing some loops. For scripts I reuse a lot that do more than just basic commands, I'd use python or another lang
How does one install modules when using sbatch?
The best way to do this is know linux commands very well and then start putting sequences of commands into a bash shell script file. Then start to read about things like if statements and all that, and replacing values with variables, etc. Trying to make simple tasks more dynamic.
Python is in no way a replacement for bash shell scripting, nor would I suggest someone try to start doing that as a replacement. Reason being is all the sudden you have to constantly maintain technical debt in python that bash does with commands in linux natively. Also python can not replace specific bash commands and it would be silly to run execs from python constantly.
It depends on what you want to do, whether you want to distribute it, and if you already know another scripting lang imo. If it's just a script for yourself and you're comfortable in py, I don't really see the merit in learning a new lang if it can be done in one you already know
thank you
I need to learn it for a college assignment
python is greatest replacement to bash shell scripting. You just don't know how to cook it.
learn subprocess library and argparse
together they show amazing results.
subprocess.run("your command", shell=True, check=True) will ensure your command will run with non zero exit return code in case of error
argparse creates quite awesome self documented input to your scripts
Oh in that case, just search for bash script playlist
on youtube
If you did something in python that only required bash I would fire you. Because you don't need a missle launcher in a gun fight and all you do is make my life harder as an executive to find a replacement and incur giant amounts of technical debt.
thats cool but i wanted it to move some files.
if you write 100 lines to do that, you wasted my money
IT is a business that runs on lean efficiency to make money and beat competition, not a pissing match between engineers about how obscure they can do something that's later impossible to repair
when someone says "i need to solve this in bash because its required" that doesnt translate into "do it in python because i like python better"
especially in a unix channel
And if u were that genius that writes parsers (or any too long bash scripts) in bash, without unit testing or any code readability, i would ensure it did not pass code review until u fixed it 🙂
https://github.com/b-fuze/batch-encoder/blob/master/config/parser.sh
he didnt ask for a parser,, that is where your argument is flawed
programming step number 1: define the problem
which you didnt do
you need a unit test to figure that one out?
Any long script in bash without unit testing is idiocy, which is not readable and not maintainable
You're avoiding constraints obviously
the ask and the requirement was in bash I need to learn x to do y
where does that say spaz out and then go with python to code 50 lines of something and reference it with "because someone else did something totally random in python because it's rediculously complex" an answer to that?
no one asked for unit testing
lol
and when you cost a manager weeks of budget with jacking around when something took ten minutes to solve you think they won't reach down your throat and fire you? lol
give me a break
stop trying to solve things that arent requested
I want to hear some pass an interview with "forget your bash because i use unit tests in python" because they're going to laugh and say what??? when given the ask to use a bash script.
https://stackoverflow.com/questions/1401359/understanding-linux-proc-pid-maps-or-proc-self-maps
Quick googling to its format suggests
address perms offset dev inode pathname
08048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm
it is easily parsable with python regex(or may be even string.split is enough)
recommending putting parsed input to List/Dict of @dataclass or to pydantic
import re
may be there is no point to parse it though? may be necessary stuff can be already may be available in Monitoring solutions like Node Exporter agent to Prometheus
i wanted to make a module for reading/writing memory and i wanted to do get a list of the address ranges
([0-9a-f]+)-([0-9a-f]+) ([r-])([w-])([x-])([ps]) ([0-9a-f]+) ([0-9]+):([0-9]+) ([0-9]+)(?: +(.*))?
is this good? it matches everything
i didnt really know how i should do the path part
are you sure you want to parse those values like that?
give me input data, i'll adjust regex to a bit better suggested way
okay
ergh. nvm. Anyway, i suggest making very general groups, capturing whole column at once
and then parsing further if necessary subvalues of column
so the perms should be one and dev too?
first, and rwxp looks good. I think time parsed with separate values is a bit bad though. may be parsing whole value with import datetime will be better
well, find for yourself what will be easier 🙂 that is just an idea
from datetime import datetime
datetime ... there are functions to parse datetime according to specified format in function
u will receive datetime object as result.
but i dont need time
no? it looked like datetime. nvm then
what looked like datetime
address perms offset dev inode pathname these are the names of the values
okay i think i will use ([0-9a-f]+)-([0-9a-f]+) ([r-][w-][x-][ps]) ([0-9a-f]+) ([0-9]+:[0-9]+) ([0-9]+)(?: +(.*))?
i made perms and dev one
([0-9a-f]+-[0-9a-f]+) ([r-][w-][x-][ps]) [0-9a-f]+ [0-9]+:[0-9]+ [0-9]+(?: +(.*))?
i removed some stuff i don't need, this is what i will use, thanks for the help
dare me to install the forbidden shell
Welcome to the xonsh shell 0.13.4
~ Conches for the xonsh god! ~
the xonsh god is pleased with your contribution
hello
my aliasing isn't working in WSL. i successfully declare an alias and then when i go to use it it says "no such file or directory"
this is after using alias to see it was indeed declared properly
maybe it cannot work with cat? does it only work for commands or executables?
what exactly is the alias that is giving you that error?
a custom alias. the scripts are in a distant directory and i'd like to alias their path and name so that i can simply use their name instead
you should add that directory to PATH
instead of aliasing it
also you have most probably typed path wrong
"no such file or directory" usually indicated that sort of stuff
can someone help me out with this I have been trying all day
im trying to make it so they can access sftp on a specific folder only and not be able to log into ssh or have root
recursive chmod to files is
chmod 700 -R /home/Dan_Files
same thing
I did it all from start again
I deleted the user and dir
this is what it looks like in sshd_config
anyone aware if there is a way to have subprocess.Popen pass something as FD 3 on unix/linux and/or another safe way to run a subprocess thats getting a extra pipe for a binary protocol thats not supposed to interfere with the stdio
explain your end goal? expected result better?
I want to spawn python subprocess and have a communication channel to them that's using a binary protocol without abusing stdio for that as we currently do with execnet
oh. u want real time sending input and getting output from it?
i only had case where i had output to python and stdout at the same time
never needed sending input in real time too
i obviously have a knowledge gap somewhere here, what does binary protocol mean in this context?
i remember i tried to use python to do something similar, i.e. sending user input to a subprocess
but couldn't figure it out, ended up using expect in a shell script instead :\
it looks like it is possible to send input in real time.
https://docs.python.org/3/library/subprocess.html
at least stdin is possible to override
is, and Popen.communicate with example is whown how to do that
https://docs.python.org/3/library/subprocess.html#subprocess.Popen.communicate
there pyexpect version for python btw, which should be more comfortable
yeah i only now discovered this, oh wells, it's already in prod, not gonna fix it if it ain't broke 😛
yeah, but the program i am interacting with is really picky about something that i can't quite remember, maybe it's the presence of a tty or something like that
and subprocess doesn't quite do that (or i didn't figure out how to get it to do that)
well, we don't understand you, but i can recommend reading throughly official documentation and discovering all options for yourself
https://docs.python.org/3/library/subprocess.html
Based on the docs, the capability of posix spawn is not exposed to the subprocess popen api
It seems that the combination of pass_fds gets halfway there, i just can't tell it to dup2 it from the current fileno to the new fileno before exec
Hi guys
I have error with import of a packet of python on kali linux
Anyone can help me ?
@devout current that's what #1035199133436354600 is for
do the standard file picker dialogs in linux distros offer to change the text of the "Select" / "OK" buttons?
no
Do you specifically need it to be fd 3? Or could you let it be passed with whatever fd it already has in the parent process, and communicate the fd to use to the child process via a command line argument or message on stdin? Or, heck, by making the child process enumerate its open fds?
But also, there's no requirement that stdin/stdout be text. I wouldn't consider sending binary data on stdio to be an abuse.
You could do that dup2 with a preexec_fn
hijacking stdio which by default is the target of print, certain default loggers and more as well as the target file descriptor of numerous other librariers iwth python bindings certainly makes it a footgun to hijack them
preexec_fn is not supported in subinterpreters (which i want to add to execnet so that pytest-xdist can use sub-interpreters for concurrent tests) and pretty much comes with warnings wrt thread-safety, as execnet is using threads (in most unfortunate ways conceived back with python 2.4)
preexec_fn runs after fork and before exec, so I don't see how it could have any thread-safety concerns - at the time when preexec_fn runs, there's only one thread (unless someone has installed an after-fork handler that spawned a thread like some kind of maniac, I suppose)...
you could always just exec a program that does the dup2 and then exec's the real program, I suppose
That technique is probably only useful if you can't modify the code of the final program you're trying to exec. If you can, you might as well write it to accept the file descriptor to use as an environment variable or CLI argument or something, rather than hardcoding 3, and then you don't need the dup2 at all
Anyone have exp with tinkerboard? What is the process of getting started with https://github.com/TinkerBoard/buildroot ? Learn Makefiles, learn buildroot, add your own thing into packages, make menuconfig and build image? I want to build an app on tinkerboard, and I want to setup github actions to build an image with the app installed.
is
i'll use a argument, its better to use the dup2 in code i control for certain, thanks for the input
Does anyone here know about tmux?
Because when I wan't to detach a session with the keys Ctrl+b d nothing happens. I can only use Ctrl+c but then it closes the session. Any help?
I'm on raspberry pi 4
is the session running in foreground
I think so
try tmux detach
tmux new-session -d -s izdabot 'python3.11 main.py'
this is the command where I start the session
In my session?
the session you want to detach, like Type tmux ls and it will return a list of IDs then detch tmux detach -s <session id>
Id or the name of the session
Okay thanks but another question
huh
I cant exit out of my session when im in the session
it doesn't say it's attached. Try attach it and then quit whatever you have there
ctrl+b k might help?
just check if the command is right : tmux list-keys | grep detach
Dont work
wait
That shows the key bindings
So that means Ctrl+b d is the detach key binding right?
yes
it doesn't say it's even attached
Is it now attached?
probably? 😄
Yes but Ctrl+b d still not working
what is azda bot
does the sessions list say it's attached?
its a mess, just create a new session and attach to it
ctrl b (release ctrl) d
tmux new-session -s <session-name> to create a new session and then typing tmux attach -t <session-name> to attach to it.
did you get it
Omg... The problem was just that I didn't release Ctrl+b ctrl and then pressed ctrl d
I'm so sorry for wasting your Golden time
happens 😄
no problem 😄
Thank you both so much!
you're welcome
i appreciate it haha
Hi, how do i turn a python project into a Linux executable? What is the best way to make it distributable?
there's something called pyinstaller that claims to do that, but I've never gotten it to work
it's insanely complex
it depends what do you mean by executable
if by executable you mean file that can be executed ie you can run it through <pathToFIle>
then you can just add line
#!/usr/bin/env python3
on top of your script
and chmod a+x it and if your script does't depend on any non standard libraries you should be fine
if by executable you mean an binary file then like offby1 said you need to use pyinstaller
you might also try using guix package manager and it's pack subcommand
if it is Web related project, then usually best choice to just pack it into Docker image 🙂 And executing container of it. book Docker Deep Dive for reference. Docker is compatible with all web related deployment systems at cloud providers and etc
Best if it is ready to use web application built for this purpose (Flask/Django/FastAPI and etc)
there is always a choice to distribute it as just pip installable package btw. It can hook commands into Linux machine for shortcut usage.
Good idea to go this way it it is some CLI tool made in python.
its a cli tool i think ill go with setuptools
if your package has too many tricky dependencies, u can offer it optionally as installable pip package as a binary
pyscopg2 and psycopg2-binary pip packages do that
Ok, thank you, ill also consider that
yeah
i know im a bit late, but you can use freeze!
it was. literally created for this purpose
and its also what the docs say to use
you should use it!
Hello everyone, i was trying to install Arch and when i tried to install grub it gave me this
That just indicates that the keys aren't up-to-date... let me find the package you need
Ah, yes. Probably just bash sudo pacman -Sy archlinux-keyring
and then do the update
You should probably -Syy before adding a package, anyway.
@river raptor ^^
So the following in order are probably a good way forward: bash sudo pacman -Sy archlinux-keyring sudo pacman -Syyu sudo pacman -S grub
@fallow tusk thanks for trying to help, one of my friends helped me, i did this what he said in picture into /etc/pacman.conf
but i also have another problem now
arch is installed
but
no internet
if i do pacman -Sy wpa_supplicant it fails because no internet
i am currently on kubuntu 22.04.1 lts, can i just copy my wpa_supplicant to the arch /bin?
What does ip a say?
wait
You're connecting via wifi, I take it
Yep, OK, so at least it sees the wifi adapter. Yes, I think you're right - install wpa_supplicant, and copy the config across
How do i install WPA supplicant If i dont have Internet connection
lol. Yes...good question. You can't wire it in?
Wait
You should be able to download the packages from a system that is connected and install them locally (iirc)
It told me to pacman -U /package/folder/*.tar.zst
Where do i Download the tar.zst
@fallow tusk
Then i do Pacman -U and the path?
I believe so; I can't recall, but ISTR doing that once or twice previously
The problem may be dependencies
(I don't have an arch system in front of me to try thing on right now)
Okay
What dependencies
Are you chrooting into the arch environment?
i just installed arch then booted to arch
If the Ubuntu system is on the same laptop, then you can make things a little quicker by chrooting into arch and doing the setup by jumping into and out of arch like that.
how to do that?
your son died so you just decided to join the python discord and ask for giving a ps5
Sorry, that counts as advertising, which is not allowed on this server.
what if he was telling the truth?
Aye
i dont think so
I mean, it was probably a scam, sure
That doesn't stop it from being advertising
why would anyone give a ps5 for free especially when its new
because it reminded him of his dead son and he wanted rid of it?
but why for free?
because he's too distraught to think about money right now?
It's irrelevant.
wow, that's cold man 😋
@fallow tusk
[root@localhost /]# pacman -S wpa_supplicant
resolving dependencies...
looking for conflicting packages...
Packages (4) duktape-2.7.0-5 pcsclite-1.9.9-3 polkit-122-1 wpa_supplicant-2:2.10-8
Total Download Size: 0.39 MiB
Total Installed Size: 9.27 MiB
:: Proceed with installation? [Y/n] y
:: Retrieving packages...
polkit-122-1-x86_64 395.9 KiB 1816 KiB/s 00:00 [####################################################] 100%
(4/4) checking keys in keyring [####################################################] 100%
(4/4) checking package integrity [####################################################] 100%
error: polkit: signature from "Jan Alexander Steffens (heftig) <heftig@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/polkit-122-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] n
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.
[root@localhost /]#
You still need to install the keyring
The same way
You'll need to get the package and update it
Sounds like the installation medium you used was somewhat old; did you not have internet access in the installer?
my installation medium is a usb stick i bought some years ago, i downloaded the iso from archlinux.org and used balenaetcher to put arch to the usb
i did have internet access in the installer
OK. Then you're better off going back to the installer and using that to install the packages you need
in the installer i had wpa_suplicant
Yeah, in the live system, but you didn't install it in the system you were building.
You can use pacstrap to add things like that
I'm surprised, though, that pacstrap didn't install the latest keyring.
how do i install the latest keyring
That's probably the easiest. You can just go from section 1.11 or even 2.2
OK...I don't know, now :)
i gave up, when adding someting with pacstrap i got an error wiht no more space left
Odd. That sounds like you were trying to install to the live system, not the target
what should i do
It may be worth starting from scratch, with this new knowledge :)
I've done that a few times when installing arch - usually I've just missed a (not-so) minor step
but i dont know what i should do instead
i did
pacstrap /mnt base base-devel linux linux-firmware dhcpcd nano wpa_supplicant
Just do everything again, but ensuring you add wpa_supplicant during the pacstrap
i did that
From scratch?
okay wait i will do it one more itme
@fallow tusk still Not working
No space left on devic
When Doing mkinitcpio -p linux
Ah…is the /boot partition pretty small? it may have run out of entries in the UEFI …err…thinggy (technical term!!)
I've had to clean that out before now. But the easier option is to make a bigger partition…yeah
I have a 500mb Partition, how can i use that instead?
On /dev/nvme0n1p5
nvme0n1p3*
How can i use that instead
It should tell you in the installation instructions - where it explains how to partition the disk
I didnt find it
@fallow tusk
I think i got it
Wajt
Now its says pacstrap Not found
Im going up
I will try again tomorrow or Something
Now this but i dont ude Windows anymore
That definitely sounds like a UEFI problem.
You may need to get familiar with the UEFI shell, if only to boot one of the entries that have (presumably) been corrupted
its alright i dont use windows
oh wait it didnt find pacstrap because i was in the chrort
chroot
That'd do it :)
how do i make the fourth partition the efi partition or how do i resize my efi partiotion with 100mb
To increase the existing 100MB partition, you're going to have to decrease part 4 to give it enough space, then move partitions 3 and 2 up.
I'm not sure about making part 4 the EFI partition…
im going to sleep now, could i talk to you tomorrow please? i found gparted and i will try to use the live usb
I probably won't be online until 10:00 GMT, but anytime after that
It's alright
Between fedora, manjaro or Ubuntu , which would you recommend?
I hate to say depends, but it depends. I always pick fedora because its based on redhat which is an industry standard build. fedora is on the bleeding end of that because red hat do not want to release unproven builds into the industry... So if you are developing skills for the industry then fedora. Its also great even if you are not interested in that. Ubuntu is the most popular i would say but not that sure. i dont go for that because the packaging is different. but if you were wanting to play steam games on linux, then that would be better fit.
Thanks you , i only want linux for programming
the real difference is the packaging . fedora uses rpm with is different from debian builds which ubuntu belong
I guess the analogy I was looking for was: "Do you recommend a Ford, a Nissan or a Peugeot?" - mostly it's down to individual preference, with slight differences in how they "handle"
And Manjaro is an Arch-based build, so uses pacman (which I think is its own thing, but can handle .debs with some fiddling)
In terms of what interface they provide and the availability of things for coding - they're much of a muchness. Throw each in a VM and try them out
the other thing that i am a bit picky about is the UI. I like Mate version of fedora. i think that this is the real thing that will affect you. I really didnt like (ad well as others) the gnome UI. Mate is gnome2 style. gnome3 was mac look alike. I never liked mac ui
I've avoided Gnome for a while, now ;) But, yes, each distribution will allow you to use different Desktop Environments. That is even more a matter of taste.
If all you want to do is code, then you could get away without a DE entirely.
Hard core 🙂
Ok, thanks you so much. I think fedora will be a good choice for me
yeh its solid
I should probably run up a Fedora VM and try it again. I never got on with RHEL, though.
i stoped using windows altogether and just use Fedora Mate build
you dont need a vm for that
just a usb they have the LIVE version to checkout
if you like it just install from usb
Well, I'd still run the live version in a VM, tbh. Means I can still do stuff whilst I tinker
sure
usb is less hassle i think thats why i suggest it
and its a good option to check out the different UI options. there are quite a few now.
its been a while since i used a VM. All the kids use docker or podman now. what setup do you have ?
Currently I'm switching between Windows and Linux on the laptop as my desktop died. I have Arch as the main Linux system, this is currently a Lubuntu VM.
The Arch system is running the remnants of a Garuda install, which I think is running Plasma. The VM is running qtile with no DE.
Ubuntu with kde
+1 for Garuda
Hsitirb i installed arch, thank you for helping, i used cfdisk to delete the partitions and Made a efi Partition half a Gigabyte, 8g swap and everything else is the root directory, i asked in the arch discord for more help and i got help with everything
hehe, and bypass all the fun of the arch forums install experience? jk, congrats on your new install!
Thank you, what do you mean by bypassing the fun of Arch Forums install experience?
no worries. I wasn't criticizing you, just remarking on the traditionally accepted arch culture. though i appreciate and respect the community it's not really my flavor since arch has selectively adopted things which meet their KISS standard and avoided some development tools for the same reasons.
then again, I'm boring. debian was generally good enough (stable, development, usable, 'it just works') without the bloat of ubuntu. cent was nice, but then redhat was acquired by IBM. fedora is great for development if you can accept potential risks to stability. however, every distro previously mentioned makes use of systemd which is the least unix compliant technology ever.
Anyone know how i can escape `help' in kali nethunter
what do u mean?
did u try
:q
q
