#unix
1 messages ยท Page 40 of 1
@restive helm your ps and grep command only found itself, not your bot ๐
aye, if you grep ps output, you will always match the grep you're grepping with unless you also do | grep -v grep
is someone here using openBSD?
how is it
i've used openbsd before
it's alright
the OS is pretty nicely integrated with itself
only reason I moved was because some things that I needed weren't compiling
@ebon wigeon Did you solve the issue?
I did, actually! Thank you so much for asking. I had pulled the 3.7src and compiled it then copied over my host machine's /usr/lib(64)/, and /usr/local/lib(64)/ and it worked!
Glad to hear that!
You know that scene in the oringinal Jurassic Park where the girl sits in front of a computer and excited says "This is unix! I know unix!"
Well I thought the interface was just another janky hollywood mockup. But I learned today that its an actual file explorer that was used with old Silicon Graphics machines. Its called FSN - file system navigator
and pronounced "Fusion"
Lol i accidently hacked myself
command: ['sh', '-c', 'echo "Hello, Kubernetes!" && sleep 3600']
What does -c do?
specifies a command on the commandline (as opposed to stdin), this case echo && sleep
Ah okay cool
I thought sh did that but i guess sh just shells you into the container
Thanks
it's a flag for sh
that entire command can be written as sh -c 'echo "Hello, Kubernetes!" && sleep 3600'
okay so can you give me a stdin example?
echo 'echo "Hello, Kubernetes" && sleep 3600' | sh
running sh "whoami" without the -c flag would try to open a script file called whoami instead of running the command
ah right okay i understand thanks
wait so
sh is like cd/
?
nvm
im just playing around in the terminal
and its listing folders for auto compelte with sh
well, you can also do sh directory/script.sh, that's fine
Which partition scheme to pick if i have UEFI/MBR?
hope it's the second one
it was at this point that he knew. he fucked up.
MBR is fine, but it's legacy.
UEFI/GPT is what you should go for if your device supports it
i am installing on an external SSD
it's more to do with the device that boots
it's probably fine
i used the second one
should be fine. :)
i'm like halfway into the installation already
and i am wondering how will the system boot
probably just fine
what do do incase if it won't?
although, depending on device, you might have to flip on legacy mode in the BIOS
where do i find it?
varies from bios to bios.
hm
but usually under the boot menu
might also be under the security tab
incase i fuck up, do i just delete the partitions on the drive through windows, remove the boots and then rewrite iso to usb and start again? or more complicated?
windows might not like a USB device with multiple partitions
so you might not be able to just re-format from explorer
i dunno, everything is ok for me
you'd have to use disk manager
i use it all the time lol
ok :D
one more thing
as i am currently in the tutorial at the part where the guy mounts his EFI partition (that i didn't create) do i just skip it?
@quaint mirage
all else fails, give it another go.
not like failure isn't an okay option here
since you can just start over.
but wait
what do i do with grub
because i need it since my lil bro uses the pc and i need to know how to set up grub
well if you're booting from an entirely different drive
it'll have its own bootloader etc
when you tell it to boot from that drive, it's going to ignore the installed drive
found a tutorial on how to, gonna try mounting myself
Is it possible to configure some display setting or environment variables or collection of software so that while sshed into a machine, I could display content visually, either with software on the local or remote. If not, my scp/rsync familiarity makes it not too troublesome.
It seems to indicate that that might be possible when you try it.
@main olive X forwarding?
I'll look into what that is. X is the display software on Linux I think, but I only know that because Ive had to install it to get things to appear again on an occasion or two
Is the auth for this flakey?
not really?
Just checking.
it just requires xauth to be installed on the server
it all still happens over ssh
thanks i can probably get it working.
What's up guys so im trying to zip a folder in linux ubuntu I used python zipfile moudle and shutil also but they are copying the whole path so I give it something like this server/playlist/songs
and what I want it to do is just zip the songs folder but its zip all the path/dirc
Does someone have any idea how to enable desktop sound for screensharing in discord?
- Ubuntu 20.04
@solid path do you need to do this with python or would a shell command be fine?
Does someone have any idea how to enable desktop sound for screensharing in discord?
@main olive im not sure but doesnt ubuntu gnome by default use wayland which has problems with apps like discord ? try switching to xorg and test if it works
@main olive I have to do it with python
does calling a shell script with python count as doing it with python ?
;p;
lol
I assume the songs have a common file extension. Then you can probably use a wildcard to target only the songs and
you checked out the answers in here? https://stackoverflow.com/questions/27991745/zip-file-and-avoid-directory-structure?noredirect=1&lq=1 @solid path
when you run pip install on linux mint, are you installing to python 2 or 3
how can I fix this? I can't find it on google
3
@main olive when in doubt, pip --version shows you the python version pip is coupled with
@main olive Thanks i know its late but it worked
I was able to run a discord bot on my iphone.
jailbroken?
What the heck is going on here?
2nd time booting up my raspberry pi running Ubuntu 64 bit
Did you enable the PURPLE_SQUARE_ONBOOT option?
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
@old panther btw - here's the gsutil doc: https://cloud.google.com/storage/docs/gsutil/commands/rsync#be-careful-when-synchronizing-over-os-specific-file-types-symlinks,-devices,-etc .
the relevant part:
The gsutil rsync command copies changed files in their entirety and does not employ the rsync delta-transfer algorithm to transfer portions of a changed file. This is because cloud objects are immutable and no facility exists to read partial cloud object checksums or perform partial overwrites.
not sure if you're interested, this is just following your comment a while back re losing data with rsync
Did you enable the PURPLE_SQUARE_ONBOOT option?
@valid wasp he also seems to have enabledCURSORS=2
hi
I'm packaging my python script.. this time with a requirements.txt which I'm not familiar with
does this go in a shell script?
or does it suffice if I put it in the readme
#!/bin/bash
set -e
set -x
virtualenv -p python3 .
source ./bin/activate
pip install -r image_sequence/requirements.txt
# Example:
# python -m image_sequence_augmentor --data_url=<url_with_file> --number=1234
it's generally best to leave it up to the users how they wish to install dependencies
you can also include a shell script which does setup for the user if you're expecting to be providing for users who might not be familiar with requirements.txt or pip
but you should indicate you've done that in the readme
what should I call this script then
like, what's the norm
setup.sh, maybe
thank you
anyone else having issues with pygame?
what sort of issues are you having @halcyon garnet?
I put in pip3 install pygame
and it returns ```
Collecting pygame
Using cached pygame-1.9.6.tar.gz (3.2 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zfwny4m0/pygame/setup.py'"'"'; file='"'"'/tmp/pip-install-zfwny4m0/pygame/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-zfwny4m0/pygame/pip-egg-info
cwd: /tmp/pip-install-zfwny4m0/pygame/
Complete output (12 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using UNIX configuration...
/bin/sh: 1: sdl-config: not found
/bin/sh: 1: sdl-config: not found
/bin/sh: 1: sdl-config: not found
Hunting dependencies...
WARNING: "sdl-config" failed!
Unable to run "sdl-config". Please make sure a development version of SDL is installed.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
@valid wasp he also seems to have enabled
CURSORS=2
@main olive Too right! I didnt notice that. I usually have a hard time when SCREEN_GLARE is set to 100
@halcyon garnet Unable to run "sdl-config". Please make sure a development version of SDL is installed.
do you have a development version of sdl installed
Matte screens seems the be the exception rather than the norm these days.
Ubuntu
20.04
that could be a problem but it shouldn't
sorry I should have tagged you @main olive
E: Unable to locate package sdl2-devapt
E: Unable to locate package install
E: Unable to locate package sdl2-dev
@main olive
imma go to sleep
try to fix it in the morning
thanks for the help ๐
@halcyon garnet sudo apt install libghc-sdl2-dev maybe?
seems like they changed the package name for some reason
Hi, any ideas why this happens?
$ source ./venv/bin/activate
bash: <venv path here>
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
if ! [ -z "${PYTHONHOME+_}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1-}"
if [ "x" != x ] ; then
PS1="${PS1-}"
else
PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}"
fi
export PS1
fi
# Make sure to unalias pydoc if its: No such file or directory
Hi:)
I've created a new virtual enviroment with:
virtualenv -p python3 venv
source venv/bin/activate
Now when I run
which pip
or
which pip3
I get /home/<user>/.local/bin/pip and not the pip of the virtualenv.
$ ls ./venv/bin/
activate activate_this.py easy_install-3.8 pip3.8 wheel
activate.csh activate.xsh pip python wheel3
activate.fish easy_install pip3 python3 wheel-3.8
activate.ps1 easy_install3 pip-3.8 python3.8
I think that the problem was with source ./venv/bin/activate
It's output was:
bash: <venv path here>
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
if ! [ -z "${PYTHONHOME+_}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1-}"
if [ "x" != x ] ; then
PS1="${PS1-}"
else
PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}"
fi
export PS1
fi
# Make sure to unalias pydoc if its: No such file or directory
just run it like ./venv/bin/pip to be safe
source ./venv/bin/activate shouldn't produce any output at all iirc
I wonder if you've got source aliased or something
after source ./venv/bin/activate
venv is not activated at all. (venv)$ is not displayed
yes I understood that part
you don't really need to "activate" your virtualenv. If you really want to you can just set PATH by hand; afaik that's all it really does
Yes I know, I would just like it to work
try . instead of source
Faster to type just pip :P
if that works better, it is further reason to suspect that you've modified the source command somehow
$ source
bash: source: filename argument required
source: usage: source filename [arguments]
Haven't touched it
I don't see how that proves it
maybe it's not working propertly in Ubuntu 20.04?
unlikely
I have ubuntu 20.04 too so (once it boots) I'll try it
:-) 2020-05-05T07:18:52-0700 [communal-pika tmp]$ virtualenv -p python3 venv
created virtual environment CPython3.8.2.final.0-64 in 680ms
creator CPython3Posix(dest=/tmp/venv, clear=False, global=False)
seeder FromAppData(download=False, retrying=latest, progress=latest, webencodings=latest, lockfile=latest, contextlib2=latest, urllib3=latest, chardet=latest, certifi=latest, html5lib=latest, pip=latest, distlib=latest, appdirs=latest, pkg_resources=latest, packaging=latest, ipaddr=latest, requests=latest, setuptools=latest, msgpack=latest, wheel=latest, colorama=latest, six=latest, pep517=latest, pytoml=latest, distro=latest, CacheControl=latest, idna=latest, pyparsing=latest, via=copy, app_data_dir=/home/ubuntu/.local/share/virtualenv/seed-app-data/v1.0.1.debian)
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
:-) 2020-05-05T07:19:04-0700 [communal-pika tmp]$ source venv/bin/activate
(venv) :-) 2020-05-05T07:19:17-0700 [communal-pika tmp]$ type -a pip3
pip3 is /tmp/venv/bin/pip3
(venv) :-) 2020-05-05T07:19:25-0700 [communal-pika tmp]$
workx 4 me ๐ฆ
try this, see if you get the same result: ```py
:-) 2020-05-05T07:25:02-0700 [communal-pika venv]$ dpkg -S /usr/bin/virtualenv
python3-virtualenv: /usr/bin/virtualenv
@covert heart 
@fickle granite
dpkg-query: no path found matching pattern /usr/bin/virtualenv
It's installed here:
/home/<user>/.local/bin/virtualenv
maybe that's why
where'd that come from? I got mine via sudo apt-get install python3-virtualenv
sudo pip3 install virtualenv
that doesn't seem crazy ๐
although the usual advice is to never run sudo pip
I'm suprised that sudo pip installed something in your home directory
not sure you even need virtualenv, tbh; I always just use python3 -m venv
and that module comes with python3
I'm out of ideas
It's interesting that the output of source ./venv/bin/activate isn't the whole script
it's just a part of it
Just lines 50-72
try this ```py
-) 2020-05-05T07:38:39-0700 [communal-pika venv]$ head -1 bin/activate
This file must be used with "source bin/activate" from bash
I wonder if yours will mention a different shell
no
is there a way to disable this.. what do I do now.. delete it?
no keep it but put /.vscode in .gitignore
that way git won't constantly nag you about it
I need to add a gitignore now?
only if you don't want .vscode in your face all the time
@fickle granite
$ head -1 ./venv/bin/activate
# This file must be used with "source bin/activate" *from bash*```
you could also put it in .git/info/exclude
where's that
@covert heart the mystery deepens
in local?
no idea what "in local" means
it's in .git/info, relative to the top of your git working tree
@fickle granite
It says source bin/activate and I'm running source venv/bin/activate
I assume that's more or less a typo
source bin/activate would fail, if there's no file by that name
anyway I did source venv/bin/activate and it worked fine
is it /.vscode or .vscode/
I did .vscode/*
@fickle granite Thanks, switched to python3 -m venv and it's working now
I could swear that it didn't work before
that's the best way, since you know which flavor of python you're using
similarly with pip -- I never do pip install...; I only ever do python3 -m pip install
@fickle granite why not pip3 install?
because you're never sure which pip3 you ran
@covert heart 
one of the most common problems beginners have in this discord is "I installed a module but python says it's not installed". it's always because they have multiple versions of python, and pip was from version A but they're running python from version B
hello
I am trying to use inline C in python and send data over a socket but it is only sending a dot
It's not correctly sending what I am telling it to send
and the length is correct of what it sends, only the string is not
Hi Guys, I am getting this when i click on the + button next to the chat input in discord app, I am using Manjaro as my OS.
Has anyone else faced this issue?
Maybe do :
pacaur -S unicode-character-database
i think it's precisly this command that worked before for me
@main olive it went through the whole setup thing but afaik it isn't showing up when I do pip list
Nevermind
amen
I got it to work
<@&267629731250176001> "ip logger"
git: 'good' is not a git command. See 'git --help'
never heard of git good what's it do?
Is there a command where i can take an input and replace a specific or phrase character in a file with that input
let's say example.txt contains >
I think sed does that
a combination of sed and shell expansion, probably
okay
@lavish hemlock tr can also do this for characters but sed is the king here
sed is pretty hard to use; there might be an easier way, except I don't really understand what 70xpwn wants. Some examples would help
like editing a variable in a json file
let's say you have a discord bot, and the prefix is: !
I'm thinking of having an input that would for example say What new prefix would you like to use:
And replace that
@fickle granite :)
if you're editing JSON, you'd be nuts to use anything other than a proper JSON parser
jq might do that, but I'd write a 10-line python script to do it
ok
Hello All, how is everyone tonight, WOOOOOOOO!
Who can and wants to teach me about system calls from statically typed languages?
what do you want to know?
im curious as to how system calls register differently for x86 architecture versus 64 bit architecture obviously its a big field of study but a brief overview of salient points is a need for me ๐
thanks for the response by the way
Also under the unix kernel is it the exact same as Linux or did they choose to modify the Unix kernel for the implementation of Linus' project i asume that Linux Is Identical to Unix but ive never been able to confirm it, Kernels are tricky business to edit and it can be dangerous if you ask my opinion.. I dont know manual system calls well enough for that rackateering gig.
๐ :{ ๐
I'm trying to set up a python service
and am getting this error
string "type=AVC msg=audit(1588907701.722:20730): avc: denied { read } for pid=1 comm="systemd" name="muri-app.service" dev="vda1" ino=33599362 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=0
aight so this is the "noobest" question ive asked in a long time but ive recently switched to linux(ubuntu 20.04) completely and noticed that it was already running python3.8.2 and thats completely fine but i was wondering how to get a older version i usually used 3.8.0 so i looked it up and went ahead and installed it like so
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
tar -xvf Python-3.8.0.tgz
./configure
make
so all that is working fine if i run ./python in that folder i get python3.8 all is dandy BUT i was wondering if thats the way i need to be doing it and i just alias python in my zshrc to run ~/path-to-python3.8.0 another question is how can i get pip to work with that installation once i set up all the aliases and everything if thats how im meant to do it
sorry for dumb question been on windows for years and this is my first week and some change of linux
its best to avoid that headache and use version management tool like pyenv
it will let you cleanly switch between python versions and everything it includes like pip, packages, etc
huh that looks really cool ill give it a try thanks
also looks like a LOT less hassle
or
itd my goto when working on multiple projects
you could pass an alternate installation dir to ./configure, which is how most apps work, and btw make doesnt install anything unless you make install
Hi
can someone help me understand this
does cpu start from 0 index or 1
i have a 16 cpu instance and want to do some pinning
when I do grep CPUAffinity /etc/systemd/system.conf I get 1 2
and here on this page I find this:
CPUAffinity=0 1```
For virtualization hosts it is common to want to confine host operating system processes to a subset of available CPU/RAM resources, leaving the rest available for exclusive use by virtual guests. Historically the most common way to do this has been using the isolcpus kernel a...
I ended up not setting affinity manually, but isolcpus with 5-15 range.. on 16 vcpu, since I couldnt figure it out
and it works, for what I needed to do.. just didn't get clarity on it
Is there a standard Linux file that is just an EOF character?
EOF isn't a character, it's a signal
/dev/null signals EOF when you try to read it, though
Ah that's cool, thanks
EOF have an associated character code, right, even it isn't saved into the file directly?
So that's a signal like SIGKILL, and whatever other thousand of signals Linux has?
no, it's not an IPC signal, probably a misphrasing on my part
it's more a... concept, than anything
Okay gotta read up on that, it sounds interesting
like
you can't really "tell" a process about an EOF
the process comes to that conclusion itself when it can't read any more of the file
the exception is terminals, of course, as input from a terminal doesn't really ever "end" unless it's hung up
so there has to be a way to signal an "early" EOF
which is what ctrl-d does
Okay I see
And so the process can conclude that it reached the end when it asks for 10 characters and only receive for 5 for instance?
usually processes rely on libc for that information
read() returns -1 once EOF is reached
Hello, I'd like to add alias to starts python script more easily. Which file should I choose between ~/.bash_profile and ~/.bashrc? I don't really see the difference
use .bashrc
.bash_profile is used for when bash is used as a login shell, and that usually sources .bashrc in turn
so .bashrc will almost always be used
ok, thanks!
is there a meta package for complete compiler tools on Ubuntu/Debian?
something akin to apt install devel-tool which includes all the common stuff like make, automake etc
The gcc package on debian already suggests make, gdb, etc
So you could install gcc with the flag to install suggested packages
Here's a challenge for you guys... make a live countdown timer, from 0-60 minutes, and display it in a digital like format
How can I check if a systemd service exists in python and save the result as a true/false variable?
@steel verge check out build-essential
it includes make, gcc, g++, and other development tools
Would using systemctl with subprocess be an option for you?
how would that look?
cmd = '[ $(systemctl list-unit-files "firewalld*" | wc -l) -gt 3 ]'
result = subprocess.call([cmd], shell=True)
if result:
firewall = "firewalld"
?
using subprocess calls rather than a weird library is definitely preferred, I'm just not sure how the syntax would work
I suggest you only use the systemctl command and process its output in Python
I believe this will work
import subprocess
output = subprocess.check_output(["systemctl", "list-unit-files", "firewalld*"])
So more like:
output = subprocess.check_output(["systemctl", "list-unit-files", "firewalld*"])
lines = len(output.split('\n'))
if lines => 3:
firewall = "firewalld"
...lemme test that
I forgot you need to add text=True otherwise the output will be in bytes
kk thx
>>> output = subprocess.check_output(["systemctl", "list-unit-files", "firewalld*"], text=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/subprocess.py", line 216, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'text'
sure
So text is for Python 3.7+
much better
For older versions use universal_newlines
You're welcome
@dim talon I recommend using the return code instead of trying to parse the output
less chances of it breaking
I'm running windows, and I have a spare partition that I don't use. I'd like to get comfortable on a unix system, my only experience anything related to it has been using gitbash and a bit of FreeNas.
I know ubuntu is very popular, but any flavour in particular that would be best for development?
more or less all of them are fine for development, but you'll perhaps find more guides for Ubuntu than any other distro@tawdry sonnet
does this channel have to be about unix + python? can i ask about vnc here?
sure, shoot @cinder wren
okay, so my vnc server keeps crashing, ive tried all 3 vnc viewers that i can find... realvnc viewer, tightvncviewer, tigervncviewer, but after 25 minutes my server always shuts down... i cant figure out why
i keep getting the error com.tigervnc.rdr.SystemException: read:com.tigervnc.rdr.Exception: newPosition < 0: (-1 < 0)
but i really dont know why this is happening, feel free to ask me questions
its fairly constistent at the 25 minute mark though 24.5-29 minutes
ive set my ufw to allow 10.0.0.0/24 on the vncserver port
and i am using the option -localhost no
ima try this for another half n hour and see if it changes anything...
tigervncserver -geometry 814x532 :2 -localhost yes -verbose -cleanstale -clean
welp, seems 1 of those commands solved the problem
rofl... as soon as i said that...
the timing..wow
KeepAliveResponseTimeout seems interesting
that's odd
seems like a bug in tigervnc
@cinder wren maybe try another vnc server?
think I've used RealVNC server mode, which has been alright
or even x11vnc
which I've successfully used on very low-resource machines, like a Kindle
@main olive can i use a single window with x11vnc server?
Iโm trying to create a environmental variable in my raspberry pi, but I canโt create one for some reason
keep getting a bad argv0 when trying to run realvnc server ๐
Iโm trying to create a environmental variable in my raspberry pi, but I canโt create one for some reason
@exotic sun What's the issue? Why can't you create one? How do you know?
thats a lot of questions asked
should've asked which OS is he running on raspberry pi for starters
Why would that matter for an environment variable?
environment variables are set in completely different ways depending on operating system
and used also
in windows it's echo %MYVAR% whereas in linux's bash it's echo $MYVAR
I'd assume he uses a Linux distro on a Rasperry Pi
Sorry for the late response. Iโm running NOOBs or whatever the default 3b+ is. Doing echo works now, but Iโm struggling to call it for my python program. I tried dotenv but itโs saying
not found.
hello!
ive made my secondary hdd dual boot into linux and given i dont use it, can anyone help me format it?
@fleet forum I think you want mkfs
Can't remember how to use it, but maybe the man page will tell you how
Oh I forgot to make an update
I managed to chance the particions via windows and just formatted it clean
Thanks though man
Sorry for the late response. Iโm running NOOBs or whatever the default 3b+ is. Doing echo works now, but Iโm struggling to call it for my python program. I tried dotenv but itโs saying
not found.
@exotic sun The usual issues with environment variables is that they only last for the current shell session. Either try setting them in your.bashrcor make sure the python program runs in the same shell in which you set the environment variable, e.g. by running it like this$ MY_ENV='12345' python test.py.
also, something to note
you need to actually export the variable if you want child processes launched from a shell to also inherit it
@main olive hey r u able to tell me when im getting a bad argv0 with realvnc?
"bad argv0" indicates that it's not being run with the name it expects
wdym
desktop name?
and about the error, tbh i dont think its the vnc server, i think its my python program that i wrote
(the other error i was encountering where it fails after 25-31 mins)
still havent found out why, but eventually i will
you need to actually
exportthe variable if you want child processes launched from a shell to also inherit it
@main olive Didn't know about that, thanks!
desktop name?
@cinder wren nah,argv[0]is supposed to contain the name of the program being executed. there are certain scenarios where this isn't the case (for example when using theexec()call) - some programs are fine with this and don't whether the contents ofargv[0]make sense or not, but others do require it to be the same as the name of the binary (for example"realvnc"for/usr/bin/realvncetc)
Oh. So I export the variables then open the python file through the command shell and not just run it in the program?
well, environment variables are always inherited from a process' parent process, all the way up to the "init" process
if you run a process via a terminal emulator, the process inherits the terminal's environment variables
so, if you do something like:
$ export VALUE=12345
$ code
the launched vscode process will have the environment variable VALUE set to 12345
(alternate methods of doing the same thing:
$ VALUE=12345
$ export VALUE
$ code
or
$ VALUE=12345 code
)
Ah.
And that didnโt work. Iโm doing everythi g the way Iโm supposed to and I keep getting different errors and Iโm about to smash my Pi. It shouldnโt take me over 3 days to program a simple program to send a text everyday
im prettymuch new to bash as it is homework im not looking for a complete script but rather someone to help me get started is anyone able to help me write a bash script that reads an integer and determines how many of each coin should be given in cents using the fewest possible coins that loops until the user types Ctrl+D
heh
that's a tough enough problem in python, but having to do it in bash? ugh
so you have my sympathy, but I can't help
yeah its pretty rough especially since im just starting out im decent at python but horrible at bash so its gonna be a challenge
Iโm trying to get sound to run in my python script on Linux.
I tired playsound and that didnโt work
Iโm try the os module out a bit
Iโm looking into pydub rn
Any suggestions?
I GOT My code to work without having to save my sensitive information into the code
x l n t
@main olive so it doesn't like the name/symbolic link that I have for vncserver instead I should use the /opt/vncserver/idk.sh
Also still haven't found the cause of the crash. Going to try and not use vncdotool and see if that's the problem or if something is misconfugured on the vncserver
However having troubles using an alternate display with xdotool...so
Will probs try later today or tomorrow
hi there can someone help me on ubuntu?
just ask
the more info you give on your question problem right away the higher is a chance to get help
!ask
Asking good questions will yield a much higher chance of a quick response:
โข Don't ask to ask your question, just go ahead and tell us your problem.
โข Don't ask if anyone is knowledgeable in some area, filtering serves no purpose.
โข Try to solve the problem on your own first, we're not going to write code for you.
โข Show us the code you've tried and any errors or unexpected results it's giving.
โข Be patient while we're helping you.
You can find a much more detailed explanation on our website.
iam a noob in ubuntu i installed it yesterday, i want to get to know it better, i watched some begginers guides and started with some easy codes like sudo apt-get , i need to know if its safe those clouds on settings that i can connect my accounts
Hey @main olive!
It looks like you tried to attach file type(s) that we do not allow (). We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg.
Feel free to ask in #community-meta if you think this is a mistake.
i need to know if its safe those clouds on settings that i can connect my accounts
@heady adderI am not sure what you mean by this
can you speak chinese
there any way to start an application with x11vnc (or another vnc) and just share the application/window without having to start one prior to x11vnc and then use x11vnc on top of the other vnc?
similar to remoteapp in windows
wat
you use x11vnc as an x server
which means that instead of running xorg, you run x11vnc - the X application running in x11vnc after that isn't really relevant, any would work
oh, wait no, i'm thinking of another project
x11vnc does require an X server to already be running
my bad
I have a python script that I want to execute but I don't want it to exit to the shell but rather leave the current variables in place and exit to an ipython interpreter. Does anyone know how to do this or if its possible? (beyond the obvious of using jupyter)
well, python3 -i your-script.py does what you want, apart from the ipython bit.
ipython -i might do the same
yep, it works
Would it be possible/practical to automate Linux setups/deployments with Python
Or is that more likely to a be a bash-only thing
@surreal vapor ansible does that, and is mostly python
might be interested in that project
Thanks! @fickle granite
Should all my python set ups be in different directories? Because on my Pi I always get โmodule not foundโ or โdirectory not foundโ or some other bs.
@exotic sun use some kind of Python virtualenv manager, I personally like pipenv. Then you can have project / directory specific Python environments and libraries and one global installation for your personal use
@main olive when it says it's written in Python, Powershell, Shell and Ruby, is it referencing bash? Or ksh or csh?
@surreal vapor poorly worded, that can mean anything
most of the time, they mean sh/bash
but not always
@main olive check the logfile, the path is visible in your screenshot
the log file doesnt exist
....
I have a serious problem in Ubuntu, a wrong version of pyqt5 has apparently been installed which now breaks Spyder3 from running, I want to restore original pyqt5, does anyone know how to do this?
Is it dangerous to try to change PyQt5 back again? wish I never messed with things
If would help if I knew what the DEFAULT verion of PyQt5 was when Ubuntu installed Spyder3 ๐ Anyone know reliably?
@nimble gale It's not dangerous changing back.
Hi guys, is there any of you using ZSH ? I am trying to change to a "YS" theme but I can't. I can be more specific on my question but I am not sure this is the right place as I am new to linux, new to python and even new to discord.
Thank you
where can I learn more about GUI events?
and very simple
not some very hefty complex source
@main olive , would you like to show me your ~/.zshrc and whethere you use oh-my-zsh framework or not ๐ ??
gfind . -type f -regex '.*csv|.*txt'
not too sure why this isn't matching csv or txt files?
(gfind is just find on osx)
@digital haven - needs to be \|
@summer trail ah, thanks... is there anyway to make them assume i'm writing regular expressions as default?
or find . -type f -regextype posix-extended -regex '.*csv|.*txt'
it's not that it didn't think you were writing a regular expression, it's that there are a ton of dialects of regular expressions, and some use | for alternation and others use \|
by default find uses emacs-style regular expressions, where alternation is \|
hrm ok thanks - guess i'll have to set an alias as it's quite a long command
Can anyone suggest a cli script to pretty print / read apache log files. Tail is too disgusting to look at. **Have found Pimp My Logs which does exactly what I want
@dreamy wing for simple colour coding i've also used ccze with relative success
@dreamy wing bat ( https://github.com/sharkdp/bat ) could be a nice option for you, check it out
Where does one typically store JSON keys?
i have a package that requires json keys, and I'm not really sure where I should put them... I guess I need to pass the key path in as a value to the package now i think about it
@fickle granite just a api key in a json file
probably not a helpful way to refer to it
it's secret, right?
I'd keep it in a file and add the file's name to .gitignore
you can use a package called "dotenv" to export the file's contents into the environment, which is sometimes convenient
that's recommended by the "how to write a discord bot" thing that I read
right... i used dotenv once a while back ago actually but never bothered continuing for some reason
i think i need to pass the keys in to the package though ๐ค
idk, i'm tired now ha... i'll look at this later
i have a quick question for anyone who knows can someone explain to me what the priority argument in update-alternitives means (using ubuntu 20.04) ive got everything working with it but im not ever sure what to put for that priority argument so i usually end up putting 1 or 2
hello i'm trying to create a simple systemd file that keeps ngrep running in the background and captures to a pcap file I seem to be able to get it up and running but the pcap file doesn't ever get created. I made a script just to automatically check on status of the service and this is the output
any help is appreciated ๐
@magic bolt post some code please
you know those flags.. x v z f c
is there a reason why they're those letters.. I'm having a hard time remembering flags for some commands
hysterical raisins
x is short for "eXtract"
v is "verbose"
z I guess is meant to suggest "zip"
f is file
I forget what c even does ๐
there are long versions of those options too
I know what commands I usually use but can't recall the flags.. feel bad
tar has some of the weirdest flags of an Unix command. But yeah, what @fickle granite said, and c is create.
oh yeah
which I never do any more ๐
well perhaps sometime in the last few years I've typed tar cf - . | (cd somewhere-else ; tar xf - )
tar, ps, find, and dd are probably the weirdest ones - they're weird through accidents of history; they came from different systems with different argument conventions than modern GNU systems have, and original flags were retained.
just like the really short English words -- "be", "for", &c
they're so common that it'd be disruptive to make them regular
i have a quick question for anyone who knows can someone explain to me what the priority argument in update-alternitives means (using ubuntu 20.04) ive got everything working with it but im not ever sure what to put for that priority argument so i usually end up putting 1 or 2
edit(bumbing this question up because it got coverd)
I think it determines which program gets used -- like if you have both nano and vim, the priority determines which one gets run when you type vi. I think.
if you have exactly one of them, then it gets used
what would happen if i had multiple fo example 5 different things all priority 1 would it just pick one at random?
or should i have different prioritys for everything
Priorities are assigned by package creators. The alternative with the highest priority determines the default value when in automatic mode. Additionally the local administrator may override the automatic selection with a manual selection.
and see https://lists.debian.org/debian-user/2002/08/msg02808.html - for equal priorities, the first one installed wins.
awesome ill read thru them also do you just have these links on hand? or have people asked similar questions to you
I just googled, and knew to put "debian" in the search to find the right thing.
how do I know what type of file my file is
I tried file <filename> but it doesn't work
nvm.. stat worked
file works 90% of the time for me
I'm on debian, it says command not found.. apparently I had to install it
Hello i cannot open my dbshell from django
im on my ubuntu
python manage.py dbshell```
it shows this error
CommandError: You appear not to have the 'sqlite3' program installed or on your path.
how do i solve this ???? check stackOverflow ,,,couldnt find anythong
is it somehting w my settings.py ??
try
apt install sqlite3
@main olive tried already
i have the sqlite cli installed
It still doesn't work
which sqlite3
maybe work thru thise:
https://docs.djangoproject.com/en/3.0/ref/django-admin/
which sqlite3
@valid wasp shows no output
okay sorry it shows output
/usr/bin/sqlite3
Is there a reason systemctl thinks my python script exits with a clean code when I run exit(1)? Specifically, I'm running a discord.py bot in an event loop.
can you try pasting echo $? in bash right after the script is executed
Oh, I see. It looks like a cleanup function is causing the program to exit with status 0, before I even reach the exit statement.
yup
@chrome shale just go ahead and ask a question right away
hey there, is there anyone here who wants to help a complete linux python noob out?
so i recently got a linux based VPS (i want to use it to host a discord.py bot, there's no issues with that as the bot works pefectly in a windows envoirment on my own pc)
and well it comes about as empty as you want it, so i tried installing python 3.8.3 (latest) and pip, whilst it gives sucess it spits errors all around
like this when i did pip --version
it's running debian 8 jessie froxlor
i have some other picks if i want to (or custom installs) but this is the default and i guess should be fine?
@main olive you have any idea? maybe I could try completely deleting everything if you want to help me get a correct install
how did you install python and pip?
and what distro is this specifically?
ah, missed that message, debian jessie
The Python team has released its latest version Python 3.8 for general use. You can download the latest stable version Python 3.8 series and install it on your system. This article will help you to install Python 3.8.2 on Ubuntu, Debian, and LinuxMint operating system. You can...
only then with the 3.8.3 instead of 3.8.2
you shouldn't really be doing that
if i do python3.8 -V i get Python 3.8.3
i'm a complete noob at linux so yeah i will do things that will make you go smh
i forget if jessie ships with python3 or not - if it does, skip step 1:
- install python 3 from debian repos, ie
sudo apt install python3or whatever the package name is - use pyenv to install 3.8.3
this will keep the system install stable (OS internals might rely on a specific python version), but allows you to use whatever version for your project with pyenv
so that would be sudo apt reinstall python3?
i think it's apt --reinstall install python3 python3-pip
there it goes
after that's done, get yourself familiar with https://github.com/pyenv/pyenv-installer
well i'm doing that and after installing pyenv i get this
so yeah that's my experience so far
.pyenv did appear in my FTP
have you done exec $SHELL like the readme tells you to?
did you read the warning?
add those three lines to your ~/.bashrc file, like it says
okay so i should type nano ~/.bashrc PATH="/root/.pyenv/bin:$PATH"?
no, nano is just a text editor
you just open the file up with the editor and paste those three lines in
preferably at the bottom
yeah, then do exec $SHELL again to reload the rcfile
ah it works!
haha
okay so now i have pyenv
what would be the next step?
@main olive ?
pyenv install -v 3.8.3
and pyenv local 3.8.3 while in your project's directory
also... you really shouldn't be doing all of this as root
what is the downside of doing everything as root?
it's easy to accidentally fuck up your entire system, and it's insecure
the fuck ups i can get over with and understand, but why insecure?
it's the same as running everything as admin on windows, except even more powerful
so, let's say you run your bot or whatever project
yes
and your bot has some sort of vulnerability
and that means they would be able to access the entire VPS pretty much?
uh....
oh
install openssl-dev or whatever the apt package name is for debian
trying again
it's good to read the output of the commands you run :)
it may seem like mumbo jumbo at times but there's generally useful info in there
i just read true their github with common issues and they also said to verify make was there
so i did that just to be sure
failed again
can you post the section that says "last 10 log lines"?
that should say what went wrong
that's... odd
Maybe it's just debian being weird?
I could completely wipe and start over with a fresh new image and even with a different distro
the distro is no matter for me as long as it runs python and the requirements for a bot
i generally suggest ubuntu server
debian is also good, but ubuntu is more beginner-friendly
which one?
any linux image is possible reall, these are the officially supported ones
20.04 lts is the latest stable release
it's installing ubuntu now, and everything will be gone
@main olive i'm in and made a non root account
lets see first updates
doing pyenv now
@main olive it did pyenv without error!
HAHA IT WORKS
@main olive THANK YOU SOO MUCh
hey i am new for here. I would like to say. because pip3 install PyInstaller works fine under Ubuntu 20.04
So, I'm trying to edit what's supposed to be a .cfg file on an SD card I have (bootable on an Rpi) but ~90% of the drive is just a file called SYSTEM with no extension. There's also a file SYSTEM.md5, but there's no .cfg file anywhere. Only dtb files, which I understand are for the hardware, and some other files like cmdline.txt or simmilar
I tried renaming the file to SYSTEM.zip, but it doesn't open
I tried editing the file in VIM (it's waay to big for Notepad++ or default Notepad) and also changing the md5 checksum in SYSTEM.md5, but after doing so the Pi refuses to mount the system file. I've been able to roll back to the old files to get it to mount again, but I'm still stuck needing to edit this .cfg file.
Google's been useless as any search with both SYSTEM and file in it gives results about Windows .sys files
I need to edit a .cfg file that's buried in a file called SYSTEM, but have no idea how to get into this SYSTEM file. Can anyone help with this?
I'm not even sure if this is a good place to ask this. If not let me know
what does "file ./SYSTEM" return?
like this:
โ ~ file foo.py
foo.py: ASCII text
is that for a raspberry pi?
I mean, vim should open anything
I accidentially ran cat on it in the pi when it was in debug mode
but Ive not used pi before maybe constrained by small mempory
In utf-8 it shows this
I'm on win10 trying to fix a RetroArch install
by editing files on the SD card
where did you get the SYSTEM file from?
This is a card that someone else asked someone else to make for them, so I'm going without information from the original install
Here's a ss from VIM
I tried editing that input_driver part
you should be able to run strings on the SYSTEM file even if its a binary
also I have a separate rpi card that boots Raspbian fine
What do you mean run strings on the SYSTEM file? I've already tried to edit that text and the associated MD5 hash and it refused to boot
just to see if you can find anything useful since you cant open the whole thing
strings will pull out the strings in the binary
let you look thru them
"strings" is a command to show the strings in any file
Ah alright
unix only though, perhaps your WSL will hav eit
loading that up now
can you just nuke the SD card and do a clean retro arch install?
There's data on the current install also buried in the SYSTEM file
'd be nice to not lose it
Retroarch boots fine right now, the issue is that I changed the input drivers and now I can't get any keyboards or controllers working
hrmm. I see.
have you tried to run gzip on it to get a table of contents?
maybe they just renamed a tarball or something
ahh, so you should be able to mount the SD on a linux box and then manipulate easier I guess
THere's files on the home dir of the SD card that are like dtb
I searched those, they're for interfacing w/hardware
device tree blob
so you can read all of those ok I assume, just text configs
From what I've seen with retroarch there's supposed to be a retroarch.cfg file that lets you change the drivers
But it's apparently inside the SYSTEM file, and that's why I'm trying to get inside it/unzip/extract it whatever'll work
this shows some good info
talks about retroaarch.cfg
had to find an SD card reader to get this going
There's no retroarch.cfg file in the root of the sd card nor any subfolders
was the file created with Win32 disk Imager?
Again, no benefit of how this was made because I'm the third person to have hands on the card:
first person made the card
for Second person who wanted it
Which I now have from them
Can't ask the person who made the card how it was made
so Im assuming this is an image
have you run fsck on it to verify ?
maybe its corrupted
It's not corrupted-- it boots fine on the pi aside from the borked driver settings
except when I try to edit the SYSTEM file as text, then it breaks, and no I haven't run the verify on the file
so yore trying to edit the image file binary.
If that's what a SYSTEM file is, then yes?
also how do I mount a removable drive in wsl? /mnt doesn't work
since then youd be using the kb from your remote pc
Uh, I could try to ssh into it
I've got PuTTY
well hm I'm not sure what the configs or the ports/etc would be to ssh into it
if ssh is even open on it by default
that may be easier to edit the driver settings on the live system rather than the iamge
you can try the default ssh of 22
Default port and then what address, home IP?
here you go
that should do the trick
from this page:
https://www.raspberrypi.org/forums/viewtopic.php?t=14125
I do have a box that might work to do that
can a bash alias use $1 for the first argument called on the alias? I doubt it since an alias isnt executing. But I dont want to make an alias for a script if i dont have to just to do that.
like a script that i maade myself so it supports $0 $1, etc
i mean by default ls is aliased to show colorful text based on file type and all the args to the ls work
thats true....
yeah, fair enough.
The idea im thinking on though is if it doesnt work
I know how to make it work
its just more complicated
I suppsed trouble could arise if running via cron or as a nother user depending on your script permissions
My aliases will be all owned by and used only by the user.
alias really is just a short cut to a longer command
like a url shortener for the web, but for system commands
Well, in the past, I have been using this.sh as a shortcut for a longer command. Then I stick the scripts on path, and I get similar behaviour,
id imagine the alias would take the commands
so the question is driver script vs an alias?
if its something simple then use and alias, if more complicated and the script needs to make decisions then driver script
nah, not really. Its mainly just that many of my scripts that exist to make it easaier to type long commands i have to research before hitting otherwise accept args. Not args that go to the commands being called, but args that are custom in my scripts
but it sounds like you know all of that.
im just talking it thru
exampler
PWD=$(pwd)
VENV=$PWD/venv/
echo "Executing $0 in $PWD"
if [ -d "$VENV" ]; then
echo "$VENV already exists..."
exit 1
fi
if [ ! -d "$VENV" ]; then
echo "Creating Virtual Environment"
python3 -m virtualenv venv
fi
echo "sourcing into venv/bin/activate"
echo "(venv) will be missing from prompt."
echo "Proof of which python interpreters:"
source venv/bin/activate
which python
which python3
bash
btw
I am not good at bash lol
echo "Executing $0 in $1"
find $1 -mtime 0
@radiant pike what does file SYSTEM say
it's probably a filesystem file
you can mount it with the mount command
and edit the files inside as usual
making sure to umount afterwards
@main olive I'd need to be able to acess it on an *nix system
I tried to mnt the removable drive in WSL but it's not there
@valid wasp I've tried the blind login for homeIP.101 throgh 103 and haven't found the rpi, it's on a local DHCP box, not exactly sure the name of this kind of box, but it's a local wired connection from win10 machine to rpi
I have now gotten windows subsystem working with the mounted file and it's showing that it's a Squashfs filesystem
@main olive It won't work with mount
root@DESKTOP:/mnt/i# mount SYSTEM
mount: SYSTEM: can't find in /etc/fstab.
isnt squashfs readonly
never heard of squashfs , interesting for sure. I should get my self a cheap pi to play with
@radiant pike the syntax is mount [device] [destination]
the "device" here is SYSTEM
but if it's squashfs, you probably won't be able to mount it anyways
Hello guys.
I need a command that will delete all directories in /tmp starting with com.google.
rm -rf /tmp/com.google* maybe?
what sort of user input?
For example it asked if I wanna delete a write protecte ddirectory tmux sometging something
so I guess I don't wanna use the f flag
make sure you don't have a space between com.google and the *
otherwise, it will delete all files in the current directory
which is... not good
That's why I cded into the /tmp to avoid things like this
๐
I mean
if I use the f flag
won't it delete also files that are currently opened?
which may not be good
-f forces removal and doesn't prompt for user input
Yeah, but if a file that is being removed is currently in use, isn't it possible that a process using it would crash?
I would like to avoid removing those files
that's why I don't wanna use the f flag
Nevermind
Thanks for the help
find /tmp -type d -name com.google* -exec rm -rf "{}" ; ?
whitout "?" and before ; put \
๐
I've got a persistent live usb with one of linux distros
i've also got a pc with hard drive
is there a way to move the whole partition with distro on usb onto a new partition on a hardrive for a dualboot?
any command line tool in linux preferably
dd?
worked like a charm, took less than 5 minutes to move the distro from separate usb onto the hard drive pog
Hello, I was not sure where to put this question. I am trying to write a script that "wraps" a binary (executable) with subprocess and continuously feeds data to its stdin and reads from its stdout.
The problem is (from my understanding of Popen) that proc.communicate() only allows me to send a single batch of data to stdin, then waits for the process to exit. Do you have any tips, guidelines or material to read on this subject?
@minor wedge
not sure but try that
if you aren't getting any exceptions that the stdin pipe was closed or destroyed then you just arent writing to/reading from stdin properly
@main olive the data is binary
you can decode it?
we will need more of your code
for context
in regards to how do you write to stdin and how do you read from it
sure
Hi, I would like to ask a question about multiprocessing in python. I have a pool of 30 worker processes running on a cluster doing numerical computations. However, some of the computation takes really long time. For these cases, I want the function running in the process to exit but keep the pool available for other tasks (there are a few hundreds). Could any one give me some suggestion? Thanks!
hey man, do you have any experience with threading in python?
you know what.. there's very little benefit in multiprocessing
30 worker processes over 15/16 of your actual cores.. any actual increase in performance really depends on the use case and how much data you're shuffling around
I've been down this road.. and would advise against it
try Spark or Beam.. simpler frameworks and easier to write code for
@rare night https://youtu.be/9zinZmE3Ogk
Keynote for https://pybay.com, 2nd annual Regional Python Conference in SF.
Slides: http://pybay.com/site_media/slides/raymond2017-keynote/index.html
That is a good overview of the differences of concurrency options in python
How can i automatically email myself a critical alert email when i log in
i have the html code for it
i'm using ubuntu/unix
I don't know, but if I had that problem, the first thing I'd do is poke around the documentation for "PAM"
if you always log in via ssh, you can probably "hook" sshd somehow, too
okay thank you
eek@vps815008 ~/BumpR v3> python3.8 runme.py
fish: โpython3.8 runme.pyโ terminated by signal SIGKILL (Forced quit)
eek@vps815008 ~/BumpR v3>
any particular reason? Sorry if I'm being dumb debian isn't my natural habitat
ok why was it SIGKILLing because of an importerror
wait it works when I sudo python3.8 but just default breaks it
@heavy frost did you try having a virtual env ?
@heavy frost If you received a SIGKILL, it's because something sent a SIGKILL. That could have been the kernel, possibly due to the OOM killer, or a user using magic sysreq, or the runlevel changing. If it wasn't the kernel, then it was another process on the machine. Without any details, my wild guess would be that it's from the OOM killer, but there's not nearly enough information to be sure.
depending on the distro it might have an exception hook thing causing this
I think ubuntu has one
I'm using ubuntu focal fossa..
I'm having a problem to connect to my WiFi router with 2.4ghz band connection. I can connect to 5 ghz with no problem. In windows I can connect to both bandwidths.
@summer trail OOM is probably right, as it killed another bot i was hosting a few minutes after I sudo'd it to run
can someone help me 
i can't update or upgrade apt
ntp is messed up and i get an error
@lavish hemlock look for it in stack overflow bro
i try install m2crypto, i get all red line?
is there anyway to get install?
and yes i did googling
paste the output
worked for me fwiw
actually you should grab a help channel, since your question isn't really about unix
alright noted that
Has anyone had any issues with Anaconda deciding it doesn't want to run on Mac Catalina?
I was able to use everything just fine yesterday
Now I guess it's not being found, but I have Anaconda installed
this isn't directly related to python development, it's just an issue i've often come across while developing on linux.
how come the linux/open source community was able to come up with all sorts of nice solutions and standardized processes for most common problems, but getting a default config 9/10 times just makes me want to kill myself.
some software provides a well commented config file, with a handful of the most common settings, which gives you a rough idea of the general syntax and options available. even if the config is writting in a language i don't know, i'll quickly be able to make a few modifications, and i can check the manual for anything beyond the most basic.
most of the time however the developer was like "nah, if you want to make modifications to my software, you'll have to scim through a manual the size of my fking mom"
it's just... people came up with smart standards for everything else. sometimes it's like people want the entry level for shit on linux to be really high.
i know i sound like a typical dumdum desktop user. i actually love working from the command line and i often enjoy exploring man pages and directories. i just don't understand why there's no "std-config library" or something that people can fucking agree on, since basically every setting in a command line environment is set through some config file
i mean they don't all have to be written in the same language. most software for windows like to use JSON for everything, which is horrible actually. it's a great format, but it's not very compact. certainly not a tool suited for everything.
it does however have these nice schema things, which combined with autocompletion, makes them very self-documenting
toml is the best config format imo
there are some "modern" standards now
- either generate a default config file, or provide a well-commented example config that the user can copy and paste
- use the TOML file format format
- place your config file in
$XDG_CONFIG_HOME/$app_name/config.toml
for 99% of user-facing applications i see no reason to deviate from those recommendations
that should lead to a relatively sane and easy-to-handle configuration process
salt, i did run apt-cache rdepends --installed libc6-dev
libc6-dev Reverse Depends: gcc-9 |python2.7-dev libstdc++-9-dev |libpython2.7-dev |libncurses-dev libgcc-9-dev clang-8 |python2.7-dev libstdc++-9-dev |libpython2.7-dev |libncurses-dev libgcc-9-dev |libexpat1-dev gcc-9 |gcc clang-8 |build-essential
@halcyon latch hmm... looks like you cant remove it then
You might want to look online and see if other people have had problems with dependencies and python 3 on kali
alright thank you for the info and guide @formal schooner
this is a stupid q but why when running commands inside a container do i sometimes see examples with -- <command> and others with -- /bin/sh <command>
What is the difference?
I'm looking at these in Kubernetes pods
there's no real difference other than one calls the command via the system shell (which can be bash, sh, anything), and one explicitly invokes sh @modern kestrel
they're usually more or less the same
Ah okay thanks @main olive
I'ma look for a way to mount them one sec
online or offline?
https://www.digitalocean.com/community/tutorials/how-to-migrate-a-mysql-database-between-two-servers
Can somebody tell me what on earth is going on with my auth.log? ?!?
DAFUQ
WHO IS FABIAN
what is going on!?!?
@lavish hemlock : Is this an ESXi host?
@lavish hemlock you are not being hacked
What is it then joe?
this is normal for a public host
people are attacking you, yes, no one has got in (hence the authentication failure)
it's just part of being on the internet
Man it's so annoying > I need the auth.log for checking legitimate things
fabian is just one of the names on the list that they are trying
my service's logs are literally 99.99% stuff like that
yeah, same
Oh really
why are you relying on auth.log?
To see failed logins
it's just part of being on the internet
for users on my instance
How can i search the logs for only users on my instance?
not worth it
oh
you should log successful logins, that's the interesting metric
how to do that?
Is there no log generated in auth.log on a successful login?
let me login to one of my nodes
something like "systemd: pam_unix(systemd-user:session): session opened for user USERNAME by (uid=0)" in Ubuntu20 at least
May 29 01:06:41 swot sshd[15894]: Accepted publickey for joseph from MYIP port 59121 ssh2: RSA SHA256:/XTyvkWst3GFd2Yw2YI4sklUoK5Cp63mQq7MASKWzLQ
But how do you filter that
grep should do it for you
Okay
yeah grep will do
No results that's weird
logout and back in on your machine, that should give you the pattern your looking for
it can be different on each system
I just logged in and it didn't work
Maybe the attacks filled up the file and it can't find the successful login
they should be rotated out, in which case, they may be in a compressed log
like auth.log.2.gz or something
you can use zgrep to look into those if you need
(assuming your distro has it)
i don't see any other file
i'm using tail -f /var/log/auth.log | grep "Successful"
yea, the pattern may not be right for you
like in Ubuntu, that will not work
and in Joe's distro, his is "Accepted"
yeah I'm on debian
release?
systemd: pam_unix(systemd-user:session): session opened for user USERNAME by (uid=0)
check for "session opened"
if not, i can spin up an ubuntu20 box if you need
i deleted my auth.log tho
oh, lol
that is certainly one way ๐
but now
logout, and back in, what's in there?
the filehandle may still be in use
yeah
you may need to restart the syslog i think to let it refresh
try just restarting syslog first, but yea, reboot should work, but iew.
just checking auth.log on one of the worker machines in my control, 3,127 invalid user attempts on a machine that has no domain tied to it or anything
over what time period?
a few days, but no birth time on the auth.log so not sure
since instance creation, about a month now, 130k invalid attempts
wow
sadly some people must be affected since clearly people still do it
yep, someone has been randomly trying to hack my accounts for the past 2 months (targeted) gmail, facebook, etc
it's nice though, b/c they reset some accounts that i forgot I had.
inspired by https://github.com/b1naryth1ef/bowser, I built an SSH daemon which had SSH keys, password and a TOTP token w/ discord webhook support, very fun.