#unix
1 messages Β· Page 26 of 1
yea i think that was introduced in 3.6 or something
the micro versions should not introduce new features
I'd say just try if what you want works with the 3.7 you have installed
I must have read it wrong somewhere then, thats true
but regeardless I want final release π
DO you know where I can find resources to add deadsnakes repo ?
and is that official python repo?
I want to install the latest Python tarball on Ubuntu, downloaded from http://python.org/download/.
Is this is a correct way to install?
./configure
make
make install
If not, how do I do that?
it's not official
but a very established and common one
@grand bane you don't need to erase it
download Rufus on the XP laptop
and the ISO
use Rufus for the ISO
on the USB
then move it to the computer with kali
and use it to install Windows
that might work
replace 3.7.0 with 3.7.3
sudo apt-get update -y
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
tar xf Python-3.7.3.tar.xz
cd Python-3.7.3
./configure
make -j 4
sudo make altinstall
@odd hollow yes this is possible, but I won't be able to unintsall it
why not
π
you should be able to
just doing make uninstall will do it?
I will try to do that, lets see what happens! thanks guys
Do i have to put it in the /usr/bin folder?
or any location is good?
@sour mesa thank u sir
/usr/bin should be for stuff managed by the package manager only
for manually compiled or extracted things, prefer /usr/local/bin
oh uh
yeah local
it's so weird seeing prefer as a verb
idk why
eh, you know what I mean
i cant start the rufus application
on the windows xp
it starts
and also in the task manager you can see it
but then it dissapears
uh oh
@grand bane the latest version of Rufus doesn't work on XP
download an older one
hi
I did apt-get install pip3
and I did pip3 install <wheel>
however when I try to execute that wheel from command line
it says command not found
how do I add pip3 to path
in ubuntu
oh alright
but @sour mesa am i able to compress windows 10 iso with the older rufus verison
And why do i get this error
hey guys
my experience with rufus
and windows xp didnt end very well
so i asked myself is there any possibility to install ubuntu with kali
and then with ubuntu and woeusb
installing windows??
Ubuntu isos can simply be flashed with dd or the disk image writer tool that should also be available in Kali, as part of the standard gnome utilities
alright
Where is the default save directory for WSL? I spent a couple days working on a project in jupyter notebook. Went to open it up today and it's gone. The .csv's I created in the folder are there, but the code is gone. Is there a way to search for all the files in the WSL drive similar to windows explorer?
anyone have any idea why disk use could be going up as I delete files? Not sure i can get an answer here, since it has to do with our HPC
Do the changes take effect on disk if you run sync?
@analog hornet find . -type f -iname '*ipynb"
@haughty verge nope
i contacted the IT people so hopefully i'll get an answer
i'm just very confused about how deleting files added 2 Terabytes of data
@distant prawn itβs not there. Iβm pretty confused as to where it went. It was mostly debugging so I was able to reconstruct most of the changes in a more timely manner than the first time.
did you save the notebook?
oh wait, now I'm down to 2.74 TB? so maybe sync did work
@haughty verge yeah, sync worked. Thanks!
Wew!
I have a device that I am connecting to directly with a crossover cable. This device hosts a web application, and it's default IP is 192.168.0.100.
I am trying to access that web application but I keep getting served the default apache2 web page. It seems like I am missing a step. Here is what I've done so far:
sudo ip address add 192.168.0.100/24 dev eth0
sudo ip route add 192.168.0.1/24 dev eth0 # Not sure about this
By networking knowledge is subpar at best, hopefully someone can clear this up for me.
if you see the apache page, the network connection is fine
you might need to adapt the sites settings for your IP/hostname
The Apache page is from my computer right? Shouldn't opening 192.168.0.100 serve the application on the device I'm connected to?
depends on what your own machine's IP is and what's the IP of the other
Can you show the output for the relevant interfaces of ip addr and your route output?
Yeah, I can in a few. On my way back to the office atm. I'll ping you when I have it ready again.
your apache config is also relevent I think. you can have apache serve a different page based on what hostname the http request header has iirc.
similarly it can change it based on what ip you use to access the server
ifconfig https://hastebin.com/umolusafaw.bash
ip address show https://hastebin.com/ezorolurag.bash
ip route show https://hastebin.com/ubiquyuqec.bash
@oak shell
enx00e04c3601ab is the ethernet adapter
ikr
yeah, the 192.168.0.100 is your local machine from which you rant hese commands, not anything connected to it
might try sudo arp-scan -I enx00e04c3601ab to check if you can find the server
hmm
zer0@zer0:~$ sudo arp-scan -I enx00e04c3601ab
Interface: enx00e04c3601ab, datalink type: EN10MB (Ethernet)
Usage: arp-scan [options] [hosts...]
Target hosts must be specified on the command line unless the --file option is
given, in which case the targets are read from the specified file instead, or
the --localnet option is used, in which case the targets are generated from
the network interface IP address and netmask.
You will need to be root, or arp-scan must be SUID root, in order to run
arp-scan, because the functions that it uses to read and write packets
require root privilege.
The target hosts can be specified as IP addresses or hostnames. You can also
specify the target as IPnetwork/bits (e.g. 192.168.1.0/24) to specify all hosts
in the given network (network and broadcast addresses included), or
IPstart-IPend (e.g. 192.168.1.3-192.168.1.27) to specify all hosts in the
inclusive range, or IPnetwork:NetMask (e.g. 192.168.1.0:255.255.255.0) to
specify all hosts in the given network and mask.
These different options for specifying target hosts may be used both on the
command line, and also in the file specified with the --file option.
use "arp-scan --help" for detailed information on the available options.
Report bugs or send suggestions at https://github.com/royhills/arp-scan
See the arp-scan homepage at https://github.com/royhills/arp-scan
huh
oh, gotta add --localnet
I thought that was implied if you specify an interface with -I, my bad
zer0@zer0:~$ sudo arp-scan -I enx00e04c3601ab --localnet
Interface: enx00e04c3601ab, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.9.5 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.0.100 00:0b:dc:01:3c:aa AKCP
1 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.9.5: 256 hosts scanned in 2.492 seconds (102.73 hosts/sec). 1 responded
That's it
til arp-scan, neat
that is weird
could both your server and client believe they have the same IP?
I'm not really in touch with direct cross-over links, but unless you set a static config on both, I'd have assumed they do some kind of auto-negotiation
Well I assigned everything statically so it is probably my fault somehow
When I don't assign a static IP, the device fails to connect
because arp-scan would not show your own machine, and it shows a different one with different MAC than yours from ip addr
Ah I see
How do I find out?
how did you config the static ips?
Just with those commands I posted earlier
sudo ip address add 192.168.0.100/24 dev enx00e04c3601ab
sudo ip route add 192.168.0.1/24 dev enx00e04c3601ab # Not sure about this
Blindly following a tutorial
cat /etc/network/interfaces and head -n1K /etc/netplan/*
sudo lshw -c network https://hastebin.com/ibiwibilon.bash
zer0@zer0:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
zer0@zer0:~$ head -n1K /etc/netplan/*
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
so looks like NetworkManager with netplan backend or something like that.
but anyway, if the above there worked, remove those two routes again and try e.g. sudo ip address add 192.168.0.101/24 dev enx00e04c3601ab
maybe then your client gets .101 and the server can be reached on 100?
That's just guessing though.
You could shut down your local apache just to be sure it doesn't pick up anything from localhost
also clear browser cache maybe
or try with curl
good idea
and you could check the ip addr and route outputs again to see if your own address is now 101 or still 100
It was, routes looked good too
π€·
It looks like using the link-local option let the autoconnect work fine
I'm trying arp-scan again but it's taking a while 
lmao
Alright I finally got it, thanks @oak shell for clearing shit up
Just had to let the auto-config do its thing, then add the route again
cool π
hey so I don't want to destroy my computer
I am trying to add somethign to a path variable
do you mean a variable containing a path to a file or the path environment varibale
Path to variable ?
path environment variable @stable plinth
do I have to append the full file path?
or can I use export path="$PATH:~/directory_name"
Hey everyone , I wonder how can I schudule for example my one python script? Everyday I want run a command at 1 pm sample? What is the code for it?
come on @robust cave π I am using Ubuntu 16.04.05
and yep cron is what I am looking for thanks
@blissful sage
my_path = '/my/new/bin/dir'
os.environ['PATH'] = os.environ['PATH'] + ':' + my_path
os.environ['PATH'] = '{}:{}'.format(os.environ['PATH'], my_path)
os.environ['PATH'] = f'{os.environ["PATH"]}:{my_path}'
paths = os.environ['PATH'].split(os.pathsep)
if my_path not in paths:
paths.append(my_path)
os.environ['PATH'] = os.pathsep.join(paths)
export PATH="$PATH:~/directory_name"
``` is fine, bash will expand ~ unless it's in single quotes
pyaudio can record audio just fine, but if i try to do it again after terminating the PortAudio session i get
python: src/hostapi/alsa/pa_linux_alsa.c:3636: PaAlsaStreamComponent_BeginPolling: Assertion `ret == self->nfds' failed.
Aborted (core dumped)
``` help please
nvm fixed it
had to install pulseaudio-alsa
anyone used tclkits? and/or cloudTk?
well cloudTk is just vnc session served over sockets... issue is more with getting a kit with all the needed packages to compile/run on aarch64
@blissful sage ls /Users/username/.pyenv/versions/3.7.3/bin/activate is this file there
ok, find the activate script inside the virtualenv
and put the correct path
I don't remember what it is, but it should be somewhere there
so I'm in pyenv
specifically the bin folder
when I try to cd into virtualenv
it tells me it's not a directory
cd /Users/username/.pyenv/versions/3.7.3/
find | grep activate
one moment
hmm
well I'm in the 3.7.3 folder
and I type find | grep activate
and I get
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]```
oh ok
ok so I have some output
the regex found somehting
I have 3 outputs
./lib/python3.7/venv/scripts/posix/activate.csh
./lib/python3.7/venv/scripts/common/activate```
I'm assuming I go with common/activate
would I have to paste the full path
yes, not starting with ./
/Users/username/.pyenv/versions/3.7.3/lib/python3.7/venv/scripts/common/activate
hmm ok
now I kinda have a different error
/Users/username/PycharmProjects/NYCJobs/update_nyc_jobs_data.py: line 2: import: command not found
/Users/username/PycharmProjects/NYCJobs/update_nyc_jobs_data.py: line 3: import: command not found
from: can't read /var/mail/tempfile
from: can't read /var/mail/quickstart ```
temp and quickstart are files my script referrences
quickstart is a .py file that I make a call to
tempfile is library
@glossy ridge lmk what you think when you're free
@blissful sage show your full shell script, how is it now
no
so there's a dollar sign in the middle of it when I paste it
that's what I'm reffering to
it should have 3 lines
source /Users/username/.pyenv/versions/3.7.3/lib/python3.7/venv/scripts/$
/Users/username/PycharmProjects/NYCJobs/update_nyc_jobs_data.py
you can't have the space before the #
but the $ I think is a place holder or something
that is because of the editor you're using
second line should start with python
python /Users/username/PycharmProjects/NYCJobs/update_nyc_jobs_data.py
space after python
yes
ok this cronjob is running every 5 minutes
so I'll see if it worked in like 4 minutes
you can test running the script by hand to see if it has some unrelated error
to save time
source /Users/username/.pyenv/versions/3.7.3/lib/python3.7/venv/scripts/$
python /Users/username/PycharmProjects/NYCJobs/update_nyc_jobs_data.py```
what do you mean
you mean using the debugger for shell scripts?
save this script, then exit the editor and run it from the command prompt
oh
instead of waiting for cron
yeah i gotcha
ok well
that did something
now I get more errors in the code though
like a pageworth
good
i dunno if I should paste it tbh
it's like project specific stuff like
FileNotFoundError: [Errno 2] File b'/Users/username/Documents/scripts/nycjobs_data.csv' does not exist: b'/Users/username/Documents/scripts/nycjobs_data.csv'
nycjobs_data.csv is a file that is refferenced in my script
but it isn't stored in scripts
but I guess the computer thinks it should be?
scripts is where I keep shell scripts
well, when your script is running, your current directory is not the directory where the file is; and your script is looking for the file in the current directory
oh then most of the errors I got with this run are like that
you have two options; cd to the correct directory before running the python script; or change your script so that it looks for the files in the correct directory instead of just opening them from current directory
!no-dm
Can I send you a private message?
No. We do not provide one-on-one tutoring - you can hire someone locally if you really need that. We also prefer that questions are answered in a public channel as it means that everyone else present is able to learn from them. If you're working with code that you are unable to disclose for any reason, you should try to make your question more general and write a separate, small piece of code to illustrate your problem.
hmm ok
not sure which one I should do
cd or change path
there are some .getcwd calls in my script
basically my script makes a call to an api, downloads the info to a temp file, in the cwd and then compares it to another file on hand. It then keeps replaces the file it is comparing it to, if the two files are different.
it also parses the data, and then uploads it to a shared google drive
and I am trying to automate this with cron
you still have the same two options:
- refactor the python script to not depend on cwd
- change the cwd before running the python script, by using the
cdcommand in the shell script
cd comman in the shell script I think is simplest
long-term I would prefer the refactor; but that's just me
yeah
well long term im going to change a lot of the internal stuff of this script
like im going to migrate this to cellary
and im going to use a timestamp call from the api to compare data sets
but for the next couple months id like to just have this running on auto pilot so I can do other stuff
you've been really helpful, I appreciate your time
I really don't understand why it's doing all this stuff though,
things were fine before I installed homebrew
like I was able to use crontab for this script with a direct call to the env path
and && for the py file
now I have to do all this extra stuff, homebrew also messed up my dependencies in my ide
Well, I always use a shell script instead
for cron jobs
because I can setup everything easily without mashing all into a single command line
yeah
abstractions
this is the deepest ive gone into shell scripting/how the terminal works
ive been studying on ldp, made my first shell script a few days ago as practice
I live in the terminal, use it for all sorts of things
and then decided that it was enough knowledge to try and solve the actual problem I needed to solve
yeah, the more you practice the easier it is
and useful
@glossy ridge you're the man, thank you for your help. it works
actually not quite >.<
when I run crontab it doesnt seem to work quite right, but when I run it from shell manually it does
so how does one change directories in a shell script
seems like when i do cd as a part of the script, bash opens up a sub shell
I tried creating an alias and adding that to my script
Cd is what you want
Each script opens a sub shell, but the commands all run in the same shell
so it should cd correctly
because I've been getting errors
oh
basically
my shell script works when I run it manually in bash
but when I try to crontab it
my dependencies don't load
and I get a module not found error
cd /Users/username/PycharmProjects/nycjobs
source /Users/username/.pyenv/versions/3.7.3/lib/python3.7/venv/scripts/common/activate
python /Users/username/PycharmProjects/NYCJobs/update_nyc_jobs_data.py```
try doing the cd outside the script and in the crontab?
there should be an activate in the project/env itself to run shouldnt there?
Depends, the venv can be anywhere it's just typically in the project directory or in some designated dumping ground for venvs in the home folder
That activation does look odd though. Not sure what's going on with that
Maybe it's just a way to make it use python 3.7 via pyenv?
I tried that mark
didn't work
and yes I think that was the idea regarding activating pyenv
my script works when I run it in bash manually
but not through crontab
Which module isn't found. One that you wrote?
so basically I am using crontab to schedule a python script
which has dependencies
and these dependencies are not loading when I schedule it
but are when I run the shell script manually
The dependencies are packages you installed?
where is your venv?
my guess is it's /Users/username/.pyenv/versions/3.7.3/lib/python3.7/venv/
That doesn't sound right
well then I am clueless where it actually is, I installed homebrew recently and it kind of messed everything up
I'm also new
and clueless
Do you know how you created the venv? Which command(s) you used?
I had to recreate it, because my IDE couldn't find it after homebrew
so I used pyenv
Well pyenv isn't a virtual environment
yeah but like I had to create it
Well in a sense it is but that's not it's purpose.
and pyenv runs a lot of that automatically, no?
pyenv just manages different versions of python on your system
typically if you would first run a pyenv command to change the current python version to use
and then you'd create a venv in one of various ways
using the venv module in the standard library or using tools such as virtualenv, virtualenvwrapper, etc
pyenv does some fancy shell stuff so I guess it trips up π€·
I am guessing your venv is fine, you just need to activate it properly
but you'd need to know the path to it
Or maybe not... just pipenv run might work since you're using pipenv
well it looks like my bash_profile is modified
and there's some pyenv stuff in there
Yeah that's normal
That's a good point actually
cron jobs probably don't use your bash profile
yeah that's what someone else was saying
when I ran the shell script using sudo su -
it got a "command not found"
Here is something from pyenv themselves
Well maybe
I honestly don't understand enough about how pyenv works under the hood
And the other thing is that the way you're activating looks odd to me
yeah like
that export PATH=~/.pyenv/shims:~/.pyenv/bin:"$PATH"
is in my bash profile
basically, pyenv places a small executable at the start of your PATH, so whenever you run python or pip, the executable gets executed, which passes the command along to pyenv, and pyenv will then decide based on global/local/shell/directory specific settings which python version to run
yeah
so then how do I ensure that the file path is consistent across profiles
and that sounds like an easy way to mess up my computer
oh hmmm, looks like I can specify which user to run the cronjob under
Maybe you could just leverage pipenv. It does support automatic detection of pyenv after all
where'd i drop the pipenv run
just pipenv run python your_script.py
you wouldn't need to activate the environment yourself since pipenv will do that
as a part of the shell script you mean
yeah
going to give it a try one sec
you may need to set the PYENV_ROOT env var so pipenv knows where to look for the python version, but I think since you have already created the venv it should be fine
(assuming you created the venv properly)
so since I am changing the shell script to run pipenv
then I should change the cronjob as well to what?
I don't understand your question
nvm
the cron job will keep executing the same shell script as before, no?
it's fine
yeah sorry, there's a lot of moving parts. I had added in the cd to the cronjob
turned out not to be a cd issue
How'd you install pipenv?
I normally install it system-wide via the package manager
I think I brew installed it
Oh right, macOS. Not sure how brew deals with that
Ok maybe you can do it without the pipenv command, just activate the environment by sourcing the activate script as before
only the correct one cause the one you used before looked weird
So for that you would need to know where pipenv made the virtual environment
i think i can use brew to find that
You could run pipenv --venv to find out
just cd into your project and run that command
hold on
I didn't activate it yet
while you're there can you confirm pipenv run python --version uses the correct version?
it uses the most up to date version, which should be the correct one
and does pipenv run pip list show your dependencies?
uhhh
kind of
like half of them
for example I use google auth
and it's not in pip list
is that dependency listed in your Pipfile?
you mean I should open the pipfile in my ide?
because if so, no google auth is not listed
ok wait hold on one second
because
..
well this script makes a call to another script
if you just use pipenv install dep_name they'll get added
so like
I don't understand why my script works then
could it be that it's not even using pipenv
me neither
this got really complicated really fast
believe me I had a hell of a time trying to fix this mess, and I'm so glad that I could even run this script
From my perspective I feel it went from complicated to simple
At least the solution
I worked on it for almost a half a year, and then homebrew just crushed my hear
If you just properly activate venv that pipenv made, I think everything will work π€
I still am having a hard time understanding why I'm doing pipenv stuff, if my script runs fine in the ide
and even the shell script
do you think itll make a difference that I am calling another script
within this script
which has its own set of dependencies
How are you calling it? with subprocess?
from ____ import main
Ah, that is good. It would be better to say you are importing another script rather than calling it
ok
Anyway, yes you would need all that other's scripts dependencies too
Regarding pipenv: it's just a tool for virtual environments and dependencies. You can use another tool if you want, but at the end of the day it is highly recommend to use virtual environments.
yes
it's recommending I do that or just skipping it
you can just recreate the lock file if it's broken
Just make sure all your dependencies are listed in your Pipfile
then you can run pipenv install and it'll install them from the Pipfile
tempfile is a default library correct?
yeah
alright I am just installing my dependencies now, thank you for your time
I keep getting no version found errors
and recommendations to clear my lock
however my pipfile is being updated
yes just delete your lock file
You could just open the pipfile in an editor and type in all the dependencies
Then, delete your lock file. Finally, run pipenv install to install dependencies from the Pipfile
is the full command pipenv install
or should it be pipenv install pipfile?
oh man I got a bunch of errors
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
__future__ = "*"
pickle = "*"
os.path = "*"
googleapiclient.discovery = "*"
google_auth_oauthlib.flow = "*"
google.auth.transport.requests = "*"
apiclient.http = "*"
pandas = "*"
requests = "*"
os = "*"
tempfile = "*"
quickstart = "*"
[requires]
python_version = "3.7"
err quickstart shouldn't be in there
Several of those are part of the standard lib
__future__ , pickle, os.path, os, and tempfile
And you need to specify dependencies as they are called on PyPI, not how they are imported in code
I don't know what you mean by your last sentence
I can help you with their names: ```
google-api-python-client
google-auth
pandas
requests
apiclient
pipenv will download the dependencies from PyPI. That stands for the Python Package Index
For example, here is one of the google dependencies on there https://pypi.org/project/google-api-python-client/
oh gotcha
You can see its name is not the same as how you use it when you import it googleapiclient.discovery
so in my pipfile I need to use the pypi names
Yes
And I think I just gave you all of them
The rest were already part of the standard library
yeah
well
toml.decoder.TomlDecodeError: Key name found without value. Reached end of line. (line 9 column 25 char 127
and also a huge wall of text
You must have forgotten to add the = "*"
yeah, use pipenv --venv to get the location
then the activate script should be bin/activate
and you just source it in your shell script
what do you mean the active script should be bin/activate
sorry dude
like I pipenv --venv /Users/username/.local/share/virtualenvs/NYCJobs-50ClFx78
pipenv --venv
/blah/project/venv
so that means
source /blah/project/venv/bin/activate
that's my location for the venv I think
so it should be source /Users/username/.local/share/virtualenvs/NYCJobs-50ClFx78/bin/activate?
well
that aint it
Traceback (most recent call last):
File "/Users/username/PycharmProjects/NYCJobs/update_nyc_jobs_data.py", line 1, in <module>
import pandas as pd
ImportError: No module named pandas
I likely typed in your instructions incorrectly
Can you show your shell script used for the cron job
#!/bin/bash
#cd /Users/username/PycharmProjects/nycjobs
source /Users/username/.local/share/virtualenvs/NYCJbs-50ClFx78/bin/activate
python /Users/username/PycharmProjects/NYCJobs/update_nyc_jobs_data.py
That looks ok
Can you try doing this in your terminal? ```bash
source /Users/username/.local/share/virtualenvs/NYCJbs-50ClFx78/bin/activate
pip list
Ah, so can do you do ls /Users/username/.local/share/virtualenvs/NYCJbs-50ClFx78/?
I get bin include lib src
yes
what was the error you got when you did source activate again?
what directly/file did it fail to find?
/Users/username/.local/share/virtualenvs/NYCJbs-50ClFx78/bin/activate
that doesn't make sense since you just confirmed it exists...'
:/
yes
but there is a discrepancy
so like
in the shell script
it's NYCjbs
but after the venv printed location
it was NYCjobs
let me try
mayb
it should be exactly what pipenv --venv gives
ok well
now we got different errors
specifically it isn't importing main, from the other script
and it looks like I was missing one of the google dependencies
Oops, must be this https://pypi.org/project/google-auth-oauthlib/
and you probably need to still cd into the project folder so it imports the other script correctly
ok so I'll cd into the correct file path
in the shell script
should I delete lock file like before, and reinstall dependencies?
You shouldn't have to
if you just do pipenv install the_name it should add it just fine
alright
done
should I reactivate the projects venv as it's requesting me to,
probably not since it's already active
i pipenv install google-auth-oauthlib
in the terminal
installation succeeded, then theres an issue with the lock file again
You may be talking about the notice pipenv gives that it's gonna use the current virtual environment cause it detected it
That's strange, I don't know why you constantly keep getting lock file issues
actually
I lied theres no lock issue
Updated Pipfile.lock (ad9223)!
Installing dependencies from Pipfile.lock (ad9223)β¦
π ββββββββββββββββββββββββββββββββ 23/23 β 00:00:05
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
yeah
well different errors kind of
still couldn't import the other script
and then one of the other dependencies isn't accurate
Did you cd into the project?
ModuleNotFoundError: No module named 'apiclient.http'```
And which dependency is messing up?
Try pipenv uninstall apiclient
I think I mistook it for a different dependency but it looks to be part of google
cd /Users/username/PycharmProjects/nycjobs
source /Users/username/.local/share/virtualenvs/NYCJobs-50ClFx78/bin/activate
python /Users/username/PycharmProjects/NYCJobs/update_nyc_jobs_data.py ```
aren't paths case sensitive in macOS?
the one you cd to
nycjobs is lowercase
though apparently it doesn't matter on macOS
the directory is lowercase
the script is not
I got the right dependency though
google-api-python-client-py3
try adding -m option to the python command
so python -m script.py
IIRC it will make it look in the current directory for other scripts
ok
I guess it doesn't matter if I put the full file path to the python script, in the shell script
so
python -m filepath/pythonscript.py
that worked
π
you're welcome
I don't think macOS comes with the latest Python so you need pyenv for that
though maybe you can install python3 directly with brew
yeah
I messed around with that stuff like a year ago on mac I just don't remember anymore.
but they say use pyenv to manage them
Pyenv only useful if you plan on using more than 1 version
yeah, I think I needed to which is why I downloaded brew to begin with
and then I didn't load it properly
and practiced SQL isntead for a job opportunity that fell into my lap
which I didn't get
and then I go back to programming, and my setup is messed up, pycharm isn't running my script
meanwhile, I spent like over 6 months on this project, and I had no idea what any of this stuff does, no real experience with the terminal either
it's been like walking around with a blindfold.
thanks a lot for your help, I know I was annoying.
You're welcome
believe me you were not annoying you were actually very patient trying different things
I feel guilty asking questions that I could google
but then it's like sifting through a pile of stuff looking for the right thing, when I have no frame of refference
so like I have to juggle that
Well you already had my attention and they were simple questions so I don't mind
how long have you been programming?
3.5 years
wish you luck on your journey 
!resources
The Resources page on our website contains a list of hand-selected goodies that we regularly recommend to both beginners and experts.
take your pick
alright thank you, have a good evening. See you around.
cya
well it stopped working
new dolphin is trash, can anyone recommend a replacement?
ranger π
I have a file-system question, if anyone knows this
I was on Linux, and did a "cp -R " operation to copy files into a folder on an external NTFS drive
subsequently, that folder was unreadable on either Linux on Windows
I was able to run chkdsk on windows for the drive and more or less recover all the files (although they'll all dumped into a giant lost and found pile -- I'll have to sort that out)
my question is: does anyone know what happened?
I feel like it wasn't a hardware error, but something to do with writing to NTFS on linux
uh, what's -R
my cp doesn't have that flag
oh, it's just -r
ntfs has been known to act up
i usually use rsync when working with ntfs
how did you disconnect the drive? perhaps it was not done writing yet.
the ntfs drivers are pretty stable these days so it unlikely but possible there was a bug
oh yeah
always do sync before removing the drive
or umount it, which does sync by itself
I "ejected" the drive from within the file explorer (nemo?)
does that constitute unomunting?
yes, there might be an issue in that sync progress isn't checked before unmounting , but you'll have to do a little digging to find out
@robust cave i assume the eject does umount which calls a sync behind the scenes before actually unmounting, but I might be wrong, nemo might use their own implementation (why?)
iunno, I was just suggesting the possibility, I haven't used nemo
welp
whips out strace
how do you redirect output to both stdout and file
command | tee filename
is anyone alive..
I'd like to know if tee appends or overwrites
it appends if you use -a
ok
great to see you're finding that out yourself, you should do that more often
My terminal is frozen
whenever I try to open it it looks like this:
I tried restarting, reloading
spamming buttons
what command does your terminal run when opening?
it should be in the settings
@main olive
Thank you, it seems I checked "use custom command instead"
while leaving it blank
._.
π glad you got it fixed
Is there a standard name for the group equivalent of "nobody"
On Arch it's also called "nobody" but on Alpine it's "nogroup"
I can check tomorrow if Alpine its just an alias in Alpine for "nobody" too
Just lazy right now
The context is that I am running tests locally for something that is normally runs in a Docker container which uses Alpine
Currently it's hard-coded to use "nogroup" and that fails locally cause the group doesn't exist on Arch
I need something that will work consistently regardless of distro ideally
But if not I can just add a note saying to create an alias for the group if your distro doesn't have it
or make it use an env var
the Linux Standard Base core spec lists user nobody and group nobody http://refspecs.linux-foundation.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/usernames.html
I have no idea which distros roll a different name though
That's technically correct. The best kind.
I linked 3.1 but I just checked the pdf version of 5.0 and it's still nobody:nobody
Thanks kosa. I'll see if alpine has nobody too tomorrow
And could check debian too while I'm at it
would be good to have a note saying that some distros do it non-standard too
Yup
But the default of your environment var will be the right way to do it
I'm italicizing too much
Yeah I was gonna add that anyway but changing the default to the more common one would be nice
If Alpine is the exception that could be worth submitting a bug report
I don't think so. I recall Wikipedia mentioning no group as an alternative and it implied several use it
It looks like my Yocto BSP uses both:
root@apalis-imx6:~/cytovale-sw/scripts# cut -d: -f1 /etc/group | sort
...
nobody
nogroup
...
I'm pretty curious now, honestly.
Ubuntu has nogroup
Would it not always be numeric ID 65534 at least though?
you could find out its primary group name withid -gn nobody anyway
^
always use id 65534:65534, because that's the only thing that never changes
hell, even uid 0 might not be root if a distro decides to rename it
always check ids, not usernames
Awful idea of the day: make a Python Linux distro and rename root to bdfl
why not, sounds like a fun evening
SnekLinux
Canβt run as root if you name it bdfl
run as bdfl
Is anyone aware of a way to expand $_on call in zsh ?
@hearty scarab trying to get the last argument? IIRC zsh (and most shells in general) don't support it
try !$
A lot of Shell support $_ the question is how to expand it
What do you mean by expand?
Cause just doing echo $_ would be considered expanding it then echoing it
it does expand on execution, just like any other variable
how do you expand something before executing? ... lol
solution, use !$
$_ is parameter expansion which is done when the command is run
the only "pre-emptive" expansions are usually history expansion (in the case of zsh) and filename generation/expansion
@hearty scarab that's what I first said lol
guys, i have to check a lot of servers, what services are they using
and they have a lot of webapps in apache and tomcat
what would be the best way to do this ? (sorry for my bad english)
actually im checking the tomcats dirs, and using chkconfig --list to check the services
if you have ssh access you could write a python script that uses paramiko to ssh to each server, run the command and get the information back. Alternatively saltstack has remote execution for managing a lot of servers. Sorry for plugging saltstack in both #414737889352744971 and here, but it is a fantastic tool for managing a large infrastructure from one place
Quick ansible ad-hoc
i will check paramiko, thanks!
i cannot install anything, but i have access to chef
and knife
or just list all your servers in a file and
for i in $(cat file); do
ssh -q "$i" "my awesome command" > "$i.out"
done
?
What do you mean ?
i need to know what services and apps are working in the server
that work for services
but i dont know wich apps are in the tomcat or apache servers (if there is any)
So your problem is not to gather info from several servers but to retrieve the needed info
If you do a ps aux | grep tomcat you will see the running config and dig from thete
How would I go about bridging my wifi to my ethernet port on Manjaro?
wanna act as a gateway ?
btw, I'm not sure about what handle the networking on manjaro but some interfaces conf might be able to handle it
I just wanna get the wifi from my laptop to my desktop through ethernet
iptables MASQUERADE fuckery @deft raft
https://wiki.archlinux.org/index.php/Internet_sharing arch wiki does it best
I've been over all the wikis and guides
I'm either too stupid, my computer is stupid, or something is broke
probably all three
ive been messing (and failed) with iptables a lot before disocvering the nm thing which doesnt work for you
dnied
Did allowed ipv4 forward in sysctl?
would I be able to modify my mouse pointer so that a line appears along the X and Y axis across my screen?
hmmmm
not that i know of, but you can probably write a simple C program which overlays everything and communicates with X to get the cursor position
or, actually
hmmm
maybe you can just set an extra large cursor and draw the "Crosshair" in gimp or something
nah, that won't work, apparently 128x128 is the max cursor size
can always just patch Xorg i guess
hmmm
interesting
I could probably write a shell script to switch between the patched and non patched versions of xorg
but would it be different on windows I guess?
most definitely yeah
i don't know much about windows tbh, dunno how you'd solve it there
Does anyone have experince with configuring Realtek network cards on Deepin
My download speeds are incredibly slow
Can't use Pip or anything else
Anyone using awesomewm ?
I am
Any idea how to make terminator transparency works ?
I did declared a class for it with opacity setting but nothing
I'm away from my computer so give me a sec, I'll be right back
so you meant terminal right? otherwise i don't know what terminator is in this context
yup its my terminal emulator
what terminal do you use?
terminator :/
i use gnome-terminal, and it handles transparency just fine. I've never used terminator
either way, i doubt the window manager is relevant here
It just works in cinnamon
really? hmm
really π
and with presumably the exact same configuration loaded up in awesomewm, it doesn't work?
yep
interesting
something should be missing but th question is what
nop, started it throuh the default ubuntu environment selector
i dont really know what is it
I'd like to take time configuring my awesome before killing cinnamon
i feel you, i've been using awesome for like close to a decade, and it still confuses me. Do you have a .xinitrc file though?
it's a hidden file, so that might hide it from the search not sure
obviously but i also looked for those
gotcha
I guess ill bother one of my workmate tomorrow
i used to, now i use i3lock funny enough
yea, i have it set up to take a screenshot of my current desktop when I peform the keybinding, which it then blurs, and finally sets as the lock image
so it just looks like my screen went blurry when i lock it
to be honest, i don't remember how it works anymore
i set it up a while ago
what you linked is cool, i'm doing it manually, not using that
i wonder if that existed when i set it up
nice
lol yea np
compton was missing
I was gonna ask if you have a compositor, yeah
the thing actually responsible for transparency..
It means ctrl + backspace
Why doesn't set -e work when the error occurs in a function, and that function is called with a command substitution?
set -e
foo() {
curl -sSL ""
echo "Should be unreachable!"
}
x="$(foo)"
printf '%s\n%s\n' "$?" "${x}"```
curl: (3) URL using bad/illegal format or missing URL
0
Should be unreachable!
[Finished in 0.0s]```
Calling it without a command substitution will correctly make it error out
But then I can't capture its output
This seems to only apply to functions I defined. If I call a program in a command substitution then it will still error out x="$(curl -sSL "")" for example
@warped nimbus https://stackoverflow.com/a/27793459/4464570
@oak shell thanks, but that isn't my issue. That person wanted to disable it sometimes but I want to keep it enabled always, it just doesn't work in some cases.
Yes.
They use an AND operator to make the command explicitly tested and thus circumvent the -e
I don't want to circumvent it
Though the answers example does imply that it would error without the circumvention
The difference there is that theirs would fail due to the return whereas mine is supposed to due to just a call in the function
I found it
shopt -s inherit_errexit
Bashism
Ah nothing like a clear mind in the morning to figure out solutions π
Thanks for helping though Byte
@oak shell Wait, I may be fucked. It needs Bash 4.4. Is this saying Bash is 4.3 in LTS? https://launchpad.net/ubuntu/xenial/+source/bash
Forgive me, I am an Arch user. How would I go about updating it to 4.4?
It sounds like a hassle, I may just live with repeating set -e inside functions (assuming it works)
Anyone have an automagic xrandr hotplug system for awesome (or i3)?
I was going to say @warped nimbus, $(foo) spawns a subshell and executes in there, at which point set options are reset
placing a set -e in the function body should workaround this if inherit_errexit doesn't work
Yeah I just didn't know bash resets it
I think I did echo $SHELLOPTS and they all seemed to be the same so it threw me off
Does it reset them all or just -e? Cause I think I read it's just -e
good question, not too sure
Subshells spawned to execute command substitutions inherit the value of the -e option from the parent shell. When not in POSIX mode, Bash clears the -e option in such subshells. ```
There we have it
@hearty scarab arandr is pretty good at generating scripts
layouts="$HOME/.screenlayout"
if type "xrandr"; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
if [[ $m = "HDMI-0" ]]; then
bash "$layouts/office.sh"
elif [[ $m = "DP-1" ]]; then
bash "$layouts/home.sh"
fi
done
fi
This is my janky display setup script for xmonad
What's the difference between the following two methods of redirection:
(>&2 printf "%s\n" "$1")
printf "%s\n" "$1" >&2
I see the latter a lot more often. I just saw the former once and started using it instead but don't even know why anymore.
It creates a subshell, but why would that be useful in the case I showed above, where it is the only command?
Ty @somber stirrup will try arandr
@warped nimbus with a simple command like that, I can't imagine why it would be useful
it's useful when you have multiple lines of commands and want to redirect them all
as the () can span multiple lines
{} >&2 works the same (except for spawning a subshell ofc)
but of course, the method you described might have some other useful side effect I haven't thought of
oh crap @warped nimbus, found this https://stackoverflow.com/questions/47182690/why-is-stderr-from-a-subshell-not-being-suppressed-or-redirected
π€
So it captures stdout
That's all I got out of that and idk what that even means
yeah, redirects happen sequentially normally
>&2 2>&1 is 'redirect stdout to the original stderr, then redirect stderr to the new stdout'
they should have done 2>&1 >&2 for redirect stderr to the original stdout, then direct the output to the (new) stderr
$((>&2 echo ...) 2>&1) would have tested what they were trying to test
or like run a command that actually prints to stderr
@livid verge an you give me a better way to delete my exisiting partitions and make a new one?
this is what ive done so far
https://gyazo.com/fee12a3fc6ed29c4476a3b81e9d72088
from this video
https://www.youtube.com/watch?v=BOu_NWHwnOg
can you suggest me a better way?
for my bootable USB?
Thanks for watching. To keep up with my latest content, please subscribe to my YouTube channel at https://www.youtube.com/user/freedomredux In this video, I ...
gparted
@stiff tiger open the gparted program; on the right side of gparted, choose your usb device
@nosk this one??
https://gyazo.com/3f0b01680bac14c05afbd59627590f2a
are you using mint?
manjaro gnome
ok
at the top right corner of gparted window, choose your usb device; Then go to the Device menu and choose Create Partition Table
make sure your usb device is selected and not your hard drive or you could lose data
@livid verge ive gparted and created a new partition!!
now what should i do to make it suitable for flashing?
trying to flash in an wind 10 iso
argh
why π¦
I think you have to create a FAT partition instead, and copy the files from inside the iso to the partition
not sure though, long time I don't do it
ok @livid verge thanks tho!!!
@stiff tiger fuck that, you can just WoeUSB to do that for you
no need to create partitions manually
Just make sure to use ntfs
Would trying to set memory.memsw.limit_in_bytes for a group give a permission error if memory swap is disabled on the machine?
Seems like it from what I just experienced and from some basic research, but haven't seen a definitive answer anywhere
Would be nice to confirm
More specifically seems to be tied to CONFIG_MEMCG_SWAP_ENABLED kernel config
do you work with/on UNIX-like stuff too? @warped nimbus
I would say I am still a beginner relatively speaking.
But yeah I've been working with some unix stuff lately
what about UNIX-like, though? @warped nimbus
I suppose it's more appropriate to say I am working with linux stuff, sorry for being unclear.
So to answer your question, no I don't
Linux is Unix-like, though
Why this loop is not working for me?
for i in {1..5};do for x in {1..2}; do mkdir rootDir-$i;cd rootDir-$i;mkdir a-$x;done;done
I want to create 2 folders in each 5 root dirs
because cd changes your environment. it's not scoped to the loop iteration but persistent
wrap it in a subshell, that's the easiest way
for i in {1..5};do for x in {1..2}; do ( mkdir rootDir-$i;cd rootDir-$i;mkdir a-$x ) ;done;done
(didn't test tho)
@safe sluice
Thanks mate I will give it a try
@oak shell thanks buddy it worked
you can also make the full path with mkdir -p
if i understand your use case right.
mkdir -p rootDir-$i/a-$x
$ mkdir -p rootdir/two
$ mkdir -p rootdir/three
$ ls -1 rootdir/
one
three
two
I'd recommend a habit of quoting variables so: mkdir -p "rootDir-$i/a-$x"
You can also do it without a loop
[12:31] zer0:temp | mkdir -p foo/{rootDir-1,rootDir-2,rootDir-3,rootDir-4,rootDir-5}/{a-1,a-2}
[12:31] zer0:temp | tree foo/
foo/
βββ rootDir-1
βΒ Β βββ a-1
βΒ Β βββ a-2
βββ rootDir-2
βΒ Β βββ a-1
βΒ Β βββ a-2
βββ rootDir-3
βΒ Β βββ a-1
βΒ Β βββ a-2
βββ rootDir-4
βΒ Β βββ a-1
βΒ Β βββ a-2
βββ rootDir-5
βββ a-1
βββ a-2
15 directories, 0 files
I'm running some custom data feature creation on WSL. I'm getting a "kernal has died" error pretty consistently on the run through. Individually, each function runs through and the resulting dataframe when dumped to .csv should be 1.7 gb (~1.4M rows, ~100 columns) and fits in memory. I've created this for a slightly smaller data set (~1.2m rows, what the estimates are based off of). Is this happening due to an out of memory error for the WSL subsystem?
Error dump from the console:
https://pastebin.com/X1WrHrLS
please hl me if you know what's up (or can help guide me)
is there a way to replace a line?
you can use ansi escape codes
check this out https://github.com/gpelouze/ansi_codes
Microsoft released Linux Kernel WSL 2.0. Who knows when it will be available? With regular cumulative update or with new Windows release?
where do i get libcrypt.so.1 for fedora?
emacs yells at me for not having it
fedora renamed it, of course
i need help with this error im getting in google colab
https://gyazo.com/e49f36f32bba4b6b3afa24c37d1f8f44
the code being
https://gyazo.com/fa14a4aa47f71467e7b4935a7ed05b70 give i dont get the same error in jupyter/anaconda
if i install that also how do i do that in manjaro?
nothing in archwiki
i have python 3.7
@main olive
the problem being i dont get that error in jupyter when runthrough anaconda
but in google colab only i get]
\thats strange
@stiff tiger have you tried from pandas.plotting import scatter_matrix in colab yet?
these plotting functions have been moved from pandas.tools.plotting to pandas.plotting since >2 years ago..
@that's throwing an error too @copper gazelle
see my reshaped question
can anyone help me this error im getting I surely need to update pandas but not sure how to do that in manjaro. the strange thing is I'm not getting this error in anaconda/jupyter but getting only in google colab
https://gyazo.com/c45c31681d83df9d2318936113051958 &
https://gyazo.com/4d3a23dad0d16131052a50817f0ee3e7
pandas.tools.plotting worked for me like a week ago only ansd now its showing like this but in colab only not in jupyter which I cant use for the moment @copper gazelle
ok that worked @copper gazelle
thank you
im trying to host my bot, can anyone help me with working with digital ocean?
Do you have a more specific question in mind?
DigitalOcean has great guides on doing a multitude of things
is there one for discord bots?
There could be, but I have my doubts.
So what do you need help with in regards to setting it up?
the farthest ive gotten to is creating the droplet and launching the console
Which distro is your droplet using?
i dont know what that is
Ubuntu, Debian, CentOS, etc
