#unix
1 messages ยท Page 39 of 1
a=`date +%A%_d" "%B", "%Y" @ "` && echo -n $a && echo $(date +"%r" | sed -e 's/\([0-9][0-9]:[0-9][0-9]\):[0-9][0-9]/\1/')
that's the code
the key component here is echo -n
Is it different for me or does the @ and the 2 meet
@02:58 PM
there should be a gap
you can just add it a=`date +%A%_d" "%B", "%Y" @"` && echo -n $a" " && echo $(date +"%r" | sed -e 's/\([0-9][0-9]:[0-9][0-9]\):[0-9][0-9]/\1/')
@rich oriole use $() for shell expansion
@rich oriole use
$()for shell expansion
@main olive I know, I just used backticks at first so wanted to solve issue with discord, I don't like when somethings doesn't work as expected :d
i didn't know you could do things like
=in linux
@magic basin you can do anything in-line
however sometimes things are slightly different but still possible
yeah
this course i am on says run this: docker run -it -p 8888:8888 -p 6006:6006 -v "%cd%":/host -w /tmp tensorflow/tensorflow jupyter notebook --allow-root /host
but the jupyter launch command fails
can someone help?
i suggest you try another guide @left pilot, this one seems to be windows-specific
"%cd%" is a cmd.exe thing
yes, it was $PWD but i changed, as i use windows
sorry @main olive i am not the strongest programmer
what error does it fail with
the course i am on with Eduonix, the code it incomplete and quite poor, and i am at a brick wall
bare with me
docker auto update
can you post the full error message?
yes
k
C:\Users\Jordan>docker run -it -p 8888:8888 -p 6006:6006 -v "%cd%":/host -w /tmp tensorflow/tensorflow jupyter notebook --allow-root /host
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: "jupyter": executable file not found in $PATH": unknown.
the container element works, but the jupyter launch fails
i have integrated jupyter into my paths
to be specific, i have added the jupyter launch directory to my PATH system variable
and i can launch jupyter by executing 'jupyter notebook' in the cmd terminal
the system's $PATH does not carry over to docker
you might have to point directly to where you think the jupyter binary is in the container with an absolute path
i see, do you know how i would locate the jupyter binary?
is there any reason you're using that particular image and not something like https://hub.docker.com/r/jupyter/tensorflow-notebook ?
to be honest, i'm just doing what the course tells me to do, I could certainly try a different approach
setting it up now ๐
yes, thanks
hi
I need help
I know how to ping an ip or resource
but how do you ping an ip through another ip
master (where I am) --> worker IP ---> another IP
I want to check whether the worker can reach the other ip
ssh into it?
I can't ssh.. the network rules don't allow it
ssh to worker I mean
unless the "worker" is set up for forwarding packets, what you're describing is impossible
then modify so you can
forwarding packets?
yes, so that the worker forwards the ping packet to the other IP and the response back to you
oh
hmmmm
how do I check workerIP-->another IP connectivity then
I figured out a workaround.. but I would like to know this..
If I change a file that's regularly rsynced to a server, will rsync load the whole file or the diff?
@main olive oh ok, ace... I couldn't remember. So if I have a 500mb CSV and add a line it'll just upload the line, cool
yeah, it should only upload a chunk of the CSV and not the full file
Why does my ssh script not work when i compile the .bat to an .exe
anyone know how i can get a screen region when using x11vnc / vncdotool or some other way of interacting with the vnc via python?
What is the correct cron expression if I want a command to run every 90 days?
nano > vim
how can i sync all terminal sessions, so when i run something like echo hi all my logged in sessions will display it?
if i have two logged in root users for example
@magic basin screen can do that
Oh ok
hello
Hi
Hi Everyone - trying to get cron to run a python script for me.... i am new to Python so not sure if my job is correct. Cron isnt executing the actual .py script.... here is job:
*/20 * * * * /usr/bin/python3 /home/ubuntu/casey-trader/get_token.py >> ~/cron.log 2>&1
normally to execute i just run python3 get_token.py in that directory
anyone?
@main olive does your script start with .
#!/usr/bin/python
@modern kestrel I figured it out now, thanks!
i had default python when i needed python3
if so then
*/20 * * * * /usr/bin/python3 get_token.py >> ~/cron.log 2>&1
``` would work maybe?
oh okay great
yes of course
Terminal Error E: Package 'python-software-properties' has no installation candidate What Does That Mean?
sudo apt-get install software-properties-common
run this @serene sigil
if it still doesn't fix it run
sudo apt --fix-broken install python-pycurl python-apt
thx
Separate Question: What do I do to fix this error? $ sh cmake.sh --prefix=(pwd)/cmake-test-install sh: 5: Syntax error: "(" unexpected
put a $ before the (
๐
i'm fairly certain SSH only sends the client's version and not the full OS information or so
is there a way to note all installed rpms and then install those on a different machine?
With packages that have dependencies, it looks like they need to be installed together or it'll throw an error (without internet)
@main olive What is Raw, Rlogin, and Serial used for
I'm aware of SSH, Telnet and MOSH
where do you see those options?
rlogin is https://www.ssh.com/ssh/rlogin, serial is for... well, serial stuff, like UART and so. Raw is I assume reading/sending characters directly over a TCP socket or file
they're all different methods for connecting to a "terminal"
is this putty or something?
Is there a command of the os module to know how much RAM has a computer? On linux
doubt it
you could run a command like "free" and parse the output; there are probably 3rd-party libraries that do the equivalent of that.
I'd guess "ansible" has something like that, but that's not a library; it's a complex application
@frank coral also see https://pypi.org/project/psutil/#memory
that's probably what I'd use
ouch, using ansible just to get the amount of memory a system has
like using an RPG to hunt ducks :p
i know, i know, i'm just joking around
mutters
what does file /media/bitlocker/dislocker-file say?
am i able to get rid of these annyoying lines in PuTTY when the server banner is displayed?
Not really a help, but do yourself a favor and move to Bitvise SSH
putty is, ugh, meh
I'll check it out, i use KiTTY too
Windows 10 has also built-in OpenSSH, but I've found that the command shell is not really doing well with it
But Bitvise is modern and works well for me with all systems
That is factually wrong, but ok.
this is it?
Hey everyone..
please tell me how to listen incoming desktop notifications using libnotify or dbus-montior ..
Actually i want to create a systemd script for this process like, if a notification pop-up then service gets start and check IF it come from specific sender.. IF yes, then start another script in background otherwise do nothing
@cerulean pagoda and the following fails?
sudo losetup -f -P /media/bitlocker/dislocker-file
(if you get no output, see if it appears in sudo losetup -l)
Does anybody have experience with kvm vm backup and restore when a hosting provider doesn't give you the option to do it through control panel?
ok, cool, what does ls -l /dev/loop0* say?
one of those is the partition you want to mount @cerulean pagoda
should be able to just go ahead and mount it like normal
hmmmm
that's... odd
@main olive can you give me a hand here then?
Yes, what do you need
Can you take a look at this script and see if its in your expertise?
post the script :p
Pastie Bin is place to share your code / text snippets it also supports threads for people to post back to your current threads to allow easy collaboration
Well thats what I was saying
ie, a history of someone running commands and what their output was
the lines beginning with $ are the commands, and the output is what proceeds after that
only the very last thing at line 304 (from the shebang line to the end) seems to be a script of some sort
Ok well what use can I make of this? The person sent it to me to learn and maybe reuse in the future
maybe you can learn the commands listed here? Looks like he's also written some explanation into the output itself
I don't really know what this could be useful for, I'm not familiar with whatever the beautyworld thing is
its just a site
that I needed info from
he wrote some explanation but its all mumbo jumbo to me
5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious/inappropriate or be for graded coursework/exams.
well definitely not malicious
But it does breach the terms of services
and what term is that
anyone got experience running a python script as a systemd unit? I'm trying to run my discordbot through it, and it's sort of working but the logging isn't working the way I want it to.
The bot uses print(stuff) to output things like who executed what command etc, and it has ascii escapes to colorise the output.
But there are two issues when running it through systemd:
- output is only captured by journalctl when the server restarts
- my fancy color coding isn't visible
[Unit]
Description=MrFreeze (beta)
After=network.target
[Service]
User=mrfreeze
Group=mrfreeze
WorkingDirectory=/srv/mrfreeze
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=MrFreeze
ExecStart=pipenv run bot
[Install]
WantedBy=multi-user.target
I first did it without the standardoutput things but it doesn't seem to matter.
so when it's restarted everything that it should've outputed is outputted as if it was just printed, with the time stamp saying the current time, rather than continously printing it.
have you considered using the logging module instead of just prints?
it will make your life a fair bit easier
what does it do?
how is it different from just printing?
you have different logging levels, can apply filters, don't need to necessarily log to stdout, etc
it's far, far more powerful than just printing
you can also decouple the log messages from the actual format
so if you ever want to change anything regarding how your logs are printed, nothing breaks
hm, I will look into it. I think almost all logging already goes through a logging cog (sort of a module in discord.py) so it should be easy to change
Hey, I'm writing a log-monitoring daemon, but I think my question is more code debugging-related, is this an appropriate place to ask questions (I'm new here)?
Never mind, I figured out how to use the help channels
I'm horrible at python, but I just built a module.... I am not tryiung to import the module, but it isn't being found by my python.
Any suggestions?
Running Ubuntu
Trying to build Ettus UHD Python API
I am trying* (Disregard the "Not")
init.py inside the folder
else from .filename import method if it is in the same directory
How do I use relative paths?
Like if how do I find a file that's in the same folder as the code?
/home/chronos/u-b1c59786803a0df1da5dda85e37e6fd9fa03f528/MyFiles/Downloads/TeccaTest/cogs/ffmpeg-git-amd64-static.tar.xz was not found.
I'm going to use relative paths instead, so tell me how to use it.
async def from_url(cls, url, *, loop=None, stream=False):
loop = loop or asyncio.get_event_loop()
data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))
if 'entries' in data:
# take first item from a playlist
data = data['entries'][0]
filename = data['url'] if stream else ytdl.prepare_filename(data)
return cls(discord.FFmpegPCMAudio(filename, executable="/home/chronos/u-b1c59786803a0df1da5dda85e37e6fd9fa03f528/MyFiles/Downloads/TeccaTest/ffmpeg-git-amd64-static.tar.xz", **ffmpeg_options), data=data)```
I just do folder/
@misty vessel So folder is the current folder of the code or the home dir
so
the ffmpeg is inside the code folder
to you, the folder is folderpyscriptisin/folder/ but the script will see as folder/
probably
yeah
I just installed ffmpeg with apt install ffmpeg so I don't have to deal with that
it added to path, at least in ubuntu 19.10
so
when I deal with ffmpeg should it look like that?
Because I've seen them end with .exe etc.
@misty vessel
.exe is windows
ooo i get it
my discord.FFMmpegPCMAudio looks like discord.FFmpegPCMAudio(pathtoaudio)
or more broadly vc.play(discord.FFmpegPCMAudio(pathtoaudio))
so u have installed ffmpeg before? @misty vessel
@misty vessel
I made a TTS Bot
if you want invite dm me
apt install ffmpeg is installing ffmpeg lol
@misty vessel I could tell.
how can i make python execute linux commands
subprocess.run
thanks
whats wrong with subprocess.Popen()
Nothing
It's just a relatively lower level interface
If you need access to more settings and features then use it
sorta
as long as command is a list of strings like ['/bin/echo', 'hey', 'you']
it's documented, you know
ty
When you create a new user, it asks for the full name and phone number. Where is this information stored and how can i view it?
@lavish hemlock
import pwd
print(pwd.getpwnam('nosklo').pw_gecos)
@lavish hemlock it is traditionally in /etc/passwd
also, the "asking for full name and phone number" thing is a debian thing afaik
their adduser command
useradd, on the other hand, just requires the username
Can someone help me, I'm trying to install pip for python but it keeps installing to Python 3.5.3 not Python 3.7.7
how are you installing pip?
Anyone know why my .py websockets/asyncio script would work just fine on my local machine; but error out on my aws insance?
what sort of error?
@main olive pinged!
hello
How's your day going?
not the right channel for this :p
You asked to be pinged :D
I'll probably ask on of the two thousand billions questions I have about Unix as I'm here
I tried to look the Linux kernel docs, but they clearly don't intend to have beginner in there, to have a custom filesystem handler (is it the right term?) you need to define some specific methods, but once it is done, how do you hook it up to the kernel? Can you do that at runtime, or you have to edit some files and reboot?
you typically load your driver as a kernel module if it's external
ie with modprobe (or plain insmod)
this can be done at runtime
Interesting thanks!
@gritty bobcat try installing pip using get-pip.py using python3.7 get-pip.py
if [ "$#" -lt 2 ]; then
echo "Usage: URL DIRECTORY [--dry-run]"
else
chart_museum_url=$1
the_path=$2
pushd $the_path
helm init --client-only
createHelmTemplate $the_path
if [ "$#" -eq 2 ]; then
packageHelmTemplate $chart_museum_url $the_path
fi
fi
Can someone explain to me what this is doing
@modern kestrel is this part of a bigger script?
Yeah @robust cave
and you understand everything else except this snippet?
createHelmTemplate() {
out=$(helm template --namespace test --values=values.yaml --set id=test . )
echo "${out}"
helm lint --namespace test --values=values.yaml --set id=test .
}
packageHelmTemplate() {
chart_museum_url=$1
echo "Uploading chart to $chart_museum_url"
helm package . && \
file=$(ls *.tgz) && \
curl --data-binary "@$file" "$chart_museum_url" && \
rm -f $file
}
loginToVault() {
echo "x"
export VAULT_ADDR=y
vault login -tls-skip-verify -namespace=/notprod/hubs/ndap -method=oidc role=oidc_role
}
if [ "$#" -lt 2 ]; then
echo "Usage: URL DIRECTORY [--dry-run]"
else
chart_museum_url=$1
the_path=$2
pushd $the_path
helm init --client-only
createHelmTemplate $the_path
if [ "$#" -eq 2 ]; then
packageHelmTemplate $chart_museum_url $the_path
fi
fi
hmmm for the most part yeah my job wasn't to understand the whole thing but i was trying to modify this script so it would take in the chart and path and then execute the functions
we got too stuck so our tech lead quickly did it this way
but we have no idea what he has done we dont understand bash very well lol
and he is too busy to explain ๐ฆ
okay let me think about that for a few minutes please ๐
what i dont understand there are several things
if [ "$#" -lt 2 ]; then
echo "Usage: URL DIRECTORY [--dry-run]"
else
this checks if the number of arguments are less than 2, and if so echo the help message
chart_museum_url=$1
the_path=$2
pushd $the_path
this sets chart_museum_url to the first argument, the_path to the second argument, and pushes the_path to the top of the directory stack
pushd: https://unix.stackexchange.com/questions/77077/how-do-i-use-pushd-and-popd-commands
for anything related to helm, the relevant documentation is here: https://helm.sh/docs/
I'm not familiar with it
if [ "$#" -eq 2 ]; then
packageHelmTemplate $chart_museum_url $the_path
fi
this then passes chart_museum_url and the_path to packageHelmTemplate if the number of arguments to the script is exactly 2
np
what do you not understand?
if there is less than 2 arguments it will echo an error but otherwise why does it need the -eq 2
there will only be 2 arguments max
i dont see why the second if statement is there thats all
seems overdone
I have no idea about the reasoning, but you can pass more than 2 arguments to the script, it just won't execute this block:
if [ "$#" -eq 2 ]; then
packageHelmTemplate $chart_museum_url $the_path
fi
yeah thats why im confused bercause the jenkins file will only pass 2 arguments max
maybe this is just an additional precaution
but thanks that helped ๐
anyone good at linux systemd can help me with this
jerry.service: Failed at step EXEC spawning /usr/lib/python3.8: Permission denied
have you tried chmod +x for your script?
just to get anything obvious out of the way ๐
yes
Hmmm unsure then sorry you'll have to wait for someone more experience
kk
i solved it with the above question's answer
using the path from which python3.8
ah okay @white gust so your exec start path file was incorrect?
was it the same error, usr/bin?
i was using python3.8 folder at first
the fix was to change it to use the file instead
file is the executable
like python.exe in windows
ah okay cool
is there a waynto copy text to Clipboard that is both Linux & win compatible?
you could use a library like pyperclip: https://pypi.org/project/pyperclip/
thanks ๐ค
I have been trying strace to see pipe syscall but it doesn't show up
$strace -f echo hello world | cat
I want to know how piping works. Like two process launched at the same time and echo waits for cat to read from stdin kind of stuff want to know the details but strace doesn't help in that case
observing pipes via strace is difficult due to the nature of pipes
@humble onyx this might be interesting to you https://superuser.com/a/222141
thank you
@main olive fwiw - with rsync is gcp (gsutil rsync) if one has an updated file locally, and the old version on the cloud, rsyncing the data from cloud to local will over-write the local data
interesting
yeah, just lost an hours worth of gcp api usage
yeah i'm not sure ๐ค screwed me up though, i thought i could use that for syncing data across different systems and users
maybe if i push the data first then sync , idk
๐
Hi can i set a max login timeout of 10 minutes so when i login, i can do whatever i want and as soon as it's been 10 minutes i get disconnected, no matter what i am doing
or maybe 1 minute before it i can run a script that will show i have not much time left
So:
System starts timer for 9 minutes and 10 minutes
When the 9 minutes is up, runs a bash script that tells them they have not much time left
When the 10 minutes is up, the user is disconnected
How would i do this
you might be able to have a program that a) starts when you log in; b) counts down the alloted time; c) kills all your processes
but that'd be messy
like if you had a cron job running by coincidence, it'd kill that too
in theory you might be able to find all your login processes, and then kill them and their children, but ... eww
more than you ever wanted to know: https://www.gnu.org/software/libc/manual/html_node/Job-Control.html#Job-Control
Job Control (The GNU C Library)
I tried making a python script that does it but it just waits for the 10 minutes, and i am unable to do anything, i would need to run it on startup as a background process
well you can start it reasonably easily by putting something in your ~/.bash_profile or whatever file your shell reads at startup
Yes but it will do the same thing
there's TMOUT=x
but when you're running python programs it will pause
I didn't understand a word of that, tbh
So i can add TMOUT = 10 to the .bashrc file
which will terminate my session after 10 seconds
that is what i want
but let's say i start a python program and go inactive, it will not terminate my session
if i use the w command, it will still show the amount of time i am idle though
@fickle granite
well I never knew about TMOUT so I don't have anything to say about that
is there anything i can do about the w command
well you could have a python program figure out your idle time, I guess
I wouldn't be that surprised if there were, tbh
Ok after a little research, there is a way to do it with the /etc/ssh/sshd_config file itself. All you do is add:
ClientAliveInterval 300
ClientAliveCountMax 0
So i guess it's good if you forget to log out of the root user while you grab a coffee :D
if that does what you think, then it should be reliable
hi
I have this command that prompts for a password after it's entered
I tried to use --password-stdin and -p as flags to it to pass the password from a json file using cat <some stuff> | command -p
but it doesn't work..
how do I pass the password here
anyone?
this is what I'm trying to do
echo $(gcloud auth print-access-token)\n$(gcloud auth print-access-token) | myapp docker-registry update 22 -u oauth2accesstoken```
it's not an arg.. because it doesn't have -p flag or accept --password stdin
it prompts for password.. then you type and press enter.. then prompts to reenter password once more
@main olive
test your output first before piping it
I tried this
and I am not sure if it entered the password into the prompt.. because I had to press enter both times
@main olive
you might need to use expect or similar
the application might be devouring stdin
could you give me an example
is it like this
#!/bin/bash
export PATH=$PATH:/root/bin/
gcloud auth activate-service-account myid@my-project.iam.gserviceaccount.com --key-file=gcrconnect.json
myapp docker-registry update 22 -u oauth2accesstoken
expect <<- DONE
expect "Password:"
send "$gcloud auth print-access-token\r"
expect "Retype password:"
send "gcloud auth print-access-token\r"
expect eof
DONE
I tried this: but still having trouble
#!/bin/bash
export PATH=$PATH:/root/bin/
gcloud auth activate-service-account myacc-gcr@project.iam.gserviceaccount.com --key-file=gcrconnect.json
auth_token=$(gcloud auth print-access-token)
expect -c "
spawn myapp docker-registry update 22 -u oauth2accesstoken
expect "Password: "
send "$auth_token\r"
expect "Retype password: "
send "$auth_token\r"
"
DONE
It works.. I'm done with this problem now
can someone tell me how export PATH works and why we need path variables
like I want to understand what's going on here
with PATH
does it overwrite the first one
export PATH just means that PATH is turned into an environment variable, rather than just a bash variable
aka all child processes inherit it
"does it overwrite" no, because each time PATH is set, the old PATH is included in it
aka it appends instead
PATH=/root/bin would overwrite, while
PATH=$PATH:/root/bin appends to the old path
hey
I've installed ubuntu docker container,
I'm trying to install squid on it
and I did
but in order to run squid I need to run this command:
systemctl start squid
and as u know u can't run that on a docker container bec of 'systemctl'
any ideas ?
hello i've got a problem
File "/usr/local/lib/python3.8/tkinter/__init__.py", line 36, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
i've install python with
dnf install python38
how to configure to Tk
@jaunty cypress you tried dnf install python3-tkinter?
seems like it's for 3.7, though
you might have to build it yourself if you absolutely require 3.8
oh ok thanks i try
In general, if I import os and then referenced something like chmod how would the interpreter know I am on a Linux box to execute the chmod command in the shell?
uh
it doesn't "execute the chmod command in the shell"
and the interpreter has something built into it that tells it what platform it's running on
Hey can I ask something related to vim here?
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.
@terse mesa I don't see why not, although #tools-and-devops might be better
I did ๐
@terse mesaunix only allowed here!
@main olive Don't backseat mod, thanks
Hello, I need to check if I have PyQt5 installed via which and for some reason it is not showing up although I have it installed. I thought it is because it is pip3 module, but when I do eg. which pyinstaller that one shows up. Does anybody know what could be the reason behind that? To understand, why I would like to prefer which, I am checking more executables and I do that with for loop.
@main olive you're welcome.
@frigid needle does pyqt5 even provide executables? what command are you using?
@main olive I am using which pyqt5
which only points to the location of executable binaries on $PATH
pyqt5 isn't one, it's the name of the pip package
you'll need to use something like pip show pyqt5
which conveniently returns 1 if the package wasn't found, and 0 if it was
Many thanks. I already considered using pip show pyqt5, but wanted to use which, if there was a way.
Which is for executables that are on discoverable on your PATH environment variable
If pyqt5 doesnt come with executables then you cannot use which for it
It actually does have some executables IIRC, but not one named.pyqt5
There's one for generating ui files from python, but I don't remember the name
If you want to see if it's installed you could just use pip
"Pip show pyqt5"
Or you can grep "Pip list"
Oh that's been mentioned already
hah you said what I did pretty much word-for-word @warped nimbus
How can i print a character like โ in the terminal
in fact, literally โ, that's all i need
worked for me
nice question mark in a box
try ```py
print('\u2713')
โ
oh, then your terminial is using a font that is incapable of displaying that charcter.
I bet you're on Linux
yes
yeah
this has nothing to do with python; it's to do with your terminal app, and/or the font it's using
i'm using windows's cmd
see if windows comes with an alternative to cmd.exe
or try PuTTY
kinda dumb using that just locally, but I think you can
this seems thorough but depressingly complex: https://stackoverflow.com/a/47843552
what do you use?
Mac
you have some other process running apt
if you're certain that you don't, then I think you can delete that lockfile
the file probably contains the PID of the process that created it
find that PID, then see if the process is still running
if not, it's fine to delete the file
if so, you should try to gracefully kill the process
I don't understand your question
nevermind
Hi everyone! Iโm using Ubuntu 16.04 and when I open the terminal the username takes too much time to appear, what can I do?
What else can I provide?
Have you checked if it is system related? ie. slow hardware. What terminal emulator are you using. I'm assuming the default terminal, but that's not a guarentee. Have you searched for this problem on google and tried any of the soltuions provided there? Did they make a difference? or did they fail? What else have you tried
Is it just the name that takes time to appear or does the entire terminal stall? how much time is too much time? are we talking seconds, minutes, years. does the terminal work fine after the name appears if it doesn't work while the name loads?
To start I would recommend following this https://stackoverflow.com/questions/5014823/how-to-profile-a-bash-shell-script-slow-startup to check if your load times are caused by something in your bashrc file. If you're using the non-default terminal emulator you might look at the FAQ or similar for slow startup questions as there can be workarounds there. LMK if you have any further questions/need help
why does the terminal sometimes disconnect when i use ctrl+z
what do you mean by disconnects? Also ctrl+z is generally used to suspend a proccess in the terminal
so if you're running a command and you use ctrl+z it should pause running that command
well i didn't get disconnected, but the terminal went black and i couldn't do anything else after that
not even ctrl+c worked
ctrl+d?
@chilly mural
Well thank you very much! I am not the only using that computer and turn out somebody created a conda enviroment, I followed your advise about the .bashrc timing so:
Before:
Conda will do that XD. NVM is also a common offender. I'm having ~.5s delays from bash-complete+/NVM that I'm working on solving. LMK if you have any other bash related questions
time source .bashrc
real 0m5.263s
user 0m5.770s
sys 0m2.011s
then i look for the bashrc and deleted the conda init part:
`#Anaconda PATH
export PATH=~/anaconda3/bin:$PATH
>>> conda initialize >>>
!! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/manuel/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/manuel/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/manuel/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/home/manuel/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
<<< conda initialize <<<`
After:
real 0m0.093s
user 0m0.078s
sys 0m0.016s
Then I check if everything was working fine and it did!
@chilly mural I checked in Google but I did not find an answer before
What is the recommended directory to store files in, besides the home directory?
@lavish hemlock read this https://www.geeksforgeeks.org/unix-file-system/
Thanks @chilly mural
Yep, for the most part you'll wanna keep files in their respective places in the fs and everything else goes in the user's space. There's more to it than that, but that's what questions are for.
I want help
I have a UNI project due to lockdown
Built a Cloud Security with face recognition
Can you please help me out with some suggestions?
anyone knows how to use screen?
5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious/inappropriate or be for graded coursework/exams.
was trying to fix the problem because I couldnt run anything
even for installing python
not sure i follow
botting to "farm" reddit karma is against reddit's ToS
it seems pretty clear that's the reason you installed linux in the first place
just using ls with google cloud and on my systemls gs://blah/* didn't work, whereas on another the glob * did work. If I leave the glob off then I get the same output as them.
Just wondering why that might be , not sure where I'd start with considering it
@digital haven probably something to do with how shells expand globs
@main olive bash vs zshell perhaps? hrm... maybe i'll look into it later
@main olive are you there?
yes? hello
I'm having problems with a server I use. The server has Ubuntu 18.04 and the problem is that some processes sometimes just get killed. It is configured with 256 MB of RAM so I don't know if that is the problem. On it, it's just a headless chrome selenium session that runs ( currently manually ). However, sometimes it works just fine and it gives me the data, sometimes it takes really long and eventually crashes and sometimes the process just gets killed before it does anything. Any suggestions?
what does the process output when it crashes?
256M might be a problem if you're doing selenium
try adding swap
Either the first or it tries to start and eventually crashes
hmmmm, not too much info here
I think you're onto something with the memory, though
add a gigabyte of swap and see if it crashes then
Do I have to configure it on the server hosts site then?
no, no, this is locally
Ok I will try that out, thanks
But just for the record: The problem is the RAM then, right?
easiest is to fallocate -l 1G /root/swap
and then mkswap /root/swap
and finally activating it: swapon /root/swap (this step doesn't persist and has to be done on each reboot unless you add it to /etc/fstab)
and see if free -m shows the additional gig of swap
and re: is it RAM
not sure, but this will help narrow it down
swapon: /root/swap: insecure permissions 0644, 0600 suggested.
swapon: /root/swap: swapon failed: Operation not permitted
chmod 600 /root/swap then
It gives me this error i.d it is a rented server
you seem to be root, so it shouldn't matter
Even with 600 I'm prohibited and that's what free -m says:
root@noez6414:~# free -m
total used free shared buff/cache available
Mem: 256 104 100 1 51 152
Swap: 16383 0 16383
Do you know what else could be the problem with selenium? I thought it only could be the RAM because sometimes it works fine
no idea, sorry, i personally haven't touched selenium at all
Okay but thanks for your help
Btw @main olive , I'm planning on switching to linux once the LTS 20.04 gets released in a few days
Is there some way to place Console history INTO a Text File? Would love to do that.
on Ubuntu, how would I place Console/Terminal history into a Text file please?
apparently its easy... never hurts to ask though,.
yeah, natureally
i mean, that's the actual command
history
and output it to file.txt with the > redirection operator
I've got weird errors from both os.system and subprocess.run trying to run commands
subprocess.run first:
I've got this line: py out = subprocess.run(['exiftool', cPath], cwd='/root/TxtToSL_Online/engine/', shell=True, text=True, capture_output=True)
fails to run, stderr: Data_TxtToSL/cache/bsl/words/test.mp4: exiftool: command not found
but both that file, plus the exec (exiftool) exists
Let me try
oh huh yeah it's in a weird location
/usr/bin/vendor_perl/exiftool
trying
okay so now it doesn't error
but it doesn't think i'm passing any args?
Fyi this is cPath
cPath = 'Data_TxtToSL/cache/{}/words/{}.mp4'.format(lang.lower(), word.replace(' ', '-'))```
okay wow it works!
i just replaced the array of args to just a string
hey @main olive you stil on?
is it possible to have something along the following lines
git add blah
msg = "something here
multiline message"
git commit -m $msg
i'm not sure if commit can accept multiline stuff likethis
yes commit can handle muti-line comments.
@digital haven try git commit without -m or the message and see what happens ;)
@chilly mural I'm here, what's up
@main olive yeah i wanted to commit from a script though
sure, should still work
on the off chance it doesn't, replace EDITOR with a function which returns whatever your message is in the script
if there's no message how will there be a message ๐ค seems a bit zen for me
by from a script i mean - i will not type the message, the commit message will be scripted
pure speculation tbh
fair, i don't think that it works
oh, right, it needs to write the contents to a temporary file, not return the message
yeah, i wanted to write a multiline commit message from a script
single line is fine, but not sure how to do multi
just realised i had space around = and it's shell, let me check without
seems not
mkdir testing
cd testing
git init
echo "this is a file" > something.txt
git add something.txt
msg="this is a test
commit message"
git commmit -m $msg
that's the gist of it, i'll have to stick to one line
@digital haven works on my machine
that's not from a script tho
that really shouldn't matter
it shouldn't
it doesn't
i tried one line with \n and it didn't work
you need to insert actual newline characters, otherwise nothing will parse \n
that's why I did $'\n'
hmm ok
shell parses that into a newline character for me
let me try that, thanks
also, in your script
in the commit line (the last line), try "$msg" with the quotations
i always forget when i should/shouldn't quote vars
or maybe the advice is "always"
you always should
๐คฆโโ๏ธ
unless you know you shouldn't
fair, i don't use bash enough
like when you're passing a string as separate flags / arguments
seems the way you did it works, i can't get others to though
this doesn't
all good, thanks
hey xx, I wanted to know if you had any advice on improving terminal launch times. I've got a couple of things in my .bashrc that slow everything down. NPM, bash complete, and some scripts I'm sourcing. My intuition says to lazy load them, but I donโt know if you can do that without using a subshell which kind of defeats the purpose. Iโve read about wrapping them in functions so they load when theyโre called. But then you'll have load times when you start them, which is better than every terminal instance. Is there another solution that loads then when there terminal starts, but doesnโt stall the terminal while the rest of the script is loading?
@chilly mural you know, I was literally just thinking about this the other day. I've got loads of crap in my rc that slows down shell execution on startup. These are mostly things that would load by the time I navigate to the correct directory anyways to utilise them, so it doesn't make sense that my entire shell spawning stalls while they load, especially if I eventually don't even end up using them. I've been devising a method to load them in the background, only blocking if you call something which relies on a thing which hasn't managed to load in the background yet (which I don't imagine would happen very often, but might still do in certain scenarios). I'll let you know if I've come up with something functional
I'm sure something like this already exists in some form, but I haven't been able to come up with the correct terms to find it on Google
I've done some extensive googling and couldn't find anything. Some people were talking about moving things from rc files to .profile, but I don't understand the difference between login/interactive and non-login/non-interactive shells to understand the value*
how i can grep an string if he is seperated randomly
he
llo
but i need grep "hello" file
without regex
@hazy stirrup if that's the input file, what would be the output file from your grepping
Can you auto fill passwords when changing user with su (username)
something like su root -P rootpassword
dunno what you mean by "auto fill"
surely you don't want to type your password on the command line, along with the command and its options
regardless of whether you want that, you can't do it
okay
does ssh support security key authentication
like physical keys
@fickle granite you're the only person i see in here, all the time ๐
and I'm only here a few hours a day
I'm 95% sure ssh does work with physical security keys, but I don't know the details.
I'm 90% I use that support every workday of my life in fact
we use YubiKeys for something; I assume ssh is involved ๐
@fickle granite Do you think they are useful? I got into a heated argument about them being useless and that a normal usb or phone is just as good
But i don't think that's true. Btw if you find out how to use them for ssh authentication please let me know ๐
I can't honestly say they're useful because I don't have real data. They sure feel useful
The one I have for work couldn't be easier to use: it's small enough that it fits into a USB-A slot, and barely protrudes; a bunch of times per day I just touch it, and that's it.
I have one on my keychain for personal use, and once in a while when I log in to google or github or whatever, from a new machine, I have to stick that into the slot and touch it. I could just as well use the 2fa app on my phone for that, so ... ๐คท
๐
rm -rfed my entire box
oh yeah, they are so nice to have just press a button and you're done
does ssh support security key authentication
@lavish hemlock SSH supports PAM, which in turn supports anything as long as someone has written a library for it - fingerprints, anus prints, password = username backwards, etc
although I'm not sure you even need PAM, doesn't SSH come with GPG support out of the box? (which most physical keys do)
How can i make my python script into a desktop icon?
you need to create a .desktop file which points to it
this might be useful https://wiki.archlinux.org/index.php/Desktop_entries @muted granite
thank you
do python scripts need the terminal statement to be true?
i can't get it launch
post your .desktop file
[Desktop Entry]
Name=Face Scan
Version=1.0
Icon=/home/homelander/Attendance/idicon.ico
Exec=python /home/homelander/Attendance/GUI.py
Path=/home/homelander/Attendance/
Terminal=false
Type=Application
how do i know what version to put???
How do you make su command ask for google-authenticator code?
Since i have it installed
that's a whole big can of worms
if you're using Linux it might be in the "pam" stuff, although I haven't thought about this for years, so that might be outdated
@fickle granite have you any idea what this means?
only vaguely
it looks like it might be relevant, but that's all I can say
fiddling with that file is probably dangerous; if you mess it up, you might lock yourself out of your own system
Failure is the key to learning :p
there's something to that ๐
apparently adding to the sshd config: Match User root
crashes my VM
Hey guys :) Any other known ways of moving to root user without su / sudo ?
"moving to root user"? like privilege elevation?
hello
I mean, there's doas, but that's about it @lavish hemlock
can I ask a nginx question here
aka webserver questioj
!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.
maybe someone knows how to fix
I mean
the error is pretty self explanatory
there's no such config option as server_name_server_blah
this is it
I access it by: sudo vi /etc/nginx/sites-enabled/flask_settings
@main olive if I may ask
anyone tell me what the number in the brackets mean?
every time i ctrl+z out of a process, it spits out a seemingly random integer in those brackets
just curious as to what it means
ah ok
so you can do something like disown 6 to disown a job
whats the difference between a job and a process?
jobs are just processes tied to a specific shell instance
ohhh ok
so a job is something that takes up a terminal session
or that normally would without a process manager
Has anybody here used KiTTY
It doesn't seem to work with google-authenticator/PAM auth, when prompted for the verification code, it says something about attempting automatic.... something
Which is not what i want
When I try to run a python script on my Linux 18.04 VPS it just spams the first print....
When I do this on my Windows10 64x machine, it works, with the exact same files...
I thought this might be a permission thing, since it uses a geckodriver, so I changed the permissions: it spams way slower, but still spams the first command/print...
Does anyone know how to fix this? Has anyone had this before?
@restive helm can't really help you if we can't see the code
can i record both sounds from the monitor and microphone?
Can someone help me use pyinstaller on linux?
its not creating an executable file for me on my linux system
Hi i need help, i pointed ForceCommand to a script that echo's "hi", but when i login it closes my session immediately
I have intel-mkl problems executing some python libraries on manjaro and they are getting annoying. Does anyone know if this is a general common problem to which there is a known solution?
Here's a little neat bit of code for you all
#!/bin/bash
function ufwAdditional {
while true
do
read -p " Enter the port you want to open (type 'done' to exit) 0-65535: " Port
if [[ ! "$Port" =~ "[Dd][Oo][Nn][Ee]" ]]; then
ufw allow $Port
else
exit 1
fi
done
echo finsihed2
}
ufwAdditional
echo hi
be easier to just hit up-arrow
i guess
hey im in the 'interative shell zsh' and i literally cant do anything
everything is "command not found"
how do i exit this and go back to my normal terminal
even the command they're telling me to use to update zsh isn't a valid command LMAO
i typed out exit and im stuk at the process completed
it wont let me do anything
stuck*
guys my bash says (base)
is that a problem
I googled a found out that it is becuase of the anaconna environment
okay nvm i fixed it
@velvet fulcrum you can either start a new terminal or try "deactivate"
Check if your password has been compromised!
#!/bin/python
import hashlib
import requests
import getpass
hash=hashlib.sha1(getpass.getpass().encode("utf-8")).hexdigest().upper()
head,tail = hash[:5],hash[5:]
url='https://api.pwnedpasswords.com/range/'+head
res=requests.get(url)
if not res.ok:
raise RuntimeError('Failed to fetch "{}": "{}"'.format(url. res.status_code))
hs=(line.split(':') for line in res.text.splitlines())
count=next((int(count) for t,count in hs if t==tail),0)
print("Hash: ",hash,"\nLeaks count: ", count)
Come on people
there are only slightly over a million five-hex-digit hashes
yet there are hundreds of millions of computer users on the planet, presumably with almost that many unique passwords
oic, that returns a whole long list
hey I need help with creating a script that add new users please
yeah!
fire away
now of course this is a Python discord, and I'll probably wind up encouraging you to write a python script instead of a bash script
@surreal drift 
Something like this?
import os
name = input(str("What user would you like to add? "))
os.system('adduser {}'.format(name))
might's well write a bash script
They have asked you to script an automated solution which periodically checks for new user information files
and adds users. Results should be documented in a separate time-stamped log for audit purposes.
Be carefull with something like this, running unsanitized input
I don't understand, sorry
it has to be in bash script
You wouldn't want someone to input username; delete the entire system command into that
You can do an ls to see files
@surreal drift It has to be bash? Is this homework, or a job interview question, or something?
python has it's own ways to deal with the filesystem rather than ls
@vestal turret It's simple. you don't give out sudo permissions.
You could create a script to see if there is new files compared to when you last ran the command, maybe?
assignment for uni
๐ฆ
If you count the number of files in the user's directory, you can store that number and then check again, if the number doesn't match, do something...
This is a server for python though,
^^
it is python too
so I've been using ubuntu in VirtualBox for a while now with ubuntu 20.04 coming out and the fact i feel comfortable enough with it I've decided i want to fully use it on my laptop i wanted to know before i go to BestBuy if this usb would work(I've never done this before so I'm being cautious asking here)
https://www.bestbuy.com/site/sandisk-cruzer-16gb-usb-2-0-flash-drive-black/9226875.p?skuId=9226875
i don't even know if you need a specific kind of usb or not im just tryna be safe about it
Shouldn't be a problem
Yeah it's fine though kind of a bad deal considering it's USB 2.0
If you're gonna buy a flash drive may as well buy one that will be more useful for other things down the road
so sorry to ask again but your saying something like this is a better deal
https://www.bestbuy.com/site/pny-elite-turbo-attache-4-64gb-usb-3-0-type-a-flash-drive-black-gray/1876003.p?skuId=1876003
its USB 3.0 and 64gb instead of 16 im totally fine spending the extra 5$ if its gonna be a better option
It doesn't matter for installing linux really
But if you are gonna use the flash drive for other things then you'll thank yourself for having usb 3
yeah i have nothing else planned that im going to do with it but i think imma go with the usb 3 just for futures sake
To answer your question: yes, I do think that one is a better deal.
good because i defo did not impulsively order it for pickup a few minutes before you answered also the questions were probably dumb but thank you for helping
@velvet fulcrum you can either start a new terminal or try "deactivate"
@valid wasp ?
I have, but I prefer gedit on Linux and PyCharm on Windows.
how do i check if i am using anaconda for vs code?
so that I can conda install for my python and not pip install
sorry if this was a noob question but I am 2 days old in linux
:p
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python3.8'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/usr/bin/python3.8'
sys.base_prefix = '/usr'
sys.base_exec_prefix = '/usr'
sys.executable = '/usr/bin/python3.8'
sys.prefix = '/usr'
sys.exec_prefix = '/usr'
sys.path = [
'/usr/lib/python38.zip',
'/usr/lib/python3.8',
'/usr/lib/python3.8/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007ff4bdedd740 (most recent call first):
<no Python frame>
Tried reinstalling python after ubuntu reinstalled since a module is broken but now whole python is broken
any solutions? thanks
How can i run a certain script when a user logs in with bash --norc --noprofile
or disable it somehow
modify their login shell to a wrapper you control
how would they log in with bash --norc --noprofile anyway?
not sure I'd call that "logging in"
@valid wasp No i want to disable it
fiddle sshd to run a wrapper that you control
Could you elaborate?
well ssh is quite flexible
you can tell it to do all kinds of stuff
permit logins, deny them, require certain kinds of authentication
and I'm 98% sure you can tell it to run something other than, or in addition to, whatever command the user has typed
you'll have to read the sshd man page for details, because I certainly don't know them
what are are needing to accomplish @lavish hemlock
if you dont want ppl to login and use bash just have a diff shell, like ksh applied to logins
so you want users to use bash ?
Yes
but you dont want them to have custom bashrc or custom bash profiles?
I don't want them to login without executing it
with out executing the default bashrc and bash profile or without executing user specific bashrc and bashprofile
I dont understand the use case. There's a good discussion in that link I posted
It means whatever i add to a users bashrc won't be called when they login
isnt that the point?
I want a python file to be ran
Yeah
hello guys
I've setup the python shell and changed the users shell to it
Just wanted to know if there's any way or locally a user could bypass it? thanks :3
WHICH is better to do, "pip3 install pygame" or "sudo apt-get install pygame" in Ubuntu?
I'd say pip install
pip3 should guarantee compatibility with Python3 :-|}
Anyone have time for a quick voice/screen share test?
Are we not allowed to Share screens here? or does someone else have to be present?
ssh -t username@hostname /bin/sh
boom no bash
@valid wasp
commands still get evaluated via the user's shell
so you're just running /bin/sh via bash
visualised: https://arse.ee/w28TXDOT.png
doh!
(I just cut and pasted that from the seg fault link - they go into details further down agreeing with you)
Trying to get this to work ```bash
git checkout <(git branch | grep -iE '^[ ]\w+/\w+/${1}/.*')
I get this error ```
fatal: /dev/fd/63: '/dev/fd/63' is outside repository at '/home/mark/repos/python/bot-pydis'
Any ideas why this process substitution is not working?
I can just use xargs for now
Do you ever just wish sudo service life stop was a command
@warped nimbus sure you want to be doing <() and not $()?
You're right
I misunderstood the purpose of <()
The command doesn't read from files so that's why it wasn't working
Does PuTTY support coloured emoji's over SSH?
When i paste them they just turn into this:
I see people using custom fonts, but i don't have a graphical interface, only the console ^^
you can tell your terminal emulator to use whatever font
your terminal emulator is the "graphical interface"
even in a truly non-graphical interface such as a tty, you can still specify custom fonts (albeit probably not ones with unicode support)
How can i install the fonts in the terminal? @main olive
All must knee before my google-fu
/s
Everyone can do it!
I tried that already @valid wasp , It is outdated and doesn't work for me
Uhhh. So I'm a noob. I managed to created a folder called "~" within another folder
how do I delete this without nuking my home directory?
oh found it, ./~ will do it
hello! i want to know is it good idea to generate ctags through all virtual environment
44 k lines
I wouldn't think ctags would be useful at all in python
Yea ^
path+=/some/new/bin/dir && export PATH works but when i restart terminal it does not work anymore
im using zsh
yeah you need to add it to your .zshrc file
i tried that it didnt work
did you use export PATH={yourpath}:$PATH
Have you set zsh as your default terminal, if so and you are in zsh echo $PATH
yes it ismy default terminal
when i add that line to my .zshrc file it doesnt work even without restarting terminal
Yeah, the .zshrc file runs at the start of zsh. It should be permenant after that.
ok i found something online that seems to work
side note: get powerline10k
powerline10k?
look it up, if you are interested in looks
thanks
when i add that line to my .zshrc file it doesnt work even without restarting terminal
@tired relic everything you put in.zshrcgets execute when zsh is started
if you edit something in there, you need to either source ~/.zshrc or exit and start zsh again
i made a script for adding stuff to path lol
i kept forgetting the command to do it
now i just have to type path
how fancy
Is zsh better than bash? If so, how?
Idk, i have set my shell to a python program and there doesn't seem to be any method of bypassing it @ember moat
I made a script for unzipping files with different extensions and it turns out that a very similar thing was in my .bashrc
why does source .bashrc work but bash .bashrc doesn't?
isn't .bashrc just a bash script?
source <scritp> command u run in the current bash terminal that <script>
i know
"source" doesn't start a new process; instead it modifies the currently-running process
bash .bashrc "works", in that the new bash process gets all the customizations, but then guess what -- that new process exits as soon as it's finished reading .bashrc
so if .bashrc contains, say echo hello, and you "source" it, it's exactly as if you'd typed echo hello.
similarly, if it contains x=zebra, it's exactly as if you'd typed that; which means the shell you're now using suddenly has a variable named x, set to zebra.
Is zsh better than bash? If so, how?
@ember moat "better" is subjective. I like zsh more because it had far wider support for plugins and some of its syntax is more modern, asides other minor details like allowing null bytes in variables (making it entirely plausible to store binary data in variables and not just text)
@fickle granite But i get errors when running bash .bashrc
yes, because .bashrc is not meant to be run with bash. It's not a script.
like the error says:
$ bash .bashrc
.bashrc: line 8: return: can only `return' from a function or sourced script
you're not sourcing it...
I've broken my terminal
can someone help
if i try to use shortcuts
ls -(anon):4: command not found: _longopt โโโ 1 โ ๎ณ at ops โ
(anon):4: command not found: _longopt
(anon):4: command not found: _longopt
I get this
my auto suggest for kubernetes and gi
are still working fine its just the bash stuff
so confused
sudo ap(anon):4: command not found: _root_command โ ๎ณ at ops โ
(anon):4: command not found: _root_command
(anon):4: command not found: _root_command
Same for this
cd do_cd:73: bad math expression: operator expected at `tmpcdpath '
_alternative:shift:14: shift count must be <= $#
_setup:64: bad output format specification
_cd:73: bad math expression: operator expected at `tmpcdpath '
_alternative:shift:14: shift count must be <= $#
_setup:64: bad output format specification
_cd:73: bad math expression: operator expected at `tmpcdpath '
_alternative:shift:14: shift count must be <= $#
_setup:64: bad output format specification
Same here
But some basic stuff still works like cat/nano
my guess is that you've got a "prompt command" that is doing something wrong; try echo $PROMPT_COMMAND ; unset PROMPT_COMMAND. If that helps, then you need to figure out how it got set, and how to fix it
that doesnt seem to do anything
all i did was accidentally run some weird file accidentally
this thing
but i dont know how to undo that
i'm not even sure what the hell it is
sourcing my .zshrc file doesn't help either
dunno, just like .zshrc.bak
and see if its the issue?
yeah
you need to restart your shell
yeah its kind of fixed it but now its just shit
but if i do ls -[tab]
it doesnt give an error
now*
yeah its a problem with the zshrc thing
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export PATH="/usr/local/opt/terraform@0.11/bin:$PATH"
export PATH="/usr/local/opt/terraform@0.11/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
alias k="kubectl"
autoload -U +X compinit && compinit
source <(kubectl completion zsh)
these are really the only custom things i have in here
plugins=(git kubectl)
source $ZSH/oh-my-zsh.sh
export ZSH="/Users/Shahe.Islam/.oh-my-zsh"
And these but theyve always been there
may just have to reinstall
hmm
autoload -U +X compinit && compinit
source <(kubectl completion zsh)
what if you remove these?
weird that worked
autoload -U +X compinit && compinit
I think this line was messing it up?
No idea why i had it in there kubectl seems to be auto completing fine without it
ยฏ_(ใ)_/ยฏ
Oh well, thanks for the help mate! I can get back to looking at stuff in peace
๐
np dog
Is there anyone that could help out with getting AppKit to install? I've tried pip and pip3 but it always returns with the same error. Trying to grab the active windows name
Here is the error
@simple hornet macos?
the error says it: pkg-config is not installed
you probably need to do something like brew install pkg-config
yeah macos
just got my first mac ever
and okay shall try that now
@main olive Nope didn't work ๐ฆ
what does which pkg-config say?
/usr/local/bin/pkg-config
hmmm
try doing export PKG_CONFIG=/usr/local/bin/pkg-config and then the pip install again
what should I look at if my qemu keeps getting deadlocked on memory
helb
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
@main olive I don't know what "snap" is but I'd try doing cd ~ and then trying the command again
my hunch is that your current working directory got deleted
if I'm right, pwd should do something like this: ```py
:-) 2020-04-28T17:04:45-0700 [x]$ pwd
pwd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
out of ideas, then ๐ฆ
How packages management separate different ubuntu versions?
I have a small python script, but for the input if i type && echo hi && it will echo hi, how can i stop that?
since what it does is os.system('clear')
I'm not sure I understand?
I have a small python script, but for the input if i type
&& echo hi &&it will echo hi, how can i stop that?
@lavish hemlock ... don't type that?
Hey guys! Quick question ๐
I'm using the nohup command to run a couple of my bots 24/7 , is there a way to stop one specific bot that is being ran by nohup?
Like is there a way I can specify a directory where I ran this .py and stop it?
not by directory, no -- but I think nohup tells you the "process ID" when it starts. If you still have that, you can do kill 12345 (where 12345 is the process ID)
Yeah indeed, you can also do ps -ef |grep nohup to see all the nohup processes which are running at the moment @fickle granite
which also shows the process ID - but I never know which ID is which .py file
sounds reasonable
if you're brave, you can poke around under /proc; there's lots of detail in there about each running program. You might find the cwd, and the arguments, and whatnot
assuming you're on Linux
@restive helm easy method (that was used commonly back in the day, but is considered "hacky" today): create pid files
each of your bot will create a pidfile. For example, bot1 creates /var/run/bot1.pid, which just contains the PID of bot1
for example, with sshd:
second method, which is a tad bit harder to set up but more modern and beneficial in the long run: Don't use nohup. Set up systemd units.
I personally recommend the latter
makes everything a bit easier - for example, logging is suddenly very easy, as you can just do journalctl -u bot1 to see what bot1 has printed; starting/stopping bots is easier with systemctl start/stop/restart/etc bot1, you can enable them to run on startup, and so on
@main olive hardcore ๐