#unix

1 messages Β· Page 53 of 1

rose ibex
#

yes

#

ill try it later

opaque ginkgo
#

mint is an ubuntu derivative so it should work

charred saddle
#

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?

summer trail
#

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

safe stirrup
#

How consistent are default utility command flags across the BSDs?

summer trail
#

if you limit yourself to only stuff that's in POSIX, extremely consistent

#

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...

safe stirrup
summer trail
#

probing for what?

safe stirrup
#

what's actually installed on a system

summer trail
#

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

safe stirrup
#

network ones

#

i'm still deciding scope tbh

summer trail
#

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...

charred saddle
#

@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)

summer trail
#

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

cobalt aurora
#

I don't understand, so every user can modify any file

#

if it's involved in some running process

summer trail
#

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

cobalt aurora
#

got it

shy yokeBOT
#

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:

https://paste.pythondiscord.com

cobalt aurora
#

"""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
"""

charred saddle
#

@summer trail , I knew that, but I never actively thought about it's implications...

#

so, linux security is a joke

cobalt aurora
#

I just broke the requests module

summer trail
#

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

charred saddle
#

it clearly says you have a break outside the loop

summer trail
#

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

cobalt aurora
#

yes, but I add that break for I dont know what reaason

charred saddle
summer trail
#

yep

charred saddle
#
loop1:
  loop2:
    some statements
    break
  after break you come here
summer trail
#

looks like that's in six.py, which is library code, though.

cobalt aurora
#

wdym

summer trail
#
  File "/usr/lib/python3/dist-packages/six.py", line 99
    break 
    ^
SyntaxError: 'break' outside loop
charred saddle
#

lol, @cobalt aurora are you messing with the library code?

summer trail
#

that says that the place where the syntax error occurs is inside six.py, from the python3-six package

#

which seems... wrong...

cobalt aurora
#

how much wrong?

charred saddle
#

syntactic error wrong

#

is this a bug in the library?

summer trail
#

probably not - six is one of the most heavily used Python libraries

cobalt aurora
#

no, I just modify yesterday because of the comments

#

just rude

summer trail
#

well that's definitely not the right thing to do.

charred saddle
#

oh, I see

summer trail
#

I'd just try to sudo apt --reinstall install python3-six to reinstall that package.

charred saddle
#

just reinstall it

summer trail
#

assuming you're on Debian or Ubuntu - looks like you are to me.

cobalt aurora
#

maybe reinstall ubuntu?

summer trail
#

nah, don't do that.

charred saddle
#

@cobalt aurora, are you new to python or programming or are you messing with us rn?

summer trail
#

the command I pasted will reinstall just the one package you messed with.

cobalt aurora
#

new to programming

#

and I'm start learning about UNIX

#

the damage already arrived

charred saddle
#

oh, in that case, start with a good python tutorial or free course
lemme think of some good free ones...

summer trail
#

sudo apt --reinstall install python3-six will fix the damage you caused

#

as long as that's the only library you edited.

cobalt aurora
#

and if I want to install a minimal version of ubuntu

#

since that the there so much software in default installation

safe stirrup
#

ubuntu isn't very minimal, even in a server installation

cobalt aurora
#

and as you said it is a security problem

cobalt aurora
safe stirrup
#

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

charred saddle
#

@cobalt aurora, don't try arch yet

safe stirrup
#

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

charred saddle
#

get some feel for some beginner friendly distributions and then if you feel like it, explore others

safe stirrup
#

@cobalt aurora how are you using linux btw? in a VM, or on bare metal?

cobalt aurora
#

both I guess

safe stirrup
#

also are you using it from the cli, or in a graphical environment?

cobalt aurora
#

gui

safe stirrup
#

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.

summer trail
# cobalt aurora and as you said it is a security problem

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

safe stirrup
#

@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

charred saddle
safe stirrup
#

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.

cobalt aurora
#

like, maybe is not weak in security

#

just overshared

safe stirrup
#

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?

cobalt aurora
#

web-apps

summer trail
# cobalt aurora just overshared

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.

cobalt aurora
#

but very interested in how OS works

safe stirrup
#

Ubuntu or Mint are fine for you to start on.

#

You can virtualize other OSes too

charred saddle
#

@cobalt aurora, please learn basic programming thoroughly before jumping into web-apps (you'll thank me later)

charred saddle
#

there's ton of free courses out there that teach you OSes

safe stirrup
cobalt aurora
#

web-apps I mean

safe stirrup
#

basic programming skills in general will be important

cobalt aurora
#

acess the web pages for research

safe stirrup
#

and I think that for web apps and python, learning some of the low level concepts actually make understanding things like async easier

safe stirrup
cobalt aurora
#

web scrapping

safe stirrup
#

oh

charred saddle
#

@cobalt aurora, harvard university has this amazing course called CS50

safe stirrup
#

pretty much any linux distro will be fine for that

charred saddle
#

check it out

safe stirrup
#

ubuntu will have the most documentation for it though

charred saddle
#

it really great and the course is completely free

cobalt aurora
#

yes, just for curiosity

charred saddle
#

they teach c and python and web apps (basics)

cobalt aurora
#

there is some software that

#

can`t be done in ubuntu, mint and so on

safe stirrup
#

what do you mean by that?

cobalt aurora
#

building a more complex program

safe stirrup
#

I think the way you phrased that indicates you're misunderstanding something

#

ah, yeah

#

well

#

that might not quite be true

summer trail
#

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

safe stirrup
#

complex software is possible on almost all modern OSes, but doing things in certain ways might be harder.

summer trail
#

and which of those packages are installed by default, I suppose.

safe stirrup
#

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

cobalt aurora
#

apt-cache pkgnames show the most absurd packages

safe stirrup
#

there are a few distros that do something really different philosophically, but those are rare

cobalt aurora
#

the I dont remember downloading

safe stirrup
#

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

#

After some low-level reading, I'd recommend implementing a Chip-8 emulator

cobalt aurora
#

8 bits?

safe stirrup
#

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.

warped nimbus
safe stirrup
#

I don't think maxwell is at the point where they can understand what that means

safe stirrup
# cobalt aurora 8 bits?

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.

summer trail
main olive
#

hi I'm haze and I'm 14 πŸ™‚

safe stirrup
#

Just build something small and reasonable

warped nimbus
#

Fair enough, i didn't know the entire context of the discussion.

#

Hi haze

main olive
cobalt aurora
#

I will

safe stirrup
#

@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.

main olive
#

so what is this server about ?

#

my guy friend told me to join it

safe stirrup
#

The python programming language.

main olive
#

ohh ok

safe stirrup
#

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.

main olive
#

ohh ok thank you πŸ€—

safe stirrup
#

But if you've never programmed before and want to learn, Python is a great first language.

summer trail
#

where the Unix family of operating systems is basically everything except Windows and DOS πŸ˜„

main olive
#

oh

#

uhh I'm back

#

where is general chat

summer trail
main olive
#

thank you

safe stirrup
main olive
summer trail
#

it's just that, for someone who's completely new to Linux, there's a whole lot more similarities than there are differences.

warped nimbus
#

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.

summer trail
#

I think my overall favorite distro is Debian, though the hardline attitude against non-free drivers feels... dated, I guess.

frigid solar
#

yeah right

wise forge
#

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

frigid solar
#

Yeah that's how discord does updates

#

even I got it today

rose ibex
#

same

hidden sail
#

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

shy yokeBOT
#
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.)
amber garnet
#

Is this what are you asking for?

hidden sail
#

can u pls give me example

rapid bane
#

Print ("hello")

amber garnet
# hidden sail can u pls give me example

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'')
hidden sail
#

uhh i think that isnt allowed tho in my host i don't want to get banned or something

#

thanks..

light blaze
#

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

regal trail
#

what does file_mode=0777, dir_mode=0777 in /etc/fstab mean? full read-write access to a mount point?

formal schooner
#

@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.```
safe stirrup
#

Under cygwin, do installed utilities replace windows commands entirely, or does cygwin sometimes use the existing windows utility executable somehow?

sharp oxide
#

please help me! I want to create a Unix platform but don't know anything

safe stirrup
#

and what do you mean by create?

sharp oxide
#

???

safe stirrup
#

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

spice gulch
#

thanks for recommending linux mint, I'm enjoying it

remote rivet
#

what do you mean

#

bash scripts are just normal commands

spice gulch
#

that grub script us bash scripting?

frigid solar
spice gulch
#

is*

remote rivet
#

echo Hello, World!

#

i have aids btw

frigid solar
#

πŸ™‚ welcome

main olive
#

.

tender plinth
#

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?

keen sequoia
south arrow
#

How do I get over the 4GB file size limit in fat32 in Linux?

open kernel
#

um... reformat to something not fat32?

#

split into smaller files

spice gulch
#

there is a limit?

fresh saddle
#

Yeah, due to the 32 bits pointer size

#

There’s no way around it

wild plover
#

Any server related to LINUX??

shrewd thicket
#

Literally any server related to programming?

upbeat wing
#

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'

real kernel
#

'''

frigid solar
lavish storm
#

there's also distro specific servers

light blaze
#

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

light blaze
#

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

#

I've download the ISO live

#

I current am using windows 10, and I partitioned my SSD

small tendon
#

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

dapper musk
#

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

lavish storm
#

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

dusky drum
#

@ionic goblet@ionic goblet

gloomy lava
#

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?

shrewd thicket
#

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?

dapper musk
#

how to redirect python program output regardless that it crashed or not?

shrewd thicket
#

redirect where?

dapper musk
#

pipe

#

to other program

#

sed in this case

formal schooner
#
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

dapper musk
#

ik about it

#

but i need also

#

error to be redirected

alpine sigil
#

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

dapper musk
#

thank you

#

it worked

hexed verge
#

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?

opaque ginkgo
#

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

hexed verge
#

oh sweet, that seems pretty simple. thanks

#

i assume we can still use -r for directories?

green iron
#

Whenever i shutdown my ubuntu this appears. Whats does it mean

untold egret
#

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()

hexed verge
#

...this is the unix channel

rapid robin
#

How to generate csrf token in django in view it self

tranquil hamlet
#

And you will ssh with your private key

#
ssh-keygen -t rsa -b <bit size>
#

That will generate a key pair

shrewd thicket
#

thanks

#

I figured it out

#

did exactly what you suggested

shrewd thicket
#

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?

tranquil hamlet
#

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

opaque ginkgo
#

you could use something like uwsgi that lets you drop privilages for the actual server

#

but still lets you bind on ports <1000

wise forge
# shrewd thicket For my ubuntu vps, how do I create a new user and make it so that I access it th...

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

wise forge
#

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

wise forge
#

Huh, terminator is cool thing

serene eagle
#

I'm not sure where I should ask this

#

But what is the difference between fzf and telescope?

robust cave
#

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

main olive
#

pls help

rugged swift
#

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?

main olive
#

yes it is still working but not pushing tho

#

oh may gahd

#

so stress :<

main olive
#

Microsoft finally did something right...

#

This thing changed my life forever.

rugged swift
#

Has Microsoft installed the winget by default in the latest update?

main olive
#

nope

rugged swift
#

I already have tried it last year. That's great, but it doesn't compare to the package managers on Linux distributions I think.

main olive
#

agreed

#

hello i thank u for the help i managed to work it again and i do not know how HAHAHHA

rugged swift
#

Good job of you!

main olive
#

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

#

πŸ‘

rugged swift
#

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

serene eagle
#

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

robust cave
#

@serene eagle telescope shouldn't be slow though

#

I wanna rip grep for a certain file
why not just use ripgrep in the terminal?

serene eagle
#

Oh wait

#

Yeah why don't I

#

Hmm

serene eagle
keen shoal
#

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

keen shoal
#

after a while I managed to find the issue

#

my group got removed from /etc/group due to my stupidity

shrewd thicket
#

This is from a code snippet I found

#

why read in chunks, and not at once?

open kernel
#

it's hashing each 4k and then hashing those hashes? lemon_raised_eyebrow

#

more efficient than hashing an enormous file?

shrewd thicket
#

I see

formal schooner
#

more memory efficient

#

if the file fits in memory you don't need to worry about doing this

dusky iris
#

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?

formal schooner
#

use pyenv @dusky iris

dusky iris
#

learning all these tools is easier than replacing python? πŸ˜† I don't need multiple versions

formal schooner
#

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

dusky iris
#

fair enough, that wasn't too hard. thanks.

formal schooner
#

πŸ‘

quasi warren
#

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?

opaque ginkgo
#

add a shebang #!/usr/bin/env python3 at the top to set the interpreter

#

and then make it executable via chmod +x file.py

vast tulip
#

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..

prime magnet
#

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

vast tulip
prime magnet
#

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

wise forge
#

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

frigid solar
#

git gui? gitkraken

wise forge
#

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

frigid solar
#

for what use cases do you want a GUI?

#

code reviews, imo the github UI is the best

wise forge
#

I mean

#

I want to check my own code before I push it

#

in a most comfortable way

frigid solar
#

ah, basically git diff?

wise forge
#

basically yeah
git diff and git diff --cached

#

or git add -A -p

#

and git checkout -p . if necessary

frigid solar
wise forge
#

even with syntax coloration. Almost IDE level of code viewing

frigid solar
#

see the docs link I sent, there are a few "showcase" images/gifs on that

#

i think that's what you want

wise forge
#

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

frigid solar
#

yeah

sharp cove
#

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

opaque ginkgo
#

wb literally every other ide

remote merlin
#

Hi what shud i write in translators part if i choosing ubuntu

sharp cove
# burnt flax vsc can do that lol

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

rapid robin
#

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.

frigid solar
#

And you can look into fusionauth

north bobcat
#

hey guys how can I run my python script as a background process, that not locks teminal usage?

#

on Ubuntu

sharp cove
#

for a quick solution you can probably use nohup

shrewd thicket
#

or screen

#

@north bobcat

woeful onyx
#

auto restart at failure and start at boot time is really improtant

#

so…use process manager

distant shore
#

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?

prime magnet
#

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?

formal schooner
#

@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

distant shore
#

what do I do for permissions and so on

formal schooner
#

@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

distant shore
formal schooner
#

did you log out and log back in?

#

group membership usually doesn't update unless you log out

distant shore
#

I closed the shell, also restarted vscode

#

would that work?

formal schooner
#

i think so, but use the groups command to confirm

distant shore
#

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

jolly idol
#

I use a 4gb ram
can I use 3.9gb as a swap partition..?

lavish storm
#

but why sweatDuck

#

why don't you try it out yourself and report back to us

#
  • good luck
jolly idol
#

oh well..

frigid solar
#

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

#

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

broken forum
#

It also depends if we are talking about a rpi or a 64Gb server. Or also the type of workloads

jolly idol
#

well thanks fam...

pseudo moon
frigid solar
pseudo moon
#

ah, me bad

frigid solar
#

not sure how it is on windows, but by build do you mean "build from source"?

serene eagle
#

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?

frigid solar
#
  • 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, with help()

-tcl/tk and IDLE
I am guessing tk is 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 by sudo 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

serene eagle
#

I got the chinese input working

#

终于可δ»₯用了

#

It took me so long

woeful onyx
serene eagle
#

I did follow arch linux wiki

#

Didn't work

#

I randomly messed around and got it in 5 seconds

#

;-;

woeful onyx
#

lol

main olive
#
        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?

lavish storm
wise forge
main olive
#

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

lavish storm
main olive
#

I mean, I had the same issue on win10.

lavish storm
main olive
#

Searching around. Nobody uses it.

#

I'll just ignore it for now

pseudo fiber
#

Hi everyone, can u explain me more in depth the pros and cons about VM please ?
Compared to dual boot

scarlet totem
#

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.

scarlet totem
pseudo fiber
pseudo fiber
#

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

scarlet totem
#

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.

pseudo fiber
#

I was thinking about using old laptops and convert it into a station, its cheap and could do the job

scarlet totem
#

If mess one up you don't cause issues with the other.

pseudo fiber
#

yeah + it's really cheap to set-up and ubuntu doesn't require a lot

#

The only problem is the monitor tbh

scarlet totem
#

Are you wanting to use them both at the same time?

pseudo fiber
#

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

scarlet totem
#

I share a monitor, keyboard and mouse between them and Ubuntu gets a dedicated monitor.

pseudo fiber
#

I see

#

ty

scarlet totem
#

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.)

pseudo fiber
#

May i ask u for links bro ? @scarlet totem

scarlet totem
#
main olive
#

Hey so if i have a string, "random 5 10"
how do i seperate this into
random, 5, 10

#

oh wait

#

wrong channel

main olive
#

yeah

#

i got it

vivid path
#

any tip?

fringe harbor
vivid path
#

each dir has a make file on it

#

but i wanna do make from the dir below using this make file

fringe harbor
#
$(DIRS):
        $(MAKE) -C $@
vivid path
#

I'll try

fringe harbor
#

you can change DIRS to OBS

vivid path
fringe harbor
#

not sure if it makes difference but remove / from dir names

vivid path
#

in other word i just wanna a way to make the same thing in one line

fringe harbor
#

that OBS variable is new to me

#

can you change it to DIRS? OBS is changing the target

vivid path
#

ok

fringe harbor
#

write DIRS like this -

DIRS := ctype \ 
        math \
        conv
fringe harbor
vivid path
fringe harbor
#

don't put \ on last line i.e string

vivid path
#

true

fringe harbor
#

run this in terminal
make -C ctype

vivid path
#

works fine

fringe harbor
#

got it

#

uncomment all target

#

all: $(DIRS)

vivid path
#

like that?

fringe harbor
#

no, don't uncomment NAME

#

change all: $(NAME) to all: $(DIRS)

vivid path
fringe harbor
#

can you paste it as code here? I'll make some changes

vivid path
#
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
fringe harbor
#
$(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.

vivid path
#

@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
main olive
#

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?

formal schooner
#

maybe it's possible to use the python c api to cast chunks of this memory space to PyObjects

main olive
#

@formal schooner it turns out, you can use gcore

inner ember
#

does wsl support hardware counters

raw goblet
#

@dapper musk hi

dapper musk
#

could you explain in what exacly it is diffrent from for example arch?

raw goblet
#

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

dapper musk
#

yes whats diffrent in NixOs?

raw goblet
#
  1. Global dependencies (shared libraries and such) are shared, it is kinda difficult to use different versions for different programs
#
  1. Newer versions of packages override older versions of packages
#
  1. system configuration files just kinda exist on disk
#
  1. 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

dapper musk
#

oh nice i hated it on all linuxes especialy on rolling realeses

raw goblet
#

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)

dapper musk
#

so it complies program in the background while you are using binary one?

#

and when it is done it replaces it?

raw goblet
#

(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)

raw goblet
dapper musk
#

ah well then it is like -bin on gentoo

raw goblet
#

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)

dapper musk
raw goblet
# dapper musk 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

dapper musk
#

so it is like regisry on windows but propably better executed

raw goblet
#

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 πŸ˜…)

dapper musk
#

well i recenty overiten my artix with random nonsense beacouse im idiot so i ill give it a try

raw goblet
#

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

#

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

dapper musk
#

well then nice feature

#

it does run on top of existing os?

cold pagoda
raw goblet
raw goblet
#

And you get a lot of the benefits, but not all

cold pagoda
#

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.

quasi warren
#

What comes closer to unix/linux experience on windows, GitBash, Cygwin, or something else?

#

Like Gitbash doesnt have man, but Cygwin does

warped nimbus
#

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.

quasi warren
#

Yeah not WSL2, I have used it before, but didnt like the vm experience.

#

For dual boot?

warped nimbus
#

It's not equivalent.

#

Just doesn't seem relevant to their question

quasi warren
#

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.

warped nimbus
#

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.

quasi warren
#

what hahahaha

warped nimbus
#

Uh ok, they're just overreacting

lavish storm
quasi warren
#

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

restive mural
#

Hey there!

#

Can someone explain me what is the difference between kernal and operating system?

formal schooner
#

@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

restive mural
formal schooner
#

the design of linux is based heavily on unix

#

hence linux is considered "unix-like" or a member of the "unix family"

restive mural
#

Is windows "unix-like" operating system too?

formal schooner
#

no

#

it uses a completely different kernel and implements completely different functionality

restive mural
#

Okay!

formal schooner
#

macos however internally still uses a kernel (called "darwin") that is in the bsd family, and could still be considered unix-like

restive mural
#

@formal schooner Thanks for you clarification! It helped me.

quasi warren
#

From what I remember when you do man man or something else on mac, it would show you BSD in the manual.

formal schooner
#

yes, lots of the man pages say "BSD" in them

fallen jewel
#

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

remote timber
#

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

jolly carbon
#

I think you could say something like python2.7 -m venv .venv

summer trail
spice gulch
#

it seems firefox stores a lot of things

gilded bane
#

!rule 9

shy yokeBOT
#

9. Do not offer or ask for paid work of any kind.

gilded bane
#

nope, wrong one

#

!rule 7

shy yokeBOT
#

7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.

nimble panther
#

Please don't send chainmail on this server.

warped yacht
#

need help in my os

#

can someone help

wise forge
#

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

lavish storm
main olive
#

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

main olive
#

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.

main olive
shy yokeBOT
lavish storm
#

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)?

undone pulsar
#

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

formal schooner
formal schooner
#

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"

dry obsidian
formal schooner
#

sorry, you're right: KDE is definitely a DE and only a DE. KDE Neon is an OS.

undone pulsar
#

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

formal schooner
#

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

tiny pelican
#

hey

#

im looking for a discord server for help with BASH - has anyone got any recommendations?

formal schooner
violet hatch
#

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?

violet hatch
#

ok nvm apparently poetry installs a new virtualenv

violet hatch
#

Nevermind I'll just stick with the old poetry install

#

I'll wait for their bugfixes just in case

formal schooner
#

i wish there was a way to explicitly control this, maybe there is in newer versions

main olive
#

i need help installing pip

#

i keep getting an error

#

ping me or dm me :)

frigid solar
#

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
main olive
#

alr

crude abyss
#

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.

quasi warren
#

Python is pretty versatile and I guess clean syntax also helps.

#

I like the fact that gitbash on windows supports grepand time

formal schooner
#

python has only gotten better

#

3.6 was a turning point imo

empty zephyr
#

how can i get unix time

#

?

quasi warren
lavish storm
#

man date

summer trail
#

date +%s to get epoch time in a shell, or time.time() to get it in Python

cobalt geyser
#

anyone here familiar with gcore?

opaque ginkgo
#

dont ask to ask

#

whats your question @cobalt geyser

cobalt geyser
left anchor
#

Guys what is a file system??? please if you can give an intuitive example!

spice gulch
#

when I run apt-cache pkgnames it will show all packages waiting for being installed?

quasi warren
summer trail
quasi warren
#

ok

plush sparrow
#

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?

quasi warren
#

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?

quasi warren
#

Should the following work as is in a terminal?:

base64 decode -d b3BlbmRz
undone pulsar
#

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

quasi warren
#

<<< This is called heredoc ?

#

Yeah it worked! Thanks

undone pulsar
#

I think technically it's a herestring

#

heredocs are <<

azure musk
#

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

lavish storm
#

i've had similar issues with i3

#

but not on XFCE

plush sparrow
azure musk
azure musk
plush sparrow
#

I use logo_neovim

main olive
#

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 :|

versed nest
lavish storm
lavish storm
lavish storm
#

oooo ta

#

archwiki saves the day (again)

past sierra
#

maybe voice?

lavish storm
#

first of all you need to check your PATH. if you enter echo $PATH it should show you

past sierra
#

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/vesta/bin

lavish storm
#

ok good

#

now enter which python

past sierra
#

/usr/bin/python

lavish storm
#

excellent

#

now enter python --version

past sierra
lavish storm
#

ah, i see the problem

#

try python3 --version

past sierra
#

ohh

lavish storm
#

right, and what was your method of installing python 3.9?

past sierra
#

this

lavish storm
#

are you on debian 9?

past sierra
#

yes

#

i have machine on debian 9

#

i need to start bot on my machine

lavish storm
#

it could just be a matter of having to restart your shell

past sierra
#

how?

lavish storm
#

exit

#

then reopen terminal

past sierra
#

i use PuTTY

lavish storm
#

i'm not familiar with that, are you not able to use the default bash that comes with debian?

past sierra
#

maybe i delete it

#

when i need to delete 3.5

#

i reinstall my machine

#

wait

lavish storm
#

ok, ya zhdu

past sierra
#

aaaa

#

gs

#

mozet

#

v ls

past sierra
#

Do you know how i can check status of it on my server Minecraft

past sierra
past sierra
#

I reinstall my machine he is clean

#

What I need to do

plush sparrow
nova viper
#

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

lavish storm
#

what about people whose ages are == 13

dry merlin
# nova viper Hi guys! So i recently created this login program and i need some help

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()

nova viper
patent flare
shy yokeBOT
#

@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

uncut ferry
#

Hello, I was trying to type in something into an variable, but when I do that, the python script crashes

uncut ferry
main olive
#

show line where u define "A"

uncut ferry
#
messageText = input("Text: ")
uncut ferry
#

nvm

frigid solar
main olive
main olive
main olive
dark rivet
#

he has a much higher chance of getting help in places designed to help with those problems instead of here

main olive
#

but yeah he has must chance in help channel

frigid solar
wise forge
#

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.

near nest
jade root
glacial vale
#

@main olive

south arrow
eager halo
#

do general questions regarding shell belong here?

narrow sundial
#

Anyone know how to learn grep? Any good tutorials

nocturne geyser
#

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

GitHub

ripgrep recursively searches directories for a regex pattern while respecting your gitignore - BurntSushi/ripgrep

proud perch
#

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

lavish storm
proud perch
#

@lavish storm thanks I'll look into that

#

This is actually exactly what I was looking for. Thank you!

lavish storm
lavish storm
#

Yes

proud perch
#

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

narrow sundial
#

Guys will this find unique phone numbers using grep?

grep -R \b\d{3}-\d{3}-\d{4}\b | uniq *.log

lavish storm
tawdry idol
#

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?

lavish storm
#

or is this an off-topic question that should be asked else where?

tawdry idol
tawdry idol
lavish storm
#

ah no worries

sick storm
#

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

warped nimbus
#

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

sick storm
#

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?

warped nimbus
#

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

sick storm
#

ah, so cgroup_mem_amount would be /sys/fs/cgroup/memory/snekbox instead and things like that?

warped nimbus
#

Yeah

sour void
#

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?

warped nimbus
#

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

sour void
#

@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:

  1. feature/branch_one
  2. feature/branch_two
  3. master
warped nimbus
#

What is select branch in ?

#

Is select a command I'm not aware of?

sour void
#

maybe? πŸ™‚

warped nimbus
#

Maybe it doesn't work with a newline-delimited input?

sour void
#

not sure. because even if I pipe it and convert the new lines into a spaces it still does not work

quasi warren
#

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

sour void
#

there is lubuntu

lavish storm
quasi warren
#

I am comfortable doing update and installing packages through cli

lavish storm
#

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)

quasi warren
#

Ok I'll look into them

quasi warren
dapper musk
#

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.

quasi warren
#

I also had Lubuntu at one point and it actually worked reasonably fast, so I'm installing Lubuntu right now

wise forge
#

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

wise forge
#

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

quasi warren
#

Yeah, Lubuntu 20.04 is available and based on Ubuntu 20.04 if I'm not mistaken.

wise forge
#

yup.

#

checked it too.

#

that would be best match for comfortable work

#

and having less pain with any installation

wise forge
#

the life of short regular releases smaller than one year for a reason)

quasi warren
#

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.

wise forge
#

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

quasi warren
#

Oh ok

quasi warren
#

Which option do I choose so I can completely remove Ubuntu?

#

Which one do I choose:
Replaces a partition
Erase disk

lavish storm
#

Erase disk

quasi warren
#

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

quasi warren
#

Ok got it working

#

Had to create a bootable USB on windows through Rufus

frank night
#

hello, can somebody explain me what does bash line
exec "${pants_dir}/bin/python" "${pants_dir}/bin/pants" "$@"
mean?

dapper musk
#

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

frank night
#

thanks

stark sinew
#

hey guys

#

is there any chance someone can assist me in making a super basic makefile?

#

to compile a GLUT project.

past field
#

gay

formal schooner
fresh saddle
stark sinew
#

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

formal schooner
#

heh i found a mistake, line 46 should be

$(CC) $(PIPE) $(CFLAGS) $(CFLAGS_DEBUG) -o $@ $< $(LDFLAGS)
#

but otherwise i think it's right

stark sinew
#

thanks

formal schooner
#

you can also set this up to compile the intermediate .o files, i believe this is common to reduce compilation times in big projects