#unix
1 messages Β· Page 53 of 1
https://docs.python-guide.org/starting/install3/linux/ follow the instructions here for ubuntu
mint is an ubuntu derivative so it should work
I was using skype desktop application today on my linux and it had a share screen option
apparently, it shares my screen with other participants
now, I'm wondering: what are the security implications of this?
cuz, when you press share scree, it does so; no prompts from the OS... it just shares screen (just like that)
my question is: can every desktop application spy on me?
Hm - I think the answer in short is "yes"
I think that's true on all desktop OS's, really
it's not true on mobile OS's, but they jump through a lot of hoops to sandbox apps from one another - like running each app under a different user account
How consistent are default utility command flags across the BSDs?
depends how esoteric the commands
if you limit yourself to only stuff that's in POSIX, extremely consistent
https://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html describes the most portable tools, and their portable options
it's not necessarily guaranteed that all of those tools are installed - but if one is installed, those should be the options it takes. There's some subset that's expected to always be installed...
ty. i'm doing some async practice and I think i'm going to have to do some environment probing for this to actually be cross-platform
probing for what?
what's actually installed on a system
right, but which things would you be looking for?
There's a common set of base utilities that you can pretty well assume will be installed - cp, mv, awk, tar, etc
sed
there's some set of commands that are required to be installed by default on POSIX compliant platforms, even
ah, uh. hm.
yeah, network ones aren't super portable. If bash is around, you've got /dev/tcp
many machines will have wget or curl, and nc or netcat...
@summer trail, I think macs put tighter control on apps
it prompts you if an app tries to access screen...
lol, but seriously, this is like basic security (why is linux bad at this)
well, in general on a Unix machine - including OS X - any process running as a particular user is able to read and write to the files and to the memory of every other process running on the same machine as the same user
Unix machines have a privilege/trust boundary between users, but not between processes running as a single user
and that's why Android (which is built on Linux) runs each app as a distinct user - to take advantage of the natural trust boundary between users
I don't understand, so every user can modify any file
if it's involved in some running process
no, that's not what I meant. The permission model for the file system has a user as the most granular unit. One process running as a user can write to any file that's writable by that user, and read from any file that's readable by that user - even if another process created that file intending it to be private.
With some possible exceptions thanks to AppArmor and SELinux and the like - there are ways of hardening Linux systems more than the default
got it
Hey @cobalt aurora!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
β’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
β’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
"""py
import requests
File "/usr/lib/python3/dist-packages/requests/init.py", line 43, in <module>
import urllib3
File "/usr/lib/python3/dist-packages/urllib3/init.py", line 7, in <module>
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 11, in <module>
from .exceptions import (
File "/usr/lib/python3/dist-packages/urllib3/exceptions.py", line 2, in <module>
from six.moves.http_client import IncompleteRead as httplib_IncompleteRead
File "/usr/lib/python3/dist-packages/six.py", line 99
break
^
SyntaxError: 'break' outside loop
"""
@summer trail , I knew that, but I never actively thought about it's implications...
so, linux security is a joke
I just broke the requests module
Hm - I don't think I'd say that. Honestly, I think Windows is about on par with Linux here. I'm not sure if OS X is any better
wdym
it clearly says you have a break outside the loop
by and large, OS's try to protect the kernel from apps running as the user, and apps running as one user from apps running as another user. They don't usually try very hard to protect multiple apps running as one user from each other
yes, but I add that break for I dont know what reaason
I mean, you install some app and bam they can read all your files, access camera, share screen...
yep
@cobalt aurora, a break breaks out of the innermost loop construct
loop1:
loop2:
some statements
break
after break you come here
looks like that's in six.py, which is library code, though.
wdym
File "/usr/lib/python3/dist-packages/six.py", line 99
break
^
SyntaxError: 'break' outside loop
lol, @cobalt aurora are you messing with the library code?
that says that the place where the syntax error occurs is inside six.py, from the python3-six package
which seems... wrong...
how much wrong?
probably not - six is one of the most heavily used Python libraries
well that's definitely not the right thing to do.
oh, I see
I'd just try to sudo apt --reinstall install python3-six to reinstall that package.
just reinstall it
assuming you're on Debian or Ubuntu - looks like you are to me.
maybe reinstall ubuntu?
nah, don't do that.
@cobalt aurora, are you new to python or programming or are you messing with us rn?
the command I pasted will reinstall just the one package you messed with.
oh, in that case, start with a good python tutorial or free course
lemme think of some good free ones...
sudo apt --reinstall install python3-six will fix the damage you caused
as long as that's the only library you edited.
and if I want to install a minimal version of ubuntu
since that the there so much software in default installation
ubuntu isn't very minimal, even in a server installation
and as you said it is a security problem
how about arch linux?
if you want something more minimal debian is better, but you might have to install a few things to get an environment you're familiar with
well
what's your actual goal and set of needs?
if you need to get up and running as fast as possible, ubuntu is great
arch is fiddly
@cobalt aurora, don't try arch yet
it's great if you have the time to set everything up manually, but it's not so good if you're new to linux
focus on learning one thing at a time
get some feel for some beginner friendly distributions and then if you feel like it, explore others
@cobalt aurora how are you using linux btw? in a VM, or on bare metal?
both I guess
also are you using it from the cli, or in a graphical environment?
gui
Well, if you have a spare computer you want a linux on that just works and you're a beginner, Mint is pretty good. It's similar to Windows in GUI layout.
That's not really what was being said. What was being said was that you shouldn't run apps that you don't trust, because you don't know what they're going to do and what they might try to steal or mess up or whatever. And that's good advice regardless of OS
@cobalt aurora what you'll eventual come to understand is that there's no thing as absolutely secure.
there are only varying levels of security
and against some threats, there's not much you as an individual can do.
But most people won't ever face those
forget absolutely secure, today I learned that desktop os's are very very bad at security
Well, there are tradeoffs to be made in security too.
Some places take security so seriously they glue the USB ports shut with epoxy and lock the screen after a minute of inactivity.
Places like that are also hard to get stuff done in for a lot of people
but those are tradeoffs they're willing to make to be safe against certain things.
@cobalt aurora let me ask another way: what do you want to do? build web-apps?
or enter into "cyber security" because there are job openings in it?
web-apps
Much of that applies to Windows and OS X as well. Any app you install that has access to your file system can go read your browser history, figure out what website's you've been using, and upload the list to the internet, or whatever.
but very interested in how OS works
@cobalt aurora, please learn basic programming thoroughly before jumping into web-apps (you'll thank me later)
that's great
there's ton of free courses out there that teach you OSes
if you want to get an idea of how computers work from the ground up, there are other things you should start with other than OSes
web-apps I mean
basic programming skills in general will be important
acess the web pages for research
and I think that for web apps and python, learning some of the low level concepts actually make understanding things like async easier
what do you mean by that?
web scrapping
oh
@cobalt aurora, harvard university has this amazing course called CS50
pretty much any linux distro will be fine for that
check it out
ubuntu will have the most documentation for it though
it really great and the course is completely free
yes, just for curiosity
they teach c and python and web apps (basics)
what do you mean by that?
building a more complex program
I think the way you phrased that indicates you're misunderstanding something
ah, yeah
well
that might not quite be true
The only difference between linux distros is what software they've pre-packaged and for easy installation, how to install those pre-packaged things, and what options they've made the default
complex software is possible on almost all modern OSes, but doing things in certain ways might be harder.
this is literally the only difference between Arch and Ubuntu and Debian and Mint. What they've packaged, how to install the packages, and what default options those packages have
and which of those packages are installed by default, I suppose.
Also what the packages are named
Things are in different places sometimes, and they might use different tools in a few cases (systemd vs other init systems to start the computer), but generally it's just a matter of different brand, layout, and labels
the overall functionality is mostly the same
apt-cache pkgnames show the most absurd packages
there are a few distros that do something really different philosophically, but those are rare
the I dont remember downloading
if that is an equivalent of dpkg -l, remember that ubuntu includes a lot of stuff in the default desktop install
desktop installs generally do
Also
if you really want to get an understanding for what a computer is from the ground up, I recommend starting with either a book called Code: The Hidden Language of Computer Hardware and Software by Charles Petzold
If you want a more interactive approach, there's also Nand2Tetris
Also there's https://nandgame.com/# which is a work-in-progress puzzle game that borrows from Nand2Tetris
An educational puzzle game. Solve a series of tasks where you build increasingly powerful components. Starts with the simplest logical components and ends up with a programmable computer.
After some low-level reading, I'd recommend implementing a Chip-8 emulator
8 bits?
this might be a few months if you're new to programming, and don't do this right away if you've just started learning programming
do some other exercises first
The number of bits isn't important here. Understanding the principles is.
That's not entirely true. Distros can have kernel patches. Debian putting unprivileged user namespaces behind a setting is one that comes to mind. Though maybe you're throwing that under "what options they've made the default"
I don't think maxwell is at the point where they can understand what that means
Anyway, if you just want to do web apps, you don't have to do the really low-level stuff yet depending on what framework you want to use
but it might eventually help you build understanding of other related concepts.
Ubuntu would be fine to start with.
Yeah, I'm being a bit handwavy. But the point I'm driving at is that they're all the same OS, just configured differently (including different patches) and with different applications installed
hi I'm haze and I'm 14 π
Just build something small and reasonable
hi
I will
@cobalt aurora As a small project to get started, you might want to try building a page that fetches small bits of information from a python back end API and displays it somehow. It doesn't need to be fancy.
But you also might want to make text-based games and learn about object oriented programming (classes, inheritance, etc) first.
The python programming language.
ohh ok
This channel is for discussing a family of related operating systems and how to use them with Python.
This isn't a general channel. The off topic and general channels are located elsewhere.
ohh ok thank you π€
But if you've never programmed before and want to learn, Python is a great first language.
where the Unix family of operating systems is basically everything except Windows and DOS π
thank you
#python-discussion for python related topics , #ot0-psvmβs-eternal-disapproval , #ot1-perplexing-regexing , and #ot2-never-nesterβs-nightmare for off topic
π₯° well bye again
But yeah - I agree. There's plenty of real differences between the distros - which ones are important enough to be notified about kernel zero days before they're publicly disclosed, whether their maintainers are competent and trustworthy, their attitudes towards non-free drivers, whether they have a track record of introducing terrible security vulnerabilities... etc
it's just that, for someone who's completely new to Linux, there's a whole lot more similarities than there are differences.
Speaking of which, the whole Canonical debacle where they put some ad in Ubuntu left a bad taste in my mouth, so I don't recommend that distro to people.
I think my overall favorite distro is Debian, though the hardline attitude against non-free drivers feels... dated, I guess.
yeah right
May be it is your lucky day
discord said to me today in Linux
and stopped working, while requested to reinstall itself semi-manually with .deb package
same
uhh
i don't know if this is the right channel
how can i do a command in console like mongod --dbpath "path/...." using py
or any file
if there is a way dm..
or ping
!d subprocess.run
subprocess.run(args, *, stdin=None, input=None, stdout=None, stderr=None, capture_output=False, shell=False, cwd=None, timeout=None, check=False, encoding=None, errors=None, ...)```
Run the command described by *args*. Wait for command to complete, then return a [`CompletedProcess`](https://docs.python.org/3/library/subprocess.html#subprocess.CompletedProcess "subprocess.CompletedProcess") instance.
The arguments shown above are merely the most common ones, described below in [Frequently Used Arguments](https://docs.python.org/3/library/subprocess.html#frequently-used-arguments) (hence the use of keyword-only notation in the abbreviated signature). The full function signature is largely the same as that of the [`Popen`](https://docs.python.org/3/library/subprocess.html#subprocess.Popen "subprocess.Popen") constructor - most of the arguments to this function are passed through to that interface. (*timeout*, *input*, *check*, and *capture\_output* are not.)
Is this what are you asking for?
can u pls give me example
Print ("hello")
You have examples in docs (when you click at subprocess.run header)
>>> subprocess.run(["ls", "-l"]) # doesn't capture output
CompletedProcess(args=['ls', '-l'], returncode=0)
>>> subprocess.run("exit 1", shell=True, check=True)
Traceback (most recent call last):
...
subprocess.CalledProcessError: Command 'exit 1' returned non-zero exit status 1
>>> subprocess.run(["ls", "-l", "/dev/null"], capture_output=True)
CompletedProcess(args=['ls', '-l', '/dev/null'], returncode=0,
stdout=b'crw-rw-rw- 1 root root 1, 3 Jan 23 16:23 /dev/null\n', stderr=b'')
uhh i think that isnt allowed tho in my host i don't want to get banned or something
thanks..
Is there a source where I can compare the major linux distributions according to several factors such as GUI environment and tools? If there is, can someone link it please? I would really appreciate it, thanks in advance.
I'm going off the chat for a bit so I would highly appreciate a reply with a mention in case of assistance. Thanks in advance
what does file_mode=0777, dir_mode=0777 in /etc/fstab mean? full read-write access to a mount point?
@regal trail is this a CIFS filesystem? https://linux.die.net/man/8/mount.cifs
If the server does not support the CIFS Unix extensions this overrides the default file mode.
dir_mode=arg
If the server does not support the CIFS Unix extensions this overrides the default mode for directories.```
mount.cifs mounts a Linux CIFS filesystem. It is usually invoked indirectly by the mount(8) command when using the "-t cifs" option. This command only ...
Under cygwin, do installed utilities replace windows commands entirely, or does cygwin sometimes use the existing windows utility executable somehow?
please help me! I want to create a Unix platform but don't know anything
what do you mean by unix platform?
and what do you mean by create?
???
Do you mean an operating system, or some sort of python project that runs on Unix systems?
If you want to write a Unix-like operating system, it is not a project for a beginner that has never programmed.
This is also not the right server for that in general, but the offtopic channels might be able to help.
If you want to build applications in python with support for running on unix-like operating systems (Linux, macOS, etc), you are in the right channel
thanks for recommending linux mint, I'm enjoying it
that grub script us bash scripting?
Bash Guide for Beginners
- https://www.tldp.org/LDP/Bash-Beginners-Guide/html/index.html
#Advanced Bash-Scripting Guide - https://www.tldp.org/LDP/abs/html/index.html
is*
π welcome
.
Hello , I had a small query about screen sharing in regolith linux , like in google meet, if i want to share one of the windows, it only shows the option of sharing current window (which is browser) , I mean , i know i can just open a terminal in that window and move it to a different tab , but is it possible that google meet recognizes already opened windows in regolith?
Isnt it built on top of Ubuntu? I think you will have better luck solving this issue if you search for Ubuntu related issues with google meet
How do I get over the 4GB file size limit in fat32 in Linux?
there is a limit?
Any server related to LINUX??
Hi, every now and then there's no connection when I run Jupyter notebooks in WSL2. Initially it worked, and then it didn't. Through magic combined with sweat and tears it worked again. And now it doesn't. It may be the firewall, but I fixed that once before. I've altered the config file according to answers on Reddit and SO. However, it won't work, unless I specify the ip. To avoid entering the ip each time, I want to use it directly in the config file. How can I best get the ip with Python? Or is there yet another trick I should try first? I prefer to run on localhost but any host is better than none. I have the same issues with live-server, localhost is unable to connect (unless through Docker). So there's probably an underlying problem I need to deal with, later.
The current solution is ```py
import subprocess
try:
ip = subprocess.getoutput('hostname --all-ip-addresses').strip()
except Exception:
ip = '0.0.0.0'
'''
discord.gg/engineerman is a good server for linux related questions and you can always ask your linux questions here π
there's also distro specific servers
for some reason I can't manage to dual boot kali linux, could someone please assist me?
I've downloaded the ISO file according to the document
Thank you
Very much
I'm a bit stuck with Kali Linux installation for some reason
I'm following the document https://www.kali.org/docs/installation/dual-boot-kali-with-windows/ yet I'm stuck at the part of resizing windows procedure
Installing Kali Linux next to a Windows installation has its benefits. However, you need to exercise caution during the setup process. First, make sure that youβve backed up any important data on your Windows installation. Since youβll be modifying your hard drive, youβll want to store this backup on external media.
I've download the ISO live
I current am using windows 10, and I partitioned my SSD
ok
how did you change your partitions?
KL will change the boot drive to it s grub isntall, and the windows boot disk will now be an option
are you installing kali on your's main drive?
if so then plase do not do that it is awful
kali was not designed for this porpouse. and it is not sutiable to be daily driver
installing kali as main OS must be the new tidepod challenge
if you wanna be cool like a kali user but want daily functionality then please use parrotOS
or you know... debian
@ionic goblet@ionic goblet
Hey, i've written a little tool to graduate my students in python. I now want to make cross platform executables for the other tutors. I've written the tool using pycharm and pyside 6 and everything is running fine inside pycharm. For files i only use the .py file, a .ui file and the module pyside6.
On Ubuntu the, only using the py and ui file with pyside6 installed via pip runs the application from the terminal, but i want to create a onefile executable with pyinstaller. Trying to execute pyinstaller from tells me that pyinstaller is not found, what do i need to add to path to make it work?
Edit: And how do i add an extra Linux interpreter for that project in pycharm?
For my ubuntu vps, how do I create a new user and make it so that I access it through ssh with my RSA key?
how to redirect python program output regardless that it crashed or not?
redirect where?
stdout will always be redirected, it will just stop emitting output after it crashes
python -c 'print("hello"); 0 / 0; print("this wont run")' | sed -n p
this will emit the hello then crash at the 0 / 0
sed will receive the hello on its stdin, and python will emit its error message on stdout, which will end up at your terminal
You can redirect stderr to a fifo with python -c '0/0' 2>mypipe
python -c '0/0' 2>&1 | ... to redirect stderr to stdout
not sure if this is the best place to ask but using ssh how can i move files from my local system to the remote system and vice versa?
Use scp (which just uses ssh internally)
scp some_local_file.txt user@remote:remote_path.txt
and swap the args for remote to local
its basically just like regular cp except you need to prefix the remote user/server
oh sweet, that seems pretty simple. thanks
i assume we can still use -r for directories?
guys
i need help
everytime i run my code it give me black screen
import kivy
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
class childApp(GridLayout):
def init(self,**kwargs):
super(childApp, self).init()
self.cols = 2
self.add_widget(Label(text = 'student Name'))
self.s_name = TextInput()
self.add_widget(self.s_name)
self.add_widget(Label(text='student marks'))
self.s_marks = TextInput( )
self.add_widget(self.s_marks)
self.add_widget(Label(text='student gender'))
self.s_gender = TextInput()
self.add_widget(self.s_gender)
self.press = Button(text = 'click me')
self.press.bind(on_click = self.Click_me)
self.add_widget(self.press)
def Click_me(self, instance):
print("name of student is" +self.s_name.text)
print("mark of student is" +self.s_marks.text)
print("gender of student is"+self.s_gender.text)
print("")
class parentApp(App):
def bulid(self):
return childApp()
if name == "main":
parentApp().run()
...this is the unix channel
How to generate csrf token in django in view it self
Not sure if you still need help, but you need to add your public rsa key to /home/user/.ssh/authorized_keys of the host you want to connect to
And you will ssh with your private key
ssh-keygen -t rsa -b <bit size>
That will generate a key pair
To run my server I need to bind to port 443 for https but I need to run sudo for that
and I feel like that's a bit of a security risk
so I used iptables to redirect this port to a higher port
which I can then use without sudo
but also means other non root programs can use it so that's maybe not great either?
Are you sure? What are you using to do that?
It's always a trade-off but pretty sure its better to have it run as root since then it's not possible to be changed or modified by other users
Since an attacker would have to escalate to higher privileges which is very hard assuming you leave no openings and update your system
I didn't fully understand what you did though
you could use something like uwsgi that lets you drop privilages for the actual server
but still lets you bind on ports <1000
you log as root in any way you can.
lets say your user hypothetical name would be myuser, and your server address 45.45.45.45
adduser myuser to create it
usermod -aG sudo myuser to grant it sudo rights
then disconnect from server
if you don't have ssh key yet
make one with ssh-keygen command on your local PC
and write ssh-copy-id 45.45.45.45 (if your current PC user is not matching user name you login, then you would have to say it explicitely ssh-copy-id myuser@45.45.45.45) in order to copy your ssh key to server
insert password you made during adduser operation, confirm yes if necessary and that's it
try ssh 45.45.45.45, it should work
uh, it was already answered. I did not scroll down to see that
well, nvm then
ssh-copy-id is more comfortable to use though, if you are in Linux
tbh, that sounds like a very extreme solution.
if you want to have good security...
during ssh-keygen operation make sure to make password to your ssh key
and during server side operations... make sure to stay inside your created user
and when you need launching something with sudo rights, request it as sudo your-operation, (do not log as sudo -s to root, stay inside your user)
it is usually secure enough.
full list of workarouns for 80/443 ports is mentioned here
funny enough, one of guys went with iptables solution too
there are some interesting alternatives though
Huh, terminator is cool thing
I'm not sure where I should ask this
But what is the difference between fzf and telescope?
fzf takes a list and allows for fuzzy searching over the list, telescope is the UI for a whole bunch of stuff, including fuzzy searching using fzf
pls help
I am not sure, but I think your Windows' environment variables are messing with your (WS)Linux's environment variables. You might want to remove git from your Windows installation or you might want to edit the WSL configuration to not appending your Windows' path. Still, I'm not sure.
Anyway, I think the error messages are just "warnings". I mean, thegit in your WSL is still working, isn't it?
Has Microsoft installed the winget by default in the latest update?
nope
I already have tried it last year. That's great, but it doesn't compare to the package managers on Linux distributions I think.
agreed
hello i thank u for the help i managed to work it again and i do not know how HAHAHHA
Good job of you!
thanks also ran a problem about gpg
is it necessary to have gpg?
i turn it to false tho
hihi it works now :3
Good for you mate !!!
yeah hehehe
π
Well, I have no idea about cryptography related things such as GPG. But I guess you'll need it in the future if you want to sign a commit. GitHub and GitLab will ask you to setup the GPG key for your account.
You can sign your work locally using GPG or S/MIME. GitHub will verify these signatures so other people will know that your commits come from a trusted source. GitHub will automatically sign commits you make using the GitHub web interface.
From https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification
You can sign your work locally using GPG or S/MIME. GitHub will verify these signatures so other people will know that your commits come from a trusted source. GitHub will automatically sign commits you make using the GitHub web interface.
I'm more concerned about speed, because telescope looks pretty but it seems pretty slow
Sometimes I wanna rip grep for a certain file but I have no idea where it is
so I just go into vim in home then just :Telescope ripgrep
@serene eagle telescope shouldn't be slow though
I wanna rip grep for a certain file
why not just use ripgrep in the terminal?
Sometimes I'm already in nvim
Oh wait
Yeah why don't I
Hmm
I guess I just like how instant fzf is
Hey I did more stupid stuff with my computer!
and now I need help
don't ever do chmod u=rw,g=rw,o=r / by the way
after a while I managed to find the issue
my group got removed from /etc/group due to my stupidity
it's hashing each 4k and then hashing those hashes? 
more efficient than hashing an enormous file?
I see
more memory efficient
if the file fits in memory you don't need to worry about doing this
hey I was big dumb and installed python 3.9.1 from source instead of 3.9.5 on debian 10, what's the best way to upgrade?
use pyenv @dusky iris
https://github.com/pyenv/pyenv
https://github.com/pyenv/pyenv-virtualenv
https://github.com/pyenv/pyenv-installer
learning all these tools is easier than replacing python? π I don't need multiple versions
for me? yeah
i like to upgrade versions
security updates and bugfixes in x.x.0 versions
and i like to mess around with new versions when they come out
also testing for backward compatibility
and generally being less of a hassle than building from source by hand
let your distro's python be a runtime dependency for applications, don't mess with it
the installer is just an installer script. pyenv and pyenv-virtualenv are part of my daily workflow
fair enough, that wasn't too hard. thanks.
π
how can I create a one-click executable file for mac?
I'm on windows and if we double click a python file, it will execute. Is there a way to do that on macOS?
add a shebang #!/usr/bin/env python3 at the top to set the interpreter
and then make it executable via chmod +x file.py
hi guys, what is the best cmd to quickly backup/restore dirs while playing around?
I'm using tar -cvpzf, but finding unpacking paths confusing..
if size is not a problem: cp -r i_will_destroy_this /your-backup-dir
if you want a different place, more advanced stuff, try rsync
would be better as 1 file for scp so probably pure tar; rsync is great for advanced stuff;
my use case would be backing up git repo folder, if I mess up the tree ie.
is there some logic helper to be sure about paths with tar?
if it is a git working space then the proper way to do this is using git stash - https://www.git-scm.com/docs/git-stash
in short:
git stash # will add all your changes into a stash entry
git stash pop # will apply and remove the latest saved stash entry
yeah stash is perfect
which GIT GUI you like in linux?
so far I was able to find few working ones for myself, but wondering if there is better one
git gui? gitkraken
I used so far GitCola (most minimalistic), GitSmart (rich feature, but over rich feature a bit), and trying at the moment GitEye. Actually GitEye looks good
tried GitKraken, it looked to me a bit meh)
I am trying to find the most comfortable one for code reviews of myself
ah, basically git diff?
basically yeah
git diff and git diff --cached
or git add -A -p
and git checkout -p . if necessary
umm, pycharm does that pretty well, have only gried gitkraken, even that does it pretty nicely https://support.gitkraken.com/working-with-commits/diff/
Compare your changes with diffs in GitKraken. Learn about where to access diffs, file blame, and more.
even with syntax coloration. Almost IDE level of code viewing
see the docs link I sent, there are a few "showcase" images/gifs on that
i think that's what you want
it looks like that, yeah.
thanks. I'll consider trying gitkraken again
as far as I remember it has Issue managing as well, which is nice too
yeah
I thought sublime merge was ok, probably a lot better if you're already used to sublime text
If you're looking to browse git history while having IDE functionality then you prob won't find anything better than pycharm
wb literally every other ide
vsc can do that lol
Hi what shud i write in translators part if i choosing ubuntu
yeah sure, what I'm trying to say is that it's probably better to be looking for an IDE with good git tooling rather than a git tool with IDE-like features
I want to implement multiple user types of user authentication with different login and signup pages with django allauth can you explain any strategy to do THIS.
Better suited for #web-development
And you can look into fusionauth
hey guys how can I run my python script as a background process, that not locks teminal usage?
on Ubuntu
for a quick solution you can probably use nohup
for a more sophisticated one you can look into systemd, this seems like a good resource: https://github.com/torfsen/python-systemd-tutorial
auto restart at failure and start at boot time is really improtant
soβ¦use process manager
uhm
I have a project folder which should belong to user and group with the name of companyname (let's call it literally it)
I'm ssh ing to the server with my own username (kenan)
so I (kenan) also want to be able to write to files (which belongs to companyname)
but for that I need to set up the permission system correctly
I also cannot use git fetch or anything due to permissions
so, I thought "since companyname user and group is more powerful, I (kenan) would be member of the company and sudo group
and I gave to companyname group to permission to g+rwx recursively
but still can not do anything.
help, what's wrong?
changing group to current user in current session is not usually reflected until you logout/login again. Also, doesn't the error give you any hint about which files can't read/write?
@distant shore unix groups don't have any notion of "power"
if you run groups you will see what groups your user is a member of
what would that mean? have no "power"?
what do I do for permissions and so on
@distant shore there is no sense in which one group is more powerful than another
either you are a member of a group, or you are not a member of a group
if a directory has owner admin:companyname with permissions drwxrwxr-x, then you (kenan) can write to it if your user is in the group companyname
if your user is not in the group companyname, you cannot write to this directory
as I said, I became member of the owner group, and did sudo chmod -R g+rwd thefolder but no luck
did you log out and log back in?
group membership usually doesn't update unless you log out
i think so, but use the groups command to confirm
groups did not print out companyname. how? like.. what?
ok added again, and restarted it should be ok now
you know what is weird, if I would to say "f*ck it, I'll change permission to 777" even then I would not be able to do anything again. (which I did)
I don't get it. @formal schooner
ok, now it works. I'll kill myself

I use a 4gb ram
can I use 3.9gb as a swap partition..?
oh well..
I would say a good rule of thumb to keep swap as. 2 times the physical memory.
You can always use smaller swap paritition, and it will work well in most normal circumstances, but if you want to keep your system healthy I would follow the 8GB recommendation
[(2 x RAM) + 1 MB] = Swap File Size
this is the general formula i follow
The things I have said, is listed on the community page, here https://help.ubuntu.com/community/SwapFaq
Realistically however you should not need more then 2GB, but that's whats it is prefered upon
I think, keeping it 3.9gb would work tho, I never went over 4gm of swap on my system
It also depends if we are talking about a rpi or a 64Gb server. Or also the type of workloads
well thanks fam...
yeah, i mentioned that
ah, me bad
not sure how it is on windows, but by build do you mean "build from source"?
I'm having trouble with having two different input methods
I've tried using fcitx but it didn't work
I've also tried ibus
I have the option to switch between english and chinese simplified, but regardless of whichever one I pick I still type in english
I have no idea what to do
I wanna just uninstall fcitx and ibus
Completely then reinstall it
Would that be a good idea?
- pip
If you build from source, you can add--with-ensurepip=install, otherwise you can just curl https://bootstrap.pypa.io/get-pip.py and run that with the python version you want it to be installed with.
- documentation
It is installed my defauly, withhelp()
-tcl/tk and IDLE
I am guessingtkis tkinter which doesn't come install so you would need to install it manually with pip, IDLE is not installed by default so you can manually install it bysudo apt-get install idle
- Precompile standard library
Installed by default
- Download debugging symbols
not sure what you mean
basically, there isn't anything like that on unix iirc
no, I don't understand what you mean by that
i get that, but what does it contain/do
IME is hard to configure, Arch Linux Wiki always has good step-by-step instruction
I did follow arch linux wiki
Didn't work
I randomly messed around and got it in 5 seconds
;-;
lol
import signal
import resource
import os
def time_exceeded(signo, frame):
print("Time's up!")
raise SystemExit(1)
def set_max_runtime(seconds):
soft, hard = resource.getrlimit(resource.RLIMIT_CPU)
resource.setrlimit(resource.RLIMIT_CPU, (seconds, hard))
signal.signal = (signal.SIGXCPU, time_exceeded)
if __name__ == '__main__':
set max_runtime(15)
while True:
pass
this piece of code I found in the Python recipes book by Oreilly
it is from an old edition though
I've never seen this library (resource) get used before in Python, is this considered good practice?

https://docs.python.org/3/library/resource.html
I can see this import resource as part of the default Python 3.9 version
so it is not requiring you to install it with pip.
Yeah I can say that this module is safe to use then
Yeah I'm sure it's safe. It is part of the standard library after all
I'm just wondering if it is good practice to use code like that
Sometimes my interpreter stops responding and consumes a lot of resources. Mostly with cpu-bound tasks. I'm way too inexperienced at this. But if I have to guess it seems that adding print statements (io bound) reduces the load
So the issue in question seems avoidable with good programming practice
i wonder if this is distro/kernel specific?
I mean, I had the same issue on win10.
ah, my bad, i kept thinking in the context of #unix
Hi everyone, can u explain me more in depth the pros and cons about VM please ?
Compared to dual boot
Pro you don't have to reboot.
Pro vms can be useful for testing things. You can spin up a vm break it do roll backs and then delete once you are done.
Con Requires more resources
Con getting hardware like gpus working in a vm is more involved than bare metal. You have to do pass through.
Con vms do a have a bit of an overhead.
You can dual boot and uses vms as well.
What are oses are you using and what are you using them for?
I don't understand the "overhead" term, sorry I'm not native
I'm only using windows for my daily life, studying etc
I want to go on Unbuntu to keep coding in a dedicated environment
I ask my self if I should use an external drive to boot as ubuntu or dual boot my pc or using VM in fact
--
Btw thanks for ur reply
I personally run two desktops. One for gaming with Windows and an old ex-lease machine with Ubuntu which I do everything else on. I have a dedicated server with vms that I am using to to dev work on.
I see
I was thinking about using old laptops and convert it into a station, its cheap and could do the job
It is a good way to to it.
If mess one up you don't cause issues with the other.
yeah + it's really cheap to set-up and ubuntu doesn't require a lot
The only problem is the monitor tbh
Are you wanting to use them both at the same time?
mmmmh
yeah u smart
I should set up a hdmi witching thing
is it possible ?
like plug in a device that switches the computer on demand
I share a monitor, keyboard and mouse between them and Ubuntu gets a dedicated monitor.
I use the multiple ports on the monitor and use the menu to switch between them. Made a box with a switch for the keyboard and mouse.(You can buy these fairly cheap.)
May i ask u for links bro ? @scarlet totem
I am in NZ so these won't be as useful https://www.pbtech.co.nz/product/KVMSTT690122/StarTech-SV211KUSB-2-Port-USB-KVM-Switch-VGA-w-Aud
https://www.pbtech.co.nz/product/KVMATN0022/Aten-CS22U-Economy-2-port-KVM-switch-USB-VGA-Cable
That's what I what I would have gotten if I didn't make one.
pbtech.co.nz StarTech SV211KUSB 2-Port USB KVM Switch VGA w/ Audio & Cables 2048x1536 60Hz
pbtech.co.nz Aten CS22U Economy 2-port KVM switch USB &VGA Cable all-in-one a built-in remote port selector One USB console controls two USB computers
Thanks a lot
Hey so if i have a string, "random 5 10"
how do i seperate this into
random, 5, 10
oh wait
wrong channel
"random 5 10".split()
any tip?
need to see your dir structure
each dir has a make file on it
but i wanna do make from the dir below using this make file
$(DIRS):
$(MAKE) -C $@
I'll try
you can change DIRS to OBS
not sure if it makes difference but remove / from dir names
that OBS variable is new to me
can you change it to DIRS? OBS is changing the target
write DIRS like this -
DIRS := ctype \
math \
conv
depends on what makefile in ctype does
don't put \ on last line i.e string
run this in terminal
make -C ctype
can you paste it as code here? I'll make some changes
NAME = libft.a
CC = clang
CFLAGS = -Wall -Wextra -Werror
DIRS := ctype \
math \
conv \
lst \
put \
string
SRC := $(addsuffix *.c, $(DIRS))
INC := include/
OBS := $(SRC:%.c=%.o)
all: $(DIRS)
# $(NAME): $(OBS)
# ar -rcs $(NAME) $(OBS)
$(DIRS):
$(MAKE) -C $@
# make -C ctype/
# make -C math/
# make -C conv/
# make -C lst/
# make -C put/
# make -C string/
clean:
$(RM) $(OBS)
fclean: clean
$(RM) $(NAME)
re: fclean all
.PHONY: all clean fclean re
$(DIRS):
for dir in $(DIRS); do \
$(MAKE) -C $$dir; \
done
you can try this as last resort
is this project present on github? It'll be better If I could clone it and try out myself.
@fringe harbor i kind make what i wanted
NAME = libft.a
CC = clang
CFLAGS = -Wall -Wextra -Werror
INC := include/
DIRS := ctype math conv lst put string
SRC := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.c))
OBS := $(patsubst %.c, %.o, $(SRC))
all: $(NAME)
$(NAME): $(OBS)
ar -rcs $(NAME) $(OBS)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@ -I $(INC)
clean:
$(RM) $(OBS)
fclean: clean
$(RM) $(NAME)
re: fclean all
.PHONY: all clean fclean re
so - I don't know which channel this questions should go in: I have this script running, and it has already opened and read from a file - which is file names for tasks - and then erased the file (that I programmed it todo) ---- Im on linux ---- how hard is it to then read the ram memory of that process and try and read the contents stored in one of the variables I have in the script?
@main olive you can get access to the memory of the process, but parsing it into something useful won't be easy https://stackoverflow.com/a/12980874/2954547
maybe it's possible to use the python c api to cast chunks of this memory space to PyObjects
@formal schooner it turns out, you can use gcore
does wsl support hardware counters
@dapper musk hi
could you explain in what exacly it is diffrent from for example arch?
(for people reading along, we are discussing NixOS, https://nixos.org/ )
Okay so, you know in Arch how you install packages and do system configuration imperatively: you do pacman -S hello? This has a couple of downsides
yes whats diffrent in NixOs?
- Global dependencies (shared libraries and such) are shared, it is kinda difficult to use different versions for different programs
- Newer versions of packages override older versions of packages
- system configuration files just kinda exist on disk
- If a package breaks, there is no trivial way to keep back that package and all its dependencies while allowing the rest of the system to use the most up-to-date version
NixOS attempts (and mostly succeeds) to solve all these problems
oh nice i hated it on all linuxes especialy on rolling realeses
Plus we've got one of the largest and most up-to-date package sets: https://repology.org/graph/map_repo_size_fresh.svg
And I didn't even talk about the hybrid from-source/binary model!
Say you want to change one compile flag or whatever for one program, or add a patch, or whatever
In arch, this would be pretty difficult because all you get is the binary
In NixOS, you are getting a build description and have the option of fetching that from a binary cache, but if you change it, you can trivially build from source instead.
(it is a bit hard to explain, but it works very well in practice)
so it complies program in the background while you are using binary one?
and when it is done it replaces it?
(so on my machine I compile a few packages with -march=native just for shits and giggles, but I also have a few packages with patches from unmerged PRs for example)
No, not exactly. It fetches everything you haven't changed on your end from the binary cache, and anything not in the binary cache is compiled locally.
ah well then it is like -bin on gentoo
Kinda, but automatically, and for every package
(and you could also setup your own binary cache pretty easily so you only have to compile everything on one pc if you have multiple, but I won't get into that)
and what about that?
Say you run a... webserver. The configuration file just lives in /etc/, and if you make changes to it, you have to pull from a backup to restore them. On NixOS, most/all configuration is done in your system configuration file (configuration.nix, but it can easily be split into multiple files if you want), and can be rolled back trivially.
I have only had a non-booting system once in ~4 years of using it as a daily drier, but even then I could just select a previous configuration in the boot menu and leisurely see what the problem was on a working system
so it is like regisry on windows but propably better executed
I guess you could compare it with that, but it is immutable
Every update is like a fresh re-install
(kinda)
(and then I haven't even told you about nix-shell, or nixos tests π )
well i recenty overiten my artix with random nonsense beacouse im idiot so i ill give it a try
well then
Okay, so with nix-shell you can basically temporary use any package without permanently installing it
Kind of like virtualenv
But for everything, not just python
NixOS tests are also really cool; we use our declarative system configuration model to define (a bunch of) virtual machines to check certain functionality works before pushing it out to users
So for example the following test: https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/bittorrent.nix
Defines 4 vms communicating in 2 vlans, sets up a bittorrent tracker and 2 clients running Transmission, and verifies they can send back and forth files
In < 200 LOC
so it basicly test if it runs properly
well then nice feature
it does run on top of existing os?
Server invite: https://discord.com/invite/RbvHtGa
thanks, I wanted to post it but it got removed :(
Yes, you can install Nix (the package manager) on an existing OS
And you get a lot of the benefits, but not all
We get a lot of spammers, so we we have a delete-unless-on-our-allowlist system (partnered/verified communities excluded). I've added it to the allowlist now.
What comes closer to unix/linux experience on windows, GitBash, Cygwin, or something else?
Like Gitbash doesnt have man, but Cygwin does
Probably cygwin
I don't use it though.
I just use git bash and a package manager like scoop. Sometimes msys2, but I rarely need to build stuff, which is the only thing I need msys2 for.
Of course there is WSL but that's probably not what you meant by your question.
Yeah not WSL2, I have used it before, but didnt like the vm experience.
For dual boot?
I have ubuntu on my hhd. Bu I was looking for linux like terminal experience on windows. So I dont have to reboot into ubuntu
And Ubuntu on my desktop is just finicky, so I try to stay on windows more.
You didn't have to delete your question. I meant that I assumed you were suggesting to dual boot because otherwise your question would seem a bit out of the blue.
what hahahaha
Uh ok, they're just overreacting
long ago when i used windows i used scoop -- are you aware?
I hadnt, but just looked it up.
Windows should bring a native linux kernel to new windows os.
Look at all these distros on Microsoft Store
Hey there!
Can someone explain me what is the difference between kernal and operating system?
@restive mural a kernel is typically the low-level core of the operating system that interacts with hardware: managing memory, sending programs to the cpu to execute, interacting with network adapters, etc. an "operating system" is not a well-defined term, but i think generally it's understood to mean "kernel + basic programs that the user can interact with". many would argue that "linux" itself isn't an operating system, but that debian, fedora, arch, etc. are operating systems.
that is - a typical "linux distro" is an operating system that uses the linux kernel, and usually depends heavily on GNU programs and libraries
the FSF/GNU people like to claim that GNU is itself an operating system, which theoretically is true, but there's no standalone "GNU OS" -- GNU is more like an "operating system toolkit" or "operating system platform", a collection of core tools that you can use to build an OS
i suppose GuixSD is a "pure" GNU OS
GNU even has its own kernel ("Hurd") but it's still basically a research project after 30 years
What the link between unix and linux?
the design of linux is based heavily on unix
hence linux is considered "unix-like" or a member of the "unix family"
Is windows "unix-like" operating system too?
no
it uses a completely different kernel and implements completely different functionality
Okay!
macos however internally still uses a kernel (called "darwin") that is in the bsd family, and could still be considered unix-like
@formal schooner Thanks for you clarification! It helped me.
From what I remember when you do man man or something else on mac, it would show you BSD in the manual.
yes, lots of the man pages say "BSD" in them
macOS is a platform built on top of the operating system darwin, which is in turn built on top of the kernel XNU, not to be confused with Xenu the galactic dictator fabled in scientology
is there a way to run python2.7 inside venv ? what I normally do is python3 -m venv .venv which will enable python3 inside venv. I just need to have only python2.7 in there ... is this possible ?
hope I hit the right channel with this question ..
... seems like this is doable with virtualenv
I think you could say something like python2.7 -m venv .venv
It's -m virtualenv instead for Python 2, and you'll need the virtualenv pip package installed.
it seems firefox stores a lot of things
!rule 9
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
Please don't send chainmail on this server.
Silly question
Why my ubuntu can't launch two video processes at the same time
I can't watch Youtube and play Minecraft at the same time for some reason
Youtube freezes while it's active and continues only after I disable the game
doesn't seem to be the case for me hmm
anyone seen any scripts, aliases, functions, that cycle thru pushd +0 using key bindings?
something like ctrl-uparrow rotates to the right and ctrl-downarrow rotates tho the left enter selects teh directory and cds to it
Hello guys I will sell my computer and I want to reset it, but I don't find out how I can do. The OS is KDE NEON
@main olive That doesn't seem related to Python development.
sorry i don't know where to ask, it so urgent.
!ot Try an off-topic channel, this channel is specificially for "Tooling, setup and configuration related to Python development"
Off-topic channels
There are three off-topic channels:
β’ #ot0-psvmβs-eternal-disapproval
β’ #ot1-perplexing-regexing
β’ #ot2-never-nesterβs-nightmare
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
well OS is linux not KDE neon is it
KDE neon is just distro name
and for those on linux, do you use python that comes with the distro or some other python package manager (e.g. conda, mamba)?
I tend to use a pyenv (https://pyenv.run) environment for general stuff that isn't specific to any one project
For project-specific things I believe pipenv / poetry will use pyenv to make one for you
pyenv for software dev, conda/mamba for data stuff
a lot of people would argue (and i generally agree with them) that a "linux distro" is typically its own OS, and that linux itself does not constitute a complete OS
that said, GNU is also not an OS, i call it an "OS toolkit" - lots of useful software that you could put together into an OS
i think it's perfectly reasonable to call KDE an "OS"
I think that may cause some confusion. IMO call it what it is, a desktop environment.
sorry, you're right: KDE is definitely a DE and only a DE. KDE Neon is an OS.
Agreed, distros themselves vary enough in coreutils and other software than accompanies the kernel that I think it's fair to consider them distinct OSes
There are plenty of distros that don't involve GNU at all, and might have completely different init systems. Alpine and Ubuntu are pretty distinct in that respect
I think in most cases though when someone refers to "Linux" as an OS they're implicitly saying "Linux, GNU, and some other stuff", which nowadays isn't really a fair assumption to make
Here's an interesting question: should package manager / choice of software repos be considered a distinguishing feature of OSes? As far as I can tell that's the only difference between KDE Neon and Ubuntu LTS
I suppose if you're comparing these with Windows or MacOS I should be more generic - "OS-provided means of updating software" would cover stuff like Windows Update
package repo source is probably more important than package manager as such
as in: what packages are available and who is responsible for them
but the package manager does tend to be "everywhere" in the system so it matters too
hey
im looking for a discord server for help with BASH - has anyone got any recommendations?
you can probably ask here, there are plenty of experienced bash users here
Hey, I have an issue with my Python installation on wsl2. virtualenvfor some reason isnβt the right installation when I try to install poetry
Can anybody install Poetry on Ubuntu 20.08? I tried with the following link:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
And I get the following error:
Traceback (most recent call last):
File "<stdin>", line 831, in <module>
File "<stdin>", line 827, in main
File "<stdin>", line 440, in run
File "<stdin>", line 462, in install
File "<stdin>", line 528, in make_env
File "/tmp/tmpflx7uq1q/virtualenv/run/__init__.py", line 30, in cli_run
File "/tmp/tmpflx7uq1q/virtualenv/run/__init__.py", line 48, in session_via_cli
File "/tmp/tmpflx7uq1q/virtualenv/run/__init__.py", line 75, in build_parser
File "/tmp/tmpflx7uq1q/virtualenv/run/plugin/seeders.py", line 8, in __init__
File "/tmp/tmpflx7uq1q/virtualenv/run/plugin/base.py", line 39, in options
File "/tmp/tmpflx7uq1q/virtualenv/run/plugin/base.py", line 18, in entry_points_for
File "/tmp/tmpflx7uq1q/virtualenv/run/plugin/base.py", line 18, in <genexpr>
File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'virtualenv.seed.via_app_data'
For some reason this module is installed with usr/bin/python3 but it doesnβt detect it?
ok nvm apparently poetry installs a new virtualenv
Nevermind I'll just stick with the old poetry install
I'll wait for their bugfixes just in case
poetry will use your currently-active venv if you already have one active when you run poetry commands
i wish there was a way to explicitly control this, maybe there is in newer versions
You have corrupted cache I think, try
sudo dpkg --remove --force-remove-reinstreq libc-bin
sudo dpkg --purge libc-bin
sudo apt install --reinstall libc-bin
``` Before that you can move libc-bin to tmp so that if that doesn't work, you can move it back it
alr
My respect for Python went ππππππ
Such an old language.
And still they make a channel for it.
Great job Python!
I think the Unix owner is happy in Heaven watching this.
Python is pretty versatile and I guess clean syntax also helps.
I like the fact that gitbash on windows supports grepand time
What do you mean by unix time, like Epoch Time?
date +%s to get epoch time in a shell, or time.time() to get it in Python
anyone here familiar with gcore?
Just wondering how it works. We have a workaround at work when some apps hang they run gcore to create a dump and then they unhang. Just curious as to why that would be
Guys what is a file system??? please if you can give an intuitive example!
when I run apt-cache pkgnames it will show all packages waiting for being installed?
Is date a system call in this case?
No, that's not what a syscall is.
ok
Problem
Let's say that I have a private pypi repository hosted on a closed network that has one package that I need to install via pip.
And all the other package dependencies are on pypi.org. The closed network only has access to internal ressources (no pypi.org).
Right now I am reaching this closed network on one system and then on my system where I get work done I route the specific domains that I need to reach on the closed network via an SSH-tunnel and proxy.pac in Firefox (SOCKS5 proxy). This works fine for Firefox, but what about the commandline? Normally I would just use proxychains or something similiar, but when doing pip install I need access to both "at the same time".
Possible solutions
I could setup some kind of DNS server that would route the different domains associated with the closed network through the system that has access to that, and everything else via a public DNS. However I have never dabbled with DNSMasq or w/e you would use for this. Any hints?
I got gcc through MinGW and now gcc is accessible in Gitbash.
I also have Cygwin and it shows man. But I dont understand why Gitbash doesnt show man. Isnt everything that's in Cygwin coming from MinGW?
So shouldnt gitbash also show man then?
Should the following work as is in a terminal?:
base64 decode -d b3BlbmRz
You'll want to use a heredoc base64 -d <<< b3BlbmRz or pipe echo b3BlbmRz | base64 -d
-d is synonymous with --decode so you could use that too
im trying to install pycharm on arch and when i open it it becomes like this
i am on dwm, i tried it on kde and it works fine
might be the initial pop-up being forced into a tile that's causing this
i've had similar issues with i3
but not on XFCE
export _JAVA_AWT_WM_NONREPARENTING=1
i did this and iβm still getting the same problem
how did u fix it
I use 
i try to update system and update my python version but output of my command is:
The repository is not updated and the previous index files will be used. GPG error: http://kali.download/kali kali-rolling InRelease: The following signatures were invalid
wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add i found this on forum but output say you needd install gnupg but i cant install any package with both apt and apt-get :|
You could try installing gnupg from a deb. https://packages.debian.org/buster/gnupg2
I believe it supports ls too - which is awesome
i moved to XFCE
and this addresses the question how?
maybe voice?
first of all you need to check your PATH. if you enter echo $PATH it should show you
/usr/bin/python
right, and what was your method of installing python 3.9?
Python is an object-oriented, high-level programming language. It is an open source with a large community. Python is used as key languages among the top tech companies like Google. The Python 3.9 stable version has been released with several improvements and security updates. It included multiple new modules, improved existing modules and many ...
this
are you on debian 9?
it could just be a matter of having to restart your shell
how?
i use PuTTY
i'm not familiar with that, are you not able to use the default bash that comes with debian?
ok, ya zhdu
Do you know how i can check status of it on my server Minecraft
?
I miss-read, thought the reply about "how I got it to work" was for me π
Hi guys! So i recently created this login program and i need some help
i need help in this
if age < 13 than i don't want any people to enter my website
Suggestion: put things inside functions and use a main() function for the whole program. For example ```python
def check_age_above_13():
# get and check age here.
# return True is age >= 13.
# return False otherwise.
def main():
if not check_age_above_13():
return
# now the rest of the stuff here
# make an account, login etc.
finally, call the main function when the script runs.
if name == 'main':
main()
i am just a begginer
== is for value
@kindred trench Per Rule 6, your invite link has been removed. If you believe this was a mistake, please let staff know!
Our server rules can be found here: https://pythondiscord.com/pages/rules
Hello, I was trying to type in something into an variable, but when I do that, the python script crashes
show line 1
from sense_hat import SenseHat
show line where u define "A"
messageText = input("Text: ")
nvm
And this isn't the right place for such questions, this is for unix specific questions, see the channel topic
bro me too
yeah you should do this conditioon too
and he is just abeginner so leave him okay
he has a much higher chance of getting help in places designed to help with those problems instead of here
okay but i said clearly he was a beginner
but yeah he has must chance in help channel
How does he being a begginer allow him to ask in unrelated channels
I remember seeing all rules in one of discord servers generalized into one rule
"Dont being a dick"
It would be more helpful to point him to the right channel where he gets better chances to get help
Instead of just saying, hi is not allowed to be here.
I'd suggest not leaking your IRL name on discord, unless that's fine with you of course!

@main olive
Try
if age < 13:
print("Sorry, minimum age is 13")
exit()
Also if you copy and paste this code you may want to change the indent to a tab
do general questions regarding shell belong here?
Anyone know how to learn grep? Any good tutorials
First I would point out that you should look into learning ripgrep (https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md) instead of grep. Soon after you start using grep, you will get frustrated when you try to figure out how to search a directory hierarchy. ripgrep makes that easy. There are two parts to learning grep. The tool itself, and regular expressions. The tool itself is not that difficult, but regexps have a steep learning curve. I can suggest two starting points. https://regexone.com and https://docs.python.org/3/howto/regex.html
Is there a way to config my .vimrc so that lines are colored based on their prefix? For example, if a line starts with # make it blue, if it starts with ## make it red, ### makes it green etc
looks a bit like markdown syntax highlighting, look into overriding it
@lavish storm thanks I'll look into that
This is actually exactly what I was looking for. Thank you!
https://github.com/gabrielelana/vim-markdown this may also be useful for you :)
Is there a way w/ vim to take a big block of text and split it into 80 char lines?
or any amount of characters to be honest
As long as I can shrink these huge text blocks into managable lines I'll be happy
Finally found a thread that answers my question π
Guys will this find unique phone numbers using grep?
grep -R \b\d{3}-\d{3}-\d{4}\b | uniq *.log
no because in my country we go 04XX-XXX-XXX
I'm writing a program in which there's a string that stores a path to a file in type(str). I need help in replacing all occurance of '/' with '\ /' in a string...
I've tried all basic string functions but nothing happens, can anyone help me out?
like using shell?
or is this an off-topic question that should be asked else where?
Yes, it's like am trying to make a framework on python but using shell commands to do tasks... Kind of a dumb homeworkπ€¦
I hope it's not offtopic...
I found it thou, thanks hehe
ah no worries
trying to use snekbox without a docker rn, but i'm not sure how cgroups work exactly?
i'm getting permission denied for creating a pid under /sys/fs/cgroups/pids/..., would it be safe to allow this to happen without sudo?
like if i changed owner permissions or something
https://github.com/python-discord/snekbox/blob/main/snekbox/nsjail.py
PermissionError: [Errno 13] Permission denied: '/sys/fs/cgroup/pids/snekbox-218fd4be-2f32-49d3-90c2-b38fa0891f39' specifically is the error i'm getting, for line 86
You can't. cgroups have to be created by root.
Though maybe if you own the parent, then it'll let you create child cgroups in it?
You can try that by creating your own groups and setting them as the mounts in the config
hm, what if i did something like make a pids/snekbox that's owned by user and then put the uuid actual pid as a folder under that?
That's exactly what I meant
Well, not exactly
The part about the UUID is wrong
The UUID is random every time
So you have to set the mounts in the config instead, like I said
ah, so cgroup_mem_amount would be /sys/fs/cgroup/memory/snekbox instead and things like that?
Yeah
I have a basic git command to show recent git commits. When I run it, it outputs the branch names. But when I store the results it for some reason stores much more than the branch names?
$ git branch --sort=-committerdate
feature/branch_one
* feature/branch_two
master
# Store the results
BRANCHES="$(git branch --sort=-committerdate)"
# Print the results
echo $BRANCHES
feature/branch_one __init__.py __pycache__ master
Why does it add all those files together with the branches when storing the results into a variable?
Because it's expanding the string
You didn't quote it when you passed it to echo
So the asterisk in the output gets interpreted as selecting everything in the cwd
@warped nimbus thanks that solves the branches issue. however, my script is still giving me trouble.
git_checker() {
input="Enter a number: ";
select branch in "$(git branch --sort=-committerdate)";
do
echo "Checking out: $branch";
break;
done;
}
The output is as follows:
$ git_checker
1) feature/branch_one
* feature/branch_two
master
Enter a number:
I would expect the output to be:
- feature/branch_one
- feature/branch_two
- master
maybe? π
Maybe it doesn't work with a newline-delimited input?
not sure. because even if I pipe it and convert the new lines into a spaces it still does not work
I'm looking for a light-weight Linux distro.
What are some distros that people would recommend?
Or is this channel just for Unix programming?
I will be using Google Chrome, Firefox with couple of tabs and vscode
I currently have Ubuntu, but I can feel that it's slow
there is lubuntu
how comfortable are you with linux in general?
I am comfortable doing update and installing packages through cli
Some beginner friendly ones are Fedora 34, LinuxMint and PopOS, if you want a bit more control over your system (with a bit more difficulty) then I recommend Manjaro or other arch based distros
PopOS will be the easiest transition since it's Ubuntu derived (just without snap)
Ok I'll look into them
Have you used Xubuntu? If you have which one would you recommend between the two?
Ok came across this:
https://youtu.be/CFi_ROvv5PM
In this video, we talked about the best lightweight Linux distros for your old laptops and desktops.
#BestLightweightLinuxDistros
#MXLinux
#LinuxLite
#Lubuntu
#lightweight
#lightweightdistroin2021
#OldLaptops
#LowSpec
lubuntu is based of lxqt witch is faster than xfce(xubuntu) but lxqt is very poor IMO desktop enviroment so if you dont want move outside ubuntu relam you should choose xubuntu if you computer would handle good enought if not then lubuntu.
I also had Lubuntu at one point and it actually worked reasonably fast, so I'm installing Lubuntu right now
I think it would be better to find distributive which was based on 20.04 though
because 20.04 has already in built 3.8 python. it just makes sure that you aren't using super old one for sure
you can install newer version of python even to old distros...
but..you know... this is not the first thing you would need to install
Like Lubuntu 20.04?
well, yeah, if it exists, it would be better
20.04 LTS is a long term support, the most stable last ubuntu version
a lot of guides for the last soft have instructions for this version
Yeah, Lubuntu 20.04 is available and based on Ubuntu 20.04 if I'm not mistaken.
yup.
checked it too.
that would be best match for comfortable work
and having less pain with any installation
Lubuntu provided their soft life cycle too
the life of short regular releases smaller than one year for a reason)
What's the benefit of short life cycle?
I think I had 18.04 before because I didn't want to upgrade the OS after a year or so.
small version like 19, 21 and e.t.c. have their short life cicle because they are basically in development
early development release
to see and try new features
sometimes it is cool, since it has the last available libraries
inbuilt it into
like last python version
Oh ok
Which option do I choose so I can completely remove Ubuntu?
Which one do I choose:
Replaces a partition
Erase disk
Erase disk
I did that previously and I think wiped off the entire OS without installing the new one. Maybe, I didnt have the wifi on, so that might not have installed Lubuntu fully.
It installed the OS but now I get this boot menu and no matter what option I choose it will bring back this same menu again
hello, can somebody explain me what does bash line
exec "${pants_dir}/bin/python" "${pants_dir}/bin/pants" "$@"
mean?
exec replaces curect proces with procces invoked by command that you provide it so with ${pants_dir}/bin/python.
${pants_dir} would be replaced with value of pants_dir varabe.
next ones are just arguments.
$@ means all posional arguments so for bash function
for example invoked by function 1 idk 3 $1 would be 1 $2 idk and $@ 1 idk 3
thanks
hey guys
is there any chance someone can assist me in making a super basic makefile?
to compile a GLUT project.
gay
i've never used GLUT but maybe i can help with the makefile
Any reason why you are just randomly saying gay?
awesome man
so, pretty much, here's what my bash command looks like
g++ filename.cc -lGL -lGLUT -o filename
and, i've got this one header file
glut.h located at usr/include/GL/glut.h
so like, i wanna understand how to make a scalable makefile in the sense that
i can just add in header files or whatever when i wanna
and stuff
@stark sinew not sure about C++ conventions, i don't know how C++ works really. but maybe you want to take a look at one of the C makefiles i've used as a starting point https://git.sr.ht/~wintershadows/xftwidth/tree/master/item/Makefile
heh i found a mistake, line 46 should be
$(CC) $(PIPE) $(CFLAGS) $(CFLAGS_DEBUG) -o $@ $< $(LDFLAGS)
but otherwise i think it's right
thanks
you can also set this up to compile the intermediate .o files, i believe this is common to reduce compilation times in big projects
https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html#Makefile-Basics
https://www.gnu.org/software/make/manual/make.html#Variables-Simplify
it also has a lot of built-in "implicit rules" that basically do the right thing for you https://www.gnu.org/software/make/manual/make.html#Using-Implicit
Makefile Basics (GNU Coding Standards)
GNU make


