#unix

1 messages · Page 56 of 1

main olive
#

what how

#

physical abuse?

#

was it a problem with the teachers and school or students?

#

unlikely

#

but i can get a idea of it

#

i kinda care about it

#

i can see how is life and school in an other country

#

yea but how it can be that bad

#

yea is there a channel for misc

#

or other

#

Hi I got a quick question about alacritty

#

Or bash I guess

#

yea thats true

#

im tired of bash tbh

#

I just installed alacritty (terminal emulator)

#

And to enable bash completion

#

It says

#

So what do they mean by source that file in the bashrc

#

Like copy the file's content

#

into the bashrc

#

oh okay then all good I'll try that then

#

but yeah gnome-terminal is pretty good

#

If you're using a distro with the gnome environment

#

network wanna be friends on discord?

#

i dont think i can add you

#

its says you dont accept friend requests

#

ok.

#

same

#

ok i added you

main olive
#

I've been at this for days. haven't made any progress. please help 😫

#

btw is there a way to get ubuntu not on the Microsoft store?

main olive
#

nah, I meant on top of windows.

#

there's no way to know without a linux OS, correct? sorry im a bit of a noobie

#

WSL2

#

I don't think you understand where my problem is coming from. it's coming from the Microsoft Store. I've installed WSL plenty of times before on other computers. but for some reason now i'm getting this error every time I try to download it from the MS Store

#

i've been googling for days

#

I have

#

in fact I got this error before I installed any AV

#

seems like it. but i've tried them all

#

yes.

#

I have a list of stuff i've tried in the original post

#

yes

#

i've rebooted like a million times

#

where can I get this? lol

#

siiiiiigggghhh

#

thanks for trying

shrewd thicket
#

@main oliveso you can't install anything from the store?

main olive
#

correct

#

not even TikTok

shrewd thicket
#

and it's not possible to somehow install WSL without the store?

warped nimbus
opaque ginkgo
#

you can also install ubuntu w/o the store

#

@main olive

thorny vine
#

how should i go about completely updating from python3.8 to python3.9 on ubuntu 20.04 lts

#

i tried and it completely fucked up my system

dark rivet
#

don't

#

install another version without touching the old one

thorny vine
#

then pip doesn't work for me too well

#

it installs to the old ones packages

warped nimbus
#

Indeed, you should never try to upgrade/uninstall the system-installed Python or any system-installed Python packages

#

If you install another version alongside as suggested, you need to invoke pip through that version

#

e.g. python3.9 -m pip install ...

thorny vine
#

ok

#

i believe i have now installed both, but is there any way to keep python3 linked to python3.9 without fucking up apt?

warped nimbus
#

I don't know, I'm not intimately familiar with Ubuntu. It's probably fine to make a shell alias though.

thorny vine
#

ok, thanks

hazy spruce
#

this is the soul of my script NekoNod
py -3.8 "C:\Program Files\Python38\Tools\i18n\pygettext.py" --docstrings --output-dir="$locales_folder" --default-domain=base bot
can I somehow get pygettext without specifying the path

river echo
#

Does anyone know how can I use ffmpeg on a linux server?

runic quarry
#

This is a Unix room :/

hazy spruce
runic quarry
#

Where's the program located for you on Debian?

#

That'd be a start

#

On Debian (Ubuntu 20.04 anyway) I'm able to just run pygettext3.

#

pygettext2 also appears to be a package if you use Python 2

hazy spruce
#

I'll try that, I think I did something like that but didn't work, dunno will try again later. Currently I'm just using the path as is, thank you

main olive
warped nimbus
#

It's more complicated to set up compared to Ubuntu (not sure how the setup is different in the context of WSL). My intent wasn't to recommend you use it (you're welcome to if you want), but to point out that there are distros that can be installed without store, so presumably it should be possible for any distro, including Ubuntu. In fact, someone else seems to have found a way to do it and shared it.

charred saddle
#

I'm helping a friend with bash scripting

#

I'm not very familiar with it

#

how do I run one script from another and get the return value of the second script

amber garnet
wise forge
#

dpkg-reconfigure slapd brings GUI

#

I wish to run this command with scripted silent choices

#

not sure how to automate it yet

amber garnet
wise forge
#

i can see created admin user

#

not sure which password it has now %

#

plus not the desired domains were chosen

#

i think it should be possible to pre-select other choices

#

oh well, I could try to fit all my settings suiting those default ones

#

it could work too

main olive
#

yum -y localinstall oracle-database*18c*
the actual file is oracle-database-xe-18c-1.0-1.x86_64.rpm, are these * like regex * or what does it mean

formal schooner
#

yum doesn't use regex though

#

the * is a "wildcard"

#

it means "zero or more characters"

#

so hello* matches hello, hello123, hello-ng, etc.

#

this is parsed by the shell

#

in the context of the shell, it's called "globbing" or "file globbing"

#

if you put it in quotes, then bash won't parse the * as a wildcard pattern, but yum itself might still recognize * as a pattern

wise forge
#

how to automate pressing yes in CLI ;|

#

trying to automate easyrsa certificate signing

#

hmm, found interesting command expect, perhaps it will work

formal schooner
#

it's specifically meant for automating interaction with CLI tools, such as for testing or for batch processing like you're doing

woeful dome
wise forge
#

echo -en "yes\r" | program tried too

#

and e.t.c.

#

expect works splendidly.

woeful dome
#

TIL you can download files like /dev/zero (DO NOT DO THAT) or /dev/urandom (SAME) from your browser

#

with devastating consequences

#

Firefox just casually saves gigabytes of zeros into a specified location

#

and if you kill it, it continues downloading it on restart

formal schooner
#

wait what

#

you can just do file:///dev/zero and firefox will happily destroy your ssd?

#

...file a bug report?

amber garnet
woeful dome
#

not an easy mistake to make

#

(I was both)

formal schooner
#

I don't know, that's one copy and paste

#

That's too close to danger for me

woeful dome
#

art least it prompts you

formal schooner
#

Oh

woeful dome
lavish storm
#

Yum

#

I’d love some action

woeful dome
#

well, it didn't destroy my SSD, it downloaded about 2GB and then I stopped it

lavish storm
#

Any meaningful data?

woeful dome
#

lavish storm
#

I’m sorry

woeful dome
#

You just almost failed the turing test

lavish storm
#

I’ll let my dev know

woeful dome
#

&yeet Leothelion self-botting is not allowed by Discord's ToS

hushed spoke
#

hey, is it possible to get the PID of piped commands when using subprocess.popen? my target platform has an old dd or something cause status=progress doesn't exist and I have to send a USR1 signal to the process to get any progress messages. I made a thread to send the signal and sleep for a second and that works fine, but when i pipe something to dd, popen only seems to return the pid of the first command, even when shell=True

formal schooner
#

you also might want to use asyncio instead of threading for this

#

easier to bail out via ctrl+c if something is broken

candid dragon
#

yes

solid onyx
#

is there a lib that can convert datetime to unix timstamp?

#

or any way

#

i tried this

(datetime(2021,8,18,tzinfo=timezone.utc) - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()
``` but for some reason its returning 8:00 pm of yesterday
solid onyx
#

nvm i found a way

glad bough
#

Hi all, I am writing a jsonvalidator to check if a textfile is a valid json, i like to check if I can execute the textfile this way to execute the python beside the textfile to check if it is a valid json
python3.7 jsonvalidator.py textfile

candid dove
#

so?

lavish storm
#

cool

latent radish
#

im using virtualenv on a python project and pip installed pyttsx3 but i can't run my code because of this error
OSError: libespeak.so.1: cannot open shared object file: No such file or directory
how do i fix this?

main olive
#

i'm clueless when it comes to the shell but is it possible to place a blank line or a line of characters in between each prompt on the shell? so i can have a clear separation between previous output/prompts

cedar socket
#

I downloaded kali lunix but when i start the systeam i get this

#

Few second later it turns on

#

But why it shows me that how can i fix this

lavish storm
#

install another distro

#

set up VM

#

then install kali

#

or is kali lunix different to kali

cedar socket
obsidian plinth
#

Guys what is the $ sign refers to in Unix/Linux (ex, echo $)

shrewd thicket
#

no

#

it means dollar

#

it's used for currency

runic quarry
#

Bruh

lavish storm
#

$ in echo $ is just ... $?

#

unless you're doing something like echo $PATH, VimVim is right

opaque ginkgo
#

$var is how you refer to variables tho

#

also some other stuff

#

$() for command substitution

#

${} also for variables

median zenith
#

anyone has experience with 2gb< machines?

#

trying to find a good distro that would perform acceptable on a potato machine

#

I thought about arch immediately but I'm only experienced with deb atm

scarlet totem
#

lubuntu is what I normally run on lower spec machines

median zenith
#

xfce?

scarlet totem
#

lxde

median zenith
#

hmm never tried it but based on how good the performance is I might use it thanks

scarlet totem
#

I normally try to put a ssd in them

amber garnet
main olive
#

does that explain why my command doesnt work? it just descibes that --git is an option and there are others?

amber garnet
#

Idk why it doesn't work

#

Maybe custom diff command or something

main olive
#

ya maybe he's using an alias or something, weird

obsidian plinth
#

so, echo$ “HI”

#

Means it will print only “HI” ?

#

ah so you make a variable called “Hi” ?

#

and what are the values of this variable ?

#

in*

#

Null ?

#

If I wanted to make a variable with a value of 2 how I do it ?

#

echo $ “Hi” = 2

#

?

#

ah ok thx

finite hare
#

Hey, this is the state of my 1tb hard disc

opaque ginkgo
#

that's windows

finite hare
#

I wanna install Ubuntu, which section do I go to?

orchid axle
#

im using wsl and trying to use docker

#

i keep getting this error

#
The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.
#

it already is activated though

#

and if i try to use service docker restart

#

i get unrecognized service: docker

#

can anyone help?

opaque ginkgo
#

is docker on PATH?

orchid axle
#

excuse me

#

@opaque ginkgo

subtle cedar
#

can someone help me please, I'm trying to download parrot os security, but when I click to download the MATE version, nothing happens and the download don't start

amber garnet
gleaming topaz
#

How can i close an application (like chromium) from the command line?

#

Pls ping when you reply

amber garnet
gleaming topaz
#

will this kill all windows of cromium if i have more than 1?

fast aspen
#

anyone knows how to edit what is output onto a terminal ? because deleting a line is fairly easy but I would like to edit the whole terminal window (a bit like vim) is there any python package to do so? how does that work under the hoods 🙂

opaque ginkgo
#

curses?

#

or one of the various higher level libs

#

eg urwid, prompt toolkit, blessed

#

@fast aspen

fast aspen
opaque ginkgo
#

in the stdlib

#

rest on pypi

fast aspen
#

ok and did you try it out personally ?

opaque ginkgo
#

no, but they should work for your usecase

fast aspen
#

thanks

odd notch
#

!warn 753091699949174795 Please don't advertise here.

shy yokeBOT
#

:incoming_envelope: :ok_hand: applied warning to @limpid musk.

olive ice
#

Dependence’s are a bit annoying tho because you have to install the dependence’s then the application

prime sapphire
#

help ubuntu cant find any packages

dark rivet
#

did you apt update, also running as root is ill adviced

opaque ginkgo
#

you dont need to sudo if you're already root

#

did you add the nodejs repo to your source list

formal schooner
#

i've never had a problem with running apt search as root

opaque ginkgo
#

because npm is not on the main debian/ubuntu repos

lavish storm
#

pretty sure it is

prime sapphire
#

This worked, thank you so much.

obsidian plinth
#

Does Linux and Unix have same Bash commands ?

lavish storm
#

no

#

since not all shells are bash

#

regardless of which linux distro you're using

#

but all bash (assuming same version) should have the same commands

#

if that makes sense @obsidian plinth

warped nimbus
#

Note that things like sed, cat, ls, etc are not built-in shell commands but rather executable binaries that are external to the shell.

lavish storm
#

Oops sorry for tag

thorn portal
#

I have bash function that should take 2 arguments

#

how i need to ecape 2nd argument so i can pass "bash ~/path to script?/

main olive
#

@thorn portal can you give an example

thorn portal
#

@main olive thanks, figured it out.

confirm() {
    local message=${1:?Must provide an message.}
    local installation=${2:?Must provide installation script path}
    local falied=${3:-Incorrect response. Exiting}
    # call with a prompt string or use a default
    read -r -p "$val" response
    case "$response" in
        [yY]) 
            $installatio | sh
        *)
            $falied
    esac
}

Instead pasing in $2 'bash path/to/script' i just pass 'path/to/scritp'

slate crypt
#

$installatio
Typo here?

#

You should put your scripts through shellcheck

formal schooner
#

also falied

gilded berry
#

so basically guys I’ve just set up my first Linux vps on aws. I want to install packages with pip. Running “pip -V” shows me pip for python 2.7, which I don’t want. “pip3 -V” shows pip for 3.7, which I also don’t want. How can I find the right command for pip for python 3.8? (Sorry if my question makes little sense)

rose fractal
gilded berry
rose fractal
#

Yes

gilded berry
agile schooner
#

I am using ubuntu 20.04 and I want to write a bash script that checks if specified scripts crashed in the background. Can anyone provide a bash script code for that?

harsh owl
#

make your script print a success / failure to a logfile somewhere, and check that?

warped nimbus
#

Also consider creating a service unit (systemd) for scripts that need to run in the background.

formal schooner
#

☝️ you can make systemd units that run as your current user, you don't need to do it with root

sudden compass
lavish storm
#

Can’t say I’ve used ksh, I’ve used zsh for as long as I can remember

amber garnet
#

make cake command of a day for Linux 🐧

lavish storm
#

thanks

gilded berry
#

hi guys, so im trying to run pip3.8 install discord.py on my amazon linux 2 vps but im running into a problem. it starts to install but it then throws this error and i dont know what it means: Command "/usr/bin/python3.8 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9y9qeuxn/multidict/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-d1shx3xe-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-9y9qeuxn/multidict/ any help would be appreciated

main olive
#

I downloaded Endeavouros but there is an error

lavish storm
#

Looks fine

#

You’re in

amber garnet
amber garnet
#

Or pwd

main olive
#

Ok

lavish storm
#

Yeah you’re all good

amber garnet
#

Like @lavish storm said, you are in

main olive
#

kiinda off topic, but i'm writing a batch script that iterates through a bunch of subdirectories using a for loop and a function, resulting to stack overflow.
how do i wait before each function call is finished?

formal schooner
lavish storm
#

i don't know if you can write batch scripts for unix systems

#

perhaps someone with more experience in this regard can add their experience

azure bane
#

I hope a Linux question is acceptable...

I'm on a fresh Linode Ubuntu 20.04 install. I've setup ssh and hostname. When I try to install mc I get...

Any ideas?

#

I'm actually unable to install anything. Should I check with Linode?

lavish storm
#

update your package list beforehand

azure bane
lavish storm
#

have you done a apt-get update?

azure bane
lavish storm
#

lol

#

happens

#

always update package list before installing

azure bane
# lavish storm lol

It's been a LONG 2 days! Banging my head agaisnt trying to docker deploy a Django site

azure bane
lavish storm
#

i have homelab so i know the pain all too well

#

tread steadily mate

azure bane
lavish storm
#

good luck 🦾

final pecan
#

I'm creating an experimental Discord server for developers who target linux systems so that there's a common place to ask questions. For example, about gtk theming, grub editing, power management, systemd services, and many more things. If you are interested, DM me because I do not know if it is appropriate to share an invite link here directly. Thanks! And you're welcome to invite anyone who you think fits the bill

#

Mods can delete my message if it is not appropriate

leaden geyser
#

@final pecan you can always ask if it is via @tight thorn.

wise forge
#

hmm, I enabled ufw

#
root@proffit:~# ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW IN    Anywhere                  
22/tcp (v6)                ALLOW IN    Anywhere (v6)             
#

and enabled ssh only

#

but why I still can connect to 443 port? why am I still seeing the web site?

#

I thought it supposed to close it

#

I even tried explicitely denying 443 port

amber garnet
wise forge
#

connecting via ssh

#
root@proffit:~# ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW IN    Anywhere                  
443/tcp                    DENY IN     Anywhere                  
22/tcp (v6)                ALLOW IN    Anywhere (v6)             
443/tcp (v6)               DENY IN     Anywhere (v6)   
#

I explicitely forbid 443 traffic fully%

wise forge
#

fresh server%

#

installed only python/pip/docker stuff

#

tried already ufw reload

amber garnet
#

Sorry, idk what is going on, I prefer iptables

wise forge
#

all right

#

I'll google more ufw guides then

#

it just has so easy interface

#

and inbuilt into ubuntu

#

I think it would be better to learn it than iptables

#

I expect less learning curve

wise forge
amber garnet
#

Lol

wise forge
#

how to make iptables rules to deny everything
but allow all traffic for 80/22/443?

#
    - name: Allow connections on multiple ports
      ansible.builtin.iptables:
        chain: INPUT
        protocol: tcp
        destination_ports:
          - "80"
          - "22"
          - "443"
        jump: ACCEPT

works only for 22 trafic

#
    - name: Block all the rest
      ansible.builtin.iptables:
         chain: INPUT
         policy: DROP

this denies everything for sure

#

I have a problem with properly allowing 80 and 443 traffic

#

oh yes, apperently I need to allow few other things

wise forge
#

one step closer, but still not working

- name: Allow related and established connections
  ansible.builtin.iptables:
    chain: INPUT
    ctstate: ESTABLISHED,RELATED
    jump: ACCEPT
  become: yes
#

wohoo it works (i changed nothing, just launched from scratch)

hushed spoke
#

hey, anyone have any experience automating a secure erase? i made a tinylinux usb bootable that I want to be able to wipe drives for my work, and im trying to implement secure erase for SSD's, but I notice some SSD's (mainly samsung) are auto placed in a security freeze state from the bios on boot. I've read the main way to get around that is putting the system to sleep using /sys/power/state.. but this requires someone to manually wake the pc up before wipe... is there any way around this without putting the whole system to sleep?

#

i do understand that having a program like mine, which auto wipes on boot could be a security issue, which is why I assume this is a hard thing to do lol

open lodge
#

is robot software work good on win or unix

main olive
#

@open lodge can you clarify

main olive
#

hello

#

does anyone use virtualbox

final pecan
wise forge
formal schooner
#

virt manager is a huge pain to set up correctly

#

Missing dependencies, permissions, d-bus stuff

#

It seems to be mostly a documentation and downstream packaging issue, but i think virtualbox is a whole lot easier to get started with

wise forge
#

the upsides are multiple on other side

#

I can ssh connect to my virt machines

#

they have ip address, and I can connect them between each other, which is great in order to test multi machine programms

#

I can nulificate chosen settings for some virt machine, and clone the machine into multiple ones with different ips/names/whatever_wished

amber garnet
#

How about Qemu? Or Qubes? Does someone use it? pithink

wise forge
#

if I guess right, virt-manager is just a comfortable GUI+CLI to interact with Qemu

amber garnet
sleek finch
#

Hello, I have a question. How do I edit a printed line without editting the line that printed it

amber garnet
main olive
#

bro im gonna have stroke. i run this command: sudo mv swift-5.3-RELEASE-ubunutu20.04 /usr/share swift and it gives me this error mv: target 'swift' is not a directory

#

how can i fix?

harsh owl
#

you have an extra space between share and swift. what are you trying to do?

main olive
#

install swift

#

but yeah i'll try that

#

oh it worked, silly mistake on my end. thank you bro @harsh owl

next kestrel
#

hey how can i execute a .elf file in kali linux?

#

google doenst seem to have the answer

opaque ginkgo
#

oh boy

#

@next kestrel kali linux is bad for beginners

#

try something like ubuntu instead

#

but for your actual question

#

elf files are linux executables, so you just run them normally
make sure that you have exec perms tho

#

do chmod +x filename if you dont

next kestrel
#

i realised what i was doing wrong, it was on a USB drive so thats why it would say permission denied

#

thanks for the response tho lol

woven yarrow
#

Let's say I have a script that runs a monitoring function on an infinite loop that checks for some conditions every minute and sends me a Slack notification if a condition is met.

I want to make the script HA by running it on multiple servers, but only one instance should be running at any given time, to avoid multiple concurrent checks and duplicate Slack notifications. So if monitor-1 is the primary monitoring server, monitor-2, monitor-3, etc. should be just waiting. But the moment the script on monitor-1 is down, monitor-2 should take over until monitor-1's script comes back up, and so on.

How can I achieve this in a way that makes sense? Technologies I'm using are MongoDB for DB, RabbitMQ for queue, FastAPI for API

inland gulch
wise forge
#

after setting those iptables rules I can't load even data from apt update, how to fix it? or making download from docker.io repository to build an image

      - name: Allow connections on multiple ports
    ansible.builtin.iptables:
      chain: INPUT
      protocol: tcp
      destination_ports:
        - "80"
        - "22"
        - "443"
      jump: ACCEPT
      rule_num: 1

    - name: conntrack allow RELATED and ESTABLISHED
      ansible.builtin.iptables:
        chain: INPUT
        ctstate: ESTABLISHED,RELATED
        jump: ACCEPT
        rule_num: 2

    - name: Block all the rest
      ansible.builtin.iptables:
         chain: INPUT
         policy: DROP
         rule_num: 5
wise forge
wise forge
#

for some reason, if I change /etc/resolve.conf and add additional nameservers like 8.8.8.8, 4.4.4.4, apt update starts to work, but I don't get it why

amber garnet
wise forge
#

the issue solved ;b
found on my own. I needed DNS being allowed at 53 port INPUT, with udp included.

sleek finch
lavish storm
#

you can stout to a file and do further manipulation

main olive
#

anyone able to help me install swift on my debian 10 system?

lavish storm
#

what have you tried

main olive
#

maybe i should try moving it to the opt directory

lavish storm
#

when you say "never worked" can you clarify

main olive
#

i've followed numerous guides & videos to install but when i verify the install by swift --version. it always says that it doesn't exist

lavish storm
#

guides for debian 10?

#

could you link me one

main olive
lavish storm
#

and which version of swift are you trying to install

main olive
#

Swift 5.4.2

#

i think my main mistake is that after i extracted the tar.gz file, i moved it to share

#

instead of opt

main olive
#

would sudo apt install swift work?

lavish storm
#

no

#

you ought to build from source

zinc topaz
#

Hi guys, I have a custom class that I import in different scripts, and I am trying to make that class get the directory where it is being used. All the solutions i've tried using os.path, pathlib, __file__ etc always point to where the module sits rather than where it's being called from. Any idea how to do that?
EDIT: solved in help channel: pathlib.Path(sys.argv[0]).resolve()

main olive
#

anyone know how to make vim follow the formatting of the code that you just pasted?

runic quarry
#

Unless Debian 10 doesn't have it packaged or something

#

I'd honestly use that anyway, as it makes it easier if/when you actually want to remove Swift from your system.

runic quarry
lavish storm
#

official documentation says to install dependencies then build from source

#

i don't think the app being in /usr/share or /opt/ really matters so long as they are added to PATH correctly

lavish storm
#

alias vim to sudo chattr -R -i /sys/firmware/efi/efivars; sudo rm -rf /sys/firmware/efi/efivars

?

viscid inlet
#

Is there any online web shell service to just play around with basic commands...??
I want my friends to learn basic Linux commands but they don't have a linux distro, so an online web shell would be something nice to begin with....

lavish storm
#

the issue is that there are many shells

#

some of which do not share the same commands

#

e.g. bash vs zsh

viscid inlet
lavish storm
#

whereas UNIX commands are universal to all of them

warped nimbus
#

I think replit gives you access to a shell. If you're on Windows you could also set up WSL and use that

viscid inlet
warped nimbus
#

Well I mentioned replit

viscid inlet
#

tysm

warped nimbus
#

Iirc there is a tab to switch between program output and a shell

lavish storm
#

yeah replit gives you bash

warped nimbus
#

Not for all languages eg python shows the python repl instead. You can get bash if you pick C

lavish storm
#

oh that's odd, i get both bash interactive python

#

for python

warped nimbus
#

Maybe it's different on mobile or it's cause you're signed in

main olive
formal schooner
#

Compiled programs don't belong in share anyway, that's for platform independent shared data

#

It's obnoxious that they don't have something like rustup or pyenv for building swift

#

Doesn't apple have like the most money of any company in the world

granite aspen
#

I am on Windows 10. There is a library I am trying to install that says it's not guaranteed to work on Windows. If I get the same error trying to install it in normal Windows and via WSL, what does this mean?

#

I have the visual studio build tools, or whatever they're called.

formal schooner
#

possibly that whatever it needs from a non-windows system isn't guaranteed to be present even under WSL

#

what about WSL2?

granite aspen
#

A coworker told me to try using 3.8 instead of 3.9. but I'm afk right now.

formal schooner
#

it probably does

#

what's the library?

granite aspen
#

This might be the error from when I tried it with pure windows, but the error is the same in wsl

#

No that one is wsl

#

Also activating a virtual environment doesn't make python point to it lemon_angrysad

formal schooner
#

hah maybe they expect you to use py?

#

that's surprising, i thought it did

granite aspen
#

I might need to install python 3-dev or -venv within wsl

formal schooner
granite aspen
#

Well, I'll try again with 3.8 when I'm at my computer next

formal schooner
#

it's possible that they pinned python_requires='3.8.*'

granite aspen
#

🤷‍♂️

formal schooner
#

i'm confused too

granite aspen
inland gulch
#

Re tmnt on windows, right at the top of the installation manual is:
"TMNT is currently only supported for Linux/MacOS. While the following steps should in theory work for Windows, some users have reported problems with installation of some of the 3rd party libraries."

formal schooner
#

what isn't clear to me is why pip doesn't know about the newer versions of autogluon.core on pypi

#

i thought it would be because they just hadn't uploaded windows wheels but that doesn't appear to be the problem

#

@granite aspen i found it, lol

Requires: Python >=3.6, <3.9

#

i didn't see it in their setup.py but it must be somewhere in their files

#

so that's why it didn't work on 3.9, because it explicitly doesn't support 3.9

amber garnet
opaque ginkgo
#

not async tho

formal schooner
#

@amber garnet ...i started building it myself

formal schooner
main olive
#

$ neofetch

warped bane
runic quarry
#

@main olive Sorry for the delay, but does sudo apt install swift not work on your system?

olive ice
#

Sudo apt update

#

Sudo apt upgrade

#

Sudo apt purge package

#

Sudo apt install package

#

Sudo apt autoremove

runic quarry
#

what?

#

Umm

olive ice
#

Just do apt -help

runic quarry
#

He just needs to know how to install Swift rn

#

lol

olive ice
#

I gave you all stuff apt can do from memory

olive ice
runic quarry
#

Just try sudo apt install swift if you haven't yet and then we can go from there @main olive

lavish storm
#

No

#

it’s not on apt

olive ice
#

Then git clone it and build it from source

lavish storm
#

i've linked the official documentation earlier and it tells you to build from source

#

alas, i couldn't find a youtube video that tells you that

lavish storm
#

yes same, but i don't think it's the same thing

#

note that the OP is using debian 10, trying to install the newest stable version of swift

#

yup

#

ubuntu versions 18.04 and newer are officially supported, but that wasn't the issue here

#

i'll link it again

#

and this

#

with Buster, the newest version of Swift you can install is 5.1.1

#

due to the specific version of compiler Swift requires

#

so please, don't give me the "sudo apt install swift should work fine" and "use apt -help"

#

it only causes more confusion for the person that actually wants help

untold abyss
#

pretty simple question.

!cp ./{class_1, class_2, class_3}/* ./Train_Images/

why does this not work?

lavish storm
untold abyss
#

copy all files in multiple folders to 1

#

usually I use multiple statements, but I wanted to know why this doesn't work

lavish storm
#

and are there folders named class_4 and so on?

untold abyss
#

no

#

just 3

#

Error:-

cp: cannot stat './{class_1,': No such file or directory
cp: cannot stat 'class_2,': No such file or directory
cp: cannot stat 'class_3}/*': No such file or directory
lavish storm
#

how's this

#

just use class_*/*

untold abyss
#

sorry but the folder names are actuall different since they have some sensitive stuff 😅

lavish storm
#

so they cannot be wildcarded?

untold abyss
#

well, I guess I can take a risk with a single character. lemme try

#

@lavish storm luckily, that works very well. Thanks a lot bro! 🍰 🤗

lavish storm
#

no worries

main olive
olive ice
runic quarry
#

Maybe upgrade to Debian 11?

#

Unless it's not feasible

ionic goblet
#

isnt unix propiretary

wise forge
ionic goblet
#

👍

ionic goblet
#

Wow

#

And I can certianly agree that windows is the best os

#

for flashing the iso of arch linux

lavish storm
main olive
#

beep! beep! boop! boop!

main olive
#

mental outlaw is based

olive ice
dull cloak
#

i need some debian help, im trying to host a wireless hotspot from debian

ionic goblet
#

Hey, could someone help me with the following? I have my .bash_aliases file which I want to add aliases in. I want an alias with a variable to which an argument will be passed to:

$ echo "alias sayhi='Hello $1'" >> ~/.bash_aliases
$ source ~/.bash_aliases

$ sayhi foobar
Hello foobar

How would i achieve something like this?

wise forge
#

and make alias to it

ionic goblet
#

Ok thanks

#

Oooooh thats nice i didint know about that

#

Thanks alot!

#

👍 Thank you, I don't have any more questions, you explained very well

woven yarrow
#

Currently I have my DB, message queue, etc. usernames and passwords exposed in my Python scripts, so I'm thinking of switching to environment variables to make it more secure. But, where do you store those variables then? For automated deployment for example, the variables should be set before the script starts for the first time. But if I just include the variables in the deployment script then they're once again exposed and it loses the entire purpose?

formal schooner
#

No matter what, the secrets need to be exposed in cleartext to your production processes

#

As far as I know, the best practices mostly are based on minimizing the risk of accidentally leaking those secrets

#

Depending on how complicated your requirements are, you can use a secrets management tool like what is offered by AWS or Google Cloud

#

There are probably 1 million other small vendors providing that kind of service

main olive
#

considering that bash process would be a parent

#

and when doing "automated deployment" just deploy that bash script as a wrapper

#

also look into symmetrical encryption with gpg to quickly encrypt and decrypt files that could hold all the sensitive data it has the simplest syntax out there

woven yarrow
#

What if for example I have a project that multiple people work on, and each of them needs to be able to access the DB for development, but I don't want everyone to know the user and password to the DB? A secret won't work for that as you can easily access them

amber garnet
formal schooner
woven yarrow
woven yarrow
formal schooner
#

at some point somewhere you will need the decryption keys for the secrets on the production machine

#

And you will need to give them some kind of restricted access to the production machine, maybe they're only able to run the deploy script using a restricted shell

#

In my organization we set up our internal applications to read from a specific environment file that the developer is expected to have created or obtained and placed in the source code repository

#

There is a "dev" version and a "prod" version

woven yarrow
#

Yeah I was just trying to see if there's a simple solution to this problem

formal schooner
#

In my case the devs have access to both, but in your case maybe the devs would only have access to the former

woven yarrow
formal schooner
#

I think the commercial secrets management tools offer very precise access controls

formal schooner
#

I don't know of any specific practices for working with potentially untrusted people like this

woven yarrow
#

Well everyone is potentially untrusted aren't they? In the past I've been hiring a coder for 4 years or so and then later found out he has been copying data since his day 1 and I don't want to get screwed again. So I guess keep what I have now, devs can only access the dev DB and I can deploy with the production DB

#

What if I use the same environment variables but with different values? For example the devs will have MONGODB_CLUSTER=dev.cluster.com but the production servers will have MONGODB_CLUSTER=prod.cluster.com

#

I guess that would make sense in my case?

#

So I don't need to change stuff around before deploying to production, their code will work but the servers will use the production DB

formal schooner
woven yarrow
formal schooner
modern sinew
#

does bash work for windows?

dark rivet
#

in wsl

modern sinew
#

hm is it enabled already on most systems?

dark rivet
#

no, you have to install it

modern sinew
#

ah ic

#

which is more portable whiptail or dialog?
for shell purposes

lavish storm
#

i have used mingw bash on 🪟 in the past

#

which i hope is still relevant today

modern sinew
#

will it work for moving files?
specifically for the mv cmd

lavish storm
#

Yes

modern sinew
#

ah alright thank you

wise forge
#

otherwise you could work with regular tools for virtualization

mild folio
#

Let's say I have a command which accepts a long list as an argument, how do I break that up with line breaks:

gcloud compute instances create-with-container gcp-scrape \
    --scopes='https://www.googleapis.com/auth/bigquery','https://www.googleapis.com/auth/pubsub', 'https://www.googleapis.com/auth/devstorage.full_control'

The classic \ doens't work to separate lists as the single elements get picked up as a new arguments

formal schooner
#

@mild folio i would construct the list using a shell parameter:

scopes='https://www.googleapis.com/auth/bigquery'
scopes+=',https://www.googleapis.com/auth/pubsub'
scopes+=',https://www.googleapis.com/auth/devstorage.full_control'
gloud compute instances create-with-container gcp-scrape -- scopes="$scopes"
#

i'm not sure if += is POSIX standard but i know it works in bash and zsh, probably also ksh

#

of course, zsh has handy array operations for this

scopes=(
  'https://www.googleapis.com/auth/bigquery'
  'https://www.googleapis.com/auth/pubsub'
  'https://www.googleapis.com/auth/devstorage.full_control'
)
gloud compute instances create-with-container gcp-scrape \
  -- scopes=${(j:,:)scopes}
#

(you also don't need to defensively quote everything in zsh, which is a big benefit imo)

hollow canyon
#

what's graphic interface are you recommend to raspberry pi zero w?

olive ice
#

Dwm?

#

Xfce4

#

Gnome

#

Bugie

#

Cinnamon

#

Openbox

#

Any wm

undone pulsar
#

While I'm sure it can handle running a TWM, If you're using this for GPIO projects I'd recommend just sticking a wpa_supplicant config onto the SD card and just using SSH to get things set up

#

If your project is heavily dependent on a GUI (a media server or emulator, maybe?), then a Pi Zero maybe isn't your best bet.

#

I had a hackathon project a while ago that needed X11 running on an older Pi, and for that we used ALARM + a tiny BSPWM config. Idled at ~100MB, which was handy

formal schooner
#

most "minimalist" WMs should idle at like 300-500 MB

#

not sure how much memory a pi zero has

hard zealot
#

does anyone know of any solutions to issues with pykhet

#

on debian

lavish storm
#

vague

#

considering the last time pykhet got a release was like 5 years ago i won't be surprised if the issue isn't arising from your distro

olive ice
#

Well ssh pretty handy and rsync well I end this here

muted field
#

where is os.getcwd() defined?

#

i can't find it in os.py

shy yokeBOT
#

Modules/clinic/posixmodule.c.h lines 1001 to 1011

#define OS_GETCWD_METHODDEF    \
    {"getcwd", (PyCFunction)os_getcwd, METH_NOARGS, os_getcwd__doc__},

static PyObject *
os_getcwd_impl(PyObject *module);

static PyObject *
os_getcwd(PyObject *module, PyObject *Py_UNUSED(ignored))
{
    return os_getcwd_impl(module);
}```
muted field
#

i was thinking should i use, os.getcwd() or Path.cwd()

#

and then found they are the same

formal schooner
#

the latter is nicer because it returns a Path instance

muted field
#

yeah, that is right

#

got it

hexed osprey
#

Hello, I have an issue related to running vagrant in a wsl environment =>

hexed osprey
hexed osprey
#
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
devout wedge
#

hello.

#

i have a problem. i installed Python correctly but i cant run "pip" command. what should i do?
edited: im using macos monterey beta

lavish storm
#

could you show the output when you do these:

#
$ python --version (or python3 --version)

$ pip --version

$ echo $PATH
devout wedge
#

python3 --version: output Python 3.9.6

#

@lavish storm

lavish storm
#

try python3 -m pip --version

devout wedge
lavish storm
#

ok this is the verdict

#

you do have pip

#

but it's not aliased to pip

#

so if you want to use pip, do python3 -m pip for now

devout wedge
#

thanks.

lavish storm
#

you can also add the alias to your zshrc at a later date

lavish storm
#

🐳

frigid solar
#

no, pip is by default available on all python versions via python -m pip, but if you want to use pip then you would need to install pip via the get-pip boostrapper

lavish storm
#

was gonna suggest ensurepip but i wasn't sure if it was a good alternative to get-pip

half heron
#

what do I do if ensurepip is disabled in ubuntu

lavish storm
half heron
#

It said the package is not available so Im updating it now, thanks anyway

lavish storm
half heron
#

yeah I'm doing that right now

olive ice
#

Anyway I can get mpv to loop?

formal schooner
#

@devout wedge it might be called pip3

olive ice
olive ice
vagrant elbow
#

just the right channel...

#

1631106005737 -> this is time data. the unix timestamp right?

lavish storm
#

seems so

#

@vagrant elbow

opaque ginkgo
#

well

#
In [4]: datetime.fromtimestamp(1631106005737)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-4-4ea3cb6c6fd1> in <module>
----> 1 datetime.fromtimestamp(1631106005737)

ValueError: year 53657 is out of range
#

or is this in nano seconds

lavish storm
#

oh i noticed they have 13 digits

#

but then again the first couple numbers align with that of UNIX time

opaque ginkgo
#

ah, its in millisec

#
In [5]: datetime.fromtimestamp(1631106005737//1000)
Out[5]: datetime.datetime(2021, 9, 8, 9, 0, 5)
lavish storm
#

that'd make sense

vagrant elbow
#

pytime.asctime(time.localtime(1631106005737//1000)) 'Wed Sep 8 14:00:05 2021'

#

how do i do the syntax highlighting?

opaque ginkgo
#

!code

shy yokeBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

opaque ginkgo
#

datetime module >>> time module btw

#

much nicer to work with

solemn snow
#

Umm, so if I have a mac and am currently usikng v 3.8.6 but if I wanted to update it how would I do it?
if i manually install it will it automatically override the existing version?

solemn snow
#

I have 3.9 installed but my terminal shows 3.8.6
Why?

inheritanc-e@Inheritanc-MacBook-Pro ~ % python3 --version
Python 3.8.6
lavish storm
#

try python3.9 --version

solemn snow
#

ye that worked

lavish storm
#

🐳

solemn snow
#

but the thing is for 3.9 i have to install a whole new set of ummm modules

#

like pip modules

#

is there a way to make the modules consistent?

lavish storm
#

do you not have project-specific requirements.txt file?

solemn snow
#

hmm

#

ye

#

oh ok

lavish storm
#

then i guess make requirements.txt from the list of modules you have on python3.8

solemn snow
#

ye got it

#

i forgot about that

#

thanks

pulsar basalt
#

Is it worth to buy a bundle of Unix/Linux related books on Humble Bundle?

amber garnet
formal topaz
#

I'm trying to uninstall all traces of python3.9 installed from the source code. Is this the righ tplace to get help? (Ubuntu 18.04)

olive ice
#

That’s the newest version of Ubuntu well I forgot newest version of Ubuntu

formal schooner
#

it's usually a good idea to install source packages somewhere "isolated" like /opt or /.local

#

maybe you can figure out the list of files from the install process

#

but at minimum there will be a lib/pythonX.Y directory somewhere, some pkgconfig scripts, some share/man files, and various python-related bin things - python, python3, pip, pip3, etc.

formal topaz
#

the main thing is, I get directory does not exist, when running python3.9 commands, instead of the usual command not found

#

This worries me, did I delete something important?

formal topaz
formal schooner
formal topaz
formal topaz
formal schooner
formal schooner
#

you might have added it in a file like ~/.profile, ~/.bash_profile, or ~/.bashrc

formal topaz
#

There was a command that I added to my .profile that points to the .bashrc file

formal schooner
#

type which python

formal topaz
formal schooner
#

what shell are you using @formal topaz ?

#

bash? the default?

white saffron
#

bash

#

yes

#

Sorry that's my alt.

lavish storm
#

root YuUmaruShook

white saffron
white saffron
white saffron
#

Ahh I just found the issue regarding the problem I had with pyenv

#
export PATH="$PYENV_ROOT/bin:$PATH" should have been export PATH="$PYENV_ROOT/shims:$PATH"
formal schooner
#

i also tend to get a lot of use out of the where builtin in Zsh, which shows all possibilities for a command, not just the first

#

it can help a lot when diagnosing path issues

#
/Users/srl/.local/opt/pyenv/shims/python
/Users/srl/.local/opt/miniconda3/bin/python
/usr/bin/python
/opt/local/bin/python
/opt/pkg/bin/python

i currently have five python's in my path and have zero issues

#

but that's because i've set things up somewhat carefully

#

in fact i'm missing one that should probably be there

#
/Users/srl/.local/opt/pyenv/shims/python3
/Users/srl/.local/opt/miniconda3/bin/python3
/usr/local/bin/python3
/opt/local/bin/python3
/opt/pkg/bin/python3

here, 5 non-"system" python 3 installations

white saffron
#

Oh, very interesting. About deleting the installations of python directly from compiling the source, should I be worried about leaving a mess there?

formal schooner
#

it would bother the hell out of me, yes

#

it probably won't cause harm if it's somewhere out-of-the-way like /opt, but it's probably safer not to have it

white saffron
#

Yeah, I got pyenv to work well and probably won't have issues. But anyways, I installed both 3.9.6 and 3.9.7 directly from the source using the commands from this tutorial. However I tend to make a bunch of fatal errors when deleting stuff like this, so I really want to make sure I delete them the right way. https://tecadmin.net/how-to-install-python-3-9-on-ubuntu-18-04/

lavish storm
#

is there a reason why you're choosing to build from source rather than through apt with PPA?

formal schooner
#

sounds like they wanted/needed a specific version and thought that pyenv didn't work for them, even though it appears to work fine now

#

it's hard to tell where make altinstall will install things to

#

@white saffron you said it was somewhere in /opt? try find /opt -iname '*python*' to at least get a list of files that could be python related

#

then we can start working backwards to surgically remove the things we don't want

formal schooner
#

(this is why installing things to non-isolated directories is dangerous)

white saffron
formal schooner
#

then you can probably rm -rf them both

#

but double check that they aren't referenced in PATH or any installed scripts

white saffron
#

so just check the ~/.bashrc?

#

I know /opt didn't have any directories before I installed those two so I'm just going to go ahead and delete them.

#

What else do I have to remove though?

#

Oh this is odd.

formal schooner
#

first of all, open a new shell

#

who knows what's in this one

#

second, where and how did you install pyenv?

white saffron
#

This is a new shell.

#

I installed pyenv by cloning

git clone https://github.com/pyenv/pyenv.git ~/.pyenv
#

This is the end of my ~/.bashrc file

formal schooner
#

ok, good

#

what is $PATH right now?

white saffron
#

Also, I really appreciate all the time you've taken to help me out. Even if things don't end up working out.

#

Ok this is very odd.

white saffron
formal schooner
#

change shims back to bin, you're probably missing the pyenv script itself

white saffron
#

I changed it back. and rebooted the shell

formal schooner
#
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv >/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi
white saffron
#

Yeah that's what I have now

formal schooner
#

that should work. what does pyenv versions say?

white saffron
#

This is the same config/issues I was having just before I gave up on pyenv to install from the source

formal schooner
#
perl \
  -e 'print "PATH:\n";' \
  -e 'foreach (split(/:/, $ENV{"PATH"})) { print "\t$_\n"; }'

what does this print?

white saffron
formal schooner
#

and what does pyenv which python show?

white saffron
lavish storm
#

root sweatDuck

formal schooner
#

wait you're not currently root are you?

lavish storm
#

they are

formal schooner
#

don't do that

#

holy

#

no

lavish storm
#

every screenshot has been in root

white saffron
#

I am in root

#

I never even configured any other users, except the postgres user

white saffron
#

Yes, my entire vps host is a complete mess

formal schooner
#

why do you have /root/.pyenv in there twice?

white saffron
#

oh my! I didn't even realize. I suppose I must've installed it awhile ago and reinstalled.

#

Oh I messed up the shell script or something

#

I ran exec "$SHELL" again, and your shell script, and now I have three /root/.pyenv/bin

formal schooner
#

stop execing, they all inherit env vars

lavish storm
#

have you quit being root

white saffron
#

No I have no other users

white saffron
lavish storm
formal schooner
white saffron
formal schooner
#

pyenv global changes what pyenv uses by default

#

you have to make sure that pyenv's shim is in PATH before the system python

#

so in that output with the perl incantation i sent you, the pyenv shim needs to be higher in the list

white saffron
#

I see. How would I do that? I need to keep the bin path it seems. I suppose the whole issue is a result of me updating alternatives a few times before.

olive ice
formal schooner
#

Look at your bashrc script

#

You need pyenv itself

#

When you eval that pyenv init thing, pyenv will set up the shim path for you

formal schooner
# olive ice Why I talk to myself

You might want to re-ask your question in its entirety, and maybe also be more specific/detailed when asking. If nobody is responding, it's because nobody knows how to help you

white saffron
formal schooner
#

and if you don't have$PYENV_ROOT/bin in PATH, then indeed pyenv won't be visible in PATH

white saffron
#

Oh I see! So should I remove the if statement?

white saffron
white saffron
formal schooner
white saffron
#

No I have no .bash_profile

formal schooner
#

ok

#

.profile is only run in a login shell

#

.bashrc is only run on a non-login interactive shell

white saffron
#

Oh.. so it should be in both?

formal schooner
#

pyenv is meant to work more or less inside an interactive shell session, so you should put it in .bashrc

#

what you can do is source .bashrc from within .bash_profile, but put a check at the top of .bashrc to not run if the shell isn't interactive

#

basically circumventing bash's strange behavior

white saffron
#

create a bash_profile? my current .profile already sources .bashrc by default

formal schooner
#

ok good

#

that's fine

#

.profile will be used if .bash_profile doesn't exist

#

to make things simple, do all of the pyenv stuff in ~/.bashrc

white saffron
#

Ok let me change that. Give me one second.

formal schooner
#

that will mean pyenv is only "active" in interactive shells, but that's okay because pyenv is mostly meant for interactive shell work

#

~/.profile:

if [ -r ~/.bashrc ]
then
  . ~/.bashrc
fi

~/.bashrc:

# Don't run in non-interactive shells (in case it was invoked from a non-interactive shell)
case $- in
  *i*) ;;
  *) return;;
esac

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
white saffron
#

Yup. That was there by default

#

This is my ~/.bashrc now

#

And this is ~/.profile

formal schooner
#

in the future it's a lot easier to help if you post text and not screenshots

#

!code

shy yokeBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

formal schooner
#

```bash
echo 123
```

white saffron
#

👍

formal schooner
#

yes, that check for BASH is good too

#

those files look correct as-is, but i recommend using $PYENV_ROOT and not hard-coding $HOME/.pyenv

white saffron
#

Ok. just add that variable?

formal schooner
#

like i did in my example

white saffron
#

Got it.

formal schooner
#

for example i use a totally different location

export LOCAL_OPT="$HOME/.local/opt"

export PYENV_ROOT="$LOCAL_OPT/pyenv"
export PATH="$PYENV_ROOT/bin"
#

(my actual scripts are more complicated, and i use zsh instead of bash because it's a lot saner)

white saffron
#

I see. I suppose I should install zsh eventually.

formal schooner
#

and i suppose i should write a bash->zsh migration guide eventually

#

i think a lot of people open zsh for the first time and see the scary "new user" prompt and give up

white saffron
#

I use zsh on my local computer, decided to not install bash on my host because I thought it wasn't necessary

#

About the pyenv global command, am I missing some pyenv file? That runs when pyenv init - is called? It seems like the shims path is never set up.

formal schooner
#

show me the full contents if your bashrc file (but please redact any API keys and such)

#

and show me that perl script output again, from clean interactive shell

#

(i.e. not with exec, either make a new window in tmux or log out and log back in over ssh)

formal schooner
#
[ -z "$PS1" ] && return

why not do the case $- idiom? this seems sketchy e.g. if you set PS1=

#

(most people wouldn't do that, but still)

white saffron
#

I have no idea, these are just there by default.

formal schooner
#

this is ubuntu?

#

interesting decision

white saffron
#

yes. 18.04

formal schooner
#

did you actually install pyenv to ~/.pyenv?

#

or somewhere else?

white saffron
#

~/.pyenv

#
PATH:
    /root/.pyenv/plugins/pyenv-virtualenv/shims
    /root/.pyenv/bin
    /usr/local/sbin
    /usr/local/bin
    /usr/sbin
    /usr/bin
    /sbin
    /bin
    /usr/games
    /usr/local/games
    /snap/bin
#

this is the result of your perl script after opening a new shell.

formal schooner
#

that looks correct to me

#

what does pyenv global say now?

#

and pyenv versions?

white saffron
formal schooner
#

interesting

#

it looks like you're missing the pyenv shims in PATH

#

i wonder why that is

#

what happens if you run eval "$(pyenv init -)" in the shell now? does the path output change?

white saffron
#

No. same as before

formal schooner
#

that's weird

#

this is in a brand new shell? logged out over ssh and logged back in?

white saffron
#

yes

formal schooner
#

do you get any weird output when starting a shell?

#

nothing that looks like a warning or error from pyenv?

white saffron
#

no

formal schooner
#

i find it strange that pyenv-virtualenv is working but not pyenv

#

oh

#

they changed pyenv recently

white saffron
#

Pyenv seems to work, it just doesn't alter the path

formal schooner
#

you need to manually add the shims to path

#

ugh

#

i forgot about this

#

so you need to eval both pyenv init --path and pyenv init -

white saffron
#

after pyenv init? or before?

formal schooner
#

~/.profile

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"

if [ -n "$BASH" ]
then
  if [ -r ~/.bashrc ]
  then
    . ~/.bashrc
  fi
fi

eval "$(pyenv init --path)"
#

they don't give a complete example, annoyingly

white saffron
#

interesting. Should I just add the init --path to the bashrc where the rest of the script is?

formal schooner
#

and ~/.bashrc has

eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
formal schooner
#

but i would do it in the order they recommend, maybe it matters

#

my own setup has diverged from this slightly

white saffron
#

Ok so I'll add

eval "$(pyenv init --path)"
``` before the other two
formal schooner
#

it seems like you're supposed to add it after the other two

white saffron
#

Ohh i see it runs bashrc before

formal schooner
#

see the ~/.profile example?

white saffron
#

I get it

#

yes

formal schooner
#

i don't know if it matters, it probably doesn't

#

but that is what they recommend so it's what i'll recommend to you

#

i will have to propose a PR with complete examples of init files as per their recommendations

white saffron
#

Oh my goodness. It worked.

#

Thank you so much. I can't believe you wasted all this time on me!

formal schooner
#

i guess this is a complete example:

~/.profile:

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"

if [ -n "$BASH" ]
then
  if [ -r ~/.bashrc ]
  then
    . ~/.bashrc
  fi
fi

if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init --path)"
fi

~/.bashrc:

case $- in
  *i*) ;;
  *) return ;;
esac

if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
  if command -v pyenv-virtualenv 1>/dev/null 2>&1; then
    eval "$(pyenv virtualenv-init -)"
  fi
fi
white saffron
#

Yes. I have everything in .bashrc though. Like you said, pyenv should be only for interactive prompts correct?

formal schooner
#

meh, if you're only logging in with SSH, then you should always be starting with a login shell, so you can do this setup

#

that way you get pyenv properly set up in your PATH

white saffron
#

Ok. So I'll most the path export and the pyenv init --path command back to .profile

formal schooner
#

the pyenv init - part is just to enable the pyenv shell and some venv-related things that need access to the current shell

#

yes, but make sure to do things in the order they specify

white saffron
#

👍

formal schooner
#

it probably doesn't matter, but do it anyway

white saffron
#

I will. Oh lastly, do you know any resources I can use to learn how to go about undoing a python installation from compiling the source code?

formal schooner
#

there probably won't be any resources on it

#

like i said, go look at the makefile to see what got installed where

#

try make -Bn altinstall to see what it would run, without executing anything

lavish crest
#

I am trying to setup this ssg https://rgz.ee/ssg.html , but I can't figure out this sentence:

Make sure ssg6 and lowdown or Markdown.pl are in your $PATH:

I am on mac so i tried adding "/bin/ssg6", "/bin/lowdown" in etc/paths.. Can anyone help?

formal schooner
#

so if ssg6 is in $HOME/bin, then you want to add $HOME/bin to PATH

nimble coyote
#

Hello i have unfortunetly deleted all python file on my pc in fedora, and now i got this when i try to run a command on the terminal : Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Fatal Python error: initfsencoding: Unable to get the locale encoding ModuleNotFoundError: No module named 'encodings'

#

i'v tried to install python again but no sucess
when i'v run the 'make test' to install python i'v go all test done but the last test_socket have been running since 1hour and still not finished:/

#

and i got this when i did the make install
i cannot work since i got this probleme, someone know how to help me please?

olive ice
lavish storm
#

first off you are in root

#

jesus

#

not a good habit because if you mess something up there's no going back

formal schooner
nimble coyote
#

I cannot use it because i need python for my file manager

formal schooner
#

Use the shell for now

#

Log in as single-user on the linux console if you need to

nimble coyote
formal schooner
#

@nimble coyote use the package manager, i think on fedora it's dnf

nimble coyote
#

Yes but i need python to use it :/

#

It dont work anymore without python

dark rivet
#

that's why you don't touch the system python

#

reinstall linux?

nimble coyote
dark rivet
#

no idea how much fedora uses python, but back them up to some external drive. if you can't do that, oh well

#

restore from your previous backups

nimble coyote
#

Can't i copy the /home of myy linux from my Windows ?

#

Because i have a dual boot

formal schooner
#

@nimble coyote log into windows, make a live USB, boot linux from the live USB, reinstall the base OS

#

in the future, use Pyenv to install python

nimble coyote
#

A live USB ?

solemn cipher
#

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
my apt package manager broke while trying to upgrade to apt 2.3.9, im getting this error "

#

and upon runnig the dpkg command, it gets stuck at setting up apt

#

can anyone fix this?

woven burrow
#

chessprogramming

solemn cipher
#

I did it

#

@main olive I tried kill all command too but I did a temporary fix

#

I downloaded the apt .deb package from debian package repository and it works fine now@main olive

#

@main olive thanks for assistance

#

Btw I ran dpkg

#

Yea

formal schooner
#

i usually do apt install on .deb files

wise forge
#

when I launch from same folder expect script

#!/usr/bin/expect
set timeout 5
set name [lindex $argv 0]
spawn ./easyrsa/easyrsa sign-req client $name
expect "Confirm request details:"
send "yes\r"
interact

it works, but... when I launch the same with ansible

  - name: Create cert if not exists
    ansible.builtin.shell: ./easyrsa/create_crt.sh {{ inventory_hostname }}
    args:
      chdir: files/
      creates: "pki/issued/{{ inventory_hostname }}.crt"
    delegate_to: 127.0.0.1
    become: no

it is stopped right before interact. it is not finishing itself

#

hmm, some sort of difference between how I launch it by hand and how ansible launches it

#

interact is not working from ansible i think

#

according to the logs

formal schooner
#

maybe you need a pty allocated?

#

not sure if there's a way to tell ansible to use ssh -t

wise forge
#
{
"stdout_lines": [
            "spawn ./easyrsa/easyrsa sign-req client 65.21.146.6",
            "",
            "Note: using Easy-RSA configuration from: ./easyrsa/vars",
            "",
            "",
            "You are about to sign the following certificate.",
            "Please check over the details shown below for accuracy. Note that this request",
            "has not been cryptographically verified. Please be sure it came from a trusted",
            "source or that you have verified the request checksum with the sender.",
            "",
            "Request subject, to be signed as a client certificate for 3650 days:",
            "",
            "subject=",
            "    commonName                = 65.21.146.6",
            "",
            "",
            "Type the word 'yes' to continue, or any other input to abort.",
            "  Confirm request details: yes"
        ]
}
#

right after yes, it supposed to finish it. but it is not

wise forge
#

hmm, all right. so I will see arguments to the module

#

I think there it should be achieved easer

#

or I need to replace interact command with smth else

formal schooner
wise forge
#

oh, all right. there should be argument for that

wise forge
#

then it did not require any additional privileges

formal schooner
#

good to know

plush vigil
#

can someone help me with vscode and python interpreter? I'm trying to locate python 3.9.5 interpreter so I can use it in vscode. i know i have it because whenever I run python 3 in my terminal, that's the version I get. In vscode though, i can only find 3.8.8

#

I'm rather new to Linux, so this is proving more difficult than I thought

opaque ginkgo
#

which python3

#

will print the path to py 3.9

#

which you can then use in vscode