#unix

1 messages · Page 64 of 1

paper moon
#

Yeah thats a URI for a webbrowser.

spice gale
#

you could have told me that

#

before

paper moon
#

I did not realize before 😅

digital prawn
#

hmm

#

can someone tell me why this happens:

#

according to google and stackoverflow, bash aliases can not have command line arguments

#

however

#

alias img='python3 /home/user/my_file.py "$@"'

#

works as an alias and copies all command line args

#

alias video='ffmpeg -i "$2" -vf scale=-1:"$1" "$3"' does not work

#

I know the function workaround, but I am asking why this happens

real vapor
#

because aliases don't take arguments

shrewd stratus
#

the $@ version's probably also not working

real vapor
#

aliases are very dumb

#

replace this by that

digital prawn
#

i'm saying that the first one i posted works

#

all evidence i read suggests it should not

#

is it because it's calling python or something which can interpret command line args itself?

#

i thought they would still have to be passed through

#

when I echo them and && my actual command, nothing shows but the command works

#

so python can interpret the command line args.

shrewd stratus
digital prawn
#

let me confirm

#

you're correct

#

it does work

#

so i guess that solves that. no command lines args in aliases.

trail sapphire
#

@gritty grail in here instead, which distro and version are you running?

fickle granite
#

I never never use aliases. Shell functions only.

main olive
#

i tried cropping the resolution of my 1 min 15 second video by deducting only 30 pixels in height at the top
the final video is also 1 min 15 seconds at close to full hd
yet the size is only 1.5 MB
from 20 to 1.5mb
is this normal

#

it plays well

#

Using ffmpeg

trail sapphire
main olive
#

But it’s barely noticeable to my eyes

#

When I watch it

#

How such a big change in size

#

oh

#

@trail sapphire

#

yeah it was bitrate

#

from 2k to 163

shy igloo
#

linux for the win

simple heath
#

is it possible to create a .app file for a CLI application on mac?

trail sapphire
#

@real vapor was just replying to @digital prawn that was the one with the problem

real vapor
#

I meant dumb as in "they don't do anything clever"

#

not as on they are a bad feature

dull vigil
#

Hi, I'm trying to add SSH in Ubuntu to my GitLab account, I generated a new one with the command

ssh-keygen -t rsa

and save it in the directory

/home/mohamedhamza/.ssh/gitlab_ssh

cat /home/mohamedhamza/.ssh/gitlab_ssh.pub

and added it to GitLab, but this doesn't work, I think this is because I'm not using the default location to save the SSH which is /home/mohamedhamza/.ssh/id_rsa

so, any help?

fickle granite
#

eval $(ssh-agent) then ssh-add /home/mohamedhamza/.ssh/gitlab_ssh

#

i.e., your suspicion is correct: ssh doesn't "know" that your key is there, so it's not offering it to gitlab

#

another idea is to put something like this into ~/.ssh/config:

Host gitlab
  User mohamedhamza
  Hostname gitlab.com
  IdentityFile /home/mohamedhamza/.ssh/gitlab_ssh
#

then ensure your git remotes all refer to the host gitlab

dull vigil
fickle granite
#

try ssh -v git@gitlab.com

#

paste the output

#
dull vigil
fickle granite
#

I don't understand

#

did you run that command or not?

dull vigil
fickle granite
#

so why not paste the output, so I can take a look? i might be able to figure out the problem

trail sapphire
shy yokeBOT
#

Hey @dull vigil!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

fickle granite
#

gimme a minute

trail sapphire
fickle granite
#

ok that succeeded -- Welcome to GitLab, @mohammedalihamza!

#

so if your actual git operations are failing, it's because they're somehow different than what you just typed on the command line

dull vigil
fickle granite
#

ok that's confusing

#

when you say "this doesn't work", what exactly are you doing, and what exactly are you seeing from your computer in response?

trail sapphire
dull vigil
#
Cloning into 'konan-backend'...
remote: 
remote: ========================================================================
remote: 
remote: ERROR: The project you were looking for could not be found or you don't have permission to view it.

remote: 
remote: ========================================================================
remote: 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fickle granite
#

that's not the exact command

#

you didn't type a bunch of ....

dull vigil
fickle granite
#

you still haven't told me exactly what you typed

#

I can't help if you don't give me the information I need

#

was it simply git clone git@gitlab.com:synapse-analytic?

dull vigil
fickle granite
#

wow, what was the problem?

trail sapphire
fickle granite
#

Your mystery is intriguing to me, and I wish to subscribe to your newsletter.

dull vigil
# fickle granite wow, what was the problem?

In ~/.ssh/config file I set

Host test_gitlab.com
  User git
  Hostname gitlab.com
  IdentityFile /home/mohamedhamza/.ssh/synapse_gitlab_ssh
  PreferredAuthentications publickey

so when I was trying to fetch the project

git clone git@gitlab.com:HamzaSynapse/testproject.git

but in ~/.ssh/config the host is test_gitlab.com not gitlab.com
so I have to fetch it via

git clone git@test_gitlab.com:HamzaSynapse/testproject.git

I spend almost two days trying to solve it and my team lead solved it in 1 min 😅

trail sapphire
#

yes, you must use the name of the "host" that you specify for the entry in the ~/.ssh/config file, not necessarily a real/existing hostname
and as you have User git in there you don't need to use git@test_gitlab.com, test_gitlab.com should be sufficient

dull vigil
#

yeah, thank you guys

trail sapphire
# dull vigil yeah, thank you guys

if you have several accounts you can also model your ~/.ssh/config file like this:

Host *_gitlab.com
  User git
  Hostname gitlab.com
  PreferredAuthentications publickey

Host synapse_gitlab.com
  IdentityFile /home/mohamedhamza/.ssh/synapse_gitlab_ssh

Host neuron_gitlab.com
  IdentityFile /home/mohamedhamza/.ssh/neuron_gitlab_ssh
```you can match many entries using wildcards, and if you want to override something you can do so in a later match as it just reads them all in order from the top down trying to match the different `Host` entries in the file to the "hostname" (which doesn't need to exist in reality other then in the configuration file) specified on the command line
shrewd stratus
#

why the underscore? pithink

trail sapphire
shrewd stratus
#

nvm. I thought it was some wildcard that I didn't know. the actual hostname contains _

#

I do have an SSH config with dashes in the name

trail sapphire
stiff cloud
#

hmm

#

oh

grizzled bay
#

I keep getting this error when I try to run my code and I'm not sure why as I have asyncpg installed and I've tried re-installing it to fix this error

2022-06-18T13:09:25: Traceback (most recent call last):
2022-06-18T13:09:25:   File "/home/shared/main.py", line 12, in <module>
2022-06-18T13:09:25:     
2022-06-18T13:09:25: from classes.bot import ModMail
2022-06-18T13:09:25: 
2022-06-18T13:09:25:   File "/home/shared/classes/bot.py", line 8, in <module>
2022-06-18T13:09:25:     import asyncpg
2022-06-18T13:09:25:   File "/usr/local/lib/python3.10/dist-packages/asyncpg/__init__.py", line 8, in <module>
2022-06-18T13:09:25:     from .connection import connect, Connection  # NOQA
2022-06-18T13:09:25:   File "/usr/local/lib/python3.10/dist-packages/asyncpg/connection.py", line 19, in <module>
2022-06-18T13:09:25:     from . import connect_utils
2022-06-18T13:09:25:   File "/usr/local/lib/python3.10/dist-packages/asyncpg/connect_utils.py", line 28, in <module>
2022-06-18T13:09:25:     from . import protocol
2022-06-18T13:09:25:   File "/usr/local/lib/python3.10/dist-packages/asyncpg/protocol/__init__.py", line 8, in <module>
2022-06-18T13:09:25:     from .protocol import Protocol, Record, NO_TIMEOUT  # NOQA
2022-06-18T13:09:25: ImportError: /usr/local/lib/python3.10/dist-packages/asyncpg/protocol/protocol.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send
2022-06-18T13:09:25: Traceback (most recent call last):
2022-06-18T13:09:25:   File "/home/shared/main.py", line 12, in <module>
2022-06-18T13:09:25:     from classes.bot import ModMail
2022-06-18T13:09:25:   File "/home/shared/classes/bot.py", line 8, in <module>
2022-06-18T13:09:25:     import asyncpg
2022-06-18T13:09:25:   File "/usr/local/lib/python3.10/dist-packages/asyncpg/__init__.py", line 8, in <module>
2022-06-18T13:09:25:     from .connection import connect, Connection  # NOQA
2022-06-18T13:09:25:   File "/usr/local/lib/python3.10/dist-packages/asyncpg/connection.py", line 19, in <module>
2022-06-18T13:09:25:     from . import connect_utils
2022-06-18T13:09:25:   File "/usr/local/lib/python3.10/dist-packages/asyncpg/connect_utils.py", line 28, in <module>
2022-06-18T13:09:25:     from . import protocol
2022-06-18T13:09:25:   File "/usr/local/lib/python3.10/dist-packages/asyncpg/protocol/__init__.py", line 8, in <module>
2022-06-18T13:09:25:     from .protocol import Protocol, Record, NO_TIMEOUT  # NOQA
2022-06-18T13:09:25: ImportError: /usr/local/lib/python3.10/dist-packages/asyncpg/protocol/protocol.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send
trail sapphire
grizzled bay
shy igloo
grizzled bay
# shy igloo Asyncpg is installed how exactly?

I have asyncpg in a requiremnts.txt file (The other packages in the file appear to work) and I did pip install -r requirements.txt and I also tried pip install -U -r requirements.txt

shy igloo
#

any venvs or pipenvs? @grizzled bay or condas

#

also pip version? @grizzled bay

grizzled bay
#

I did have one but it was throwing the same error (running pip list it appeared that the venv was dragging all of the global packages in as well) so I deleted it and now I'm just running it globally

#

pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

shy igloo
#

have you tried updating pip or building asyncpg from source?

trail sapphire
shy igloo
#

do you have postgresql? @grizzled bay

grizzled bay
shy igloo
#

But you also need postgresql for the tests and building to work

grizzled bay
fickle granite
#

I think you can have one git repo "include" another, but by default, when you clone that top one, it doesn't also clone the included one

#

but if you ask it to include it, that's called 'with recuse-submodules'

grizzled bay
#

thank you

trail sapphire
digital prawn
#

Hey guys

wet folio
wet folio
# wet folio

Any idea, whats the meaning of such error message information?

shy yokeBOT
#

Hey @wet folio!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

wet folio
digital prawn
#

Could someone help me with this issue as seen in the attached video? On the left is gnome-terminal and on the right is konsole, the colors you see in the terminal are ANSI colors codes with a space as character. The ANSI color code is set to the foreground, not the background. This means normally, the image is invisible since the characters are spaces. When you highlight them image, it inverts it so that you can see the background colors. The ANSI escape codes are 24 bit RGB codes, not codes within user defined color space. So why in konsole, is it behaving like this? It works as expected in gnome-terminal.

untold socket
#

I cannot view the video but it looks like the right window simply has set an opacity value less than 100%

#

If that's the problem you're describing

digital prawn
#

hmm

#

so you didn't see the video? at all?

#

or just the thumbnail

#

in the video, i disable the transparency

#

to check that as well

untold socket
#

I can see a thumbnail

digital prawn
#

ah

#

it shouldn't effect it based on the way it shows in the video anyway

#

some colors work

shrewd stratus
#

download the video

digital prawn
#

some just show grey

untold socket
#

It might be the console window application does not support those colors

digital prawn
#

thats so strange.

#

it's just rgb

#

24-bit RGB ansi codes

#

it accepts some of them

#

clearly, why not all? lol

untold socket
#

¯\_(ツ)_/¯

#

You can try any RGB value with \033[38;2;r;g;bm (the m is not a typo) where r;g;b are integers in range(256) if you know what I mean (\033[0m to reset)

#

Use 48 instead of 38 for background color mode I think

digital prawn
#

Roie

#

not quite sure what you mean try any value. and what you posted is accurate, and is how the program works

#

but it takes images as input

#

and converts them to the output

untold socket
#

I don't know what the output is

digital prawn
#

output is what you see in the video in the terminal

#

the ANSI string

#

the input is an image

untold socket
#

I can't view the video

digital prawn
#

oh

#

right

untold socket
#

It just doesn't load

digital prawn
#

same for me

#

but it works locally

#

not in browser

untold socket
#

I assumed you mean virtual terminal sequences for console colors

digital prawn
#

by the way

#

I should mention

#

you said use 48 instead of 38 for background

#

this is correct

#

and it works 100%

#

all colors show in konsole

#

in any image

#

as soon as the 48 is 38 foreground not background

#

only some colors work

#

and the rest are grey

untold socket
#

You can try use background color codes and use a virtual terminal sequence to invert the color mode of the console

#

I don't remember its code

digital prawn
#

i think thats a windows thing?

#

the video will give more context, maybe you can view it locally and then delete it? but you will see what the use case and purpose is

#

it has to be foreground color

untold socket
#

I'll open up my computer and try to

digital prawn
#

cool

untold socket
#

In the meantime type or link the message where you explained what it does

digital prawn
#

basically

#

takes an image as input

#

takes rgb pixel values

#

build an string with ANSI color codes using the same rgb values

#

sets the foreground instead of background

#

requiring you to highlight the image with your cursor to view it

#

otherwise it's invisible

#

which is the whole goal

#

having it invisible, and view when the cursor highlights

#

which works in gnome

#

not in konsole

untold socket
#

I suspect it's a problem of adjusting to the buffer resolution

#

Meaning maybe you print to few or too many pixel values in a single line on konsole than you do on gnome

digital prawn
#

the output is identical on gnome and konsole

#

as in the ANSI string

#

not what it renders

untold socket
#

Just to make sure, are you using os.get_terminal_size to adjust?

#

It tells how you how many rows and columns the console window currently has

digital prawn
#

no. The only thing I use os.get_terminal_size for is --autosize feature which isn't used in this video

#

there is no adjusting to size

#

the height is specified in the command

#

--height 35

#

in both terminals

untold socket
#

Have you tried looking at konsole in different window sizes

digital prawn
#

yes, it's the same. there is much more space than 35px

#

fullscreen no dif

untold socket
#

The width of a line matters just as much as the height

digital prawn
#

yes

#

its the same the width is based on height

#

so width is height*2

untold socket
#

That depends on the font I think

#

And isn't it the reverse

digital prawn
#

when i say width I mean number of spaces, and height, number of spaces

#

the font only changes the size of the chars

#

so it would make smaller output

untold socket
#

I just checked because some fonts on Command Prompt change the line and column widths in pixels

digital prawn
#

yes

#

that's what I mean by size of chars

#

the block is smaller

#

itself

#

not the gap

#

it makes no difference

untold socket
#

Maybe your program optimizes out characters/pixels?

digital prawn
#

there's more than enough space

#

it does

#

--opt in the command

#

in both

#

create the SAME

#

optimization

#

which is what sets height*2

#

instead of --opt

#

its height=height

#

not height=height*2

#

i don't know what else you mean by optimize

#

that is my implementation

untold socket
#

Try printing the line and column values of each character drawn

digital prawn
#

as in, you're looking for the output

#

the text output

#

?

untold socket
digital prawn
#

OH

#

wait

#

wtf

#

hold on

untold socket
digital prawn
#

you got me thinking

#

so actually

#

i added a feature that

#

saves like 25-75% of ram and disk space if you store it

#

by eliminating repeating ansi codes

#

so it works like this:

#

if the next pixel to the right is the same color as the last pixel

#

dont write an ansi code just draw a space

#

since the ansi color is already set

#

but this should have no effect in konsole different than gnome

#

because i'm not resetting the color

untold socket
#

Or maybe konsole auto resets colors

digital prawn
#

weird

untold socket
#

Maybe it's like a harsh setting

digital prawn
#

i'll comment out that condition and try it

#

hold on

untold socket
#

Have you tried writing a long line of characters starting the string with one color code

#

If they're the same

digital prawn
#

it made no difference keeping the ansi codes instead of having them account for repeating colors

digital prawn
untold socket
#

For example

print('\033[48;2;255;0;0m' + ' ' * 20 + '\033[0m')
digital prawn
#

that worked, all red

#

lets try foreground

#

worked 100%

#

highlight showed all

untold socket
#

Since this seems to be a static image shower thing, you can fill a buffer like this and print it

#

You can build up a string

digital prawn
#

it's one string printed.

#

with 38 not 48

#

foreground

#

background works 100%

#

foreground some colors work

#

the output is appended and printed at once

#

and also, it has gif and mp4 support. but that's not within scope of this issue

untold socket
#

Oh so it really is just a problem of color support then?

digital prawn
#

i guess so.. it's weird

#

you'd expect that in konsole rgb foreground would have all colors like rgb background

untold socket
#

I found the virtual terminal sequence for inverting foreground and background: \033[7m

#

There is a virtual terminal sequence to revert this operation other than \033[0m apparently, and it's \033[27m

digital prawn
#

i have a feeling results will be the same if its supported at all

#

will take a bit to implement this in the app, might give it a try though

untold socket
digital prawn
#

do you know if this is widely supported by linux terminals or just windows console?

#

i'll test it

#

in a python term

untold socket
#

As far as I know, from my own experience with my Command Prompt console and from websites documenting this online, virtual terminal sequences are not enabled by default

#

But that's just for Command Prompt. I haven't checked this on PowerShell

untold socket
digital prawn
#

so if we did something like:

#
print("\033[48;2;255;0;0m\033[38;2;0;255;0m    \033[7m     \033[27m       \033[0m")
#

it works in konsole

#

but i still don't think it will solve the issue

#

one sec

#

yea it doesnt solve the issue

#

just using 48 and inverting it

untold socket
#

Maybe they really are only starting to support colors

digital prawn
#
konsole --version
konsole 21.12.3
#

changelog not showing that

#

ohh

#

hold on

#

i got to scroll down

#

nah, still don't see it

untold socket
digital prawn
#

I think you're looking at the KDE section?

untold socket
digital prawn
#

Add color tabs support
Add new ANSI sequences CNL and CPL

#

this?

#

sorry haha

untold socket
#

Yee

digital prawn
#

I'm actually using i3 + konsole

#

not kde, not sure if thats applicable but also

#

my konsole version is 21+

#

so idk

#

also

#

I don't think color tabs is ANSI related

#

and those escape codes are not related

untold socket
#

Ye I don't know

digital prawn
#

@untold socket

from time import sleep
min = 0
max = 255
selection = "48" # 38 for foreground
for r in range(min, max + 1):
    for g in range(min, max + 1):
        for b in range(min, max + 1):
            print(f"\033[{selection};2;{r};{g};{b}m \033[0m", end="")
            sleep(0.0000000001)
#

this generates every possible rgb color

#

all of them work in background

#

like half of them work in foreground when I hold my cursor and select it

#

blues and greens work, yellows dont show

#

so strange

nova hatch
#

Does anyone have an idea on why I can connect to my server when we're in the same LAN through SSH and IPv6, but it doesn't work when I turn on mobile data?

vital bay
#

does your server have a public ip?

fickle granite
#

and are you using that IP address, and does your NAT setup allow the ssh port through

vital bay
#

the address needs to be resolvable in order to be found. when you're connected to data, you're in a completely different network and your traffic needs to be routed, but it can only be routed if the route is known, which requires it to be a public ip. if not an ip of its own, then a tunneled or NAT'ed one, or something of the like

nova hatch
#

I get the IP with curl icanhazip.com from the server

#

It's a website that tells you your IPv6 address, which has to be public if they know it, right? SSH-ing into it on the same network works, but as soon as it's from a different network the connection instantly fails (It doesn't even try, the error comes instantly)

#

It's not a fe80 address.

#

The error is:
ssh: connect to host 2a00:---:e356 port 22: Network is unreachable

vital bay
#

especially for this, some sort of port forwarding is needed. i'm not sure you'll be getting it to work

#

the ip you get is the one that your ISP translates to give you access to the internet from inside your private network, but it doesn't work in the opposite direction

nova hatch
#

I set up port forwarding in my router, from port 22 to port 22... I remember trying to get this to work a long time ago, but I just didn't work. We don't get a public IPv4 from our ISP, which is why I've been using a VPS, but they get quite expensive and I've got a few Rpis lying around.

vital bay
#

having an ip be publicly visible on the internet is in general a paid service

fickle granite
#

weirdly in my experience if you're already paying for (say) an ec2 instance, the public IP is free

#

it's weird because I'd have thought the supply of public IP addresses was more constrained than the supply of ec2 instances

vital bay
#

thanks to ipv6, not really

nova hatch
#

My server has a IPv6 address labeled "IP Address in the internet" in the router configuration page, but ssh-ing into it doesn't work at all.

#

I guess there's just some problems with ipv6 still. Hopefully they will work everywhere someday just like ipv4 addresses work now. It's really frustrating.

vital bay
#

they both work more or less the same way

nova hatch
#

*should

vital bay
#

your ISP is masking your IP somehow, making it impossible to be reached from the internet in general

#

if you can't ping your router from outside, nothing to do

#

no matter what settings you change on your router

nova hatch
#

Ok, thanks, at least I know that there is no stupid simple mistake from my side. I tried calling the ISP support, but they weren't really helpful lol

#

Thanks again

fickle granite
#

ISP support never is

vital bay
#

you'd probably have to pay extra for that

fickle granite
vital bay
#

there is, to the best of my knowledge, no free way to do this

#

even if you get an ipv6 ip of your own, which iirc were still free up til recently (might still be), you'd need some sort of server to do tunneling for you

nova hatch
vital bay
#

well

#

i have 4mbps so, good for you 😛

nova hatch
#

Oh, my condolences, I just got used to my Gigabit access so moving back is kinda hard. But that's a real zeroth-world-problem lol. I really shouldn't be complaining...

trail sapphire
#

are you trying to troll the unix/linux people in here with the statement about windows? 😉

mortal knoll
#

It’s always a good feeling when the first install works

dapper musk
#

and screenshoting tool doesn't?

lavish storm
#

on a VirtualBox? 😂

sand beacon
#

How to use linux in windows?I want to start with linux and i downloaded ubuntu virtual box and the linux iso file but it shows error while installing so any other way to use linux in windows?

fickle granite
#

you might be able to use "WSL"

#

but if you already have virtualbox and an ISO, you should just solve the problem

#
sand beacon
grizzled bay
#

How do I set up a python virtual environment on Ubuntu 22.04? I know there's packages like pipenv and venv and I'm wondering if there's any others; If anyone is particular better than the other for ubuntu use

kind coral
trail sapphire
mortal knoll
#

After I complete my make.conf and ensure everything works on the vbox, i wanna try installing it on the physical machine itself >:)

To be fair, I don’t think gentoo is as hard as anyone who haven’t tried to install it makes it seem. Most of the docs are well written and there’s plenty of resources explaining every little bit

#

Granted im not using my own custom kernel (im using genkernel) I will get there eventually!

grizzled bay
trail sapphire
grizzled bay
main olive
#

guys i have a sad news...i mean i guess its a sad news

#

im going to start using haiku os

#

im no longer a unix/linux fanboy

fickle granite
#

😭

#

I'll be wearing a black armband for the rest of the week

main olive
#

damn

main olive
tropic blaze
#

got the below error

Traceback (most recent call last):
    File "/home/sipl/PycharmProjects/pyScr/venv/ymlscr_1.py", line 27, in <module>
    if 'dns' in data['network']['ethernets']:
TypeError: string indices must be integers```
main plank
tropic blaze
#

thx for replying, but I sorted out the error

sand beacon
#

I have seen that many companies want their employees to have linux experience why is that...I have read that its fast and secured and updates are easily done in linux?? I dont get it windows also provide these facelities right? like security and updates,I read somewhere it was written that updates are easily done in linux what does that mean I mean in windows we just need to go to the settings and update whats so time consuming in that?Just to make it clear I want to know any practical examples from experiences on why linux is asked in jobs

trail sapphire
# sand beacon I have seen that many companies want their employees to have linux experience wh...

linux drives most of the internet on the server side, connected devices and cloud services, that is why companies sees it as essential knowledge, also licensing is much simpler which is most important in ephemeral/dynamic environments like containers and other cloud computing many times are today

when it comes to updates, imagine that the same process updated almost all software installed on the server at the same time as it updates windows (not only a few othere microsoft components) and that the updates were also much much faster to install

ocean coyote
#

Since everything's transitioning to the cloud these days I guess it makes sense to want employees to know at least how to navigate around directories, create files and stuff in linux.

#

It also really depends on the position

#

Sysadmin, devops, infra admins and such aklimust know linyx nowadays

#

Developers not sure

trail sapphire
#

it's getting more and more common that all the developers are part of devops teams and are managing there own slice of the cloud deployments that there applications run on, within the confines that has been setup for them

placid coral
#

Is there a way to require confirmation when using the redirect command in bash? > to prevent overwriting files in the case that you meant to append? currently can only find noclobber but that's not exactly what i want

trail sapphire
main olive
#

Need some help... This happened after I ran fsck on /dev/sda2

#

It's stuck on that screen rn... No further logs

mortal knoll
#

Do you have a previous update to rollback to?

#

If not, you should be able to boot a live disk and fix the issue. Gnome display manager seems to be hanging but I couldn’t tell you why unless we see more logs

#

Network is failing too, but that shouldn’t be causing the display manager to be failing

#

Can you try and hop into another tty?

flat kayak
#

I can barely read the logs, it looks like systemd is shitting itself

trail sapphire
#

i think that should work
what is your environment (bash on linux)?

#

how and from where are you sending SIGUSR1 to the script?
and is the script still running at that point or has it exited?

#

i don't know anything about SLURM and how things are being run by it
but if you were to do this in the shell and try to get it to work there i might be able to help with that at least

#

add the variables to the echo too, so that you'll know if they are accessible, like:

_copy() {
    echo this runs with ${GAUSS_SCRDIR} and ${INPUT_DIR} >> message.output
    cp -r "${GAUSS_SCRDIR}"/* "${INPUT_DIR}"
}
trap _copy SIGUSR1
```and don't forget the `""` around the variables in your commands when working with arguments to commands like that (or you'll have problems if anything contains space or other special characters)
#

so, have you had time to test it out yet and how is it turning out for you?

upper prairie
#

What's that supposed to mean?

trail sapphire
#

you could use something called a "here document" which will make your script that generates the script a lot more readable and easier to edit
within a here document you only have to excape \, $ and ' with \ if you don't want the variable to be expanded by the script that generates the other file
here's an example (and __END_OF_SCRIPT__ is just a delimiter, could just as well be EOF or something else) that uses both expansion and not for different variables:

#!/usr/bin/bash

SLURM_FILE="slurm.sh"
PWD=$(pwd)

cat > "$SLURM_FILE" << __END_OF_SCRIPT__
# This is the script ${SLURM_FILE}
export INPUT_DIR="$PWD"
export GAUSS_SCRDIR=/mnt/storage_2/scratch/gaussian/\${SLURM_JOBID}

_copy() {
    echo Safety copy — this runs with \$GAUSS_SCRDIR and \$INPUT_DIR >> "\${GAUSS_SCRDIR}/safety.message"
    cp -r "\${GAUSS_SCRDIR}"/* "\${INPUT_DIR}"
}
trap _copy SIGUSR1
__END_OF_SCRIPT__
trail sapphire
#

yeah, this was just a suggestion for improvement for how you generate the script, but you'll still need & and wait

placid coral
#

Has anyone experienced this? Running a project in pycharm using the venv python interpreter and trying to activate my venv simultaneously in the terminal so i can run certain commands, however whenever i activate it it seems to break the terminal, any command i type in is not found and with every command i enter it also posts grep and sed not found

#

using git bash on windows

fickle granite
#

my guess is that the activate file is messed up

#

it's modifying PATH in a way that omits the directories you need, like /usr/bin and stuff

#

type echo $PATH to see what it is

#

here's what mine looks like learning-grosbeak% . ./venv/bin/activate (venv) learning-grosbeak% echo $PATH /home/ubuntu/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin (venv) learning-grosbeak%

#

I'm guessing yours is pretty different

upper prairie
placid coral
#

ye, it's pretty good

trail sapphire
upper prairie
#

Idk if I'd suggest using git bash

fickle granite
#

it's the standard thing; visual studio code recommends it

placid coral
#

It's been perfectly fine for java development

#

what would you suggest instead? just cmd/ps?

upper prairie
#

PowerShell 7 + WSL2

#

kinda hard to beat with that

placid coral
placid coral
upper prairie
#

After a reboot, the first load can take a few seconds

placid coral
#

idk i used to use on previous pc and if it hadn't been opened recently it could easily take 10s to load

upper prairie
#

but it stays running in the background

placid coral
#

ik a lot of people that have had issues with wsl tbh

#

this is the only issue i've ever had w git bash

upper prairie
#

I don't think I know anyone

placid coral
#

maybe unlucky

fickle granite
upper prairie
#

I would think it's a git bash thing

fickle granite
#

that's WIndows

upper prairie
#

that looks like WSL, though

placid coral
#

might give wsl2 another try

fickle granite
upper prairie
#

Anyways, I've heard of fewer people having issues with WSL than git bash

#

and I feel like more people use WSL than git bash (here, I mean)

placid coral
#

I guess it's a small sample size, but I know 3 people personally that had wsl issues and none w git bash, though it is likely more simple than wsl

shrewd stratus
#

nice username and hostname

placid coral
#

I don't remember tbh, I didn't really probe as I didn't anything about it at the time

upper prairie
#

Well, I think it's worth a shot anyways. Pretty easy to install, now

fickle granite
#

I wouldn't try to use windows python with git bash; the activate script probably isn't doing the right thing

upper prairie
#

just like wsl --install -d Ubuntu

fickle granite
#
meeeee@mememeeeeee MINGW32 ~
$ py -3 -m venv venv

meeeee@mememeeeeee MINGW32 ~
$ . venv/Scripts/activate
(venv)
meeeee@mememeeeeee MINGW32 ~
$ echo $PATH
C:\Users\meeeee\venv/Scripts:/c/Users/meeeee/bin:/mingw32/bin:/usr/local/bin:/usr/bin:/bin:/mingw32/bin:/usr/bin:/c/Users/meeeee/bin:/c/Python310/Scripts:/c/Python310:/c/Program Files/Parallels/Parallels Tools/Applications:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/ProgramData/chocolatey/bin:/c/Program Files/PowerShell/7:/cmd:/c/Users/meeeee/AppData/Local/Microsoft/WindowsApps:/c/Users/meeeee/AppData/Local/Programs/Microsoft VS Code/bin:/usr/bin/vendor_perl:/usr/bin/core_perl
(venv)
meeeee@mememeeeeee MINGW32 ~
$
#

that's git bash this time 🙂

placid coral
#

Yeah it'd be nicer to have wsl it definitely has some advantages

fickle granite
upper prairie
#

that is curious

#

but something I'm glad I don't have to deal with

placid coral
#

😄

mortal knoll
#

Idk if the guy fixed the problem, but could always just reinstall from a live image but make a backup and copy to another storage or something

#

Just gotta mount the drive and you’re good

foggy swallow
#

guys, any idea why i can't install wine32 ?
libwine:i386 : Depends: libvkd3d1:i386 (>= 1.2) but it is not going to be installed

ember quiver
main olive
#

gecko linux + python = win win

frosty hazel
#

arch linux >

main olive
#

arch is cool and all but gecko is perfect for both newbie and advanced users

upper prairie
#

Oh, what the heck... "gecko linux" is a thing

#

and it's based on openSUSE

#

oh, it actually looks incredibly useless .-. it's literally just openSUSE but with some stuff pre-installed

vital bay
#

well, if it brings what you want 😛

#

in that sense, all distros are useless. you could just hand-pick what you want to sit on top of the linux kernel yourself

upper prairie
#

Well, I mean compared to openSUSE

#

I'm not exaggerating when I say it's literally just a few packages

#

which is simple stuff like a NVIDIA driver, packman... and that's all I can honestly remember from what I've read

vital bay
#

i'd say nvidia drivers and a different package manager are already pretty good things

upper prairie
#

not to be confused with pacman

vital bay
#

ah, i thought you meant pacman and miswrote it, that was my bad

upper prairie
#

and the NVIDIA drivers on openSUSE are as simple as sudo zypper in nvidia-glG06

vital bay
#

ah, it's a repo

upper prairie
#

Indeed

#

and all you have to do is opi codecs and you'll have all of that

vital bay
#

yeah maybe not that good a deal then

#

but you also have to add in the nvidia repo first, don't you?

upper prairie
#

Not on openSUSE, no

vital bay
#

i see. i haven't used it in a long time, i'm out of touch

upper prairie
#

Well, maybe I lied actually

#

It's been a while since I installed NVIDIA drivers that way

#

For some reason those drivers are usually borked so you have to install manually via the .run

#

it's not that much of a process regardless, especially with YaST

vital bay
#

yeah, my experience is that there's usually some reason or another that makes nvidia drivers at least not immediate on most package managers. i would say if one is just starting out, that could be something useful to have taken care of for you

#

like with pop os (though that one brings a bunch of other stuff too)

upper prairie
#

Well, Pop!_OS has definitely lost its charm

#

With Ubuntu, you can have the drivers installed if you pick the option during the installer

#

so really if you use Pop!_OS, you're probably picking it because of the DE

vital bay
#

hmm yeah, that's true. i forgot 22.04 gives that option

upper prairie
#

Even 20.04 did

vital bay
#

oh, that i didn't know at all

upper prairie
#

Idk if the name of the option has changed recently, but it was something like "Install additional software"

#

which was the option for proprietary software

vital bay
#

aha, yeah, i didn't know that included nvidia drivers

main olive
upper prairie
#

what

main olive
#

i kinda like gecko having minimalism look and feel

#

like it has vlc and firefox installed out of the box and not some weird video player

upper prairie
#

Firefox is installed by default on openSUSE

main olive
#

also no games preinstalled lemon_swag

upper prairie
#

You get to choose which packages are installed during openSUSE' install process

#

if you don't want the games, uncheck the games pattern

upper prairie
#

Yes

main olive
#

damn

upper prairie
#

That's one of my favorite features of openSUSE

main olive
#

how come installers dont have that

upper prairie
#

No clue

main olive
#

arch also has that option but im not really a fan of rolling release lol

upper prairie
#

I like rolling release in the way that openSUSE does it with openSUSE Tumbleweed

main olive
#

does it follow the same formula like fedora?

#

with the updating

upper prairie
#

No, it's pretty different

#

Updates are rolled out in the form of snapshots

#

That way, if something breaks, you can just rollback to a previous snapshot

#

It's not like Arch where everything is updated instantly

#

you have to wait for a snapshot to be released

main olive
#

i see

#

so it has timeshift

upper prairie
#

I've had a lot more stable of an experience on openSUSE Tumbleweed compared to Arch

upper prairie
main olive
#

but its kinda painful to have snapshots like they take a huge amount of space

upper prairie
#

but they're not those kinds of snapshots

kind coral
upper prairie
kind coral
#

the xbps package manager is so nice too

upper prairie
kind coral
#

yeah mb

upper prairie
#

but also Void is notorious for supporting significantly less packages than other distros

kind coral
#

is it?

upper prairie
#

I guess that's just what I hear from the Void dissenters

kind coral
#

the only package I have struggled to get which was recently added was libgccjit which is a very obscure package because really the only people using are native comp emacs uses which is a minor group of emacs uses who alone are a minor group of programmers

kind coral
upper prairie
#

I'm not sure, I just never thought of Void as really having anything going for it

#

For the most part, I only ever see people using Void because they have a strong dislike towards systemd

#

usually completely unfounded in that regard, though

kind coral
#

If you're looking for a barebones distro it sits between Gentoo and Arch

upper prairie
#

I'm not sure I agree with "barebones," though

kind coral
#

why?

upper prairie
#

For the most part, it ends up being people obsessing over disk space that would hardly affect them otherwise

#

I would understand caring about like CPU and RAM usage

#

but that's pretty consistent across distros, mainly because it's the DE that becomes hungry for those

kind coral
#

thats why I use dwm

#

well

#

not really

upper prairie
#

but when you can use any WM on any distro, does "barebones" really mean as much as you think it does?

kind coral
#

I prefer a tiling window manager because it's more ergonomic

upper prairie
#

because to me it's usually just a psychological thing, not a practical thing

kind coral
#

if I were to be using the gnome image this would be a different conversation

upper prairie
#

I used to fall into the whole minimalism religion, but I guess I've since discovered that I really don't need to care about it

#

I suppose it's kind of a rabbit hole at first

#

You want to see how far you can push it once you kind of move away from like Windows and macOS

kind coral
#

imo gentoo is just way too far

upper prairie
#

and I don't think anyone can really disagree

kind coral
#

there is no need to build everything from source

upper prairie
#

but IMO Gentoo at least has something you can't beat for those who know what they're looking for

#

like with Gentoo, it at least deserves some respect in my book

kind coral
#

Installing Gentoo does sound like an adventure and a half

upper prairie
#

It's definitely not everyone's cup of tea but at least it's good at what it does

kind coral
upper prairie
#

I've felt that way about a lot of things

#

I cannot be an enthusiast, I don't like putting too much thought in what I'm using

kind coral
#

I am a rust and emacs cultist enthusiast

upper prairie
#

Maybe I'm just depressed \🤔 I can't really be enthusiastic about anything, huh

#

anyways, this is why I happen to like openSUSE \😩 I don't need to put in much effort to have a system that I can trust won't break spontaneously

#

Even something as simple as being able to pick my packages during install

#

love that, need more of that everywhere

torpid cipher
#

some people just want a distro that's ready to go so they can get to work, and don't want to fiddle with things, and that's perfectly fine

#

suse, rhel, ubuntu, whichever

mortal knoll
#

So things like WiFi can be setup easier if you’re installing on physical hardware

#

That’s supposed to be one of the better ways of installing (which I’ve never tried) but it makes sense. You can even easily download the tarball without having to use links / lynx as well

carmine meadow
#

I use arch btw

trail sapphire
#

you might want to read the topic of the channel

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

light gorge
#

Is there a channel like that for windows as well? Would make sense as Windows is a top platform according to PSF survey

vital bay
#

you can ask about windows stuff in any channel

#

this one is for more nitty gritty stuff, but you can also ask about linux stuff in other channels. i guess what you said is the reason itself, many people are already working on windows by default, so it doesn't need a dedicated space

trail sapphire
#

i think many of the problem areas when working with python on windows is many times related to and solved in #editors-ides
but i might be wrong and maybe it's just my inexperience with working on windows as a development platform for python

trail sapphire
# upper prairie It's mostly PATH stuff lol

yeah, mostly, but i'm also very used to be able to run pyenv without a problem for my environments, that can be a bit more challenging to get running on windows (there is such a project, but...) 😄

torpid cipher
#

the thing to do on windows is just use the WSL

#

imho

trail sapphire
#

depends on if you require windows specific APIs in your code
you might be developing some python code that is specific to the native windows python interpreter
then you can't go with WSL as far as i know

proven ridge
#

Hello!
Please, is it okay to share a project here?

dapper musk
#

Why not?

tight badge
#

what’s unix

upper prairie
#

tbf this channel would be better named "#unix-like"

trail sapphire
upper prairie
tight badge
#

i can get voice verified that way?

#

i don’t even want it

upper prairie
tight badge
#

oh

#

lmfao

proven ridge
#

Hello!

I've just released a new version of term-image. It's a Python package including a library, a CLI and a TUI for displaying and viewing/browsing images within a terminal.

It currently supports a whole lot of features including:

  • Extensive API
  • Kitty graphics support
  • iTerm2 inline image support
  • Support for PIL images, file paths, URLS
  • Animations (even transparent ones)
  • Browsing image directories recursively
  • Automatic terminal support detection

Displaying an image can be as simple as

from term_image.image import from_file
image = from_file("path/to/image")
image.draw()
# OR
print(image)

with python, or

$ term-image path/to/image

from a shell, and as extensive as possible...

Links:

The project is open to contributions and I welcome everyone with knowledge and/or experience that could benefit the project.

Thank you very much!

GitHub

Display and browse images in the terminal. Contribute to AnonymouX47/term-image development by creating an account on GitHub.

untold socket
proven ridge
foggy swallow
#

is there some strong boy from debian?

upper prairie
shy igloo
proven ridge
bright raven
#

Hello! Anyone willing to help with building python from source?

shy igloo
#

It was very tall

#

Also maybe could you make it so if they're aren't any images it reverts to a directory list?

shy igloo
bright raven
#

i'm using the 3.10 branch from github

#

should i use tarball instead?

#

Linux darmok 4.15.0-180-generic #189-Ubuntu SMP Wed May 18 14:13:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

shy igloo
upper prairie
#

Makes the whole process so much easier

#

Once you have pyenv installed, you just pyenv install 3.10.5; pyenv global 3.10.5, for example

bright raven
#

can i use pyenv without root access?

upper prairie
bright raven
#

i'll check it out thanks!

#

is it like the nvm but for python

upper prairie
proven ridge
proven ridge
#

To be clear... you mean in the TUI, right?

trail sapphire
bright raven
#

OpenSSL doesn't seem to be installed on the computer

bright raven
#

since I don't have root, I'm thinking I have to

  1. Compile OpenSSL from source
  2. install it into some alternate directory
  3. ???
  4. Install python
trail sapphire
trail sapphire
bright raven
#

yup

#

i can't use apt install

trail sapphire
bright raven
#

^ yup

proven ridge
# shy igloo Yes

I see. Well... I'll sincerely like to keep it strictly images. 🙂

trail sapphire
# bright raven ^ yup

that's too bad, otherwise you could simply have installed the packages you need for building
i think you might get problems if the system don't have the required packages installed on the system to build python and no way to install them

trail sapphire
# bright raven ^ yup

i think your best bet would be to setup a system with the same version of ubuntu and install all the required packages there and build it all there as well and then just transfer the files (including dependencies) over to the other constrained system, but it will not be a walk in the park

bright raven
#

pain

trail sapphire
#

yeah, you're in quite a pinch if you need to use that system and can't use something else instead

dapper musk
# bright raven i can't use `apt install`

If you have physical access to computer you can gain root easily. Reboot and when grub menu appears click e then add init=/bin/sh to kernel parameters and press f10 and it will drop you to root shell

bright raven
trail sapphire
bright raven
#

i got it through pyenv actually

#

but now i have a separate issue that doesn't seem related

trail sapphire
#

oh, the system had enough packages installed to be able to build python for you?

bright raven
#

yeah it did

upper prairie
bright raven
#

i had to build openssl manually

bright raven
trail sapphire
bright raven
#
(venv) bcj@darmok:/scratch/cluster/bcj/poke$ which python
/scratch/cluster/bcj/poke/venv/bin/python
upper prairie
#

I've never heard of a /scratch folder

#

What distro are you on?

bright raven
#

Ubuntu 18.04 x64

#

It's a folder our university uses for... scratch space

upper prairie
#

I see

bright raven
#

i just needed to upgrade setuptools

#

we chilling

#

thx for all the help through these troubled times ❤️

trail sapphire
#

nice, happy to hear that you're on track again 🙂

slender whale
#

help needed with general linux question (not python related). I'm setting up an SFTP server and want to create a /ftp folder where files will be uploaded to. All that is OK. I want to create a user that can only use a subfolder . I think I have done the chgrp and chmods properly but the user keeps getting an error when logging in that they can't cd to the proper directory

#

any ideas what's wrong ?

#

ah got it ..... chmod settings were wrong

trail sapphire
#

you would run something like: find . -name '*.log' -size -10k -exec sha256sum {} \; 2>/dev/null
the first . in there is the current directory, you can set it to /var/log or what ever you want instead
the - in -10k means less then and k is KB for the arguments to the -size option
sha256sum can be any command you want (just be careful) and {} means the name of the current file and the \; is absolutely necessary to tell -exec that the end of the command has been reached
and finally 2>/dev/null suppresses any error messages from find and the command find runs with -exec for the matching files

wet folio
#

Hi guys, facing problem with GDB:) So I did GDB using below command gdb ./combined/afl-image/afl-fuzz And the code I am trying to check its under ./combined dir . So, once I went gdb mode using first command I typed break ../Program.cpp:Program:deserialize(some args) but after that I can not do anything using some command line info line 200 or print, trace etc or other command from gdb doc, any suggestion how to read specific line

#
(gdb) run
Starting program: /home/combined/afl-image-syscall/afl-fuzz
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Inferior 1 (process 48280) exited with code 01]
(gdb) break ../Program.cpp:Program::deserialize(unsigned char*, unsigned int) 
Breakpoint 1 at 0x55555557ccd6: file ../Program.cpp, line 172.
(gdb) info line 254
Line 254 of "afl-fuzz.c" is at address 0x55555555f2b4 <main+6788> but contains no code.
(gdb) 
#

It can not give any info of Program.cpp code

upper prairie
#

install discord-installer or discord-canary-installer

#

oh, through opi

#

sudo zypper in opi

#

then opi discord-canary-installer

#

what the

#

hmm if I had to guess... it's because you're on leap

#

well

#

I assume you're on Leap

#

I guess whoever made that package doesn't support 15.4

#

oh yep

#

I guess you could try

zypper addrepo https://download.opensuse.org/repositories/home:simonizor:discord/openSUSE_Leap_15.2/home:simonizor:discord.repo
zypper refresh
zypper install discord-canary-installer
#

some of those you'll need sudo

#

I dunno which, I just know the last one for sure

#

Neat

steep sequoia
#
#! /bin/python3

import os

glob = globals()

glob["echo"] = lambda *args: os.system(" ".join(("echo",)+args))
glob["clear"] = lambda *args: os.system(" ".join(("clear",)+args))
glob["touch"] = lambda *args: os.system(" ".join(("touch",)+args))
glob["rm"] = lambda *args: os.system(" ".join(("rm",)+args))

touch("testfile")
echo("test", ">", "testfile")

file = open("testfile")
print(file.read())

rm("testfile")

bash in python

#

the scripts output is "test"

#

which is what was echoed into the file :D

#

then the file is removed

#

so that it doesnt clutter up whatever directory you're in

upper prairie
#

lol I'd just use iPython for that

#

also what you're doing with glob and what-not, you might prefer to just use a partial from functools

#

actually I lied... You do fancy stuff with + args

steep sequoia
#

thats just for the "".join lol

#

you can do it without +args I think

upper prairie
#

right... one second, let's find out

steep sequoia
#

with echo:

"echo "+" ".join(args)
#

does the same thing as

" ".join(("echo",)+args)
upper prairie
#

uhh... I kinda hate how os.system() works

steep sequoia
upper prairie
#

now that I think about it

steep sequoia
#

looking back on it, the `"echo "+str.join is better

steep sequoia
upper prairie
#

this whole "only one arg with words split into a sequence >:("

steep sequoia
#

yeah thats a bit dumb

upper prairie
#

I'm on Windows, but

In [1]: dir_ = !dir

In [2]: !echo "Meow, world!"
"Meow, world!"
#

imagine dir is ls

steep sequoia
#

dir is also a command lmao

#

it does basically the same thing as ls but the default formatting options are slightly different

upper prairie
#

lol

❯ where dir                                                                                                             dir: aliased to ls -l 
#

Never knew that, never used it

steep sequoia
#

lol

upper prairie
#

anyways, your glob thing is useless regardless

#

glob["echo"] = would just do the same as echo = , no?

#

except more expensive

#

or... I'd think more expensive

steep sequoia
#

yeah its more expensive

#

i was originally doing it because i wasnt in the global namespace

#

so it would put it in the function namespace, then remove it when the stack frame got deleted

#

i wanted it to be global

#

but then i decided to play around with it, and i largely just pasted in my previous code lol

#

but yeah, you're right
glob[] is more expensive

#

and unnecessary

upper prairie
#

I honestly don't like touching the shell at all from within Python

#

feels so... dirty

steep sequoia
#

i was doing it bc i wanted to invoke gcc from python

#

then i got distracted and started playing around wiht it

#

*with

stone timber
#

hu

upper prairie
#

I feel like with something like gcc, you'd want your main "thing" to be a shell script

#

like check the exit code of the script or something and do something based on that

#

but that's just me \😩

steep sequoia
#

the reason i didnt use a shell script is for speed

#

shell scripts tend to be much slower than python

#

and bc im writing a relatively large/expensive thing, shell script was too slow

upper prairie
#

but then again... you're having to use os.system()

#

which I think would come with a bit of overhead compared to running a script directly

steep sequoia
upper prairie
#

oh, I see

#

I guess I just wish Python felt more like it was meant to do that kind of stuff

steep sequoia
#

the geniuses in #esoteric-python once did something that made it so that you could call functions like this, iirc:
fn arg1, arg2, etc

#

it was a while ago, but if i could find that, i could make bash in python lmao

#

or at least, make it much more natural to use

upper prairie
#

I can imagine something like cmd: arg1, arg2, arg3 being possible

#

but I dunno about anything else

#

eh, maybe not that

#

Well, you could cmd: "arg1 arg2 arg3"

steep sequoia
steep sequoia
upper prairie
#

Cursed; whatever it is

steep sequoia
#

this lovely script by someone called apple does that

@type.__call__
class __annotations__(dict):
    def __setitem__(self, item, value):
        print(value)
print: 989
print: "foobar"
print: 3*8-9
#

though looking at it, i think it only works with print

#

bc print(value)

#

but you could mess with that and get it to work with whatever function you use it with i think

dusky nymph
#

Please anyone know how to enable zoom pinch in Ubuntu?

silent hare
#

Hi im using linux mint 20.3 and I have the 5.15.0 kernel version, a ryzen 9 5900x and a rtx 3050ti laptop version
The brightness adjustion is quite buggy and Idk why, the screen keeps getting brighter till 62% from there on its just stuck and doesent get brighter anymore

#

If anybody could help, that would be great

ember quiver
light gorge
#

Can you run this command on windows?

upper prairie
next abyss
#

Hello, I need help with something related to time.

>>> log_time = datetime.datetime.now().strftime("%d/%m/%Y %H:%M:%S")
>>> 2022-07-02 21:34:41

>>> log_time = datetime.datetime.now()
>>> log_time.strftime("%d/%m/%Y %H:%M:%S")
>>> 2022-07-02 21:34:41.061181

Why is there this difference?

fickle granite
#

I don't know where that output is coming from

#

how did the 2022-07-02 21:34:41 get there?

#

did you type it?

#

here's what I see

#
>>> log_time = datetime.datetime.now().strftime("%d/%m/%Y %H:%M:%S")
>>> log_time = datetime.datetime.now()
>>> log_time.strftime("%d/%m/%Y %H:%M:%S")
'02/07/2022 15:59:24'
fickle granite
#

@next abyss ^^

upper prairie
#
In [1]: from datetime import datetime

In [2]: datetime.now().strftime("%d/%m/%Y %H:%M:%S")
Out[2]: '02/07/2022 11:29:31'

In [3]: t = datetime.now()

In [4]: t.strftime("%d/%m/%Y %H:%M:%S")
Out[4]: '02/07/2022 11:29:48'
#

No difference for me \🤔 (other than the time itself, naturally)

light blaze
#

I'm trying to install python on ubuntu, but I can't manage to do so... I uninstalled python 2.7 and installed 3.10 using apt but it just says

catow@catow-H470-HD3:~$ python --version
bash: /usr/bin/python: No such file or directory```
upper prairie
#

also where did you get Python 2.7?

light blaze
#

builtin I guess

upper prairie
#

shouldn't have done that, then

light blaze
#

not 3.10.5

fickle granite
#

you should post a complete transcript of all the commands you ran

upper prairie
#

try python3.10

light blaze
#

but where did 3.8.10 come from

upper prairie
#

Preinstalled, likely as a dependency for some package or internal script

light blaze
#

most likely

upper prairie
#

same with 2.7

#

You probably shouldn't have removed it, since it came with your installation

light blaze
light blaze
#

good to know for next

upper prairie
#

You probably want to use something like pyenv, to keep the preinstalled versions of Python intact and usable by the system

light blaze
#

oh

fickle granite
#

I just meant "all the commands you ran where you were trying to remove or install python"

upper prairie
#

Once you've got pyenv installed and setup, all you do is pyenv install 3.10.5; pyenv global 3.10.5

light blaze
#
sudo apt install python3.10
sudo apt remove python2.7 (sorry lol)
upper prairie
#

python -V will be 3.10.5, python3 -V will be 3.10.5, python 3.10 -V will be 3.10.5

upper prairie
#

same for pip, pip3, etc

upper prairie
#

When working with Python on *NIX, I will forever praise pyenv

light blaze
#

so yeah pyenv will do well

upper prairie
light blaze
#

yeah yeah now installing

upper prairie
#

You may want to reinstall 2.7

light blaze
#

I think I'll just reinstall the operating system

#

I don't like ubuntu

upper prairie
#

but also it sounds like maybe you're running an older version of Ubuntu

light blaze
#

I'll switch back to arch

upper prairie
light blaze
#

I was just lazy one day and decided to install ubuntu

light blaze
upper prairie
#

Beyond the DE, I don't know if I see what you could be talking about

light blaze
#

unrelated to python now, I just don't like ubuntu because there are many things that I need to change or don't need, which I can just directly get on arch and not bother about what I don't need

upper prairie
light blaze
#

a year ago

upper prairie
#

Ubuntu hasn't shipped with 2.7 in a while

#

You would've been using something like 20.04, no?

light blaze
#

yes

upper prairie
#

I don't think 20.04 came with 2.7

light blaze
#

lemme clarify the version I have wait

upper prairie
#

but also 20.04 is about two years old now

light blaze
#

yep 20.04

#

I'll remove ubuntu in a few days

#

I'll get a new piece of SSD that I've been wanting to get for quite a while

#

and then install arch

upper prairie
#

Yeah 20.04 doesn't come with 2.7

light blaze
#

without noticing

upper prairie
light blaze
#

yeah alright I'll give that a shot

#

and if that doesn't go well with me I'll switch back to arch

upper prairie
#

I might suggest Kubuntu or KDE neon

light blaze
#

KDE is my favorite

#

why not plasma?

upper prairie
#

Kubuntu and KDE neon are both distributions that come with KDE Plasma instead of the GNOME like on Vanilla Ubuntu

#

KDE neon and Kubuntu are very similar except KDE neon is from KDE themselves and comes with the latest versions of KDE Plasma

light blaze
#

I mean on arch I use xfce but like with ubuntu I find KDE more similar rather than kubuntu

upper prairie
#
warped nimbus
#

Ubuntu itself is alright but not a fan of Canonical so I stay away from Ubuntu

light blaze
#

what are you using then?

#

just curious

warped nimbus
#

Arch and Debian

upper prairie
#

There's only one thing about Ubuntu that I do not like

#

and that's snaps

light blaze
upper prairie
#

debatable, honestly

light blaze
#

I tried arch and debian but I stayed with debian only for a little

upper prairie
#

I'd never use Debian for a desktop

light blaze
#

arch was so much lighter and faster but I mean that's just probably because I installed some things poorly when I installed debian

upper prairie
#

I understand and can justify its use in servers, but not so much a daily driver

light blaze
#

yeah I uninstalled debian after a day 😅

upper prairie
#

Arch... I just don't like kind of altogether

light blaze
#

I mean I still liked it, better than ubuntu imo

upper prairie
#

maybe the only thing I actually like about Arch is that it's a rolling release

#

but in my opinion, openSUSE Tumbleweed just does everything better

light blaze
#

might be right yeah

warped nimbus
#

Canonical has made some poor choices like sending some user data to Amazon and also showing ads.

#

So I have a sour taste in my mouth

upper prairie
#

but also wasn't that like 6 years ago

warped nimbus
#

Yeah. maybe I am being petty but when there are so many other choices for distros I can afford to be so

upper prairie
#

I've basically landed on two distributions

#

Ubuntu and openSUSE

#

and honestly I don't see myself ever seeing much of a benefit in anything else

light blaze
#

I think I just fell for arch the first time I met linux distros I really have no idea why

#

I think it's because I saw it as a challenge

#

"to install something that's considered to be advanced"

upper prairie
#

I don't think I like how popular Arch is

light blaze
#

and it got stuck in my head

light blaze
#

I find it justified

upper prairie
#

I don't think I'll ever see it as justified

light blaze
#

what'd you think would be a better replacement then?

upper prairie
#

I feel like beyond the annoying installation process, there isn't terribly much to like about it

upper prairie
light blaze
#

that's the whole idea, the customization

warped nimbus
#

I like rolling release and AUR 🤷‍♂️

upper prairie
#

Just wait until you see TWs rolling release and the OBS

#

Much better in both regards, in my opinion

upper prairie
#

In the year that I used Arch, I've had so many things break just from casual use

#

Eventually I got tired of fixing the most random stuff, so I switched off of it and found openSUSE Tumbleweed

light blaze
upper prairie
#

Open Build Service

light blaze
#

I know lol

light blaze
warped nimbus
#

Okay I have no loyalty to Arch. Maybe I will check it out. But when something is established, and I don't have any major grievances, I can't really justify the effort to switch.

upper prairie
#

I felt the same until I got fed up with Arch lol

light blaze
#

yeah well I'm honestly just used to windows so much that I have a hard time getting to know linux, which is why I picked arch in the first place

upper prairie
#

I mean that kind of happened a lot for me

#

but openSUSE has a lot of benefits

#

One of my favorite being the YaST installer

#

during the final step, you can choose what software is automatically installed

#

You get to look through all of the patterns and only install what you want

light blaze
#

oh I didn't know that

#

that's a nice feature

upper prairie
#

It's fantastic

#

and that option will exist post-install in YaST

#

You can look at all the patterns and choose software to install in a GUI

#

An example of a pattern which might be appealing to you is the "Python development" pattern

warped nimbus
#

Go-to choice for something stable that's pretty much it

upper prairie
#

but I feel like openSUSE doesn't get as much love as it should

#

and I will preach that until I die

#

plus the community is amazing

#

I don't think I could say the same for Arch, honestly

light blaze
#

Arch's discord server community are fucking insanely nice

upper prairie
#

We must share different experiences

light blaze
#

sorry if I'm not allowed to swear but about 5 people there all together helped me install arch for the first time while explaining literally every bit to me and teaching me so much

#

they stayed with me on the chat for 6 hours

#

they helped me 6 hours straight without a break

light blaze
warped nimbus
#

I don't believe it's fair to make generalisations. There are good and bad people in every community. You just need to find the good guys.

fickle granite
#

ymmv

light blaze
#

they said it was a rare occasion and the support I received was a 1 in a million

#

they just felt like helping that moment

upper prairie
#

idk, always been harder for me to find an Arch community that wasn't so uh... elitist

warped nimbus
#

Well you're talking with two Arch users and neither of us came off as elitist I'd like to think. So we do exist :D

light blaze
#

yeah

#

but I am by any means not good enough to assist with anything that is arch related

#

well I got to go, it was a really fun chat and I learned quite a lot

#

I'll look through many new particular options I've been suggested here when I uninstall ubuntu

#

including new ubuntu flavors

mortal knoll
#

Feeling nutty rn

dapper musk
# upper prairie but I feel like openSUSE doesn't get as much love as it should

may i ask why? as far as ik there is nothing special about it. It is very similar in feature set to RHEL while having smaller support both community wise since it is less popular and enterprise wise since redhat is bigger company than suse. in addition to that at least from my experience they zypper is slower than dnf(this might be related to my location tho) and YAST the suposedly main selling point have awful interface in TUI mode(you need to constantly spam tab) + it is slow(loading? times). Why would someone use it over RHEL/CENTOS/Rocky or other clones?

trail sapphire
dapper musk
#

while fedora is quite good distro which makes good use of things like zram, thermald and pipewire however i personaly would't use it for desktop since wayland on nvidia is pain and i would't trust BTRFS with my data(multi disk is still considered experimental) also they are pushing flatpak imo awful technology which is compleatly unusable on my 11 year old thinkpad(secondary computer). Also since fedora relies on systemd boot times are awful compared to something like runit while they do not nessecarly matter on servers and desktops they do on laptops since hibernation in linux cannot described as working(tbh it is't used by any OS anymore) and "sleep mode" uses a lot of power while being idle turning off laptop is the only way to conserve battery and well waiting 30s while you want to check something fast is't ideal.

trail sapphire
fickle granite
#

@wispy ingot what exactly are you trying to protect your VPS from?

#

unless you're rich, I imagine the biggest threat is script kiddies; in which case, what you've already done should be fine

#

I've run a couple of EC2 hosts for years with nothing fancier than that, and (as far as I know! 🙂 ) have never been hacked

wispy ingot
#

oh cool, I see. Nope, I was just planning on making my Discord bot public and I'd just like to ensure I begin the right way - prevent any skid from getting into my VPS later down the road.

fickle granite
#

I wouldn't stress over it; ssh is good and linux is good; you sound like you know what you're doing

somber ermine
#

hey guys I have a question

#

how can I change filenames

#

with regex

#

I want to change log1.txt to mylog1-file.txt

#

with linux ofc

trail sapphire
light gorge
#

How ppl usually remap keys for MacOS? Caps to ctr on long press, caps to esc on short press. Anything else?

olive jungle
#

I'm having a problem with this:
bash: /home/vi/.bashrc: line 147: syntax error near unexpected token `(' bash: /home/vi/.bashrc: line 147: `export DISPLAY=\$(grep nameserver /etc/resolv.conf | awk '{print \$2; exit}'):0'Can I borrow a fresh pair of eyes?

upper prairie
olive jungle
upper prairie
#

Sure, but why would you need \?

olive jungle
#

I'm going by these instructions.

#
 echo "export LIBGL_ALWAYS_INDIRECT=1" >> ~/.bashrc```
#

this was copied exactly, so that's why I have the \

upper prairie
#

ah, I think I see

#

in your .bashrc, remove those backslashes

#

the purpose of them is to prevent the $() and $2 from being evaluated

#

like when you run the echo, I mean

#

but they're not intended to be in your .bashrc

olive jungle
#

export DISPLAY=$(grep nameserver /etc/resolv.conf | awk '{print $2; exit}'):0

#

so this should work?

upper prairie
#

If I had to guess, yes

olive jungle
#

just a sec

#

well, bash starts without an error now. i had hoped that removing the error would allow fsleyes to work but it's still saying it's unable to access X Display

upper prairie
olive jungle
upper prairie
olive jungle
#

localhost:0.0

#

i could change that to something else

#

i guess

upper prairie
#

Well

#

Then another question... Are you on Windows 11?

olive jungle
#

I hate networking tho it always feels hard to me but it's usually just my anxiety

#

windows 10

upper prairie
#

So then that might be why

#

"Unable to access the X Display" is presumably because you don't have WSLg

olive jungle
#

the steps i'm following are for WSL 2

upper prairie
#

which is a Windows 11 thing

#

WSL without WSLg doesn't have an X server

olive jungle
#

oh it doesn't?

#

shoot

upper prairie
#

Pretty sure, anyways