#unix
1 messages · Page 56 of 1
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
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?
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
@main oliveso you can't install anything from the store?
and it's not possible to somehow install WSL without the store?
@main olive I don't know about Ubuntu specifically, but I know there are distros that can be installed without the store. I've seen arch https://github.com/yuk7/ArchWSL#archwsl and I think alpine before
you can also install ubuntu w/o the store
@main olive
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
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 ...
ok
i believe i have now installed both, but is there any way to keep python3 linked to python3.9 without fucking up apt?
I don't know, I'm not intimately familiar with Ubuntu. It's probably fine to make a shell alias though.
ok, thanks
this is the soul of my script 
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
Does anyone know how can I use ffmpeg on a linux server?
Are you on Windows?
This is a Unix room :/
then give me answer for unix 
I am both on Windows and Debian
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
python -m pygettext?

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
oof, but isn't arch like super hard to learn?
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.
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
You can run it by using $(...)
output=$(ls) # you can put any command instead of `ls`
return_code=$?
dpkg-reconfigure slapd brings GUI
I wish to run this command with scripted silent choices
not sure how to automate it yet
Try to set DEBIAN_FRONTEND to noninteractive
well, DEBIAN_FRONTEND=noninteractive dpkg-reconfigure slapd I guess it worked to create with all default values
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
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
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
how to automate pressing yes in CLI ;|
trying to automate easyrsa certificate signing
hmm, found interesting command expect, perhaps it will work
i was going to suggest exactly this
it's specifically meant for automating interaction with CLI tools, such as for testing or for batch processing like you're doing
yes | program 🙂
already tried 😉 it did not work
echo -en "yes\r" | program tried too
and e.t.c.
expect works splendidly.
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
wait what
you can just do file:///dev/zero and firefox will happily destroy your ssd?
...file a bug report?
I am almost persuaded to do it 
well, you must be either really brave or really stupid or both to do that
not an easy mistake to make
(I was both)
art least it prompts you
Oh
well, it didn't destroy my SSD, it downloaded about 2GB and then I stopped it
Any meaningful data?
❓
You just almost failed the turing test
I’ll let my dev know
&yeet Leothelion self-botting is not allowed by Discord's ToS
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
the Popen object will have a pid attribute
you also might want to use asyncio instead of threading for this
easier to bail out via ctrl+c if something is broken
yes
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
nvm i found a way
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
so?
cool
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?
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
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
install another distro
set up VM
then install kali
or is kali lunix different to kali
Yes it is onther one
Guys what is the $ sign refers to in Unix/Linux (ex, echo $)
Bruh
$ in echo $ is just ... $?
unless you're doing something like echo $PATH, VimVim is right
$var is how you refer to variables tho
also some other stuff
$() for command substitution
${} also for variables
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
lubuntu is what I normally run on lower spec machines
xfce?
lxde
hmm never tried it but based on how good the performance is I might use it thanks
I normally try to put a ssd in them
does that explain why my command doesnt work? it just descibes that --git is an option and there are others?
like there's this: https://unix.stackexchange.com/questions/102287/diff-git-unknown-option
but that just says "dont use the command" which the guy clearly did
Hmm, yeah, man diff doesn't have the git name anywhere on my computer 
Idk why it doesn't work
Maybe custom diff command or something
ya maybe he's using an alias or something, weird
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
I wanna install Ubuntu, which section do I go to?
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?
is docker on PATH?
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
Download button works very well for me
How can i close an application (like chromium) from the command line?
Pls ping when you reply
You can also use programs like htop to find process and kill it by sending SIGKILL for example
will this kill all windows of cromium if i have more than 1?
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 🙂
curses?
or one of the various higher level libs
eg urwid, prompt toolkit, blessed
@fast aspen
do you have a link ?
ok and did you try it out personally ?
no, but they should work for your usecase
thanks
!warn 753091699949174795 Please don't advertise here.
:incoming_envelope: :ok_hand: applied warning to @limpid musk.
Dependence’s are a bit annoying tho because you have to install the dependence’s then the application
did you apt update, also running as root is ill adviced
you dont need to sudo if you're already root
did you add the nodejs repo to your source list
i've never had a problem with running apt search as root
because npm is not on the main debian/ubuntu repos
pretty sure it is
This worked, thank you so much.
Does Linux and Unix have same Bash commands ?
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
Note that things like sed, cat, ls, etc are not built-in shell commands but rather executable binaries that are external to the shell.
UNIX for poets throwback
Oops sorry for tag
I have bash function that should take 2 arguments
how i need to ecape 2nd argument so i can pass "bash ~/path to script?/
@thorn portal can you give an example
or clarify this
@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'
also falied
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)
Which AWS AMI are you using? Each Linux distribution comes with a specific or set of python version(s) installed
If you're using Amazon Linux 2, this should help you install 3.8: https://techviewleo.com/how-to-install-python-on-amazon-linux/
Thank you
Will that install pip for 3.8 aswell?
Yes
Thanks
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?
make your script print a success / failure to a logfile somewhere, and check that?
Also consider creating a service unit (systemd) for scripts that need to run in the background.
☝️ you can make systemd units that run as your current user, you don't need to do it with root
Thank God!! ksh one of the older ones, still the best, imnsho. Been using it since before bash was even a thought.
Can’t say I’ve used ksh, I’ve used zsh for as long as I can remember
make cake command of a day for Linux 🐧
thanks
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

Yeah you’re all good
Like @lavish storm said, you are in
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?
can you be more specific?
batch or bash
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
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?
maybe try apt-get install mc?
update your package list beforehand
have you done a apt-get update?
face palm Thank you
It's been a LONG 2 days! Banging my head agaisnt trying to docker deploy a Django site
Yeah. Thanks...My brain is fried apparently. I appreciate the reminder
I want to code...but deploying a web site...OMG!!!
good luck 🦾
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
@final pecan you can always ask if it is via @tight thorn.
Okay 😅
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
Are you connecting by localhost?
no, it is remote vps server from hetzner
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%
Hm 
ubuntu 20.04
fresh server%
installed only python/pip/docker stuff
tried already ufw reload
Sorry, idk what is going on, I prefer iptables
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
https://www.digitalocean.com/community/questions/ubuntu-ufw-firewall-not-working-at-all
https://blog.viktorpetersson.com/2014/11/03/the-dangers-of-ufw-docker.html
urgh. it appears that docker and ufw conflict in uptables.
So if for some reason someone raises any service with docker and expects ufw to block connections... it will not.
Lol
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
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)
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
is robot software work good on win or unix
@open lodge can you clarify
I do
Recommending virt-manager. It Is the best
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
hmm, the only small problem I had with initial virt emulator working, that's it
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
How about Qemu? Or Qubes? Does someone use it? 
virt-manager works through qemu
if I guess right, virt-manager is just a comfortable GUI+CLI to interact with Qemu
Oh, okay, I am not familiar with all of those programs
Hello, I have a question. How do I edit a printed line without editting the line that printed it
Are you asking about shell command? You can use awk or sed for example
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?
you have an extra space between share and swift. what are you trying to do?
install swift
but yeah i'll try that
oh it worked, silly mistake on my end. thank you bro @harsh owl
hey how can i execute a .elf file in kali linux?
google doenst seem to have the answer
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
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
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
@woven yarrow sounds like a 'leader election algorithm' problem, have a look at https://zookeeper.apache.org/doc/current/recipes.html
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
Isn't it more #networks thing? 
🤔 technically we resolve the problem with very unix specific iptables thing
so I would say it is more unix problem than networking issue. Because since we are in python server, #networks channel is more busy with python networking issues than general networking issues
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
From my point of view it's network configuration problem and maybe there are people on #networks whos can help 
worthy to try
the issue solved ;b
found on my own. I needed DNS being allowed at 53 port INPUT, with udp included.
I just clear the console lol
you can stout to a file and do further manipulation
anyone able to help me install swift on my debian 10 system?
what have you tried
installing the tar file, extracting it and moving it the share directory. as many guides told me to, but it never worked
maybe i should try moving it to the opt directory
when you say "never worked" can you clarify
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
Swift is an open-source language that is used as a fast and interactive programming language to develop various software for all platforms and servers. This article shows you how to install Swift on a Debian 10 server.
and which version of swift are you trying to install
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
would sudo apt install swift work?
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()
anyone know how to make vim follow the formatting of the code that you just pasted?
Should work just fine if you ask me
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.
Did you move it to /usr/share/swift?
A common complaint I see in discussions about using Swift on Linux is that it's not possible to install Swift through popular package managers and distributions besides Ubuntu. Why is this the case? Are there technical reasons behind this? Is there anything I can do to help improve the situation?
Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.
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
alias
vimtosudo chattr -R -i /sys/firmware/efi/efivars; sudo rm -rf /sys/firmware/efi/efivars
?
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....
you probably mean UNIX commands
the issue is that there are many shells
some of which do not share the same commands
e.g. bash vs zsh
ahh yeah that one..
whereas UNIX commands are universal to all of them
I think replit gives you access to a shell. If you're on Windows you could also set up WSL and use that
Yeah it might just work, but I'm just curious if there are any such web shells
Well I mentioned replit
Iirc there is a tab to switch between program output and a shell
yeah replit gives you bash
Not for all languages eg python shows the python repl instead. You can get bash if you pick C
Maybe it's different on mobile or it's cause you're signed in
whenever i moved it to share it didn't work at all, but when i moved it to opt it worked but it was missing some packages to run
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
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.
possibly that whatever it needs from a non-windows system isn't guaranteed to be present even under WSL
what about WSL2?
Sorry, wsl2 is what I'm using. I thought it was implied that that's what people use these days
A coworker told me to try using 3.8 instead of 3.9. but I'm afk right now.
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 
I might need to install python 3-dev or -venv within wsl
that error message is confusing, the file they are looking for is right here https://pypi.org/project/autogluon.core/0.2.0/#files
Well, I'll try again with 3.8 when I'm at my computer next
it's possible that they pinned python_requires='3.8.*'
🤷♂️
i'm confused too

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."
right, but that's not actually this issue
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
Thanks!
Is there something similar for Python? 👀
not that i know of, but you could probably build it on https://docs.python.org/3/library/asyncio-subprocess.html#asyncio-subprocess
@amber garnet ...i started building it myself
i forgot about this, it's cute
in fact i will probably borrow a lot of ideas from their implementation, particularly https://amoffat.github.io/sh/sections/piping.html#advanced
Wow lol
$ neofetch
@main olive Sorry for the delay, but does sudo apt install swift not work on your system?
Sudo apt update
Sudo apt upgrade
Sudo apt purge package
Sudo apt install package
Sudo apt autoremove
Just do apt -help
I gave you all stuff apt can do from memory
Well from memory well what I remembered it can do
Just try sudo apt install swift if you haven't yet and then we can go from there @main olive
Then git clone it and build it from source
that's what i've been saying the whole time
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
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
A common complaint I see in discussions about using Swift on Linux is that it's not possible to install Swift through popular package managers and distributions besides Ubuntu. Why is this the case? Are there technical reasons behind this? Is there anything I can do to help improve the situation?
i'll link it again
Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.
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
pretty simple question.
!cp ./{class_1, class_2, class_3}/* ./Train_Images/
why does this not work?
what are you trying to do exactly?
copy all files in multiple folders to 1
usually I use multiple statements, but I wanted to know why this doesn't work
and are there folders named class_4 and so on?
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
sorry but the folder names are actuall different since they have some sensitive stuff 😅
so they cannot be wildcarded?
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! 🍰 🤗
tried that, installed it then when i tried swift --version it said command not found. so i assume it installed something else
I forgot sudo apt search
Might be out of luck then 😦
Maybe upgrade to Debian 11?
Unless it's not feasible
isnt unix propiretary
https://www.guru99.com/difference-unix-vs-linux.html
apperently it is
👍
Wow
And I can certianly agree that windows is the best os
for flashing the iso of arch linux

beep! beep! boop! boop!
mental outlaw is based
Well it did evolve into freebsd in the end
i need some debian help, im trying to host a wireless hotspot from debian
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?
as a blunt way, just make shell script
that will accept your argument as first one after itself
yourscript.sh $1
and make alias to it
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
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?
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
you can make a bash script which would set those environment variables and call python script which will have access to them
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
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
Isn't it possible to prohibit reading specified column?
Which DB are you using?
Then don't give them access to the production DB, give them access to a test/dev DB with the same schema but fake data
MongoDB, but I don't want to prohibit anything from them, I just don't want to expose the credentials for security reasons
That's what I'm doing right now but they need to deploy to production stuff also
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
Yeah I was just trying to see if there's a simple solution to this problem
In my case the devs have access to both, but in your case maybe the devs would only have access to the former
What if your devs were to steal your data from the production one?
I think the commercial secrets management tools offer very precise access controls
I think eventually you are screwed against a sufficiently motivated internal attacker, but like I said you can implement internal access controls to try to make it hard for them to actually access the secrets, rather than just running the deploy script
I don't know of any specific practices for working with potentially untrusted people like this
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
That's precisely what I was suggesting
I already been using prod and dev clusters just wasn't sure what's the best approach for handling this, using the same variable with different values completely crossed my mind for some reason lol
Nothing is obvious if you've never thought of it before
2 deep 4 me
does bash work for windows?
in wsl
hm is it enabled already on most systems?
no, you have to install it
depends on what you want to do with it
i have used mingw bash on 🪟 in the past
which i hope is still relevant today
ic
will it work for moving files?
specifically for the mv cmd
Yes
ah alright thank you
wsl is available in Windows 10+, requires installation
otherwise you could work with regular tools for virtualization
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
@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)
what's graphic interface are you recommend to raspberry pi zero w?
I wouldn't 🙂
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
most "minimalist" WMs should idle at like 300-500 MB
not sure how much memory a pi zero has
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
Well ssh pretty handy and rsync well I end this here
https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Modules/clinic/posixmodule.c.h#L1001-L1011
weird, i don't see where os_getcwd_impl is defined
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);
}```
i was thinking should i use, os.getcwd() or Path.cwd()
and then found they are the same
the latter is nicer because it returns a Path instance
Hello, I have an issue related to running vagrant in a wsl environment =>
When i typed the command vagrant up I got this error
vm: * The host path of the shared folder is not supported from WSL. Host path of the shared folder must be located on a file system with DrvFs type. Host path: .
I saw on the github issues that I could fix that with this line of code
config.vm.synced_folder '.', '/vagrant', disabled: true
```, which I did.
But now I get another error saying
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
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
could you show the output when you do these:
$ python --version (or python3 --version)
$ pip --version
$ echo $PATH
try python3 -m pip --version
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
thanks.
you can also add the alias to your zshrc at a later date
its work
🐳
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
was gonna suggest ensurepip but i wasn't sure if it was a good alternative to get-pip
I tried that but it says pip module not found
what do I do if ensurepip is disabled in ubuntu
in your case i think you should check for python3-pip in apt
It said the package is not available so Im updating it now, thanks anyway
have you done a sudo apt-get update first?
yeah I'm doing that right now
Anyway I can get mpv to loop?
@devout wedge it might be called pip3
—loop exists
Thanks
just the right channel...
1631106005737 -> this is time data. the unix timestamp right?
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
oh i noticed they have 13 digits
but then again the first couple numbers align with that of UNIX time
ah, its in millisec
In [5]: datetime.fromtimestamp(1631106005737//1000)
Out[5]: datetime.datetime(2021, 9, 8, 9, 0, 5)
that'd make sense
thanks, i finally figured it
pytime.asctime(time.localtime(1631106005737//1000)) 'Wed Sep 8 14:00:05 2021'
how do i do the syntax highlighting?
!code
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.
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?
I have 3.9 installed but my terminal shows 3.8.6
Why?
inheritanc-e@Inheritanc-MacBook-Pro ~ % python3 --version
Python 3.8.6
python3 is symlinked to python3.8 probably
try python3.9 --version
ye that worked
🐳
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?
do you not have project-specific requirements.txt file?
then i guess make requirements.txt from the list of modules you have on python3.8
Is it worth to buy a bundle of Unix/Linux related books on Humble Bundle?
Hmm... I think that you can find this kind of informations in the web but if you prefer e-books then you can buy them
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)
That’s the newest version of Ubuntu well I forgot newest version of Ubuntu
what was the install prefix?
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.
yes it was in /opt
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?
By going through and deleting these, will I have the default configuration back? I tried installing python3.9.6 from the source, and I still get the directory not found error.
post: 1) the exact error, 2) the contents of $PATH in your shell, 3) the steps you performed during installation
note that usually Pyenv is the best/easiest way to install python on linux https://github.com/pyenv/pyenv
I've tried pyenv, was unable to get pyenv global to change the python version. It would show a success message, but the python command in terminal still showed the system python version.
I currently have no errors. This python3.9.7 version was installed from the source with the instructions from this tutorial. (The second half) https://tecadmin.net/how-to-install-python-3-9-on-ubuntu-18-04/
Installing Python 3.9 on Ubuntu 18.04 with Apt. Two methods to install Python 3.9 on Ubuntu 18.04 using PPA or Source code.
that's because you didn't add the pyenv shim to your PATH
if you get errors only after removing python, then you need to make sure the /opt/whatever place where you installed it is not in PATH
you might have added it in a file like ~/.profile, ~/.bash_profile, or ~/.bashrc
How do I do that?
There was a command that I added to my .profile that points to the .bashrc file
it looks like you did, with export PATH=
type which python
root 
Terrible idea isn't it?
Would it help if I show the .bashrc file as well?
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"
good catch, that is indeed the right value
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
Oh, very interesting. About deleting the installations of python directly from compiling the source, should I be worried about leaving a mess there?
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
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/
is there a reason why you're choosing to build from source rather than through apt with PPA?
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
ah i see 👍
(this is why installing things to non-isolated directories is dangerous)
/opt only has two folders. Both from the altinstall. (Python-3.9.7 and Python-3.9.8)
then you can probably rm -rf them both
but double check that they aren't referenced in PATH or any installed scripts
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.
first of all, open a new shell
who knows what's in this one
second, where and how did you install pyenv?
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
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.
Pyenv automatically starts when I use ```sh
export PATH="$PYENV_ROOT/bin:$PATH"
in the `~/.bashrc`
However, `pyenv global` doesn't make any changes to the system python when using "bin" instead of "shims" in the bashrc.
If I change the path from "bin" to "shims", then pyenv does not start on reboot.
change shims back to bin, you're probably missing the pyenv script itself
I changed it back. and rebooted the shell
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv >/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
Yeah that's what I have now
that should work. what does pyenv versions say?
This is the same config/issues I was having just before I gave up on pyenv to install from the source
perl \
-e 'print "PATH:\n";' \
-e 'foreach (split(/:/, $ENV{"PATH"})) { print "\t$_\n"; }'
what does this print?
and what does pyenv which python show?
root 
wait you're not currently root are you?
they are
every screenshot has been in root
Yes, my entire vps host is a complete mess
why do you have /root/.pyenv in there twice?
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
stop execing, they all inherit env vars
have you quit being root
No I have no other users
Oh I didn't know. I restarted the shell, and here's the new output.
that looks good. but what happened to your bashrc setting up pyenv?
Same as before, pyenv seems to function normally, but pyenv global does not alter the system python version.
it shouldn't
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
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.
Why I talk to myself
Yes, i said to keep it
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
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
Sorry I don't follow you. It runs the pyenv init command though.. This is what's currently at the end of my .bashrc file #unix message
but command -v pyenv will return non-zero status if pyenv itself isn't visible in PATH, so the stuff inside the if will never run
and if you don't have$PYENV_ROOT/bin in PATH, then indeed pyenv won't be visible in PATH
Oh I see! So should I remove the if statement?
This is what I don't understand. I cleared everything related to pyenv from the .bashrc, and wrote
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
``` If I run `exec "$SHELL"` after editing, pyenv command work. (except pyenv global)
But on a new shell, pyenv raises `command not found`
That's my issue. I removed all the stuff from the .bashrc and put it in .profile. I figured that was better because it goes to .profile before the .bashrc file. Now, the only thing that doesn't work is pyenv global. Even though pyenv init - is getting run
you also have a .bash_profile right? but it's just set to source .profile?
No I have no .bash_profile
ok
.profile is only run in a login shell
.bashrc is only run on a non-login interactive shell
Oh.. so it should be in both?
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
create a bash_profile? my current .profile already sources .bashrc by default
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
Ok let me change that. Give me one second.
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 -)"
in the future it's a lot easier to help if you post text and not screenshots
!code
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.
```bash
echo 123
```
👍
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
Ok. just add that variable?
like i did in my example
Got it.
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)
I see. I suppose I should install zsh eventually.
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
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.
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)
[ -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)
I have no idea, these are just there by default.
yes. 18.04
~/.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.
pyenv versions:
system
* 3.9.6 (set by /root/.pyenv/version)
3.9.6/envs/.venv
.venv
pyenv global;
3.9.6
python -V:
Python 2.7.17
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?
No. same as before
that's weird
this is in a brand new shell? logged out over ssh and logged back in?
yes
do you get any weird output when starting a shell?
nothing that looks like a warning or error from pyenv?
no
i find it strange that pyenv-virtualenv is working but not pyenv
oh
they changed pyenv recently
Pyenv seems to work, it just doesn't alter the path
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 -
after pyenv init? or before?
~/.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)"
that's what i gathered from their docs https://github.com/pyenv/pyenv/
they don't give a complete example, annoyingly
interesting. Should I just add the init --path to the bashrc where the rest of the script is?
and ~/.bashrc has
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
yeah, if you're doing it all in the same place that should be OK
but i would do it in the order they recommend, maybe it matters
my own setup has diverged from this slightly
Ok so I'll add
eval "$(pyenv init --path)"
``` before the other two
it seems like you're supposed to add it after the other two
Ohh i see it runs bashrc before
see the ~/.profile example?
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
Oh my goodness. It worked.
Thank you so much. I can't believe you wasted all this time on me!
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
Yes. I have everything in .bashrc though. Like you said, pyenv should be only for interactive prompts correct?
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
Ok. So I'll most the path export and the pyenv init --path command back to .profile
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
👍
it probably doesn't matter, but do it anyway
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?
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
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?
it's telling you to add the directory containing those executables to PATH
so if ssg6 is in $HOME/bin, then you want to add $HOME/bin to PATH
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?
Test stuff in vms don’t go breakjaro your own computer
first off you are in root
jesus
not a good habit because if you mess something up there's no going back
Reinstall python with your package manager, and next time don't mess with system files + don't do things as root
I cannot use it because i need python for my file manager
How Can i install python with shell ?
@nimble coyote use the package manager, i think on fedora it's dnf
Yes but how Can i do it without loosing my files ?
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 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
A live USB ?
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?
chessprogramming
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
i usually do apt install on .deb files
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
maybe you need a pty allocated?
not sure if there's a way to tell ansible to use ssh -t
{
"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
pty allocated?
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
basically telling ssh that it has an interactive terminal available
oh, all right. there should be argument for that
solved 😉
replaced interact with expect eof
then it did not require any additional privileges
good to know
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


