#unix
1 messages ยท Page 5 of 1
Wait lemme see
Yes it workedd
๐๐๐๐
Fron where do u got dem kali skillz g
Man i put in commands but it says command not found
Oh
I would recommend you to get familiar with unix by using linux
where are you running kali?
On mobile too
no need to use kali
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
Lol man was so fast to pop that up
I have it memorized ๐
if you want to learn just plain termux
just use plain termx
install lunarvim
its usable
with that
From where did u learn this stuff
u will have a learn a bit of vim bindings
Mmmm
looking up
Courses??
I didnt take any courses for this
if u want to learn vim bindings there are plenty on youtube
ah
basic unix commands are plenty too
vimtutor is good for learning vim keys. It's a command
(better do it yourself, than watch someone else do, imo)
yea vim is all muscle memory
you gotta get in the reps to get competent at it
or at least get to a point where its not getting in your way
ESC ESC i Yeah. Until you do them subconcESC``hxsciouslyESC
Hi guys
I tried updating my ubuntu and when I rebooted all I got was white screen
Then I tried recovery m9de but I could login
And fixing all broken packages dkpg could connect to network in terminal
omg I cannot tell you how many times I have ctrl-w to delete a word but instead closed the browser tab
It's the ESC tick that often gets me - leaves the field I was typing in and clears it rather than entering it!
For me delete word is either dw or the more explicit diw
that's interesting, I've never used esc tick before
ctrl-w is a terminal shortcut to delete one word back
I mean, I use that shortcut in vim
Anyone here use Anaconda?
not more explicit, it's just different
dw is delete with a motion (effectively "delete until next word")
daw and diw will delete the whole word with/without surroundings
yeah, you're explicitly stating that extra information
when you say this it reads as dw and diw are the same and that the latter is just more explicit
which is not true
Yeah, I agree. I've always thought of diw/daw as being an extension of dw
the i and a are pretty special
they allow stuff like ', ", (, ... as well
(for any interested reader)
ab cdef gh ---dw-> ab cgh
^
ab cdef gh --diw-> ab gh
^
ab cdef gh --daw-> ab gh
^
fwiw, ciw, ci" and the like are quite nice if you remember to use them ๐
there is also s for sentence and p for paragraph
and t for tag, though I never use that
lots of fun stuff
Yep, I'd been using vi for yonks before coming across the i/a versions. Now I use that quite often. I probably don't use ciw as much, although I do think I've had occasion to ;) The s and p I knew of, but they haven't entered my repertoire - probably because I seldom need them, and so seldom use them even when I could.
Having said I don't use ciw much, I just found myself using ci" - to replace everything inside a pair of quotes. That and similar I do use a heck of a lot ;)
vim is this constant learning experience
even after like a decade
@fallow tusk
I recently jotted down some notes about useful but maybe less known vim stuff, maybe you'll find something interesting.
https://algmyr.se/vim/
Or maybe you even have suggestions about things to write an article about. I for sure have stuff I don't know about vim, and probably a bunch of stuff I use without realizing it's kinda obscure
||or more! cough||
* and # I didn't know. That's quite useful (and also works in VSCode with its own Vim emulation)
Why is my swap full, and how can I clear it?
(I'm processing some data in the background)
so you've exceeded your ram by a pretty good margin to force swap usage that high
wdym by clear? you want to try to force that usage from swap to ram?
I probably wouldn't do that when you're so close to the limit
How? Its only uing 69% of the RAM and 85% of the Swap rn
there is still some space
13 + 2.1 = 15.1 which is kinda close to 16.5
I would like to try that, because I didnt have this issue on Windows (altough I had others), and the swap slows everything down by 100x (quite literally)
you can do it by turning swap off
sudo swapoff -a
and then back on again
sudo swapon -a
but I would probably try to reduce some memory usage first
yeah thats what I need to do
so that you're not hitting swap again immediately at the first spike
but as of lately I see it uses alot of swap, even when its only using like 50 - 70% of the RAM
if you exceed 100% ram it will send stuff to swap
look at this shit:
I just interrupted the script but its not even clearing the SWAP (or moving it)
it should theoretically be swapped back eventually as memory is actually accessed
but you can force things with swapoff/swapon
there is possible to configure rules for priorities
swap is supposed to be less priority
so this isnt normal, is it?
but as said, try to avoid swapping in the first place ๐
swap is a crash cushion, not extra ram
my swap cleared itself on its own, not noticed when.
It was full along with mem recently, almost to the top
having 2 GB SWAP is kind of useless in the first place, Swap should be equal to amount of RAM or greater ๐
it should clear up a bit as ram in swap is accessed
if I had to guess it's probably stuff belonging to a web browser or something, lots of caching, few accesses
yeah bro, its just the Ubuntu default
I'll try to clean up a bit the script, but I'm already doing everything in batches, weird ...
looking at your ram you have really high base usage
and then some fluctuation on top
which I guess might be your batches
exactly, the fluctuation was bringing the chunk in memory (list of dictionaries) and then writing it to a parquet
so I guess look into what causes the high base memory usage
the thing is that the base should be the same troughout the execution of the script, but instead it grows slowly slowly, so I'm thinking there is a memory leak somewhere
if it's plain python probably not a leak per se
do you have stuff that gets added to throughout all batches?
idk what you mean by added, but I'm basically reading some data, create new data, and wrting the new data to a parquet
and I'm doing everything using Iterators/Generators both for reading, processing, and writing
but I need to double check how pyarrow handles an Iterator when its passed to pyarrow.dataset.write_dataset(data=it), cuz I suspect it might create some very large dataset with all the batches and then write it to the disk
yeah, that sounds possible
as in something accumulated somewhere, be it a buffer, something that should be cleared between runs but that isn't, or whatever
What distro is everyone using?
And is it 'unix' or more commonly 'unix like'?
Everyone uses their own favourite
It is very common to use something Ubuntu/Debian based in its distro origins.
(Good choice commonly used for servers too, and Debians are most often choice for Docker images too)
(Ubuntu is based on Debian)
I can recommend my favourite Kubuntu 22.04 LTS. A bit heavy in GUI, but very nice.
Plus general GUI layout is my favourite. (KDE Plasma)
And good enough default console terminal with multi window split screen support
More Unix like. Unix is its own operational system as far as I know, from which Linux derived. Unix was original source of inspiration apparently.
Indeed, anything "Linux" is going to be "unix-like", as that was the original intent of the university project - to produce a "unix-like" operating system
I guess the other main "unix-like" group of OSes are the BSD ones. Again, I don't think they are "Unix", just "unix-like".
Ah, no, BSD is actually a UNIX (according to Wikipedia, at least), along with AIX, HP-UX , SunOS/Solaris, Xenix
no BSD isnโt unix it is unix derivative just like linux
unix itself was operating system developed by AT&T
and apparently wikipedia isnโt consistent with itself on this. It brings up BSD as an Unix-like on Unix-like page while categorizing is an Unix on BSD page. Either way distinction of Unix group from Unix-like is blurry at best and when people refer to Unix nowadays they mean Unix-like
I guess the original AT&T UNIX (bought by Novell?) is no longer in use (except, perhaps, in an archaeocomputing environment - although I wouldn't be completely surprised if there's some vestigial system that still relies on it somewhere!), and all that remains are the descendants ;)
I remember relatively recently we learned and used something named Unix during university.
It was for subject: Real time response systems.
Our program is heavily outdated though
It had unusual gray GUI interface that looked like from Windows 98 era or older, and taskbar on the right
Psh. A GUI? That might have been something Solaris-y.
Considering that Fortran (with on purpose compiler from 1970x years!) and Prolog were in our program too, it speaks nothing about how ancient it can be ๐
!pypi pylog
}:D
.... just seeing the name "prolog" brings back memories. not good ones at that.
In computing, Motif refers to both a graphical user interface (GUI) specification and the widget toolkit for building applications that follow that specification under the X Window System on Unix and Unix-like operating systems. The Motif look and feel is distinguished by its use of rudimentary square and chiseled three-dimensional effects for i...
this perhaps?
missing ugly taskbar on the right
and ugly background
Found name!
it is Neutrino! QNX!
oh thats really bad lol
but i guess in real time operating system it was't their priority...
more correct authentic background ๐
indeed
Oh. QNX is quite a lot more recent than UNIX, iirc.
1980s, apparently
OK. It was written for the 8088 ;)
and apparently it is still used
Yep.
Although it was rewritten from the ground up in the 90s.
And presumably tweaked by Blackberry since then
Blackberry Unix ๐
BBX :)
looks nice.
My understanding is that Unix is a licensing specification provided to OSes. One major difference between Linux and Unix distributions is that Linux is a separately packaged kernel + user space tooling, where Unix is an all in one synchronization. In that respect, BSD distros are Unix though in the respect that packages/ports are now available it could be considered Unix-like.
xenodm ftw
I am having SSL Error when I try to pip install a package in venv.
I tried to run the pip install with --trusted-host pypi.org --trusted-host files.pythonhosted.org which still didn't work.
I have no issue when pip installing outside of venv. Is there something I'm missing?
I'm running ubuntu 22.04
I think the reason was my python was installed with wrong SSL configuration
how did you get your python? did you compile it yourself?
well there is specification https://en.wikipedia.org/wiki/Single_UNIX_Specification
The Single UNIX Specification (SUS) is a standard for computer operating systems, compliance with which is required to qualify for using the "UNIX" trademark. The standard specifies programming interfaces for the C language, a command-line shell, and user commands. The core specifications of the SUS known as Base Specifications are developed and...
but according to this BSD's don't comply
and there have been Unix-certified Linux distributions. https://unix.stackexchange.com/a/476945/17497
idk if it's worth it for most operating systems to spend the money and time needed to certify as unix
Mint vs Manjaro vs Fedora, which is best on a slow, old laptop with low ram, and which would you recommend a Linux noob?
personally i like to stick to ubuntu/debian-family in tems of distro.. (for personal use and recommendation alike)
that just leaves mint on your list, it's probably fine with an old laptop
though i prefer XFCE (so xubuntu instead of mint) if you really want to be super resource efficient while being beginner friendly
I think your DE / WM will make the biggest impact on performance. I recently set up Linux on an old laptop with 2 GB RAM and a HDD: Debian 11 with IceWM (goal was to make it look like old Windows since the user was familar with it) runs great for its age
Hey there, to anyone who may be looking at this tired or fresh!
Been hitting my head constantly figuring out how github pull-requests work via Git or command line interface!
Kinda stuck hard right now!
If anyone could shoot me up a DM, would waste a little time of yours, I bet!
Step 1 and Step 2 have been shown in the image, Step 2 is basically me clicking on the pull request option.
Expected Behavior: Should show a box to write message for my pull request!
Do shoot me a DM, if you choose to answer to this.
Thanks have a lovely night/day!
You canโt open a PR because like the description says master and main have different commit histories. Your two branches need a common ancestor to be merged properly
Sorry mate, but you need to dive deeper with that explaination, for me to understand!
Tried googling a lot.
Got some keypoints-
--github recently changed master to main!
-- so i need to first put git add -M main and make that branch in my local repo as well
--after doing that confirming I am the user of the repo I am currently practicing at either by SSH or token keys or other ways!
Also rebase-ing dosen't work, neither does --allow-combined-histories something!
@vagrant fern
if you have master locally and main is an empty branch on github and it's a mess trying to get it to work then maybe it's just simpler to just change the default branch of that repo on github to master
are there any commits on main?
How exactly do WMs work? Like.. say I install Linux Mint (with Cinnamon DE).. do I just install a WM, such as i3, on top, and.. that'll work and make things better? Does the DE version matter in such a case? I mean, Linux Mint has Cinnamon, MATE and Xfce.. does it matter which version I install if I then install a WM?
P.s. I'm a total Linux noob, sry
cinnamon comes with a WM built in
not sure about choosing each separately tbh
I just run i3
you should be able to use the package manager to swap window managers easily. I can't give you any details since I've never used Mint
Either that or could I change my local branch to main?--same name as online!
Also, coming about commits on main, I don't think so! As I made changes using CLI so was only making them on master, where master being the base branch!
@vagrant fern anyways, thanks mate!
I'll try all the solutions today and let you know!
Hi guys
I have a log files, it might contain an error lines or not, i want to make a code that can understand each error line and print just a unique from each no need to duplicate
Example
Input file :
Leakage value 1.2 for circuit 1 is greater than the standard
1)Leakage value 0.9 for circuit 2 is greater than standard
2)Capacitance is huge in circuit 3
3)Capacitance is huge in circuit 4
4)Capacitance is huge in circuit 5
5)Capacitance is huge in circuit 6
6)High delay in circuit 7
Output: must be the unique ignoring instance information like circuit number or certain value
-
Leakage value 1.2 for circuit 1 is greater than the standard
-
Capacitance is huge in circuit 3
-
High delay in circuit 7
The log file may contain over than 10000 errors but not ,however its might be just 10 unique errors as shown in the output ,,,
Anyone can suggest a library, or a place to start from?is it possible to make code clever enough to determine these things ?
I'd use Python, although I'm sure some combination of grep, cut, sort and the like could do it. If it is just a Python question you might be better off asking in a #1035199133436354600 channelโฆ
Ah, I see you didโฆand in #algos-and-data-structs โฆ
Btw, firstly it is a classical example task belonging to #tools-and-devops
Secondly, I can bet there are tools/solutions already having features to deduplicate error logs. This feature exists at least in Sentry. Datadog should be having it too
Sentry should be possible to self host
Among lightweightest self hosted ones, logging stack : Loki + Prometheus+ Grafana should be having same feature, while giving cool interface to navigate logs
Your task kind of sounds more like u need perhaps Prometheus metrics custom agent perhaps instead of real Logging
Just check Prometheus integrations, there should be python library too
Thirdly, u can of course make your own tool.
In python it will be simple default libraries
Usage of generators/regex parsing if necessary. Everything pretty simple and no third party libs are required
All u need to be not dumb enough to keep it all in memory at once. Use iterators/generators to be reading files in a smarter way
Fourthly, in such tasks shines the best solution made in Golang, because it is the best for such logging/monitoring tools due to small end weight result binary without dependencies. Always great to augment easily existing infrastructure
U would be able to make it on same Inbuilt libraries to read file / and some data structure to deduplicate it (if u have just ten unique records, it means just using hashmap/set in python, or map in Golang)
Thank you so much sir, you put me on the road again, i really donโt know that this problem are under devops, since i work as a chip design i automate and know very well bash and linux and of curse some python, but never delt with such a problem, all the topics u mentioned was totally new to me, however i am excited to learn about it and make this script which will save me and my team lot of time,,,appreciated again
find . -type d -name "recup_dir*" -exec find {} -name "*.zip" \; -exec mv -t /home/k/recovery {}/* \;
i'm in a folder.... trying to scan through these directories.. each directory is named recup_dir.xxxx < xxxx being a number
locate the zip's and move them into a recovery folder
when i run this it says file cannot be found
v: cannot stat './recup_dir.257/*': No such file or directory
mv: cannot stat './recup_dir.817/*': No such file or directory
mv: cannot stat './recup_dir.4184/*': No such file or directory
mv: cannot stat './recup_dir.4171/*': No such file or directory
mv: cannot stat './recup_dir.2774/*': No such file or directory
mv: cannot stat './recup_dir.3013/*': No such file or directory
mv: cannot stat './recup_dir.2301/*': No such file or directory
mv: cannot stat './recup_dir.1870/*': No such file or directory
mv: cannot stat './recup_dir.106/*': No such file or directory
mv: cannot stat './recup_dir.978/*': No such file or directory
mv: cannot stat './recup_dir.1004/*': No such file or directory
mv: cannot stat './recup_dir.101/*': No such file or directory
i know this is a stupid issue with my syntax.. any ideas?
you're running find twice. Is that intentional?
Oh, the -execs are seen as belonging to the top-level find; the second one isn't for the inner find
Might need the sh -c (iirc) trick to run the inner find
don't think you should have two finds at all; it's confusing. Maybe find . -wholename '*/recup_dir.*/*.zip' -exec mv {} /home/k/recovery ';'?
I can see the logic behind the two finds; that's not confusing. Combining them produces something that is, though :)
what's the worst that could happen if i do nano /etc/sudoers instead of visudo?
do you mean sudo nano /etc/sudoers?
IIRC, visudo is just a convenience binary that basically does sudoedit /etc/sudoers
see https://unix.stackexchange.com/a/27595
anyone wanna help me with copying files from a server to my local PC while using WSL / ubuntu?
the paths are.. never straightforward and i can't seem to get it right
how can i do that if sudo doesn't work
i meant first doing su
then doing nano /etc/sudoers
but anyway i figured it out
/usr/sbin wasn't in path for some reason
are you on an older debian version? that used to be a thing with the old sudoers config
check your secure_path setting in /etc/sudoers. it should have
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
how to write in the 4th line of a file a text using command line
file before
a
b
c
d
e
file after
a
b
c
text you typed
e
You could use sed I guess.
yep
how you are going to override of the 4th line using sed?
4s/d/stuff would work too I think
that inserts
thanks for your help
override
I guess that could be sed -i '4d;4i new line' filename - not sure. Moyen's suggestion using s would work, but you'd have to specify the entire line as the search pattern (^.*$) which seems a little unnecessary ;)
raised InputException: "Help requests do not work with code provided in screenshots ^_^"
The thing is my laptop is restricted to the company i work for, so i cant download discord or anything there,
So i use my phone
literally installed yesterday
quote the whole path instead of just parts of it, and print it out for debugging. double check that it exists
There's the web interface ;)
Thank you man , it is working now
I am working in chip design field , you canโt imagine how restrictive they are about it
I dont want to get in trouble
Hello everyone,
I have created a little python program with which you can create a beautiful readable chapters txt file (of the format "h:mm:ss YOUR_CHAPTER_TITLE") .ย
Then you can use the txt file to add your chapter titles and afterwards use the script to attach it to the video.ย
Keep in mind though that this program only works in Unix systems like macOS and you need FFmpeg installed on your machine.ย
The github repo of the project is: https://github.com/amireza007/ChapterForVideos
There are some TODO things, available in the code such as a UI and exception handling.
I would really appreciate if you take time to test and even more if you have any comments regarding it or improvements or edits to the project.ย
Thanks for your attention
What is the problem, friend?
ubuntu sway when
opinions on this?
Kubuntu is cooler ๐
I like Cinnamon
more than KDE in fact
1- sway/i3
2- Cinnamon
3- GNOME
4- KDE
for me
any idea why there is no python 3.9 installer?
I assume they only keep a few minor versions of each old version
there's files for a bunch of other minor versions though
oh yep I didnt see that
thanks
any idea why there is no installer for 3.9.16
other than that, no
if you're that set on exactly that version, and no other, then build it from source
or try pyenv -- it might let you specify a version that precisely
โฏ ~/.pyenv/versions/3.9.16/bin/python3 --version
Python 3.9.16
โญโ๎ถ ๏
น ๎ด ~ โโโยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทโโโ โ ๎ถ 17:25:20 ๎ดโโฎ
โฐโ
``` ๐
@unkempt hamlet judging from the pattern of the last few versions, only maintenance patches get binaries, and once they're legacy (for example after 3.8.10 and 3.9.13) they get source-only security releases
oh its also described in the release schedule https://peps.python.org/pep-0596/
got it
thanks
Linux is no longer unix. Only exception is slackware. Use slackware.
sure there is nothing better than installing dependencies manual...
Package managers nowdays do database, interwebs, packages, installation.... Soon they will brew coffee. It is so easy to ldd to see what your deps are and just install them. And packages are just tarballs. And init files are good old bsd style init scripts. Who needs more?
It's the ||april trolls|| truth. Do not question it. Linux is just inferior to slackware.
oh i have't checked the date
Linux is no longer unix
Can anyone help me with this?
File "/usr/bin/add-apt-repository", line 3, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'```
I'm assuming you have installed python3-dev and python3-apt?
yes both
What's your python/python3? Is it the system-installed Python, and have you messed with it in any way?
Is the problem maybe that I installed python 3.11.2 and made it the default version
Yes.
oof
Don't ever change the system python.
okay
If you want a newer Python to work with, I recommend using pyenv to install it in addition to the system Python
so I have both installed python 3.11.2 and the system one but python 3.11 is set to default
Oh okay thank you but how do I fix this now?
What do you mean by "set to default"? With update-alternatives?
my problem
yeeees ๐
First try to set the previous version as the default again and/or uninstall Python 3.11
okay one sec
I'm confused how do I do that?
Well, you say you set it as the default with update-alternatives, right? Then set it to the previous version. What distro are you on?
Re: deleted ๐ฉ๐ช question: It should, yes
Im sorry ๐
I wanted to say: If I uninstall python 3.11, does the system python version automatically set itself as the default again?
It should, yes.
Kubuntu
Which one? 22.04?
22.10
That seems to have come with 3.10.
If after uninstalling 3.11 it doesn't work yet, reinstall python3
Wait I will try this
huh
I can't uninstall this
How did you install 3.11? deadsnakes?
sudo apt install python3.11
Did you first add some PPA, e.g. the deadsnakes one?
And then I used update alternatives
Umm yes I added some PPA but I don't know if I added deadsnakes
Hm.. can you run sudo update-alternatives --config python3 and select 3.10 there?
I did that
And it let you select 3.10?
Wait I will try if it work now
yes
side question
How to install graphics driver for nvidia gtx 1050 ti?
ยฏ_(ใ)_/ยฏ
๐๐๐๐๐๐
I'm sorry
Oh and the python problem is now solved
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.```
Huh
this pops up when I do $ sudo apt update
You should be able to remove the deadsnakes ppa now
And as I said, I recommend using pyenv for newer Python versions these days.
(Deleting works with the same add-apt-repository call, but with an added --remove. Or just remove the corresponding .list file from /etc/apt/sources.list.d/)
Uhh
I installed a Nvidia graphics drive and now my Linux kubuntu is a console window
Please help what did I do wrong
The driver you should be able to find with something like sudo apt search nvidia
Does startx do anything? (it may notโฆor it may give you an error)
Wait I will try it
When I type startx it says command not found
OK. That's one option I was expecting :)
Can I fix my kubuntu?
kubuntuโฆrunning SDDM, I'm guessing?
Assuming it's using SDDM (iirc, that's default for Plasma/KDE), have a look - do you have a /etc/sddm.conf?
Wait
apparently startplasma-wayland should work
It does not
If it's defaulting to Wayland, that would be why startx isn't present :)
I wonder what DM runs for Kubuntu, thenโฆcan't recall how to find out :/
I reinstall it
But
What is the right way to install a graphic drive for 1050 ti?
Reinstall what?
Kubuntu
Do you know it's the missing graphics driver that's causing the problem right now? If not, and you had it working previously, don't go adding more complexity in until you've got things back to a working state
Idk. I just reinstall kubuntu rn but another question
What is the right way to install a graphic drive for 1050 ti?
In kubuntu
Because I wanna play Minecraft or something
There should be a dkms package, iircโฆ
I was hoping to see something like nvidia-dkms, but all I see are versioned packagesโฆyou probably just want to choose the latest (nvidia-dkms-525, maybe?)
I installed this (nvidia-dkms-525) then I rebooted and just got a black console window
how do i add a help for a shell script program
My teacher is asking me to: "Include a usage description (otherwise known as a help message) that describes how to use the script if the user calls the script with a command line argument of -h"
write something that looks at the script's arguments, and if it see one of them is -h, it emits the help message
that's for python, not shell scripts
that's for python, not shell scripts.
im not learning python, im already over that phase. I am learning unix scripting and i need to do this for bonus marks for an assignment.
very simple example (cadged from stackoverflow) ```
#!/bin/sh
OPTIND=1
while getopts "h?:" opt; do
case "$opt" in
h|?)
echo "Usage: $0 [whatever]"
exit 0
;;
esac
done
shift $((OPTIND-1))
[ "${1:-}" = "--" ] && shift
echo "OK, now let's get to work: $*"
there's a million other ways to do it
So would the best way to do it would be a case with h)
I don't understand the question
Also there's probably no "best" way; or, rather; the best way is the one that is best for you
'course this is homework, so it's all about making the instructor happy ๐
if startx is not found then my guess is you dont have x11 installed
I dont really like that statement. There are certainly best practices. And code only you understand is certainly not good
shellscripts are often especially hard to read so its even more important to use standards
considering limitations of bash, best practice is not using bash for making CLI programs / long scripts.
Use smth else... python ^_^ library argparse is awesome.
Given the context, it was a decision between selecting to use just h or both h and ?โฆ something that's likely more dependent on the project requirements.
shell script is the best way to script shell commands. if you have a deployment script that copies something from a to b and restarts a service, shell is what most people will understand best
I need help
[DEBUG]: In file included from <built-in>:382:
[DEBUG]: <command line>:6:9: warning: 'ANDROID_API' macro redefined [-Wmacro-redefined]
[DEBUG]: #define ANDROID_API 21
[DEBUG]: ^
[DEBUG]: <built-in>:375:9: note: previous definition is here
[DEBUG]: #define ANDROID_API ANDROID_MIN_SDK_VERSION
[DEBUG]: ^
[DEBUG]: 1 warning generated.
Warnings are just warningsโฆ
tell your build not to stop when it sees a warning, I guess?
-Wno-macro-redefined (or just remove the existing -W)
what is it?
Or, of course, fix the redefinition.
The compilation is using -Wmacro-redefined (as shown in your output)
I have no idea what you're doing, so i cannot tell you how to fix it.
never heard of buildozer; sorry
Kivy?
yup
Yep.
No idea why it's doing thatโฆiirc I had to make it rerun at last once to get it building when I played with that
ohh
Hey
Do you know who Richard Stallman is?
How come you not know about Free software of then?
Of what?
Unix
You are wrong, he started GNU project which is Free(opensource) operating system. And GNU stands for GNU's Not Unix
Its not Unix
Its Unix-like
No no no
He is one of the original develop of UNIX! Come on read!
No sorry my mistake!
He did not make unix
Rather GNU which is a copy of UNix
Its not a copy its inspired
Yes and even SCO filed lawsuit!
Come to the the offtopic channel
you know, there's this thing called "Wikipedia" which answers these sorts of questions.
Lol
Dude your knowledge is still lacking, you should read more!
Already wasted too much time reading FSF.org and stallman.org
If software should be free, why also not hardwares!
everything should be free!
its not about the price its about the freedom
i can tell you didn't even bother reading the homepage
I finished setting up my selfhosted email server ๐ฅณ
Works and delivers. I have a clean IP from a reputable provider so that probably helps
For anyone wanting to make their own, I used this guide: http://workaround.org I may also publicize my Ansible role to host it sometime.
wow, I'm surprised. I assumed that in practice you'd have to pay someone a lot of money to get a "clean" ip address
I thought the same, but figured might try anyhow ๐คทโโ๏ธ
I have a friend who selfhosts with mailcow and the only hurdle he had was that one German ISP asks for contact data on your website (for abuse etc. I'm assuming)
out of curiosity, why did you do it?
just curiosity and interest in learning about postfix and dovecot, apart from that I'm a big fan of selfhosting
curiosity is the best motivator IMO
Cue comments about cats.... }:)
wouldn't dream of it
I ended up falling asleep yesterday, are you around now or sometime this week?
I'm here, but not at home.
well. let me boot into manjaro and share some errors with you
Sure.
so you can know about it, and maybe give some feeback
alright, 501 updates later and im here
@fallow tusk how can I share details with whats going on. whenever I activate wayland after install i just fall back to a black TTY (I think at least) and some emacs like shortcut pressing later i am back to the login screen
the hardware relevant but the same errors are there before x11 enters
Can you ctrl-alt-2 to get tty2 up?
Not sure about the errors, tbhโฆcan't tell if they're important or not!
KDE plasma works well with that error at least
you mean ctrl alt 2 while im trying to get into wayland?
Plasma X11, I assume :)
Yeahโฆ should give you a tty you can use to execute commands to see what's going on
yes, Plasma X11
should ctrl-alt-2 work now? because it does not do anything
let me switch and try
Sorry - c-a-F2!
I get to the same TTY screen shown in my screenshot, cant input commands
same when im in X11
Hmm. And the same with C-A-F3 or C-A-F8?
yes, no change when i use one of the other F keys
That's unusual, but I think you can disable that...
Just starting up a VM to check what I'm telling you!
maybe my KDE version is to new?
Operating System: Manjaro Linux
KDE Plasma Version: 5.27.3
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 6.2.9-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 24 ร AMD Ryzen 9 7900X 12-Core Processor
Memory: 125,0 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 4090/PCIe/SSE2
Manufacturer: ASUS
This is what I get from C-A-F2
that is what I used to get on my old system
It might be purely driver oriented and i know that nvidia is a pain
might have to wait for plasma 6 to arive
Yeah, but it ought to work. I'm sure I've had a Plasma/Wayland setup running on Arch.
I guess you can view the logs from Plasma X11. I was going to suggest a live USB and digging from there (arch-chroot is a wonderful thing!)
I guess you've seen this: https://forum.manjaro.org/t/howto-use-wayland-with-proprietary-nvidia-drivers/36130
Any instructions that end with the step 7. Profit have to be good, right? :D
Yep, ignore the Gnome stuff
well, part4 is very implicit for me, no idea what they want me to do
should i add it to MODULES='' you think?
MODULES="nvidia, nvidia_modeset, nvidia_uvm, nvidia_drm" like so, with commas between?
or without?
Let me have a look at mine - if I recall correctly it is space-separated
space seperated worked
and i already had the second part of part4 done
alright.. rebooting into GNOME Wayland now.. lets see
Gnome?
the link said gnome wayland, but it did not work, same thing
I can try to install another distro though
would booting another distro and formating my SSD with manjaro mess up my boot loader and my option to boot into windows you think?
and do you have any distro recomendations?
It shouldn't. The grub installation will try to detect other OSes, and it's usually good at finding Windows
nice to know
Manjaro's probably a good one, or Ubuntu of whatever flavour you fancy (I like Lubuntu for its size - LXDE, but Kubuntu is the KDE Plasma variant)
so maybe manjaro GNOME could be a good fit to test out?
Maybe, although I tend to stick clear of Gnome - it's always seemed slow and clunky; trying to use everything the machine has just to add a few bells and whistles to the GUI. (But, yes, this is like me preferring petrol manual cars because historically I've found them better, even if the automatic diesels are a heck of a lot better now)
I also have the same general feeling about Gnome
but since Manjaro Plasma is not working as I want it to, I can just try and see
Have you tried a full reinstall of Manjaro Plasma?
yes, this is a clean new install
Weird.
yeah, I cant even get i3 to work, so im opting for a driver issue
Yeah, almost certainly.
I do however have no idea how to debug it. it all worked very well with my RTX 3090
Probably something to do with those errors you're getting at the start ;P
I'm unlikely to be able to replicate if it's an nVidia issue - I have a Radeon card in the laptop. It's the desktop that's got an nVidia.
(but the desktop is out of action atm, anyway)
Of course it just defaulted to X11
yeah, thats the default.. but I might just get a new SSD and test out other distros via that one. I just want to test out new stuff and see if i like it.
I like to play with distros every so often, too. Although I do tend to use VMs to do that.
yeah, but you know, hardware and nvidia
im getting a new SSD tomorrow or order it online and have it ready for the next weekend
Good luck!
Hi everyone. Having this weird problem with running a large matrix computation using np.memmap. I can't tell if it's an issue with python or something about the hard disk. I had the disk wiped clean, checked for errors, formatted in ext4. The disk space is 2 TB, and I make 11 large matrices of size 90 GB. That's just 990 GB, but then suddenly, the computation stops and the terminal disappears. The memory consumed also just shows 500 GB, when there are 7 large arrays. Is there a way to track exactly where this issue is originating from? I just know that it stops while making a specific array, and that's it. From what I know so far, disk looks clean and no issues with reading/writing. But I don't know, maybe there is some sector that is bad?
if this is Linux, you can tell if it's an out-of-memory error by looking in /var/log/syslog for hints that the "OOM killer" ran
+1 to this being an OOM issue, also check your ulimits with ulimit -a
Bad sector would hang or silently rearrange, especially if you're only writing out half the available disk space
Check your SMART bits if you're on spinning metal & worried about disk failure https://manpages.ubuntu.com/manpages/jammy/man8/smartctl.8.html
I try to use this command
ls files_{7..10}
However since the default shell in my terminal is csh, this didnt work.
I find a solution to use
foreach i ( 7 8 9 10 )
ls files_i{$i}
end
But how i can apply this on the terminal since it takes just one line?
another solution is to use a different shell
โฏ bash -c 'echo ls files_{7..10}'
ls files_7 files_8 files_9 files_10
Nice
So this will run the command in a bash, regardless of your default shell right?
Because my default shell is csh
you can also replace csh with bash by putting exec bash as the only line in your cshrc, if you don't have the access to change your default shell
I will try this out, as you say i have limited access to lot of things
another question
When i check the machine i work on using lscpu command
I found that i have total 4 threads.
so if i need to make parallel execution it canโt be more than 4 at once.
ls directories |xargs -n 1 -P 15 du -sh
And then check cpu using top command i found that its list the 15 job, is that possible to work on all of them in parallel with the 4 thread system
one CPU core can make work on multiple threads concurrently (by switching between them periodically)
specifying the process count equal to the number of available cores minimizes the number of such context switches
you can do that like xargs -P $(nproc)
I made a thing. It makes Python CLI tools start much faster.
I now use it to make my pre-commit hooks blazing fast. It's nice for git commit to be near-instant again, even with pre-commit checks!
It's called JumpTheGun, because it makes Python tools win the race by cheating ๐
https://github.com/taleinat/jumpthegun/
So I'm looking for early adopters. If you like, give it a whirl and let me know how it goes.
Clever idea. I'm gonna try it out when I get back from vacation.
neat! had a quick look at the repo, doesn't seem to be malicious (can't be too careful with the recent wave of malicious packages found in the wild)
i am not sure what is the cause, but some entrypoint scripts seem to be written with " as opposed to ' (maybe it was generated by a different template or something), as such the find_entrypoint_func_in_entrypoint_script in your lib fails to detect the entrypoint func
fwiw, i was testing using sqlfluff
Good catch, thanks!
what is the lightest possible linux? my laptop is a potatato so i need sped
you need light in GUI then Linux. try going Lubuntu then https://lubuntu.me/ 22.04 LTS can be an interesting choice
If you don't need a gui, there are much smaller footprint linuxen
Alpine, for exampleโฆbut it's light for a reason - it doesn't have much more than the minimum necessary to get an OS up and running
as far as i understand goal is not small in size, but being lightweight in performance ^_^
so there should not be point to choose stuff like alpine, but better choosing stable in working ubuntu/debian based smth, just with lesser performance requirements
small footprint OSes aren't good for desktop, hardly anything can be booted on them easily
laptop mentioned hints, he needs desktop stuff probably
I agree, but with just "lightest possible linux" to go on, the rest is just assumption (and I specified my assumptions so they could choose based on what they actually need, or come back stating their assumptions)
yes, I did mean "fast in performance", but I might still check out the one you sent me
A gui is always going to be slower than a command-line only interface :D
Fixed in the latest release.
lovely, i actually submitted a PR but i didn't add a test ha
thanks!
How to bypass grub rescue mode?
That usually indicates that a valid boot config can't be found. iirc the way I've got around that previously is to use a live environment, chroot into my system, and fix the boot - which has usually been caused by an update that got interrupted.
I've sometimes managed to use rescue mode to boot into an existing system, but that tends to involve reading howto instructions on the web :D
This looks super cool. How does it work? My understanding is you start the service in the background and then simply cat stdin and stdout to the sockets of the service
irrelevant right now but, to my knowledge, tiny core is around 16mb. has a gui and has the linux kernel. if you want a os you can actually use though, i would recommend maybe peppermint or some light diy distro. both i've used are pretty good.
That's sort of the gist of it, but the devil is in the details, and there is definitely more going on than what you wrote. I hope to write about that soon.
debian with icewm
not the โlightest possibleโ, if you want the lightest possible probably slackware in text mode or something
thx
if you want something lightweight to manage files on your desktop, install pcmanfm and run it with the desktop flag
runs nicely on an ancient laptop with 2gb of ram
ight
Thank you ๐
When i check this variable i got the number 2 so the optimal valur for the parallel running must not exceed it right?
Do interpreters running inside cygwin still provide access to the win32 API via ctypes?
lightest possible
Bunsen Labs is a bit off the beaten path, but it's as light as recognizable DE setups go without becoming really weird
there's no start menu in it, you right click on the desktop to bring up the menu
otherwise the default UI will probably be somewhat familiar
The latest release is based on Debian stable (11) so it might be a little less current than other distros, but it should still get the job done
Hello everyone, i would i like to build my python app for MacOS and Linux, but i don't know how to do this. How exactly should i do this?
[My machine is a windows 10 computer and i dont have any ways of running macos or linux]
What do you mean by "building"? Normally you can just execute the Python files on any OS.
I mean using PyInstaller or similar to make an executable file
like py -m PyInstaller --icon=icon --noconsole script.py makes an exe
I don't think people generate executables for python
specially on linux and mac, you just run it
The entire BEE2 application is a python script turned into an exe
(the Portal 2 editor addon)
really
I don't know any way to turn python code into unix executables so
Alright then
Thanks anyway
your welcome
actually
I think pyinstaller can turn python code into executables for unix
let me see wait
see this
You don't necessarily need to compile a special file or anything like that for Linux: https://stackoverflow.com/a/304896
I saw that sof post, I think they want to build a executable they can share or something
fwiw: I've never gotten pyinstaller to work on any platform.
I am more optimistic about https://github.com/indygreg/PyOxidizer although I've not dug into it
A modern Python application packaging and distribution tool - GitHub - indygreg/PyOxidizer: A modern Python application packaging and distribution tool
@fading thorn If this is the case, building a pip package is probably what you want https://packaging.python.org/en/latest/tutorials/packaging-projects/
actually i'm too lazy windows only it is
anyone know what are these pipes in the shell thingy called
the one which looks like a maze
ty
do i need adwaita for dark mode in gtk?
can i theme a gtk application window without adwaita?
adwaita is the theme itself, you can choose to use any number of themes that aren't adwaita
that's just the default in gnome 3 (citation needed)
so what is the theme getting used by gtk without libadwaita?
ohh libadwaita is something different
isn't that the one that adds CSS support to GTK
ah
yes you can apply themes without putzing with libadwaita
afaik libadwaita gives you the ability to customize themeing on a per-application basis
global themes can be applied like normal
Browse GTK3/4 Themes Latest | https://www.gnome-look.org/browse?cat=135 | A community for free and open source software and libre content
that shouldn't matter on windows right tho?
since gnome is separated from windows anywyas
my educated guess says the only thing that gtk on windows changes is the path location for the themes
it'll be somewhere in %APPDATA%
but I'm not certain it'll all work the same
gtk on windows is surely a mess
i wouldn't know, my windows install is strictly for league of legends
although, all that gnome jank and all the dlls are still somehow half the distribution size of pyqt's wheels
lol pyqt
what an overbloated lib
QT is a dead technology since 6 went proprietary anyway, we just gotta wait the couple years for qt5 to go EOL
what will happen to kde then?
last I checked they had plans to continue security patches on qt5
And isn't wayland qt also?
naw, not strictly
i mean qt was a sizeable part of linux gui
qt6 is like a full rebuild of the thing that the Qt foundation is trying to push
nobody's going to be on a qt5 -> qt6 upgrade path
5 will probably just get forked, idk, I haven't looked at the licensing
cool stuff. then maybe qt5 simply won't die
laughing at how GTK opted to implement its entire own object system instead of trying to interface with C++
that is powerful a power move
i wonder if i can go ahead and publish gtk wheels for windows
vendor lock down tactics
Since those exist at all
your problem will lie in compiling the wheel, not with packaging GTK
don't native wheels on windows need specific versions of visual studio installed
for the compilation, yes
iirc it was a pain in the ass
but gvsbuild automates the entire build process, even creates the pygobject wheels
and i ran a quick pyinstaller test of my hello world gtk example so I know what dlls and dirs are needed for the whole gnome-gtk thing
The script requires a working installation of Visual Studio for Windows Desktop, Python 3 and msys2.
ahhh, so it is still a pain in the ass lol
gvsbuild looks handy though
Imagine requiring vs and msys2 both
some unix libs haven't yet shifted to cmake land
mixed feelings on cmake. whenever im on windows and a tool uses cmake I'm relieved. when a linux tool uses cmake I prepare for the worst
btw i am allowed to distribute wheels for gtk right?
from a legal pov?
since that might be a reason nobody has done it before
uhh, I think that falls pretty squarely under "you have to relicense your code under the GPL as well" but as long as you do that I think you're fine
i mean it will be all on github anyways
yeah afaict distributing wheels constitutes "conveyance" under the GPL so your code also must be GPL
/shrug if it's all open source on github you're fine
@urban drift u got any gtk experience?
naw sorry, I have used it for toy projects but nothing more
have u used a listview?
ostensibly yes but any help I give would be out of the docs lol
ok but anyways i am trying to add a listview to a window
and the rows appear very thin and have no text in them
def on_activate(app: Gtk.Application, file: pathlib.Path | None) -> None:
lv = Gtk.ListView(
model=Gtk.NoSelection.new(Gtk.StringList.new(["A", "B", "C"])),
factory=Gtk.ListItemFactory(),
show_separators=True,
)
Gtk.ApplicationWindow(
application=app, default_height=600, default_width=800, title="", child=lv
).present()
This is what I am trying
@urban drift by any chance could u help with this?
I don't know enough GTK off the top of my head to help, I'm sorry. I might search github for some other code that uses a ListView and copy some example code
Which is the best Linux dusto which i can run in my old low end laptop,
I am shifting from windows so i want a windows like desktop
Is there any Destro which fills my recruitment best
I am so confused there are maaaaaannnnnyyy destro and everyone have there specific advantages
๐ฑ
linux mint xfce is light and a windows like operating system
wow its cool, can i install linux on my portable SSD
linux come with a grub boot loader do it stuck to grub rescue mod if i plug ssd out?
i have win8.1 in internal hdd
and i want to learn some basic of linux before jumping completly to it
If you just want to play with Linux first, I recommend putting it on a VM. That way you can try out different distros and different setup quite easily
i dont think low end laptop can run VM easily
You could set up a VM that mimics your internal and external drives and investigate what happens, and how to set them up
zorin os lite system requirements are even less. A bit sus it is paid version having though. (has free version though)
Minimal system requirements are 1 GB. can be fitting super old PC.
Looks like windows looking too.
True, although if it's the only thing runningโฆ
indeed. definitely not for the case when it is super old and not powerful
VMs are hungry
I'm writing a shell script that will run my Python code via exec, but first I need it to run a background process. Considering that this going to be run in a container as the main process, would it enough to run my background process as python my_background_task.py </dev/null >/dev/null 2>&1 &? Should I be using something like nohup, or something else?
-
make rethink, maybe your background process should not be background, launch it as side car additional container. Try to keep one container per process
-
if choice one is not available and you still want background process... check, if your logic allows launching it with your programming language mulththreading (or multiprocessing) in background, along side with main process. That is very optimal good choice as well. (especially if using multithreading, because threads used right in a use way, make sure to crash parent as well if problem happened, which makes properly restarted your container. At least this is how it is handled in golang. Not checked in python)
-
... mm other options are way less prefered at this point, but next prefered choice having parallel process launched in parallel with main one (in same ENTRYPOINT/CMD command!) through & linux shell syntax
https://www.cyberciti.biz/faq/how-to-run-command-or-code-in-parallel-in-bash-shell-under-linux-or-unix/ -
other options should be not even mentioned at this point
Thanks for the detailed response and multiple options!!
Option 1 isn't relevant in my specific case, unfortunately, though "one process per container" is indeed a good guideline to follow.
Option 2 seems basically like 3, where 3 does it using the shell language's API.
I think 3 should be fine, since with exec the current process is replaced, so the background sub-process should be fine until the main process ends, after which it is no longer needed.
I always say that if you have to ask, you want some flavor of Ubuntu, because there is a lot of support for beginners like askunubu.stackexchange. You may need to look at a lighter version of it like xubuntu or Lubuntu
ok
@lavish adder Do not spam across channels. My suggestion was to narrow your focus to the part that is relevant to this channel.
If you are new, just use Linux Mint and be done with. It is based on ubuntu and is better than ubuntu in all sense.
Ubuntu creates problem as time goes on. It is not a beginner friendly distro. I always get surprised when Ubuntu is recommend to new Linux folks. Especially if u have time constraints. If u want ubuntu spwcifically, I recommend Xubuntu for a good experience.
If you aren't tied to ubuntu related stuff, I recommend Arch but it is for advanced users. A lot of reading and tinkering stuff needed initially. But extremwly rewarding for long term use. My installation is 5+ years old with zero hiccups.
Pop!OS is somewhere in the middle. A better Ubuntu I have heard. But I haven't used it. But have heard praises from my dev friends.
I am choose linux mint
its similar to windows desktop
Good choice. Its community based distro. It provides full out of the box experience which is expected by a windows user. And works with all the things needed for a dev or a normal user. Like GPU drivers etc. ๐
Hangout in their forums. They have a wonderful community. ๐
thanks
I also am using Linux Mint ๐
this... linux mint is the best
user friendly
similar to windows
easy to use
ubuntu has a bunch of issues with snap, performance errors and so forth
mint doesn't have those
and i dont recommend pop os
tried installing it for a friend and the ui was confusing asf
like, why tf do i have to use command line to install a friggin taskbar?
idk what's with all the ubuntu hate, GNOME 4 has had some serious performance improvements + canonical is still the most reliable when it comes to rolling out security patches
u can simply not use snapd if you don't want it, but most packages that "require" it... don't. It gives you a choice whether you want to download a version from apt or from snapd, it's just that the apt versions are tied to ubuntu releases and the snapd versions are rolling
!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 formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
By default, your code is run on Python 3.11. A python_version arg of 3.10 can also be specified.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
@frank orchid :white_check_mark: Your 3.11 eval job has completed with return code 0.
hello world
!e
print('hello world'
@frank orchid :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | print('hello world'
003 | ^
004 | SyntaxError: '(' was never closed
!e
import os
@minor coral :warning: Your 3.11 eval job has completed with return code 0.
[No output]
use #bot-commands instead
Sry my bad
exact reason why it shouldn't be for beginners
who comes from windows expecting to deal with all that snapd bla bla bla
not me, i began with ubuntu but they weren't forcing snap down our throats when i first joined (20.04)
firefox was still apt back in april 2021
if I got 2 folders as ./test/folder1 ./test/folder2
would sudo chmod o+rw ./test
add rw to other on ./test and its subfolders/files?
you'd need chmod -R for that AFAIK
!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 formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
By default, your code is run on Python 3.11. A python_version arg of 3.10 can also be specified.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
!e
from time import time
print(time())
@heady elm :white_check_mark: Your 3.11 eval job has completed with return code 0.
1682629934.2222834
omg ๐ฑ๐ฑ๐ฑ
does anyone use EBPF with python?
!e
import os
print(os.getcwd())
@trail crater :white_check_mark: Your 3.11 eval job has completed with return code 0.
/home
!e
import os
os.system("pwd")
@trail crater :warning: Your 3.11 eval job has completed with return code 0.
[No output]
Please use #bot-commands
!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 formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
By default, your code is run on Python 3.11. A python_version arg of 3.10 can also be specified.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
!e
print("a")
^ Please see above @vale cloak
perks of having an ISP that mirrors the arch repos
Total (237/237) 3.6 GiB 276 MiB/s 00:13
2.2Gbit/s package slurping
now, I could upgrade my computer with a network card and get 10Gbit...
Ah
If your ISP is a university, then lots of universities have mirrors :D
Which ISP are you using?
I assume AWS mirrors Amazon Linux ๐
they have two plans, was it the private one?
also, is it fasterb ecause you are connected to it?
private, I have no clue what their business plans are like
considering in the private one you can get up to 25Gbit/s
but you need pretty serious hardware for that
and yes it's faster because it's basically just traffic inside my ISP's network
Okay
for some reason after adding plugins in pycharm, it just crashes.(mostly themes)
So is this a unix question or a Pycharm question?
good question
What is "it" here? Pycharm?
yes
but it happens after I switched to Ubuntu.
I don't use Pycharm, so can't say whether that's a known issue with running it on Linux or not.
it never happened before tho.
what are you using then if you do not mind?
VSCode mostly.
vs code?
does it have good GitHub handling?
Yes
Well, I don't know about "good". I've used it to work with some github repositories
gonna try that, I don't want to struggle with this issue for years.
good enough to me, especially if having installed plugin Git Lens
pure inbuilt functionality is kind of enough for 98%+ cases though
since it can already make code reviews and solving merging conflicts
Git Lens just extends functionality and has inbuilt git blame running, and allowing to see Git diff between any chosen brances, and other stuff doing
Hi everyone, I am having issues installing Python3.10 on Raspbian 11.
Here's my approach to installation:
wget https://www.python.org/ftp/python/3.10.11/Python-3.10.11.tgz
tar -zxvf Python-3.10.11.tgz
cd Python-3.10.11
./configure --enable-optimizations
make altinstall
The error I get is the following (excerpt):
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
As I understood, I need to set the two variables $PYTHONHOME and $PYTHONPATH, but I have no idea how to do so.
Are you asking how to set them (https://pimylifeup.com/environment-variables-linux/) or what exactly to set them to?
Both ๐
I actually managed to install python3.10.11, but I still get this error when I try to run it
I mean, I am able to set a variable on linux but I don't know what to set it to
prefix and exec_prefix will be defined by the configure script
Iirc, exec_prefix is usually /usr/bin
Sorry I don't get it
It tells you to bash Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>], yes? You can find those in one of the output files that was generated when you ran bash ./configure --enable-optimizations (they'll be one of the newer files in the Python-3.10.11 directory; I can't recall the name - something like configure.conf, perhaps)
aaaaah ok I'll have a look!
I got the following:
prefix='/usr/local'
exec_prefix='${prefix}'
What do I do with it now?
Do prefix and exec_prefix are both /usr/local, so the suggestion is to set PYTHONHOME=/usr/local (although that doesn't feel quite right to me. Perhaps it is...)
I tried "export PYTHONHOME=/usr/local" but when I try to start a service (home-assistant) based on python 3.10, I receive the very same error
I assume that make altinstall completed successfully
I actually used "apt install python3.10"
root@GC01hass:~# python3 -V
Python 3.10.11
I'm unsure. It's claiming it can't find encodings, which is part of the standard library. That suggests that something didn't go well with the installation. I'm a bit worried that you've tried to install by both a manual compile and using apt; I wonder if they are interfering. I would go through and uninstall the versions you have installed, and clean up from the manual install steps, then just do the apt install from clean.
(tbf, this is almost the "turn it off and back on again" approach to problem solving!)
LOL, I can't even apt purge because I get the same error!
That sounds like it's trying to use the installed version for the system python. Try unsetting PYTHONHOME
export PYTHONHOME=```
but it says
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
which python
which python3``` ?
(how did you write formatted as code?)
root@GC01hass:~# which python
root@GC01hass:~# which python3
/usr/local/bin/python3
root@GC01hass:~#
!code
OKโฆso no python; I am going to hazard a guess that you also have a python3 in /usr/binโฆ
root@GC01hass:~# whereis python3
python3: /usr/bin/python3.9 /usr/bin/python3 /usr/lib/python3.9 /usr/lib/python3 /etc/python3.9 /etc/python3 /etc/python3.7 /usr/local/bin/python3.10 /usr/local/bin/python3.9 /usr/local/bin/python3.9-config /usr/local/bin/python3 /usr/local/bin/python3.8-config /usr/local/bin/python3.8 /usr/local/lib/python3.9 /usr/local/lib/python3.7 /usr/local/lib/python3.8 /usr/share/python3 /usr/share/man/man1/python3.1.gz
Yep, so what is your PATH?
Yep, that's what this is saying
I'm a bit unsure, but either /usr/bin/python3 has been linked to the wrong version or it's not being found (due to PATH??)
aaaaah yes I think it's my fault
root@GC01hass:~# ls -l /usr/bin | grep python
lrwxrwxrwx 1 root root 23 12 mar 2021 pdb3.9 -> ../lib/python3.9/pdb.py
lrwxrwxrwx 1 root root 31 5 apr 2021 py3versions -> ../share/python3/py3versions.py
lrwxrwxrwx 1 root root 25 7 mag 14.37 python3 -> /usr/local/bin/python3.10
-rwxr-xr-x 1 root root 4703672 12 mar 2021 python3.9
should I remove the softlink?
It probably needs to be linked to /usr/bin/python3.9
still doesn't purge :;(
I'm a bit stumped, now :(
Probably easiest at this point
Yw :)
Hey guys I followed instructions from a book (copied and pasted): $ pip3 install jupyter; sudo pip3 install virtualenv
No idea why the book used sudo in the 2nd command but not the first.
Now every time I do anything I get errors:
Traceback (most recent call last):
File "/usr/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3254, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3237, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3266, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 575, in _build_master
ws = cls()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 568, in init
self.add_entry(entry)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 624, in add_entry
for dist in find_distributions(entry, True):
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2066, in find_on_path
for dist in factory(fullpath):
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2128, in distributions_from_metadata
if len(os.listdir(path)) == 0:
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.8/dist-packages/platformdirs-3.5.0.dist-info'
Can someone help fix my python3/pip3?
Now every time I do anything I get errors:
this is not very precise what you are doing
also this does not specifies which Linux distribution you have
oh, i am user of similar distro ^_^ used Kubuntu 20.04 LTS for the last 2-3 years
hmm, i am 100% sure in my diagnosis, but i believe you screwed up System Python of a distro, through running it with sudo
which installed some new files with permissions of a root user
and since you work from a regular user -> you are no longe rhaving right permissions to acces it
Great! Thats what I get for following instructions from a book
ergh, this situation is easiest to fix by reinstalling OS i believe.
if you have nothing important on it, it is the easiest way, unless u wish to find some obscure instructions to repair it regardless
screwing up System Python is one of those reasons where reinstallation is easiest to fix ^_^
Honestly, do python authors ever check their articles?
For the last 10 years (I kid you not) everytime I follow an article about Python it always ends up in disaster
Every. Single. Time
xD try stuff in docker containers first. or in virtual machines
for any dubious risky stuff i run docker run -it ubuntu:20.04 bash first
it creates me temporal container isolated from main system and connects me to its bash console
that is very lightweight and has its own... simulated system inside
from there i can do more risky stuff (including safely running deleting everything)
I could literally follow instructions on a Python 'Hello World' script and it would break my system
because the idiot author would fail to mention things like: oh, this code is for Python2. Like, seriously
This is why I will never buy handover money for a Book or Subscription. Its all utter garbage. All of it
https://brain2life.hashnode.dev/how-to-install-pyenv-python-version-manager-on-ubuntu-2004
as alternative, you can install pyenv if u want. it creates global other python versions running on OS, that are different from System Python
if u screw them up, that will be not a harm in comparison to System Python
technically
technically
u just need to survive to the moment of venv creation ^_^
and its activation
after that you are able to screw up stuff too, it will mess up only local created venv copy
it is easy to do at ubuntu
venv is already usually installed
python3 -m venv venv in desired folder, source venv/bin/activate (to activate and get inside of it)
if it is not installed, then run sudo apt update and sudo apt install python3-venv
once venv is activated, you are safe in isolated venv environment
where you can break stuff if u wish ^_^
for this reason of posibility to break System python, i did not even install pip3 on my system python btw (by default it is not installed)
i just created venv in my user folder (~/venv), that i connect in parts for globally installed stuff
alias jypiter="~/venv/bin/jypiter" in my ~/.bash_aliases file create me global access easily to venv installed stuff for global specific stuff
What is Jypiter? Something different from jupyter?
typo probably
probably. Just wanted to make that sure
Anyway, so you got a global jupyter installation and just install ipython in other environments if you want to use the kernel in a notebook, right?
Nah I've since uninstalled that piece of $shit. The author can't explain why jupyter is installed without sudo but the 2nd command has sudo, jupyter installed with a bunch of errors and warnings in red and orange respectively. Seriously the world of python is garbage
I remember last year in a different distro (EndeavourOS), python venv f'ed the package manager. Somehow it decided it was the default python. All from following a hello world tutorial
10 bloody years and I still havent been able to follow a Hello World tutorial without something breaking across 100 Linux installations in 10 years
Forget about something more complicated like web scraping a page, these idiots don't even fact check their articles
or their books.
My tip: Don't ever pay $$$ for a python book. Pirate it. The author aint worth a single cent
Well I thought I uninstalled jupyter but the binaries are still in ~/.local/bin
So I had to install the garbage pip3 again, add myself to the 'staff' group so pip3 doesn't shit itself with PERMISSIONS errors (genius development there folks)
Attempted to uninstall jupyter, it tells me jupyter is not installed - WTF
So I pip3 install jupyter - that "works", there is a red error, nice one guys, my Ubuntu install isn't tainted with 3rd party repos whatsoever, never has been
So now I can finally run pip3 uninstall jupyter, that "works" but the binary files are still in ~/.local/bin
I uninstall python3-pip package. F this python platform
Removed myself from staff group too to unf*ck the mess
I don't think you can put the blame on Python for issues you had installing Jupyter - especially if you were following something other than the official docs.
I've definitely had issues when I've made a mistake in an install - especially when I mis-linked the system python to a user-installed Python. But that was definitely an error on my part.
You certainly can't put blame on Python for something some third party writes. Stuff on the web is often wrong, or even if wasn't wroog when written, it may now be out of date. This is the case for any evolving system
And, in the end, there's nothing we on the server can do for you. If you want help or advice, ranting about how terrible Python is is likely to get you ignored rather than helped.
https://wiki.python.org/moin/BeginnersGuide/Download
Nothing special.
Is pip3 part of the vanilla Python distribution?
Its easy enough to do a 'sudo apt install python3-pip', but then pip3 shits itself with PERMISSIONS errors just running it without any parameters
what error
If the answer to the above is YES, I would say Python3 really is a pile of poo
Error is:
Traceback (most recent call last):
File "/usr/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3254, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3237, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3266, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 575, in _build_master
ws = cls()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 568, in init
self.add_entry(entry)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 624, in add_entry
for dist in find_distributions(entry, True):
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2066, in find_on_path
for dist in factory(fullpath):
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2128, in distributions_from_metadata
if len(os.listdir(path)) == 0:
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.8/dist-packages/platformdirs-3.5.0.dist-info'
and that's from running pip3 install jupyter?
yes, or just running 'pip3' on its own
oh I see
the sudo fucked up everything
pip is part of the standard install nowadays, although it was a separate piece previously (but I believe that was pre 3.8). You do still seem to have to apt install it separately, though. It should default to installing packages to a user-accessible location (there used to be a --user option that would enable that, but it should now happen by default)
I don't have access to a Ubuntu install right now, so I can't try to recreate what's happening.
Looks like Ubuntu has 3.10 in the repos from 22.04โฆare you on an older Ubuntu?
.
23.04 has Py3.11โฆ
20.04 has 3.8.2; that should still be pretty standard. I'm reasonably certain that even by then --user was unnecessary
if i remember correctly, using the system's installation of python's pip will usually print out a warning saying you shouldn't be doing that. this is maybe a new thing from the past year or two, i don't really remember.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead
from a quick google search.
imo the most correct thing to do is just use pyenv to install your desired python version, make a venv out of that, then install jupyterlab in said venv. (venv is virtual environment in case you aren't already aware.)
re. your point to book author not fact checking their content, the python packaging system is a quickly evolving system, the author might have the correct ideas at the time of writing it, but it might have been outdated now. and in any case, ditto on Hsitirb's point, ranting will unlikely get you the help you require
pip by default is not installed in 20.04 and in 22.04, requires python3-pip installed.
and it should not be installed
because messing with system python is bad. venv is available by default and already installed
if u need global python packages installed, better creating user specific venv and aliasing stuff from it ^_^
I think I've probably needed system pip installed for things like pipenv - basically anything that's needed to bootstrap a venv, but nothing more
i take a more paranoid approach of installing a completely separate installation of python with pyenv, but the principle of "don't touch system installation of python if possible" is still the same
i don't like pyenv for how it messes with my shell. a bit fragile in its working
not installed pip, and using alias flake8="~/venv/bin/flake8" in my ~/.bash_aliases i think is more reliable and less messing around
to each their own ๐
going probably to install anyway may be, when default 3.10 python will become too old to use ^_^
good principle- i once replaced /usr/bin/python3 to be the newest version of python and a lot of stuff broke. i still had the other version of python installed, it was just that python3 pointed to a different version (3.11 instead of 3.10). i would think that if they've got something version specific they would use that specific version (e.g. /usr/bin/python3.10 if they have something specific to python 3.10) but no, apparently not
ยฏ_(ใ)_/ยฏ
It's not version-specific, thoughโฆit's release-specific (they may need to update a script or two when the version of Python is updated for a new release, but they don't have to change every single Python script)
Annoyingly due to a mistake virtualenv depends on python3-pip in Ubuntu 22.04
checked out of fun in Kubuntu 22.04
python3 -m venv venv is available with installed python3.10-venv/jammy-updates,jammy-security,now 3.10.6-1~22.04.2ubuntu1 amd64 [installed] but without python3-pip
i have it as main running OS anyway ^_^
$ sudo apt list --installed | grep "python"
python3.10-venv/jammy-updates,jammy-security,now 3.10.6-1~22.04.2ubuntu1 amd64 [installed]
python3-pip-whl/jammy-updates,jammy-updates,jammy-security,jammy-security,now 22.0.2+dfsg-1ubuntu0.2 all [installed,automatic]
yeah venv works but I'm using virtualenv via virtualenvwrapper
I did pip config set global.require-virtualenv True instead
which is why it confuses me that stuff breaks
there shouldn't be any version specific stuff
Kubuntu was my First distribution
I still use KDE Plasma But i might Switch to another DE or a WM, im Not sure yet
It breaks if you install a different version than the released version because it's not the released version. When that version becomes part of the release, all the scripts that need to be updated will be.
I am trying to manipulate Windows filepath in an application running on ubuntu and centOS. What is the best way to do this?
You can probably use pathlib with the windows-specific class.
!e py from pathlib import PureWindowsPath p = PureWindowsPath("C:\\") print(p) print(p / "User")
@fallow tusk :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | C:\
002 | C:\User
(The bot's running on a unix system...)
Does anyone know a command similar to more where I can look at a .py file with syntax highlighting? (Please do not tell me how to make more relay colors that are already encoded in the file--that is not my question.)
bat, either find it in a Linux distro or then compile it in via Rust.
thank you, you are better than google.
Vim?
vim sometimes plays poorly with tmux, which is annoying when I'm not trying to edit the file anyway
that doesn't fix the problem
if I'm using tmux (which I often am), opening something with vim sometimes makes the terminal all fucky. whether I plan to edit the file or not.
hmm, that's strange
I (and many others) use the tmux + vim combination daily
it could be a tmux and/or vim configuration issue
I've never configured either
or the terminal as well
I use cmder
I've never used that, so can't tell ยฏ_(ใ)_/ยฏ
it's the best bash console for windows that I've used so far (my host machine is a windows laptop, but I do everything on linux VMs)
not a Windows user, but I've heard good things about Windows Terminal
isn't that win11?
in true Windows fashion, no

No, even on Win 11 both are there
Terminal can use CMD or PowerShell or WSL at the same time
nano has fairly good syntax highlighting by default
nano -v for readonly mode
nano is installed by default on most distributions, and also on windows via things like Git Bash (and iirc Win Bash)
if worst comes to worst, you could always write a syntax highlighting script and pipe into it with cat <file> [file...] | highlight.py
or something similar
if you do that, then you could probably cheat by using things like tokenise and ast
but that still sounds like a lot of work
im fairly late to the conversation but hopefully my confused ramblings were a bit helpful
time.process_time() calculates its value from /proc/[pid]/stat, right?
is it (utime + stime) / sysconf(_SC_CLK_TCK)?
looks like it uses clock_gettime if CLOCK_PROF or CLOCK_PROCESS_CPUTIME_ID is available, or getrusage if RUSAGE_SELF is available, or times if times is available (in that order), finally falling back onto clock() / CLOCKS_PER_SEC
Well, that makes it complicated