#unix
1 messages Β· Page 34 of 1
The package name is just "linux"
Okay so going to bet soon but basically you want to:
- install the "linux" package
- update your bootloader configs however you first set them up so that the latest kernel is an option
- reboot into latest kernel
- install linux-headers
- install the rtlwifi-new package from before
I don't even think it's grub. I can't find what it is
Finally got it all working. Thanks so much @torn snow
https://www.humblebundle.com/books/linux-bsd-bookshelf-2019-books Linux book bundle, 9 days left
Hmmmmm
Do i pay for this or instead continue to get paid for listening people tell me about this
sadly
Does anyone know of a good screenshot tool that works well for ubuntu/kde neon? I need to be able to select an area to screenshot, and if I can upload to imgur with it, that's a plus
i get random grey blocks covering the image with shutter
Looks like kazam works but if anyone knows of one that lets you upload to imgur as well as select an area, I'm all ears
@granite abyss spectacle works great with KDE (I think it's a KDE tool?), allows you to select areas (as well as active windows etc) and upload directly to imgur
Hmm I don't think that one worked for me
Oh actually I can select a region
oo it automatically copies the direct img link hell yah
Flameshot isn't bad
I'm using flameshot as well, with Ubuntu/i3wm works well
Xmonad is doing something funky with application focus so the keybinds are hit and miss for me
I think it's something to do with flameshot using a background daemon instead of the process used to launch it
ok ty lads!
you guys with window managers tried maim? It's cool
Unix is an early Linux?
It came before Linux
Unix has been around since the 60's
Linus Torvalds made Linux in the early 90's as what started as a personal project based on Minix, which was a variant of Unix designed for educational purposes
People thought it was interesting, so he threw it up on a FTP server for people to get it. A lot of people started using it and contributing fixes and code back to Linus.
It rapidly snowballed and is now the most widely used OS on the planet
thanks for the history lesson!
@robust cave looks promising, thanks!
when should i be upgrading my linux distro? like ubuntu mate 19.04 and 19.10 are avilable and i am on 18.04.3 LTS
depends on what you're running
desktop pc? update away to 19.10
server? probably wanna hold off until the next lts (20.04)
I am using a laptop
Get arch and you'll never ask yourself that question again π
yea, you'll just ask what might break this time
That's how you learn how to linux :p by breaking it, again and again
So, I was reading this: https://superuser.com/questions/739736/apache-as-reverse-proxy-for-multiple-destinations-and-one-default-destination
I am not convinced that it solves my issue. What I need is to proxy any url of my choosing from http to https. Mostly streams. Is there a way to achieve that with Apache reverse proxy?
Without restarting the server, I might add
I can't seem to be able to wrap my head around it
Maybe I describe what I have in mind: Have a Virtual Host running on [::1]:80, which runs with SSLEngine On and the URI should look something like: https://[::1]:80/theother.example.com/stream.mp3, streaming the content to https from a non https source.
Or maybe someone knows a different solution, idk
nginx reverse proxy.
for streaming things, you should add the rule proxy_buffering off;
you'll want to extract the URI and pass that as a variable, so probably something like
location ~ ^/(.*) {
proxy_buffering off;
proxy_pass http://$1;
}
if i've got this right
(alongside your ssl-related rules of course)
Thanks, but my whole project revolves around apache, switching to nginx before I really have to would require 2 days work at least
not too familiar with apache, sorry
but some googling tells me you cah achieve this with a mod_rewrite rule, something like this
RewriteRule ^/(.*) http://$1 [P,L]
@steel verge
no idea if this would work or if it's even valid syntax
this has some very serious security implications, though, and i hope you never allow public access to this
Yep, that did the trick, combined with proxy_pass
thanks mate, you saved me lots of headache, I hate rewrite rules
<VirtualHost [fc00::1]:9999>
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/internal.tuxstash.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/internal.tuxstash.de/privkey.pem
RewriteEngine On
RewriteRule ^/(.*) http://$1 [P,L]
ProxyPassReverse / http://$1
ErrorLog ${APACHE_LOG_DIR}/proxy.error.log
CustomLog ${APACHE_LOG_DIR}/proxy.access.log combined
</VirtualHost>```
When I now visit https://proxy.internal.tuxstash.de:9999/br-edge-100b-fra-dtag-cdn.sslcast.addradio.de/br/br3/live/mp3/56/stream.mp3, it properly plays the stream on https
Now Chrome can suck it π
Regarding security: I don't think it has that serious implications. It is a separate virtual host and nothing else is there. The rest of the system is still safe. I need to do it though, because German radio stations are too stupid to implement proper TLS and I need my app to continue to work with the new rules on Chrome @main olive
it has the same implications as any open proxy does, ie it can be abused by whomever to do evil things. Additionally, since this is a pretty iffy way of doing, it, you could do things like reverse proxying to localhost to access services running only on the loopback interface, which you probably definitely don't want
Oh that. Yeah, I will have to find a way to wall that off and only allow domains I want to have there, but for now I got a working solution.
I can probably do that with a htaccess or something
@blazing wolf Arch is way way easier than gentoo :p
hmm
"beginner" distros include debian, sometimes fedora, but mostly ubuntu
yea im using ubuntu mate now, due to some issues im switching to open suse
i am going to try it out in the virtual box first
Debian is really not a good desktop distribution
Depending on what you want the Linux Experience for, I'd go with Ubuntu for private and Fedora for professional experience
Reason being, that businesses mostly use RHEL and Fedora is as close to RHEL as it can go, save CentOS, which is not recommended for Desktop either
Fedora has the caveat of not having a lot of packages readily available and you need to install more sources to get newer packages
@blazing wolf
I personally don't like SuSE even though I am from Nuremberg
But, that is a personal preference
debian is fine for desktop
I didn't say it does not work, I am just saying that Ubuntu offers the better experience and deep down, it is still a Debian π
I had severe hardware recognition issues with Manjaro though. Mint is on my shitlist for having hard coded DNS.
which can be disabled by stopping systemd-resolver, but the mere attempt is bs
Yeah, but it refused to recognize my headset receiver as such and always tried to use it to connect to a WiFi
π
lmfao
I mean, it is a WiFi Adapter, but it is not meant to be used as such. Mint at least connected my headset properly.
i'm tempted to try LFS, but at the same time, I don't want to lose my great arch setup
maybe I'll change when I get a new ssd
it's a lot harder to set up but does a lot more
oh sweet
eh, getting a simple vm running is really easy
will check out sometime this week
I had more troubles with Hyper-V than virt-manager π
no thanks
passthrough is amazing via libvirt
love running games in my windows vm with full gpu acceleration
I have been meaning to acquaint myself with IOMMU grouping, but didn't get around to it yet
It is possible, but be aware that passed through hardware is not available to the host anymore
so you either need 2 gpu or use the integrated for the host
arch, but it should be the same-ish setup across the board
hmmm
@steel verge i worked around this by using Looking Glass
do you have two gpus?
Oh, there is a workaround now? Interesting
if I can just install arch/gentoo on my desktop when I upgrade and use a vm for games, I'd love that
I am not sure how nice it plays with anti cheat though
haven't had any issues personally
only game that I can think of which I play that utilizes anti-cheat is Titanfall 2 though
that good?
cya dude
seeya
bye
ciao
Anyone
Alive rn
I got stuck in tty mode
I wanna switch back to normal gui mode
How can I do that ?
try going to tty1
(or probably tty7 if Debian or derivative)
^^ I don't use Debian that much
Ohh k
what's a good way to pass big number of arguments to script? I can't use env variables
doing ./script a b c d e f sounds bad?
I don't see why
loads of popular commands pass loads of arguments like that, something like
qemu param1 \
param2 \
param3 \
param4
alternatively, consider passing a filename instead, where the params are stored (in a sensible format)
hi guys i am bit a noob on linux. Could you guys let me know how to close vs code from terminal (without using pkill electron)??
some other ways!!
using ubuntu 18.04*
killall code?
here's a oneliner which kills only code and leaves other electron processes intact
kill $(ps aux | grep "electron.*code.js" | head -n1 | awk '{print $2}')
pgrep does not exist on my system
what system is that?
gentoo
Gentoo package sys-process/pkill-darwin: pgrep(1) and pkill(1) for Darwin in the Gentoo Packages Database
... in any case, there's nothing wrong with using my ps|grep for this if you don't have pgrep or pkill
of course, prefer the latter if you can, but he specifically said "without using pkill"
"without using pkill electron" if we're gonna quote things
:l
my response would be pkill -f code.js or so, depending on how the command line for vsc looks exactly
something like
/usr/lib/electron6/electron --no-sandbox /usr/lib/code/code.js
and head -n1 is wrong, I think? You use that to filter out the grep process, I assume, but as ps is sorted by pid, this fails if your code process has a higher pid than grep, which happens once the pids overflow and start over.
would rather need a grep -v grep or so, I believe
which is one of the big problems with ps|grep
and it's not atomic
ps aux --sort=lstart
then
oh, hm, this doesn't take date into consideration
apparently
complexity increases
screams in a posix-compliant manner
Is it possible to redirect all traffic from docker container (from 1 container, not all) through proxy without exposing env variables like HTTP_PROXY to that container?
It runs untrusted code
Anyone has experince with viewvc and SVN authentication?
Hey, Iβd like to know how to clean up the working tree at /tmp/python-build.20191116213422.12827 I explained my situation more in details in #microcontrollers but I guess itβs more related to Unix.
what exactly does the yum update command do?
nvm
yum install package_name
Used to install the latest version of a package or group of packages. If no package matches the specified package name(s), they are assumed to be a shell wildcard, and any matches are then installed.
yum update package_name
Used to update the specified packages to the latest available version. If no packages are specified, then yum will attempt to update all installed packages.
Hello there,
I've a problem regarding the installation of the python module aiodns (I'm in a venv environnement in 3.7 using pyenv):
I installed it via pip and it looked fine:
Successfully installed aiodns-2.0.0
However when I try to use it in my project I get:
RuntimeError: Resolver requires aiodns library
π€ So I tried to import it in shell, and here is the problem:
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by /home/pi/D/my_venv/lib/python3.7/site-packages/pycares/_cares.cpython-37m-arm-linux-gnueabihf.so)
I did not delete the folder @sage solar before reinstalling python 3.7 with pyenv because it seemed to rewrite the folder, could it be the cause of the problem?
you probably just need to upgrade your distro's glibc
looks like CPython was built with 2.28, which is (maybe probably) newer than what you have
@frank coral what does ldd --version say
what distro are you running anyways?
raspbian my guess
(Debian GLIBS 2.24-11+deb9u4) 2.24 (raspbian)
well... there you have it
my suggestion? compile a newer glibc manually and point to it via LD_LIBRARY_PATH when running anything requiring pycares
maybe the unstable repos have a newer libc?
that sounds like out of reach for me now ^^" Maybe downgrading aidons could works?
looks like it's an issue with pycares, which is a dependency of aiodns
Yep, but downgrading aiodns will downgrade its dependencies requirement, doesn't it?
I do need to uninstall all its decencies as well before downgrading, no?
depends on whether it's listed as >=version or what, but I'd say yes just to be sure
picards 2.4.0 still needs GLIBC_2.28
I'm slowly downgrading testing every combination...
@main olive I tried v 1.0.0 and it still needs GLIBC_2.28 but this version was released in 2015, is it normal? It looks to me that pycares is not well uninstalled
seeing as 2.28 wasn't even out in 2015, I wouldn't say so :p
Well what I've done is fully removing aiodns from my code and it works...
just a thought - latest raspbian (buster) uses 2.28
tried upgrading?
it's fairly simple - https://pimylifeup.com/upgrade-raspbian-stretch-to-raspbian-buster/
@main olive Maybe pycares in 3.7 needs it? Or uninstall pycares does not remove it completely
couldn't really say tbh, I'm not too familiar with pycares, sorry
neither I am lol
But because it have C dependencies from what I've seen, pip may not remove it entirely
I think I'll need to, my current distrib' only support postrgesql 9...
π more the reason to
and 3.7 will be supported natively
@frank coral let me know if you run into any issues while upgrading
Ty I appreciate π
i installed python 3.6.8 and side by side got 3.7.5 too
and had python2 too
so yeah the new advances are cool too
Hello, folks. I'm looking for some script that can give me the full info about Linux machine. I need numbers of cores, ram, swap if any, hdd space (would be great to get model of hdd or to check if it's ssd or hdd), number of network interfaces, ip addresses, mac addresses.
any of the fetcher scripts should
or do you want it programmatically
although i dont know of any that give all of that info
@zenith shale sounds like a very easy script to write. Any reason you can't look up the commands to do those things and put them in a script yourself?
Getting this error while installing pytho. 3.7
@thorn prawn can you install... anything? does apt -y full-upgrade work
because I don't think python depends on nvidia stuff
in which case your installs a bit broken
hi guys i am new to python as well as linux and wanted to install scikit-learn for machine learning-
i am facing issue while installing scikit-learn:
python-version-3.8
pip-version-19
Issue:
Building wheel for scikit-learn (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/rishi/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-29z5zpj/scikit-learn/setup.py'"'"'; file='"'"'/tmp/pip-install-29z5zpj/scikit-learn/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-18pq3ort --python-tag cp38
what can be done to resolve it?
resolved the issue with upgrading the cython manually and then install sklearn
@steel pewter glad you solved your issue! Next time please use codeblocks for pasting code, makes it a lot more readable :)
!codeblock
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```python
print('Hello world!')
```
Note:
β’ These are backticks, not quotes. Backticks can usually be found on the tilde key.
β’ You can also use py as the language instead of python
β’ The language must be on the first line next to the backticks with no space between them
This will result in the following:
print('Hello world!')
@main olive thanks buddy will keep in mindπ
currently to install something using pip, i will have to use sudo, is there a way to change some settings and not use?
@blazing wolf its good to create an environtment and then perform the pip actions(just a preference)
https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
yea i got that but generally for installing?
like i have to do sudo python3.8 -m pip install pipenv
but inside a pipenv, i dont have to use sudo
are you installing it to use it user-wide or as a project dependency? @blazing wolf
pipenv is for user-wide
not sure if im gonna need any tho
but in general how can i remove root user access for commands(specific commands)?
just don't run those commands with sudo?
it wont let me
pass the --user flag to pip to do a user-local install, rather than a system-wide install
okay
Hey @main olive remember my compatibility problems? I did not change my distribution yet, but planning to do so. However I just thought about using Docker, could it be a solution?
definitely, yeah
Hello
I need help with only displaying the error message from a mkdir command
i only want it to display the error message as the output
mkdir -v /tmp /tmp/test
Then take off the verbose flag
its for an assignment and i have to use that command
i cant get it
i tried to pipe it into grep
but it still displays the whole line
Redirect 1>/dev/null? Bit silly though, why can't you just take off -v?
/dev/null is the black whole of the Linux filesystem. It discards whatever you write to it. Sometimes you only want to see the error messages or the successful output. Show just the error messages from mkdir -v /tmp /tmp/test.
i have to right the command that will do this
^^^^^
i thought it would be something like this
mkdir -v /tmp /tmp/test | grep " "
and put the error characters in the quotes
Yes that's exactly what I wrote, 1 is the stdout stream, if you redirect it to /dev/null you only get stderr outputted
No it's not a command, you don't pipe to it
Anyone able to help me out with a VIM issue? While working I will end up with a number of open buffers. I then decide I need to open another file and immediately hit Nerdtree. Once Nerdtree is open I realize that the file is already open in another buffer and so I immediately switch to that buffer to find that the Nerdtree is replaced with the buffer. What I would prefer is that Nerdtree closes and that my main buffer switches. Does that make sense?
Try reading this https://en.wikipedia.org/wiki/Redirection_(computing)#Redirecting_to_and_from_the_standard_file_handles @tranquil steeple
ohhh
so i could do
mkdir -v /tmp /tmp/test 2>/dev/null
2 so its filters standard error
?
What do you mean, is that a question?
im trying to automate ftp using bash script but im having a error in the ftp command itself
@tranquil steeple you are redirecting stderr (numerical value of 2) to /dev/null
stdout, which is where standard output is usually put, has a numerical value of 1
I really don't understand why you can't just remove the -v flag
HOST=' ftp 10.1.1.1'
USER='name'
password='pass'
FILE='nmap.txt'
ftp $HOST <<END_SCRIPT
user $USER
$PASSWORD
pass
put $FILE
get important.txt
bye
exit 0 ```
i get an error on the HOST part, it says command invalid
well, yeah
your command gets expanded to ftp ftp 10.1.1.1
does that seem correct to you
damn
thanks
:+1:
yeah me too
i am facing issue with the no module found if someone free who can guide me please reply
<@&267629731250176001>
Is there an issue that needs moderation?
If not, then please don't ping everyone on the moderation staff
That role is only pingable so that users can let us know when there's something that needs resolved, not as a "get help now" button
Sorry..deeply sorry
No worries, now you know. And I think you'll have to give more details about your question before anyone can really offer you any help
What module, what are you trying to do, etc.
!ask this embed offers a pretty good guideline on how to ask good questions
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.
β’ 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.
β’ Keep your patience while we're helping you.
You can find a much more detailed explanation on our website.
I am new to python and linux and I use vscode for scripting--also i have set python3.8 as aliased to all the pther python versions i have
when the code i run in vscode with the environment set to python3.6 all the libraries get displayed and the code runs perfectly fine but when i try to run the script using python3.8 in terminal it throws the error no module found 'pandas'
i have checked the path for pip and the python-both are set to same but still confused of whats the reason behind this issue?
i am using pip virtual environment to install any package
from my look out i have no clue how to solve the issue?
@wild kraken find a way to install libpython3.6
it's probably available in some repository
@hearty sable solved it by dumping debian and going over to arch
its too many dependencies tbh
@main olive read it but theres no information about how i input data
input data?
show log?
do export EDITOR=nano
and try crontab -e again
it bails because by default, vi is set as the editor (which your system doesn't have for some reason) and crontab -e tries to execute the editor
worked? @wild kraken
@main olive 1 moment
whenever I try to ssh into another computer it keeps saying the connection was lost
does anyone know why?
Connection closed by [SERVER_IP].. by port 22
please help me
run your command with -vvvvvvvvv and send the log
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
use that
ok
exactly that amount?
of v
that should be enough
also I didn't do a command
the command to ssh in
I opened terminal
I went to shell
and clicked new remote connection
then tapped on the computer
do I have to do the command?
do ssh user@the-ip-you-want-to-ssh-into
ok then
for the password what do I put, mine or the other computer?
the remote user's password that you're trying to ssh into
ah ok
might have to do it tomorrow though
the other computer is being used right now
I'll notify you tomorrow if that's okay
I mean, ssh-ing in isn't going to disrupt any activites on the other machine
the person using the machine shouldn't even notice unless he's specifically looking for logs
it's not like rdp where it kicks the active session out
pacman -S base-devel
whats that?
includes developer packages, ie packages for compiling shit
gcc is included, it's a c compiler
you'll probably need other things from that package group as well which is why i recommend installing the whole thing
GNU C Compiler
ah i see
GNU being the project which made/makes the software which most people refer to as the Linux OS
at least it wasn't your sudo password :p
yeah LUL
i see, theres alot to learn about the linux operative system, how long will it take to learn about it fluently
depends on what your target skill level is
not to toot my own horn, but i consider myself pretty adequately knowledgeable when it comes to linux, and i've been using it as my main operating system for 15 years
but it took me far, far less to get to the point where i felt comfortable using linux
i see, so you know most of it right now but you got comfortable with it much quicker
guess so
i see, i'm still quite new to it, however i really love how much easier it is compared to windows, i just need to remember the name
and i can download it on command
iirc gcc is actually the GNU Compiler Collection
instead of going trough sites and sites
it also includes Ada, Fortran, and maybe another compiler
@wild kraken software updates are much easier, ye?
yeah just a single command 
i'm still setting up the stuff i had in my debian
but i've come to yet another issue
but its netdata related
i mean
nginx
π€ thats a new one
yea do the journalctl command to see what happened

is there a listing for www-data in /etc/passwd
alternatively, does sudo -u www-data /bin/sh work
if not, the www-data user is missing
you can either create the user or change the nginx conf to use another user, such as nobody
@main olive it was an error on my side
i had to change some stuff in nginx.conf
to work with my site
user www-data; was unnessesary for this version of nginx as it seems
it's not unnecessary, please don't blank it out
that will run nginx with root privs and it won't deescalate itself
which you very much don't want
set it to nobody nogroup
or just nobody
alrighty
@wild kraken did you literally type "user@host"?
..y.. yes
yes
lol it wants the actual username and actual hostname, domain name, or ip address of the machine you're ssh-ing into
Hmm, I am a bit in a trepedation. This is not Python related, so if you want me to fuck off, just tell me. But I need to benchmark several nginX servers. Does anyone know a good tool? I have tried Locust.io, which is written in Python, but I am not sure I understand the usage correctly. What I need to know are two things: 1) how many users can concurrently visit the servers without it breaking down 2) which part of the system would benefit from an upgrade, either RAM or CPU. If I just send 100 users onto the server, half of the connections just fail. How do I use this tool correctly to get the sweet spot? If anyone has experience with it, I'd appreciate some advice.
Current config: 2 nginX with PHP-fpm, MariaDB, running a CMS, 1 Load Balancer with haProxy, both webservers firewalled off, only way to get to them is to visit the load balancer which is using round robin for balancing. So, pretty standard. 3 Dell RX470 Servers
#!/usr/bin/env python3
from locust import HttpLocust, TaskSet, Locust, task
class MyTaskSet(TaskSet):
def MyTaskSet(self):
print("Executing Stress Test")
@task(2)
def index(self):
self.client.get("/")
@task(1)
def article(self):
self.client.get("/?p=11")
class MyLocust(HttpLocust):
task_set = MyTaskSet
min_wait = 1000
max_wait = 2000
My current locust config
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
i keep getting
i double checked everything i dont see any problem
π
ive spent so much time on this
as you can probably tell by those 304 lines
line 254
health1 isn't in scope there
you start a block at line 150 and assign health1 inside that block
as soon as that block ends at line 254, health1 isn't in scope anymore and is unbound
giving you that error
@split grotto you are not actually listening to him properly
your health1 variable is assigned inside the if self.broadcast == True block
o
i also fail to see how this is related to unix, even moreso seeing as you're loading files from a windows machine in your code :p
Here's part of my script: ```sh
#!/bin/sh
timeout --preserve-status --k=1s "$TIMEOUT" sh <<EOT || exit_code=$?
run_user_code() {
$@
}
run_user_code
EOT``` why $@ commands error when they try to read stdin? If I put $@ before timeout block, it can access stdin
why are you putting stuff inside that shell and function anyway and not directly?
also you should always quote "$@", otherwise the individual arguments will be subject to word-splitting again.
real script has a few more opreations, I excluded them, but this example still reproduces problem for me
"$@" breaks everything, it tries to run several things as one command ("python main.py" not found)
well, sh <<EOT is a here-document. You pipe the contents before EOT into the stdin of sh.
hm?
how I could rewrite this? move this block of code to function?
have you tried with bash instead of sh? Maybe sh understands $@ differently...
I don't have bash in some containers. This script should be able to run everywhere. I run it in docker
I think "$@" works outside of this timeout block, but I need it inside
sorry, I'm confused. Guess I'm missing whatever is wrong too. π€ I'm mostly used to bash anyway.
Put the content of $@ into a variable, then access it later
will it fix stdin problem?
Hey, do you have an idea of how much space is needed to install and run an image using docker? I think itβs about 2Gbm, am I right?
Well, it will save whatever was passed to the script, not sure what stdin issue you mean. But calling another command clears the content of $@
it seems like $@ gets evaluated and replaced before I call another command
how much space is needed to install and run an image using docker?
depends on your image. Some are few MB, others a couple GB. There is no general answer.
Well docker itself is pretty heavy, isnβt it?
The $@ in your script should get evaluated in your main script, because it's in the here-doc. So it gets the args passed to your script file, I believe.
maybe I could pipe my string script from the other side? xargs or something
without <<
the docker daemon itself is not too heavy. Couple hundred MB all together. But downloading containers, their cache, volumes and logs can quickly grow large.
I think Iβm going to start from a ubuntu image, because debian is quite conservative, but itβs a lot more heavier
what
I am not sure what or why you are asking. If you want to build lightweight containers, you should start from light and container-optimized base images like Alpine, or even better use from scratch or truly minimal base images that only contain the runtime needed for your project (e.g. a JRE) if necessary.
Ty
To be clear, Iβve 600mb left on my disk (Sd card), and Iβd like to know how much space does take docker + an image with some very basics tools (such as postgresql, python...), to buy a SD card with enough space.
very basics tools (such as postgresql, python...)
that's not basic at all. Also storage is cheap these days, don't save on that if you buy one anyway.
Well by basic I meant that they donβt really take a lot of space. Ty
I meant the same.
Wow, 32Gb about 6$, space is a lot more cheaper than 5 years ago or so (last time I checked)
yeah, don't go lower than that. Better double or more and have some reserve. Also gives you more space per dollar.
64Gb seems to be the best space/price ratio, but itβs no more related to Unix. Have a nice day
@split pulsar in a standard conforming shell, "$@" [and "${array[@]} for array variables] is an exception, it still gets split as long as the values were separate arguments in the first place
only "$*" will turn them into a single string
sh: 5: python exec_input: not found
this happens after adding quotes
python exec_input is my command in $@
@frank coral 64 GB you have to start thinking about compatibility, not every device/software supports SDXC/exFAT, and 32GB is the largest for SDHC
@split pulsar how did you run the script?
it's docker entrypoint
i am asking how you passed "python exec_input" to the script
the question is really whether that had quotes around it going in
it is argument to docker run
i.e. sh foo.sh python exec_input or sh foo.sh "python exec_input"
ok what is tyhe full docker run command then
ENTRYPOINT ["run_entrypoint.sh"]
CMD ["python", "exec_input"]```
I haven't found a way to not use it. I can't just call function defined above
yeah but there's a way to do it, hold on
I'm currently trying to use sh timeout ... sh -c " ... " but I get weird errors
at this point I'm considering moving entrypoint logic into application
ok i found the right way to do it
#!/bin/sh
timeout --preserve-status --k=1s "$TIMEOUT" sh -s "$@" <<'EOT' || exit_code=$?
run_user_code() {
"$@"
}
run_user_code
EOT
though honestly I don't get why you need to do all that instead of just
timeout --preserve-status --k=1s "$TIMEOUT" -- "$@" || exit_code=$?```
full code is here https://github.com/IOMirea/run-runner/blob/master/build/run_entrypoint.sh
I'll try that snippet in a moment, thanks
i.e. why does this need to run in a subshell and have a function at all
oh
ok well yeah
you probably need to export COMPILE_COMMAND too for this approach
i gtg, be back later
wait nevermind, it's already coming in the environment
anyway, the basic approach of sh -s "$@" (or sh -s -- "$@") and using <<'EOT' instead of <<EOT is the important part, variable expansion needs to happen inside the subshell
I posted full script. All I changed was using -s "$@" <<'EOT' and adding quotes around $@
my initial problem was that any code inside timeout block can't access stdin
are you sure docker passes stdin to the script at all?
what happens if you run the script directly
yes, commands work outside of this block, I'll try to run it manually now
the same happens when I run it manually
"$@" is empty
this is probably because I use it in function. it has no args and $@ gets overriden
without quotes it gets evaluated before function starts
I'll just move timeout to application. This is not worth it
@split pulsar haven't really read any messages after your script but
$@ in a function takes params passed to the function, not the script
if you want to pass stdin to the function within the script, call the function with run_user_code $@
actually, no, you can't pass stdin like that at all
need to read from filestream 0
ie <&0
lol i can't believe i didn't realize that
incidentally i figured out the stdin problem
<&0 won't work either, incidentally
I think this will work, your problem is that the <<EOT overrides stdin.
script='set -e
run_user_code() {
$COMPILE_COMMAND
"$@"
}
if [ -z "$MERGE_OUTPUT" ]; then
run_user_code
else
run_user_code 2>&1
fi'
timeout --preserve-status --k=1s "$TIMEOUT" sh -c "$script" x "$@"
exit_code=$?```
@split pulsar
i might do this instead, to simplify the inner script as much as possible ```sh
if [ -n "$MERGE_OUTPUT" ]; then
exec 2>&1
fi
script='$COMPILE_COMMAND; "$@"'
timeout --preserve-status --k=1s "$TIMEOUT" sh -e -c "$script" x "$@"
exit_code=$?
now there is a weird problem, stdin goes into stdout if not consumed, all \n are \r\n now
anyway I'm rewriting this in python
oh, these are fixed, it was caused by --tty docker flag
@worn apex thanks! this part of code was a headache for a few days if not weeks for me
kskskskskskskskskssksksksksksks
?
π€
i have a really weird question
is it possible to run pgadmin4 on ARM linux
and where do i begin from the source code
alternatively can i run pgadmin4 remotely
I thought pgadmin4 ran in the browser
... in which case setting it up remotely should be very easy
@main olive indeed it does
from a local ip
you mean postgres running on your local machine, from your local machine?
should just be able to connect to localhost
....you connect to 192.168.0.21
that is assuming that the postgres db on .21 is running on 192.168.0.2 / 0.0.0.0 and not 127.0.0.1 / localhost
^ you need to expose it to the correct interface
by default, it's only exposed to localhost iirc
Hi
can you do ls to see if the directory is listed there?
Hmmm no I donβt see it in ls
what do you get when you do pwd?
/
Now itβs in home/myusername
excellent, now try cd Downloads
Not working
how about ls again, what do you see in your home directory?
sorry, what distrobution of linux is this
Lemme check
ubuntu, arch, debian, etc
Oh yeh Ubuntu
Itβs a server
gotcha, can you do lsb_release -a?
Lemme try
it's possible that the server version doesn't include a Downloads directory by default
lol
No LSB modules are available and the it said some info
yea that warning is fine, i get that too
Ok
the info is what i care about
it doesn't say anything after the LTS part for Description?
Nope
ok cool, let me google something, and while i do that, can you just tell me why you're trying to navigate to that directory?
Erm yes Iβm trying to get golem setup with it
Itβs a thing that uses your CPU power to do stuff and you get money for it
oh, doesn't really have anything to do with python development then
did you download some install file and can't find it?
No I need to install it first
what do you expect to be in the Downloads directory?
It says I need to be in the downloads directory to start the downloads
can you link me to where it says that?
k
I started doing it in the normal dir but it would not work so I YouTubed the issue and got this
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
The issue he got at the start is what I got
can i get a timestamp?
Yh gimme a second
2:40ish by the looks of it
2:19
ah ok, so it's as i expected
Thatβs the error for the thing I got then he said I need to go into downloads dir which did not work
yea, it doesn't matter what directory you do it in, you just need to be in the same directory as the install.sh file in order to run that specific command
otherwise you can provide the full path
all they're doing is making the file executable, and then executing it
do you have that install.sh file downloaded somewhere? like did you download that file?
No, do I need to install that first
you need to download the file so it's stored on your server. After that, you would make the file executable, and then run it in order to install
are there are instructions for downloading the file itself?
around 1:26 in the video you see them downloading the file in a browser
i assume you're using a headless server, so you need to use a command to do it
you can copy the URL he clicks to download it, and do wget <url> replacing <url> with the one you copied
that would download the file
no problem
Ah
for future reference, i would avoid coming to this server for help of this nature, as it has nothing to do with python. Even though this is the unix channel, it's still predicated on the idea that you're doing something python related
hello! I have been thinking about switching from windows 7 to some Linux OS ,maybe Mint - my question is as follows:
See..I host a discord bot on my laptop - do not ask my why and tell me other solutions - what are the differences between python on linux and on windows 7? I want to have my bot 24/7 online. I am asking this question because I want to have offline time as less as possible with knowing the pros and cons.
I have been installing linxes and oss before so I know to do that part.
Please ping me.
@main olive The differences between the two regarding Python code are minimal.
The only huge differences you'll find are going to be if you're opening files from your code, as your file paths are going to be different as are how you call them
Which could be mitigated if you use something like pathlib
Only other big thing that stands out in my mind is remembering to do python3 instead of just python, as calling python in either Linux or Mac will open up Python 2
Since they come with both
I see
Thank you
Linux probably has much better security than this windows 7 that refuses to update for months
Well considering Windows 7 is going to reach its sunset at the beginning of the new year, yeah
I'd say so
Great!
But considering my security did not update for like 2 months,probably massively better π
Yeeeaaaahhhhh, couldn't hurt. Although if you want to make it last a bit longer, you should be able to troubleshoot the windows update thing
As in it actually has a troubleshooter program that lets you fix it
I am switching to Linux permanent tomorrow
I know how to get latest win10 beta or something,but I like Linux more
I know it is not related to Python,but Mr. Helmock said why not:
Is there anything to do when creating a permanent Linux OS? Like I saw some people doing some area something while making a partition for Linux..I hope someone knows what I am talking about! :)
Ping me
tbh if you're using one of the main distros with a nice installer there's really not much you need to do
if you are manually installing it and setting the advanced options by hand there are bits and pieces you'd perhaps want to do
seperate partition for tmp / home perhaps
swap partition
that type of thing @main olive
again, most of this is done automatically in a lot of linux distros
I have been thinking about Mint perhaps,and yes,I meant on swap partition !
Thanks again,now I know at least what to look for
@quaint mirage
it's basically like a page file for windows
if your run out of RAM it starts storing that excess information on the hard drive
the swap partition?
yup
DAAAAEMN
pagefile is the windows version
sow how much is recommended? I have heard double the ram,right?so 16gb for me
that sounds about right
Thank you! I will switch to it tomorrow
with 8gb of RAM i can't see your swap being used too much either
also, you can create / destroy / mount / flush swap whenever you want on Linux
it's not an install time process
When I am doing a OS switch - I do it in this order: using a software minitool partition wizard I make a new partition
then I reboot,select the usb and put the OS on that new partition
are you completely uninstalling windows?
Yeah,why not? I will be storing my files on a usb
okay so yeah. backup your files somewhere and triple check to make sure they're backed up and then check some more that you got everything
then just full format the SSD and start from scratch
the linux installer should give you the option to remove all partitions
then just create a new partition
Or to be secure I could do my thing and copy-paste and then format,right?
i mean yeah, as long as you don't accidentally break your new partition during the linux install
or remove it, rather
no problem
does anyone know how to copy and paste code between terminal windows using tmux and vim?
say I'm editing one file in vim on one pane and want to copy and paste some code from that pane to another pane I have open. I can't figure out how to do that.
hey guys need help with executing a bash .sh file on Rasbian
I'm getting an message: permission denied
then I ran: chmod +x install.sh
but it still didn't work, then I tried right click on permission and then execute permission: everyone but it doesn't change for some reason.
so how can I run it?
well, it's technically because you have permission to run sh
yh now it kinda crashed my vnc but I think it works
/home/dom
- domalert
- domalert (2nd)
-venv
- domALERTV5
-all the files
I need to take the 2nd domalert out of the first domalert and put it in the home directory
how can i do that?
mv ~/domalert ~/domalert-temp
mv ~/domalert-temp/domalert ~
rmdir ~/domalert-temp```
thx
where should i be though?
in the home directory
or the first domalert directory
I am trying to run: git diff upstream/master -u -- "*.py" | flake8 --diff to test to see if it my changes pass the PEP test. I pushed my changes to a branch called fstring changes but no matter what I change my upstream branch to (master or fstring-changes) it says bad revision
Options like -u need to come before the first commit is specified
I mean git diff -u upstream/master ......
@main olive ~ means home directory (alias to $HOME), you can run these from anywhere
git diff -u upstream/fstring-change -- "*.py" | flake8 --diff still doesnt work
if you look here
they have -u after
origin https://github.com/ForTimeBeing/pandas.git (fetch)
origin https://github.com/ForTimeBeing/pandas.git (push)
You don't have a remote named upstream hence it fails
Presumably you forked pandas so the upstream would be https://github.com/pandas-dev/pandas.git
Can be added with git remote add upstream https://github.com/pandas-dev/pandas.git
origin https://github.com/ForTimeBeing/pandas.git (fetch)
origin https://github.com/ForTimeBeing/pandas.git (push)
upstream git@github.com:pandas-dev/pandas.git (fetch)
upstream git@github.com:pandas-dev/pandas.git (push)
like so?
Yes, sorry. That is correct
Though you used the ssh remote url which may give you issues if you didnt set up ssh credentials for git
You could use the https url if you have issues with it
anybody knows if it's bad to use an older version of the Linux kernel after you've used a newer one
it's not
as long as you have the proper kmods
userland and kernelland are entirely separate
you could theoretically even swap out the kernel entirely for something that's not linux (like Hurd) as long as it provides an API that uses the same standard
Is it possible to make crontab wait with running my python scripts until it has a internet connection? i want to prevent some of my scripts from running when they dont have internet as they will crash and not run
My power keeps cutting out rn, the pi boots up before internet comes back so python scripts wont run properly.
Please @ me if you know as well, my power is most likely going to cut out again
where is locat trash on vps? *unbutu 16.04
@proper bison you could just....add error handling to your script
@sage solar yeah but do i just try: except: a request or something to check if i have a connection?
@proper bison don't use cron, use systemd
it specifically lets units wait until connection is achieved
even more specifically, you need the following values in your systemd unit file:
After=network-online.target
Wants=network-online.target
Cron seems so much simpler though π€·ββοΈ any good reads to understand what i need with systemd?
@proper bison Try this https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/
except, obviously, changing the Wants and adding the After
hello guys when i try to run this code i got error
import numpy as np
q_table = np.zeros((8,8,8,8,8,8,8,8,8,8,8,8,4))
print(q_table[1,1,7,3,1,1,7,3,1,1,7,3])
q_table = np.zeros((8 8 8 8 8 8 8 8 8 8 8 8 4)) MemoryError: Unable to allocate array with shape (8 8 8 8 8 8 8 8 8 8 8 8 4) and data type float64
my system is ubuntu when i google it people say that something related to my kernel doesh anybody has any idea abot that?
I mean youre telling your thing to allocate memory the size of 8 * 8 * 8 * 8 * 8 * 8 * 8 * 8 * 8 * 8 * 8 * 8 * 4 * 64 bits thats aroudn 2200 gigabyte of memory i severly doubt youve got so much in your PC
@still nacelle
ok
@ how is it possible to make 9 dimentional array ?
sorry 13 dimentional
the same size
that is exactly what youre trying to do right now
and im telling you your machine cant handle this
i mean
if youre doing q learning on an environment this complex
i doubt youre gonna get even close to being able to train whatever youre building to the point where its gonna do something beyond random without some massive massive massive increase in computing power
what exactly are you trying to do?
pursuit-evasion game in reinforcement learning multi-object
btw i have an another question i am working in 9 dimentional array
q_table = np.zeros((8,8,8,8,8,8,8,8,4))
print(q_table[1,2,2,31,1,1,1,1]) ## first print
print(q_table((1),(2),(2),(1),(1),(1),(1),(1))) ## second print
my code smilar to this actually it works in my code if i use first frint style the code really slow but if i use second print style the code super fast
actually if i try the first one work second one does not work if i try this part of code
if you copy past ethe aboev piece of code its gonna fail
idk what you are executing but not this
does anyone know how I can load my LOIC.exe file using mono? I need help
I need help setting up
that does again sound pretty illegal or at least possibly illegal to me
LOIC It self isn't illegal
don't know where you got that notion from
havent we talked about this before
did you read the server rules when you got here?
yes not helping with illegal
!rule 5
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.
the rule states may
I just said that
and we dont know your intuitions so you may be breaking laws with this information -> we wont help you
Performing denial of service attacks against a service you dont own is illegal and no matter how often you tell us you wont how can we be sure you wont?
give me a reason we can be sure you wont and ill help you
I'm a child
so?
I'm on my school computer
they can see everything I do
I wouldn't want to get in trouble
trust me nobody at my school does
cool and what exactly would be stopping a not child at a not school computer prevent from saying just this?
do you want to see my classes?
no
I just want you to understand that you are not getting help with stuff that is potentially illegal even if you promise that youre not gonna do illegal stuff
so you're not going to help me?
no
then?
and according to rule 5 you shouldnt even be asking this quesiton here
@ ty nix it looks my code working and it is quite fast now because my reward always increase after some time of training
fine, how do I load a .exe file using mono?
well if that wouldve been your question int he beginning yes I wouldve helped you but youre obviously up to the LOIC stuff so no
@main olive wtf u are everywhere did u ask this question in all programing discord groups
i just saw u in sentdex
I mean you're also always asking question about possibly illegal stuff in #cybersecurity i wonder when you will understand there is no help for you with this here
Ok this is not illegal how do I use wine?
it's just a windows emulator
nothing wrong with that
Hi ! Can anyone help me to fix my tesseract install on ubuntu please ? I tried everything but i'm really stuck still :/
!warn 501950248831418369 As per rule 5 which you definitely know about by now, we absolutely will not assist with tools that are very easily able to be used for malicious purposes. Your intent does not matter, it's the clear ease of being able to be that is.
:incoming_envelope: :ok_hand: applied warning to @main olive.
@sage solar you might want to ping mods if it runs on like this in future, just to avoid the lengthy argument
@trail gust you'll probably get better luck by putting a description of your issue here so people can look into it as soon as they see your question
things like what you're trying to do, what it's doing instead and any error outputs if there's some
@trail gust what's broken with it
I just wanted to be sure before saying it, but i thinks after 3 more hours, i finnalt fixed it :)
The problem was the version of tesseract i installed from ppa was different than the one i installed for training tools by cmake
Oh damn
It was then trying to find the libtesseract. So for the version 5 and my tesseract was 4.0.1
Yeah that's gonna cause some issues
And i couln't remove it cause it was installes by cmake, and i lost the sources
I finally deleted the lib files (from the cmake instructions) and reinstalled everything and recompiled tesseract and the tools
Just a side question : is there a channel suited to ask for a specific software? I'm tryinf to find something but couldn't yet and i'm wondering if it exist or not xD
Maybe #tools-and-devops?
Thanks you!
anyone know what the purpose of the subdirectories outputted by the following commands into #bot-commands are:
!eval
import os
filelist=[]
for path, dirs, files in os.walk('./'):
filelist.append(path)
for f in files:
filelist.append(f)
depthcount=[x.count('/') for x in filelist]
a=depthcount
m=max(a)
print([filelist[i] for i, j in enumerate(a) if j == m])
Sorry, but you may only use this command within #bot-commands.
/sys/devices/ is a folder on the virtual sys file system which holds file-like interfaces to all the hardware devices the kernel can interact with
what's virtio?
virtual environment?
ah nevermind
I think that's it...
the string 'virtio' was in the folder names of my code output
that probably means the system is running in a vm using virtio interfaces
thx, was just curious
I have reinstalled Ubuntu 3 times today.. I could not get Python 3.8 to working.. now I can not get PyCharm interpeter to work!! Please help me,I will be spending my whole life trying to fix this
Building wheel for aiohttp failed: [Errno 13] Permission denied: '/home/loner/.cache/pip/wheels/f2/8b' Could not build wheels for aiohttp which use PEP 517 and cannot be installed directly
This is the error I can not fix
People online were talking about python setup.py wheel or something?? It says there is no such file as setup.py
I had no problems 1st time I installed Ubuntu,why the actual fuck can I not get that lucky again?
Please help me
seems like you ran sudo pip install ... at some time, or messed up ownership in another way
with pip, always use sudo -H
to fix ownership and give it back to your user instead of probably root, run sudo chown -R $USER: ~/.cache/pip
after that try your installation again
@main olive
well, you must not change owners of system files
I did that to /usr folder
as long as it's inside your home directory (~) it is safe to make yourself the owner.
yeah chown on /usr kills it
π€£
gotta be careful not to typo there π
I had to run it as root - Pycharm
god, no
don't run things as root arbitrarily
especially gui applications and such are not meant to run as root
not to mention the security aspect, that is exactly what is breaking correct ownership of files and leading to permission issues in the first place
Maybe sudo chown -R $USER: ~ to set ownership of all files in your home folder back to you, and then no more sudo for things that aren't supposed to run as root
uhm.. did you forget an import pytesseract or something?
dunno that library, but that error doesn't seem os-specific
you need the tesseract-ocr package installed on your system, but you don't have to set that variable because the default will be just tesseract and should work fine
you can try which tesseract in your shell to find the full path, but it should not be required to set that, if you can invoke tesseract directly on the shell (which means it's on PATH).
that depends on how you imported it
gah, please stop using all these star imports. that hurts
but there is no import pytesseract anywhere to see?
you clutter your global namespace with tons of names that are not used, and which might even overwrite each other
no need to apologize, such things happen to all of us.
see e.g. https://www.geeksforgeeks.org/why-import-star-in-python-is-a-bad-idea/ or any of the many more articles about it out there
if you have terribly long package names, you can do import pytesseract as tess for example
or you can explicitly import only the parts you want from a package, like from concurrent.futures import ThreadPoolExecutor
@quaint mulch no,sorry..I did use that module/library you mentioned,but I do not remember if it was on Linux and I did not have any problems.
@oak shell what do you mean?
I did that to the project folder
did not worked
I ran as sudo - everything works
PyCharm
running pycharm as root is terrible
if things don't work as your user, that means you screwed up permissions or ownership somewhere - probably by having run things as root before that should not
do sudo chown -R $USER: ~, then start PyCharm normally as user, without sudo. What exactly happens then?
I have told you π But now when you are interested..I will again tell you
So basically when I open pycharm - I have to import modules(for example discord.py) and When I do so it says that
I have reinstalled Ubuntu 3 times today and every time I could not get it working
Sooooo no,I do not think I did screw anything up..yet
how do you install modules? and to what interpreter?
What interpeter? python3.8, but it does not work - error linked in the link.
because PyCharm can not install modules if you selected the system interpreter directly, instead of creating a virtualenv/pipenv/whatever
settings -> project -> project interpreter
okay, that works
but that has nothing to do with pycharm then if you install manually using sudo -H pip?
but NO ANSWER online
I guess
I mean I linked my problems describing in more detail,so please take a look at that.
or you have Python2 or any other interpreter as default for your project in PyCharm, instead of the one you installed packages for?
