#unix
1 messages Β· Page 18 of 1
Ah
i prefer a fixed speed
I thought it was usually tunable
especially since i play osu with my mouse, sensitivity is paramount
it is
easiest to tune on windows (personal choice, not factual)
I'm a long time unix nerd. Windows drives me insane.
if you tinker around with it, you'll find that it's pretty interesting
gives you a whole new look into OSes
my first laptop had Ubuntu, I was 5 too
started young I see
yeah, windows have long had the main share there
so when i grew a noggin i moved to windows, then im back on linux
before i grew a noggin inside my head, i used to play those Flash games
kind of glad flash is long gone
it was a security hazard
I'm a UNIX person, but the Windows kernel is interesting. The "Inside Windows" book covers it extensively. If you're old enough to be a VMS user, you'll find some... familiar things in the book.
I worked in the NT group when they were developing it; I occasionally saw Dave Cutler in the halls. Scary guy.
I'm sad. The nostalgia of old style internet. Browsing somewhere playing a game. But it's not really dependent on the technology. Just those kind of sites don't exist any longer
How do I stick myself to unix for longer duration...I find windows better when it comes to build circuits and PCBs...any tips? I want to totally shift myself to unix
Hard to say. Maybe if you find a good circuit design thing for linux or MacOS you can shift.
A friend used to work in a windows shop and liked linux. They installed cygwin and ran its X11 server full screen, so they coul forget there was a windows box underneath.
You can probably do the same with WSL on Windows these days also: run a linux desktop in a full screen window.
That (a) lets you sit full time in linux if you'd like and (b) keep windows around for the tools you still use on windows.
If you don't like unix, why force yourself to use it?
Also: cameron's advice about WSL sounds right. I've never used it myself, but I hear it works well.
If you want a new skill, it can be hard if the old and competing skill keep getting in the way.
I once forced myslf to move on from the stock CLI mail command to mush (initially, now an avid mutt used) by refiling my entire email into an MH folder which mail wouldn't handle (it's mbox only) and, initially, wrote myself a small script to make an index file and a set of vi macros to browse it and pick emails.
Just to force myself away from mail.
@fickle granite ^^
as problematic as Flash was, it's a serious loss not to have a proper replacement. the learning curve with html5 <canvas> and JS (I guess that's the closest thing now?) is really not the same
Try Dart and Flutter. Probably very different from flash, but pretty slick
There's always openfl which has all of the graphics APIs from actionscript/flash but over haxe or typescript instead and transpiled for different platforms like JavaScript/html, android, a native application, etc.
use wsl
I have fooled around with the schemdraw library in Python, which would work on any operating system with Python. Not sure it would meet all your needs though
I used gEDA a couple of decades ago, I was a clueless student so it worked for creating some nice diagrams but it appears it is no longer maintained http://www.repo.hu/projects/geda-archive/www.geda-project.org/
This seems to be the replacement project http://www.repo.hu/projects/ringdove/
I like unix... it's just that I feel bored sometimes bcz I'm unable to get the things done... maybe if I try to work on it, It'll feel more engaging than windows
This is the most exciting thing I did with schemdraw, which I admit is not terribly exciting
Hi people, what are some good resources to learn about WSL or Linux in general?
i like content of this book to get better with LInux. full of just practical modern stuff.
Otherwise 99% of linux users will tell you that best way to learn is just using it π
WSL is not linux, it is hybrid of Windows and Linux that makes Windows issues somehow being present in Linux.
any online docs?
my zoomer brain is a bit too adhd for books tbh
download the book above? and it will be online docs.
well too bad, imma still learn wsl first lol
never saw online docs for linux. People usually used Rufus to make live usb and try it at least in this way
Linux is very for practical head on experience first
time to become a pirate I guess
These are "standards" rather than docs but could serve a similar purpose https://refspecs.linuxfoundation.org/
I need a good friend
ventoy is superior
is wsl just as good as native linux or are there any caveats I should be aware of ?
it's another layer of indirection
so there are integration and performance cost
I already knew about the performance issue. What about the integration part? Like, are there any important incompatibilities I should know about?
the performance hit is actually pretty low, usually in the single digits, but it does make a difference for cpu/gpu intensive tasks. other than that, if you require systemd, you have to enable it manually. networking is also finicky because wsl NATs by default, though nowadays there is a mirroring mode that makes the distro's port visible on the same ip address as windows
it is the best you can get on Windows. Beware of things like git vs git.exe , etc
Can anyone tell me how can i use windows .exe in my linux?
you'd have to use wine or virtualization. linux cannot natively run exe files
I prefer using Lutris for this. GUI manager of wines. The most lazy option for me
No. Wsl is not as good as native Linux. Besides performance overhead from having Windows in background:
-
You will have at minimum weird GUI issues in anything u use in WSL
Because it will be trying using Desktop of Windows to show stuff -
Also weird port forwarding issues to see web stuff from wsl in your browser
-
also potentially weird networking, volume and VM issues from using Docker Desktop that was made for Windows people.
Native performance good is only in Linux native Docker Engine, with which in WSL u get port issues -
expect possible issues with Filesystem differences. It is always issue when distributing cross OS stuff
I have this project in Python. For unix based systems. CLI programs.
https://pynosaur.org
If you're ever interested in collaborating, feel free to ask me anything.
should I use uv with system unit
you can but you don't need too, there are many different ways around it
What do we think about Debian moving to reproducable builds? It sounds like a good idea, but I'm kind of waiting for the other shoe to drop.
what do you expect the other shoe to be? It sounds like a good idea to me
The other shoe maybe being every package needing that degree of control? Or does ubuntu provide that work?
Apparently every package will need it.
At least by default.
Well, I'm thinking...what then if that can then be used to not just restrict what can be run in terms of security but restrict and enforce what can be run in terms of freedom. "Sorry, it looks like you're trying to run a non-approved version of a package we use to make sure the powers that be can spy on and control you."
Call me paranoid, but there's a lot of shit going on that kind of makes me feel just a tinsy bit validated in that position, you know?
I donβt think theyβre considering end user constraints, rather that what the distribution provides is reproducible. You could also off constrained user side stuff like appleβs signed applications but such a thing would need to be totally opt in.
i don't think you would need to worry about Debian doing something like that, it would be very much against their mission and reason for being as a project
that has nothing to do with reproducible builds, it's just about you or others being able to verify that nothing has gone into or been modified and that their source package really correspond to the produced binary packages
reproducible builds is a good thing in my book at least
it's just another security measure in addition to signing the packages
Fun fact : unix was an os that ran on B the predecessor of C when bell labs got a new computer that couldn't run B or unix they created C in around less than 3 months but do double check this I'm not hundred percent sure
!kick 1504280833672872087 we are not a job board
:incoming_envelope: :ok_hand: applied kick to @analog pewter.
locate is a magnificent thing, guys
Indeed
also one of our servers is triggering my monitoring system and I went to check out what's taking up all that space
-rw------- 1 postgres postgres 16777216 Sep 18 10:46 00000001000001F8000000EE
-rw------- 1 postgres postgres 16777216 Sep 18 10:46 00000001000001F8000000EF
-rw------- 1 postgres postgres 16777216 Sep 18 10:47 00000001000001F8000000F0
-rw------- 1 postgres postgres 16777216 Sep 18 10:48 00000001000001F8000000F1
-rw------- 1 postgres postgres 16777216 Sep 18 10:48 00000001000001F8000000F2
-rw------- 1 postgres postgres 16777216 Sep 18 10:49 00000001000001F8000000F3
-rw------- 1 postgres postgres 16777216 Sep 18 10:50 00000001000001F8000000F4
-rw------- 1 postgres postgres 16777216 Sep 18 10:50 00000001000001F8000000F5
-rw------- 1 postgres postgres 16777216 Sep 18 10:50 00000001000001F8000000F6
-rw------- 1 postgres postgres 16777216 Sep 18 10:50 00000001000001F8000000F7
lmn@db11:/var/lib/postgresql/9.1/wals$ ls -l | wc -l
18610
I'm scared, hold me.
how could they do this to me
oh dope i just saw this
this channel
I'd just like to interject for moment. What you're refering to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.
Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.
There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!
(sorry had to share some inaugural crappost before any serious conversation)
π€¦
what did you expect tbh
btw why isnt there a linux and mac channel?


Linux and mac are kinda unix-oid systems
macos is posix certified iirc
unix and unix-like systems include linux and macos. we do not have a lot of mac questions on this server, it is natural to combine the two into a single chat.
Shawn, but isn't the "GNU system" actually hurd?
well, the GNU system
or would that be the GNU system with hurd added (edit: makes sense, since hurd is apparently just the microkernel)
oh π
LOL hey hey who says Im no GNU expert
I sing Stallman's Free software song in my head all the time
But yes it's a copypasta but GNU hurd has never been ready for everyday use so far, theyre still working on it
Theyve been working slowly on the Hurd kernel for like decades now
When the Linux kernel came out I guess they slowed down cause they had a complete free OS useable and that was their main goal
Though Im curious to see if Hurd ever sees some real use
But no I'm not a GNU expert
Nerd

@oak shell I've been here for ages
*3 months
this is MY channel, hell yeah

trying to run pip on cloud9 i get sudo: pip: command not found
however if i run without sudo it runs, but doesn't have sufficient permissions to complete the task
you shouldnt run pip under sudo
error: could not create '/usr/lib/python2.7/dist-packages/httplib2': Permission denied
thats what happens without sudo
why are you using sudo?
trying to follow this: https://developers.google.com/identity/protocols/OAuth2WebServer#example
a lot of samples i find online seem to suggest running pip in sudo - granted many of these are old so i'm not sure if the practice has since changed
i think i figured it out - running pip with --user instead
yeah,you should run as few things as possible with sudo
i understand what you're saying - but can you explain to me specifically why it WON'T run?
i understand why I shouldn't - but the fact that it doesn't run confuses me
for some things it is required
sudo pip is very insecure. setup.py runs for a pip install, so you're essentially running arbitrary python code as root. Due to the nature of Python package distribution, malicious code is not robustly protected against so it can be a pretty potent attack vector (as seen recently with the PyPi namesquatting issue https://arstechnica.com/information-technology/2017/09/devs-unknowingly-use-malicious-modules-put-into-official-python-repository/, but it doesn't have to be namesquatting)
python3 -m pip install --user -U <package>
^ Ensures you are using the desired Python interpreter (can be used with pypy, different versions, etc.), installs in user space (doesn't require admin/sudo), installs the latest version even if you have a older version cached
@flint carbon you should be using a virtualenv
pip install and python care about PYTHONPATH, which is where python packages live. PYTHONPATH involves system-wide directories such as /usr/lib which users should not touch. pip install installs things in directories listed in PYTHONPATH.
When you use a virtualenv, the PYTHONPATH is modified, which causes pip to attempt to install in the virtualenv path when you use pip install
pip install --user tells it to install into the non-system directories within PYTHONPATH
Generally --user isn't what you want when working on a project. You want a virtualenv for each project. This has many many benefits, but lets talk about system coherence. When you use pip install in a system directory, it simply replaces important files from your package manager when it has conflicts, and some systems use an exec script which pip will mangle in the process of installing, and will do even more harm when uninstalling any package.
The pros? Dependency separation. Each venv can contain a different version of a package, and this isn't a problem since they never know about each other. Permissions separation. You no longer have to worry about installing a package for development (editable) because it's contained in a venv. Your system can use the stable version of the library you're working on while you can use the development version when you activate your venv.
When someone reccommends that you sudo pip *anything*, they probably want to hand you a command that they know will "just work" regardless of the side effects. In basically every single case, the thing they're telling you to sudo pip for shoud not be done. This is the domain of your system package manager. You should find the package in your system's package manager (apt/dnf/yum/pacman/portage) instead of doing sudo pip.
^
If you want to create a virtual environment, on Python 3.4+ you can simply do: python3 -m venv ./nameofenv
However, if you're on Ubuntu, Debian, and probably a few other distros, you will need to install venv using sudo apt install python3-venv (replacing apt with your package manager, e.g. zypper, yum, dnf, pacman, etc.)
I like keeping my environments in a single directory under my home directory: mkdir $HOME/.virtualenvs
~/develop/venvs for me
Then: python3 -m venv ~/.virtualenvs/project && source ~/.virtualenvs/bin/activate
If you're using Pycharm or Visual Studio Code, they can be configured to search that directory for environments and allow them to be selected for projects
This also works if you're using custom interpreters (e.g. pypy) or instances of CPython you've built from source
Is there anyone here who can help me add a email server and setup multi domains on my vps?. Currently I'm running it for only 1 website which uses flask. Don't want to make it a mess thats why I'm asking for help before trying every guide on google :D. (Was thinking of doing some docker setup, would that be good? )
In your webserver you should be able to add differences per URL
well it doesn't have a cpanel so I have to configure it myself
What are you using as a web server
I'm using uwsgi for flask app, But I need to add a php site. Maybe i should just convert the site to flask π
I'm looking into setting up docker. That way it would be cleaner π I hate having a mess on my servers
This really isn't the channel for any of these questions :P
You're thinking of #411200618561273856
.. The other dev-ops
@flint carbon There are a few different options for venvs. Python 3.2+ now ships with venv in the stdlib (so it's sort-of defacto), but virtualenv has been around for a long time, is used in many python 2 projects, and just generally has many users. There are tools which build on top of these existing virtual env providers.
My favorite venv tool is pipenv (and its config file Pipfile). It does a few things for me, such as autoactivation* and hiding away the detalis about where the virtualenv is.
- I have my shell set up to look for a
Pipfilewhen I change directories, check if a venv exists, and then activate it. This makes it super easy for me tocd project/dir/token-slingerand have the venv for that project activated automagically.
ey yall, setting up hp printer here, anyone know if it's assumed I add myself to the cups group or nah?
just check...?
That doesn't really have anything to do with Python
So it goes in an off-topic channel
that's unfortunate
yet, still okay
Well, yknow, this is the Python server
linux hp tooling is written in python, so we gotta be good
facepalm.tiff
no one is installing your printer for you because the tools you haven't even tried to use yet are maybe python.
chreist mate, take a chill there
whispers in a soothing ASMR chill "gooooooooooo.... oooooooooooooogle"
How do I make a tilux profile that automatically starts a SSH session?
JohnSmith, might want to check if your printer is affected by that nasty vulnerability reported a while back, if you haven't already done so
two vulnerabilities actually
Linux users, what distro do y'all run?
Fedora arch Debian and Ubuntu (from fav to I don't really want to)
hmhmhm
I kinda want to set up Arch on my laptop to force myself to actually use the OS (Currently runs Ubuntu)
What's you guys' arch setup like window manager and stuff
how's the learning curve on i3? I see it all the time on r/unixporn and it seems neat
Once you just start using it, its great
I used kde plasma for a long time, but then i decided to get a r/unixporn style i3-gaps setup, and I just haven't found a reason to go back to kde

whatd you elave it for
better ux
Joseph made his own from toothpicks, floss and a whole lot of duct tape
ubuntu on my desktop, debian on my server & on work pc
used to have ubuntu on the server but it pissed me off for some reason
and raspbian on my rpi
Windows 10 on my PC, Ubuntu on my server, and libuntu on my laptop and rpi
95% of my time (excluding work) i use my macbook for all sorts of programming though
Fedora 28 on a laptop, Win 10 on most other machines, several Ubuntu 18 VMs, plus a few Kali VMs
Spent a split between Ubuntu VMs and Win
@scarlet hawk late response, but now use bspwm
I kinda wanna install Arch on my laptop but
I'm so useless at Linux
I feel like I don't know enough
Though I guess setting up an entire system is a good learning experience
I can't help but feel like I'm just reading instructions and typing in commands Id on't understand lol
blah
Always remember man, |, >, and Google
also get tldr
whats tldr
Googles
sounds lovely
ooooooo
It's really useful
Hell yeah
npm install tho
not everything is on there, but what is on their is quite useful
loool
oh is it npm
So does that mean Node is a dependency?
Oh btw this is great: https://explainshell.com/
match command-line arguments to their help text
hey what https://i.seph.club/kaw0m.png
And this: https://www.shellcheck.net/
ShellCheck finds bugs in your shell scripts
it is a python script >:(
I use Shellcheck with all my scripts now, you can either apt install it, or compile it from scratch to get the latest
is the tldr server node maybe?
Explain shell is awesome for learning though
@gilded basalt https://github.com/tldr-pages/tldr#clients
it's not node, but it isn't python, it's...
alot
Oh
Damnnnnnnnnnnn
Holy shit that's a lot of distribution methods
And of course, there's a Docker image
There's a Shellcheck extension for VScode too
And JetBrains, but that one is a bit slow and buggy
This is like Get-Help -examples and Get-Help -detailed in PowerShell
does anyone know how to setup dkim , spf with postfix. I can't get my mails to pass the email secyrity check
hmm, so, you should probably just pay someone to do email services for you. Unless you're intending to become a mail server admin professionally (and considering you're asking in python how to set up dkim on postfix, that option is doubtful), the immense amount of effort and ongoing new information learning required to responsibly run a mail server farrrrrr outpaces, in lost value, the option of paying someone to do your mail services for you. (outlook, gmail/gapps, fastmail)
cryptsetup: WARNING: failed to detect canonical device of PARTUUID=1b61bb90-cd16-4b1d-8342-a40dcf3db68e
cryptsetup: WARNING: could not determine root device from /etc/fstab
Is this bad?
Are you using an encrypted filesystem
No
hey here's a dumb frigging question
(this'll show my ignorance on everything hardware)
are some heavier distros rougher on battery life or does the OS on its own have a negligible impact?
Hm, Lubuntu claims to be energy efficient so I suppose it can have some impact
guess I answered my own question bye
Just to confirm - yes, they can have a big impact
@scarlet hawk the "size" of the OS is not going to affect your battery life. The features it does or does not have on or off by default is what will affect your battery life. Whether it loads a bunch of programs by default can affect your battery life. The settings and the things which need to do processing and I/O being "on" is what affects your battery life, not the "size" of your OS.
A fully-featured OS is, in fact, likely to do better for your battery life because a group with the resources to curate an OS also already has the resources to focus on efficiency and battery life compared to an OS group which is small (and perhaps produces a "small for the sake of being small" OS). A small OS does not have to worry at all about energy or battery settings in concert with other programs or settings because it is, by default, doing basically nothing. Installing things on top of it is where the "heavyweight" OS shines in battery life.
It also depends on the battery saving features it utilizes or has available. For example, Fedora only recently started making use of SATA power link management and Bluetooth auto-suspend.
Some other examples are ACPI power states (S0-S5) and Wi-Fi sleep
your computer also has to have linux drivers for the specific management features
Also, CPU usage levels and times can make a big difference. If you're not using much CPU, most modern Intel and AMD CPUs will dynamically reduce the clock speed to conserve power and reduce heat output. If something is regularly triggering the CPU to clock up, then there's going to be a lot of wasted power.
my asus laptop doesn't have nix drivers for the keyboard backlight
Yeah
it recognizes the leds and whatnot, but can't actually turn them on
Windows generally performs better than standard customized Linux distros in battery life, and a lot of that is due to better (or any) driver support
hard to believe, considering how much windows thrashes my disk and uses my cpu
with arch and i3, running sublime, 3 konsole windows, discord and vivaldi in the foreground, my cpu rarely goes over 8, and almost never goes over 15
on windows, it constantly stays at 20% or more
Probably some pre-installed manufacturer bloatware or something you added (like AV software). The most CPU usage on my Windows machines is usually Discord, VSCode, PyCharm, and occasionally Chrome/Firefox
When you said Athlon I instantly thought of Athlon64 π
Well, also, I usually spend some time optimizing my Windows machines after I get them (as with all my daily driver setups)
So disabling services, uninstalling bloat, various setting tweaks, etc.
Yeah
but arch (and linux in general) is just so light
I had a TON of them, ended up e-wasting some of them last year
unless you have ubuntu with unity
Fedora is pretty heavy on battery I found
My old laptop that I used back in college as a notetaker would last ~4-6 hours under Windows 8, and 10 added a hour or two to that.
Fedora would not last that long
discord eats my battery, but if its not running, my laptop can last a good 4-7 hours depending on use
Yeah Discord is often times the most resource intensive thing on my system
Only things that match it are PyCharm and sometimes VSCode
that's why i use sublime π
Sublime nonfree [angry richard stallman]
How does one deploy a cli script that uses virtualenv for dependencies on a Ubuntu server?
I may misunderstand what "deploy" means here, but isn't enough to make a systemd unit service and call the script using the full path to the python executable inside the virtualev?
Not really. It's a cli tool that takes some arguments and processes some files. I'm using click to parse arguments and use a few other libraries to perform various tasks.
import click
@click.command()
@click.option('--count', default=1, help='Number of greetings.')
@click.option('--name', prompt='Your name',
help='The person to greet.')
def hello(count, name):
"""Simple program that greets NAME for a total of COUNT times."""
for x in range(count):
click.echo('Hello %s!' % name)
if __name__ == '__main__':
hello()
$ python hello.py --count=3
Your name: John
Hello John!
Hello John!
Hello John!
So normally, if I didnt have dependencies, I'd add a hashbang #!/usr/bin/python3 and do my thing but using virtualenvs require that mapping to some other python executable instead
Pipenv for example provides pipenv run command to run given command in the virtual environment.
So I can write a bash script mytool.sh to relay the arguments to mytool.py as pipenv run python mytool.py $ARGS
But this gets tedious when you have to maintain a number of tools on a number of servers.
So I looked for solutions, setup.py and writing a setup script seemed interesting.
But I can't seem to get it to work properly. The executable it creates (automatically) does not load dependencies/virtualenv.
let's say that click is your dependency, and if you launch your script without having your activated virtualenv the script fails.
what I was suggesting it that, instead of launching your script with
python hello.py --count=3
you could use
/path/to/virtualenv/bin/python hello.py --count=3 even if you are outside your virtualenv and it isn't live
(source /path/to/env/bin/activate && python script.py)
Would that work
() creates a subshell in bash
(test_discord) sgrc@t420:~$ chmod +x hello.py
(test_discord) sgrc@t420:~$ nano hello.py
(test_discord) sgrc@t420:~$ python3 hello.py --count=3
Your name: sgrc
Hello sgrc!
Hello sgrc!
Hello sgrc!
(test_discord) sgrc@t420:~$ deactivate
sgrc@t420:~$ .python_virtualenvs/test_discord/bin/python3 hello.py --count=3
Your name: test
Hello test!
Hello test!
Hello test!
sgrc@t420:~$
didn't know about the subshell thing. Thanks @vestal turret
But directly using the venv python binary would be better imo
@proper aspen Yes, that certainly works, that's how I run the scripts on Windows, such as:
@echo off
D:\Development\python\pdftools\.venv\Scripts\python.exe D:\Development\python\pdftools\bookmark.py %*
But having to write full path to the script for every script for every machine that I use is tedious. setup.py creates an executable and places it PATH, but when I run ./venv/bin/python3 setup.py install in a virtualenv shell, the executables are created inside the venv folder. Running it with the python installed on the system python3 setup.py install gives me an error.
(pictools)prime@alien ~/s/pictools> python3 setup.py install
running install
running bdist_egg
running egg_info
writing pictools.egg-info/PKG-INFO
writing dependency_links to pictools.egg-info/dependency_links.txt
writing entry points to pictools.egg-info/entry_points.txt
... [cut off] ...
Installed /home/prime/scripts/pictools/.venv/lib/python3.7/site-packages/pictools-0.0.1-py3.7.egg
Processing dependencies for pictools==0.0.1
Searching for click==6.7
Best match: click 6.7
Adding click 6.7 to easy-install.pth file
Using /home/prime/scripts/pictools/.venv/lib/python3.7/site-packages
Searching for Pillow==5.2.0
Best match: Pillow 5.2.0
Adding Pillow 5.2.0 to easy-install.pth file
Using /home/prime/scripts/pictools/.venv/lib/python3.7/site-packages
Finished processing dependencies for pictools==0.0.1
I can run it inside venv just fine
(pictools)prime@alien ~/s/pictools> processimgs
Usage: processimgs [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
Options:
--verbose
--help Show this message and exit.
Commands:
process Process images in folders
rename Rename images in folders
separate Separate images according to criterias
(pictools)prime@alien ~/s/pictools>
but after deactivating venv, you can't call it, because PATH has been changed.
(pictools)prime@alien ~/s/pictools> exit
prime@alien ~/s/pictools> processimgs
processimgs: command not found
prime@alien ~/s/pictools>
My discord bot run on #unix im running a #303906096458891264 bot, however it always seems to crash all my discord bots at the same time. Not sure why
none as im running on screen
so I never see the output @sage solar
I did make it create a discord.log tho, which has nothing in there
okay will do
Or did you do that in order to create discord.log
@sage solar @halcyon beacon hey guys. That log which produced log.txt had nothing inside.
is there any other way to log a discord python3 code.
If your code did any prints or error msgs exceptions whatever it should've been put inside that file
What exactly are you running it on / in?
That is not a good idea usually
usually but same error using the normal way
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6
sudo apt-get install python3-pip```
Hmmmmm
normal way I would do is above
I guess you sshed into it and ran the command?
soft ghost voices in the distance: doooockeeeerrr
And screen should stop the program from quitting once the session is closed
Stop ghosting inver
use docker?
:D
Yeah that's usually a good idea
You could try doing a systemd service maybe
kk never used docker yet need to look into that O.o
Does the server get auto rebooted or something like that regularly?
using screen in this day and age is a big no no imo, systemd or docker are preferrable
What is the age Inver
It shouldn't do, I did consider it however I'm running a Bitcoin node which was still active.
it's the age of containerization and microservice architecture
anyway to check last boot up? lemme google one sec
Webscale β’
no webscale was 4 year ago
Oh
uptime Zumy
What did they use to webscale
who -b
How does one webscale without containers and the database for big ideas
And?
im gonna run again and see if dates change
bot still crashed and server didn't reboot @sage solar @autumn walrus
Using scree.
Try a systemd service
hi @sage solar
root@vps# python3.6 bot.py
<discord.ext.commands.context.Context object at 0x7f106ad66198>
Unclosed client session #this happends 30 mins later today
client_session: <aiohttp.client.ClientSession object at 0x7f106c1865c0>```
that's the whole log output. I just ran normally
at this point you might be better of going to #303906096458891264 #discord-bots as thats the place where the people who are into discordpy hang around
because i really have no idea whats happeniong here
yeah that's what I did waiting for a reply still
alright @oak shell
As I said, I do not use Arch and don't know very well how their package management works and how deeply integrated Python is in a regular installation. Post your complete question here again and somebody who is able to help will see it and respond.
You should not override your system/pacman python with your specially compiled python, but it's fine to compile python and install it
g n u s l a s h l i n u x
I was asked some questions by some one
he asked me how can I use a grep to find an element int he string
normally i would use perl/python
i didnt know :/ felt bad
he also asked how can u pick an entire colum content and print that. I know it could be done in awk one one line but i didnt know either . Felt humiliated

Grep to find element in string is just
echo "string" | grep s
Isn't it?
yes
that shows you all lines containing an "s"
Yes
@halcyon beacon Well, you can still use python. Pipe the input into python script, then in your script just read from standard input with sys.stdin
Anyone who masters sed and awk can do anything on a Unix system :p
man I never use sed and awk, but I think I should look at the awk functionality to get the coloum data extracted
cuz any interviewer can ask it
in perl it takes time to do that
can you guys recommend some important SED and awk functions I should study?
the column thing is simple, to print columns within a string just use $n, e.g. ```sh
$ echo a b c | awk '{print $2;}'
b
Is there a way to run any terminal command through a python script?
there's a couple of options, if you don't care about getting a result back from the command you can do
os.system('run a command')
If you do care about getting the result back you can do use the subprocess module
from subprocess import Popen, PIPE
proc = Popen(['whoami'], shell=False, stdout=PIPE)
out, err = proc.communicate()
print(out.decode())
print(err)
Thanks @autumn walrus and @main olive
And is it possible to do git push <link> without having to put my credentials everytime?
yes, by using ssh instead of http(s), how familiar are you with using ssh for git?
or rather, how familiar are you with ssh in general?
right, then it might get a little tricky, but I would strongly recommend getting familiar with ssh and how to use github with ssh keys
So i have to do this git remote add origin master {the ssg link} git push -u origin master
that's a step in the middle of a longer setup process
Where can i find that "longer process"?
oof good question, I don't have a link handy
no worries, I'll also google real quick and see if I can find something that looks right
github also has this https://help.github.com/articles/connecting-to-github-with-ssh/ it's a whole tutorial from end to end explaining ssh and also how to generate ssh keys and uploading them
the outcome will essentially be using git without having to use username and password as the key will handle all authentication
That's great
stupid q of the day, I am a newbie user of Ubuntu 18.04 and I need Python 2.7 (yes, 2.7, we're stuck with 2.7 at work). how do I get 2.7 and not 3.0?
there are no stupid question (there are some times, but this is not one) I don't have an immediate answer actually, when I ssh into a ubuntu 18 box it defaults to python 2.7.15, and I have to type python3 to use python3. That said, maybe it's as easy as doing python2 --version ?
but that's a total guess
didn't occur to me that it might come bundled, I'll check
I just set up a linux vm on my home computer so that I'm a bit better equipped to install essential stuff on my new work box
nice as a dev box?
probably - we run super duper complex Python software which doesn't run locally on Windows (too many dependencies to fight) but supposedly is much easier to run locally on Linux
so far I β€ the package managers - no more wondering where to get programs from
aha, 18.04 has python 3 bundled, but when I tried python it helpfully told me how to get it β€ β€
yeah ubuntu is pretty accomodating like that :D
may I give some unsolicited advice being completely oblivious to your current setup? - it's usually a dick move but I feel strongly about it
go ahead
I often find myself needing to recreate my development environment, and since you mentioned you've created a vm, I can recommend looking into using vagrant, but you might already be using that?
nope - I'm using virtualbox on a windows 7, zero idea what vagrant is, I'm gonna google π
cool, in short vagrant is an automation framework that can be used alongside virtualbox (and other virtualization tech)
once you've created a little snippet telling vagrant how you want your vm to look you just run the command vagrant up and it downloads the linux image and installs and configures the things you told it to
wow, great
if you then go and fuck the VM up for whatever reason, you just do vagrant destroy and it deletes the vm, and you can start over (without the download process)
I'll be sure to look it up for the next time I'm setting up the vm (hopefully never π as I don't indend to do anything destructive to it)
cool, not to toot my own github repo, but this is what I use for ubuntu 16: https://github.com/inveracity/vagrant
I haven't moved on to 18 yet because I'm lazy
the real benefit is the shared folder, so you can code on your own computer and it'll automatically sync that into the VM for execution
@autumn walrus your subprocess module can be shrunk a bit
do tell, as I imagine it's not by putting it in cold water?
"module" i meant snippet lol
if you set stdout or stderr to a PIPE object, you can just do proc.stdout or proc.stderr to get the output (it may be bytes or str)
check_output might also help shrink it https://docs.python.org/3/library/subprocess.html#subprocess.check_output
ah yes! good tips
kill me
I want xorg to work
I never have this issue on fresh ubuntu rolls
ITS WORKING
nvidia lts drivers
NOT
jsut nvidia
ah its broken again
I fixed it π
nvidia lts drivers somehow
bricked my boot
My ETI partition didn't have any more space on it at the time I installed the nvidia drivers
but
when i reinstalled them having freed up by deliting some of the "emergency images"
which i really dont need
everything worked fine
nvidia drivers want EFI partition space?
well it explains why it worked after reinstalling them and cleaning up EFI partition space π
What actually happened
I have no idea
it couldn't mount my EFI partition for some reason after installing then i cleaned up and reinstalled
That's why it was the last place I looked when I was having boot issues
but its all done now
There were a few bugs with EFI and nvidia interaction
reported across the web
Can I remove the boot partition from my fstab now I'm done with it? Or does Grub talk to Arch to run the EFI bootloader
I feel its kinda doubley insecure to have boot mounted all the time
I'd rather decouple it from my system
Good ole NVIDIA drivers lol
^havenβt been on in a bit. Just saw the above convo.
Hey thought I'd ask it here
since its Python related and on xUbuntu
I believe I have 2.7 on my XFCE4 Ubuntu
How can I change it to 3.7
so that I can use Python3.7 on PyCharm
apt-get install python3?
I had the opposite problem, 3 came out of the box when I needed 2
my own question, what's a good python ide for linux? on Windows I have PyCharm, but it's overkill - basically I do most stuff over ssh with vim, but I need something else for the local copy of the code - I absolutely need a folder overview AND search in files/folder function, integrated debugger is nice but not essential
@oblique kernel
Atom
SublimText
Or minimalistic Geany/VimGui/Xed
vscode
I haven't noticed any annoying pop ups
What popups?
@vestal turret $ sudo apt-get install zlib1g-dev Password: sudo: apt-get: command not found is there any problem?
What OS do you use?
Mac
ah i misread that
Well Mac has no apt package manager. That is a thing of Debian-based distros, like Ubuntu
I think Mac has brew or something like that? Dunno, never used one
I am using mac os mojave
homebrew, but that's not installed by default
That did not work either
@outer reef No . I am just trying to install python and set up an enviroment for me to write codes
Then I suggest using the link I just posted
Thank you. After installing how do I start ?
Have you ever worked with Python before? Just learning?
Then I'd suggest looking at http://www.automatetheboringstuff.com and snagging https://codewith.mu/en/download
I am sorry but I appreciate your time
The first link is to a book that we often suggest to people just learning, and the second is an editor that we suggest for the same reason
Is this what I am supposed to see?
Yeppers
Got it thank you so much @outer reef
Any time
@oblique kernel how would I get rid of P2 when I install P3 tho
you dont want to get rid of python2
lots of stuff under several major linux distros wants python2
rule of thumb: never remove a Python version that came preinstalled with your system.
or change python from 2 to 3 or vice versa
not all scripts may have been nice enough to specify the version they require
yep, don't mess with system binaries
bash aliases are fine though (except that they will confuse you if they shadow different commands)
It's better than the other 2 (talking about gnome and KDE), it's still quite slow
gnome is terrible let's just keep it civil and call it MATE π . but where is your point of comparison or perspective? yeah the other big ones suck, i agree
I use i3 and sway (for Wayland)
i like i3 but to compare something like XFCE or KDE to i3 or hell fuckin' emacs is just disingenuous and you know that
but they don't m8. it's like comparing C to Python bluntly.
@vestal turret I just want to use Py3.7 on PyCharm so I can continue my projects
i mean just have some perspective lol
I use Py3.7 on Windows so I am trying to keep persistence in that regard
I cant re-write an old project to be 2.7 compatible
Mainly cause I donβt have the time
Except that XFCE doesn't offer "high level stuff" that i3 doesn't. I3 also supports the mouse, has a contextual menu from which to launch applications, notifications, etc.
....and at the end computers are just adding and storing numbers amirite. all the same
i like i3 a lot too
but lol cmon
i3 can be compared to...other tiling managers
why do you think i3 is within the demographic it lives in
Because it's not shipped as default in many distros
That's why I don't know Unity, as I dislike Ubuntu
well i can agree with that one
Building dependency tree
Reading state information... Done
python3 is already the newest version (3.6.5-3ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
wot
why isnt it 3.7
apparently sudo apt install python3 is useless as Python 3.6.5 exists
but that aint 3.7
3.6.5 is the newst version in the repo's of ubuntu
bascially everything new 3.7 brought to python?
I really like Gnome
I just like how there's a UI to do everything
Like I agree that the other options are good if you sit down and learn how to configure them in great detail
but I just... don't have that time
Or at least I don't want to spend my weekend tuning i3
What I like about gnome is the tweek tool makes everything really easy and I get a pretty windows / mac like experience and everything has really well defined hotkeys out the box and everything just works. I'm not having to install clipboard managers just to print screen something .etc.
I get that there's a lot of bloatware that comes with Gnome that really isn't preferable but at the same time, it's not nearly as bad as Windows or costs a Mac and I'm willing to take that trade
and come on now it's not slow by any means on modern hardware
@snow terrace agreed, gnome is mature, modern and well-rounded
there's a reason why Canonical has switched back to it
If all you want to do is have a UI that's highly customisable in an easy to use fashion and looks and functions well
gnome is the usability king
Like MATE and XFCE just don't even come close to how nice it is to use and the volume of hotkey integration that feels natural that comes out the box.
I've never spoken to anyone who liked XFCE and Mate more unless they (a) hadn't tried Gnome or (b) used massively customised window managers. And I think it's so-called bloatware REALLY ISNT THAT BAD and hugely exaggerated.
kde best tho
Hi
Bear with me on mobile
I have a python script that needs to run on a cron job as a regular user called webadmin. Webadmin is in Apache group, because script writes to a data file that php opens up and displays on the page. Currently the code is in /home/deploy/code in script but hereβs my q for now. Does the code need to be in webadmin home directory in order to be run by webadmin on cron?
I have a few more thoughts but thatβs a start..
I think that I need to create a new pyenv and virtualenv in webadmin directory because the venv using now is actually from a django install
yep, i ended up realizing i dont need to use webadmin right now and used deploy instead and chown'd the folder to deploy:apache and it worked fine
Anyone able to help me out with pyinstaller? https://github.com/Sebhol95/50-Unique-Calculators/issues/2
So i have downloaded pyinstaller: Collecting pyinstaller Using cached https://www.piwheels.org/simple/pyinstaller/PyInstaller-3.4-py2.py3-none-any.whl Collecting pefile>=2017.8.1 (from pyinstall...
@kind latch you really don't need to spam in every single channel..
having issues in PyCharm in Xubuntu
(Don't mind my project name, I am using an old folder to examine the code of Fsociety)
Its subject to change
This is what happens when I try to generate a Python 3.6 venv
I did do sudo apt install python-pipin my terminal
then restarted PyCharm
install distutils
How can I go about setting up a media centre on my old Dell Optiplex 380?
@heavy warren what kinda of media center?
I say go simple. Minimal linux distro, simple desktop environment + VLC
that'll play literally anything.
a good 4K player would require a decent cpu though
ok, what's a good minimal linux distro? I've tried puppy and lubbuntu but both of them are eh
I haven't tried it yet, but maybe Kubuntu?
I'm going to try the blank lubuntu installation (so there's no programmes on it aside from termial)
(and internet browser ofc)
For a good minimal distro, Arch all the way
It's a killer distro, honestly. You can make it whatever you want/need, it's a heaven for people who like to customize their system
Their wiki explains everything
I'm not joking, my mother installed ArchLinux
If you want to try π
Manjaro is also nice and a bit easier to install. But well, as you want a minimal installation, for me distros like Gentoo/LFS and Arch will always be better, because they don't "impose" you any software, you just have the bare minimum to survive after the installation, then you install whatever you want
And arch has official repositories + user repositories, which means that you'll probably find every software you want
"Upon installation, only a command-line environment is provided" wait what
Isn't that what you asked for ?
After installation, you only have a shell from where you can install anything you want, using pacman (the equivalent of apt)
If that's not what you asked for, then I don't understand your definition of a minimal distribution @heavy warren
PSA: if you're creating a bootable OS image (e.g. installing Linux, live CD), use Etcher: https://etcher.io/
Flash OS images to SD cards & USB drives, safely and easily.
Does pip come installed with a fresh raspberry pi I solved le issue
Yes
How in bash I can create a script that loop in a file with IPs ssh them each of them and run different command in each?
Something like that;
cat hosts | while read -r $line
do
for i in some_commands
do
ssh root@$line echo $i
done
done
The problem is, for each host i'm running X times and not a single time the command
how can I share the index between the loops ?
Did you check clusterssh ? It might do what you need
kinda looking for a solution without the need to install stuff
anyway, to share an index between loops, you could use a global variable, as ugly as it is
Declare a variable on top of your script and assign it to 0, in your for loop, update the value of this variable with the index, and then you can use it in your other loop
ugly, but it should work
it can be ugly - I will try thanks!
This might be of use as well: https://unix.stackexchange.com/questions/44757/ssh-input-from-text-file
@safe sluice
In bash, define your own function.
In python, use paramiko
I am trying aws, ubuntu 16.04
The problem is that when i disconnect from the terminal my script stops working!
Is there a way i can make it so that it runs even if i am not actually connected to the server
I was thinking of crontab but i am afraid that it will run the same command again while the script is already running, messing up everything
screen, tmux, or pm2
Do you have links to them @uneven silo?
man
u building from source?
@uneven silo yes ofc, there's no *-bin (precompiled) pkg yet
Doesn't using binary packages kinda defeat the point t of Gentoo?
there isnt really a precompiled linux package available from python.org
@uneven silo yeah but you wanna tweak it however you want, why would it be π
I didn't mention it, you did man
not downloading it from python.org, but from portage
why lol
i mean yes, but..
your question is like, why do people install python via apt π
no
oh
oh it's global lmao
or local
via /etc/portage/package.use/python
and applies to that package strictly
but what about configure?
didn't try that way, but that was the old way
you can still do it that way
but no one does that anymore
uh
./configure [options] is how you setup python. Do you not compile with optimizations or anything?
I do
how then
I don't use ./configure , as I said
I check the package from portage and see the available flags
if it's optimized for my CPU et. al. then I add them to my USE
wut
you ever used Gentoo ?
no lol
ok
so in Gentoo you can tweak w/e you said with ./configure via the USE env var from your /etc/portage/make.conf
ie. add USE="vaapi amd64 X alsa"
and when you install the pkg emerge --ask dev-lang/python3-7 it compiles with those flags
you get it now?
i guess it works if configure only changes flags
Hello Guys, I want to install latest version of python3 on my CentOs 7 and i am confused on which guide to follow, some have 20 steps, others are a simple line yum install python3 , can you shed some light on how to do that?
do you want to build it from source or not?
I do not know the answer to that question as i do not know wwhat that would do for me.
I need to google what that is
CentOS does not have python3 in its repositories per default so you will either have to add a repository by doing
sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm
sudo yum update
sudo yum install -y python36u python36u-libs python36u-devel python36u-pip
That would install a binary version
If you have special reasons to build from source (which you apparently dont)
sudo yum groupinstall -y "Development Tools"
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
tar -xJf Python-3.6.4.tar.xz
cd Python-3.6.4
./configure # optional parameters go here
make
make install
Are you using CentOS as a desktop distro or why are you asking this question?
you can get customized optimizations when building from source
ok, in my case I dont.
python36u
Isnt the latest version of python 3,7?
Ok, thank you
idk why they say that, unless you are using asyncio, you likely won't have an issue
@uneven silo @sage solar
sudo yum groupinstall development```
Is this neccessary/good practice to do before `yum install -y https://centos7.iuscommunity.org/ius-release.rpm` ?
what you are doing would be necessary for building from source
just use
sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm
sudo yum update
sudo yum install -y python36u python36u-libs python36u-devel python36u-pip
as i showed befor
ok
i dont use centos
it seems like psutil.sensors_battery() is returning None on my laptop with arch linux (btw) on it, yet i have a battery in there and the acpi command works just fine. i can access the battery information in /sys/class/power_supply/C23B/..., so why doesn't psutil do that?
i imagine it's just not supported by psutil.
@shy grotto apparently psutil relies on sysctlbyname for battery stuff
namely
int percent;
int minsleft;
int power_plugged;
size_t size = sizeof(percent);
if (sysctlbyname("hw.acpi.battery.life", &percent, &size, NULL, 0))
goto error;
if (sysctlbyname("hw.acpi.battery.time", &minsleft, &size, NULL, 0))
goto error;
if (sysctlbyname("hw.acpi.acline", &power_plugged, &size, NULL, 0))
goto error;
return Py_BuildValue("iii", percent, minsleft, power_plugged);
I'd suggest doing all of the three sysctl calls and check what they return to find out where the error actually is and then do further investigation on that
oh okay sure
has anyone here installed postfix and tried to pipe the mail?
Already done that yeah
Though I just remember following a tutorial and that's pretty much it
@karmic vessel Where in the pipeline do you want to insert the pipe? And how do you want to connect to it? You can either add <<| command>> to aliases, or set it up in master.cf
@main olive I donβt honestly know. But I want it to work lol so either way possible I want to try
How do I set it up in master.cf
i'm trying to manually upgrade Pip on Ubuntu, i get this error
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Python 3.7
on mac i know i need to run Install Certificates.command but idk where that is on Ubuntu
edit: fixed this, anybody who has the same question check this https://stackoverflow.com/questions/41328451/ssl-module-in-python-is-not-available-when-installing-package-with-pip3
(ping me pls!)
@karmic vessel Start at step 3 (And substitue the command invocation as needed) https://www.howtoforge.com/how-to-install-and-configure-mailman-with-postfix-on-debian-squeeze
How To Install And Configure Mailman (With Postfix) On Debian Squeeze
Mailman
is an open-source mailing list manager, i.e., it can be used to man...
@main olive do you mind if i pm you m8?
@vivid vault u dont need to install certificates, because that only helps when the certificate isn't recognized. Did you read the error?
i figured it out, i edited the message with the solution i used
I did a fresh fedora install on my desktop yesterday and started my PC today but interestingly ctrl c ctrl v isn't working anymore
I did some research on gpaste and other clipboard managers and it appears that it takes the stuff I tell it to copy but just doesn't paste it
Ideas?
another fresh install
did you reload the files after modifying them?
i did not modify files
so in google chrome i can now do
select text
copy
paste (pastes text)
paste (doesnt paste text)
in discord its just straight up not working
i tried on both
well as i said it works partially
so I assume its either a bug, error during installation, error during update or an error in config
Is the "source" of your copy/paste still open when you paste ?
Anyways it seems that it's still an open issue on the Fedora bug tracker
I guess the Fedora team will say it's because of Wayland and likewise
so my bet is that it won't be solved before long
as i already explained
i tried under wayland AND Xorg
to be precise
Gnome Wayland
Gnome Xorg
Gnome Classic
LXDE
Under Xorg, that's another problem, as no issue seem to be open on this
yes I am looking at bugzilla myself already
well have looked until i gave up for today 30 minutes ago
i mean i got my perfectly working laptop with fedora here
checked all the config files i could find about it
they fkin match
are you copy/pasting with keyboard, or with the mouse ?
both π¦
On fedora and other red hat-based systems there can be a problem where your window manager is using a different clipboard to x
i mean i could paste like once in chrome
Try using shift+insert for pasting
like i copy
then paste (works)
then paste again (doesnt work)
lemme fire up my machine again......
nope @tawny sky
grrreat
sooooo
lets see if i can make a fedora installer accept my home partition as home......
no because it has to use a LVM ofc
n i c e
you are reusing an old home folder?
no its a fresh fedora install
but i just thought about reinstalling
no its a fresh fedora install
Guys how do I run a python script from cron when I need to change to a virtualenv with workon
doesn't work
funny enough if I try it on console only with python I can import my library
if I put the script it doesn't import
Run a bash script that activates the env and runs the code
Do you log the errors? say "/path/to/venv/bin/python /home/......./file.py > /tmp/cronlog.txt 2>&1"? or do the bash script thing from @vestal turret
any commands to get my static IP address?
I'm on linux ubuntu and tried to run pip to install something, and it creashed with segmentation fault. attempting to see the crash report crashed the crash reporter, what do?
Can you paste the full output you got?
https://pastebin.com/v7YYJJ6Z the packages I'm installing are a little niche...
the actual crash report is crashing on open, so I can't copy it
I think it's a problem with one of the libraries
so I'm stuck trial and erroring? :/
Or uninstalling and reinstalling the libraries
Hey dudes, here with a question about some code I'm trying to write:
# Get Users
import subprocess
details = subprocess.check_output(['cat','/etc/passwd']).decode('ascii').strip().split('\n')
user_details = [[category for category in container.split(':')] for container in details]
users = [x[0] for x in user_details]
With list comprehension, is there a way I could combine the user_details and users into a single instance of list comprehension, or is LC limited to two sets of brackets? I'm still relatively new to Python, and I've been trying to wrap my head around this specific task for a bit.
Arguably, this could be accomplished in a much quicker way with cat /etc/passwd | awk -F ":" {'print $1'} , but the point of this project is to use Python as much as I can.
You could nest a generator comprehension in a list comprehension
Also, why are you using cat when you could just open the file directly?
Unless of course this is through a reverse shell π
sorry, i fixed the problem and deleted the message but i forgot i sent more than one
@gilded basalt damn, good point man. Thanks
Is it a reverse shell?
@cerulean pagoda What're you trying to accomplish?
hmm... which user did you removeed ?
ls -la /lib/systemd/system/stop-bootlogd.service
My Django project on AWS EC2 cause 500 error on /registration endpoint,
Email sending cause this I think.
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
SITE_ID = 1
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = env('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD')
EMAIL_PORT = 587
EMAIL_USE_TLS = True
If I change this django.core.mail.backends.smtp.EmailBackend into django.core.mail.backends.console.EmailBackend
I see result on console and don't get error
users receive activation link when register on my site.
Why email smtp email sending is causing 500 error? anyone has opinion?
os is Ubuntu16.04
If linux was as popular as windows is, I can't see why you would ever want to use windows
@vapid depot driver support would be great
yup
thats the reason i said if its more populAR
that way people cant say about lack of drivers π
anyway, they have came far in the last 2 years and with steamplay it will hopefully get more drivers
Ye
Hello guys. i am struggling with setting up a selenium on my CentOs 7 CLI 64 bit VPS (no desktop). I cant find an up-to-date, clear guide that shows what i need to do. From what I understand so far I need to install a 'fake' screen solution in order for any browser to run at all (even phantom js) . Then i need to install the browser and its webdriver ? Once all that is done all browser will automatically run trough the fake screen when I launch them trough python and what fake screen solution should I use ? Can anyone shed some light on this please ?
You dont need a "fake screen". You just need a headless webdriver
so simply installing the browser (chrome for example) and its webdriver and runnign in headless doesnt require something like Xvfb ?
I got it sorted out in the end with some help fortunetly, on the bad side Its lieka tribal wisdome, I have no idea how i did it...
CentOs 7 64 bit CLI + selenium
basic webscraping
but a site uses lots fo javascript
I coudltn set up the chrome + its webdriver
I installed a bunch of stuff, made an absolute clusterfuck and got lucky that it worked...
Thx for the replay anyway π
I wanted to but I couldnt find any proper guide lines, every guide is 2 years old and out of date, and made for a desktop environment
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--no-sandbox")```If I dont use these options, it crashes
Browsers run websites in a sandbox for a reason
@broken canopy Try #web-development
and please post the exact error you get
saying that you got a 500 error wont help much :P
brought a ubuntu sticker to cover up acer on back of my laptop (75cmm) and a little powerd by linux
I'm using Paramiko to execute "wget -O linuxgsm.sh https://linuxgsm.sh/" but it just saves a empty linuxgsm.sh while if I execute the command via putty it works. What could be wrong?
Anyone who can help me with this?
Next question:
root@ubuntu:~# clear
terminals database is inaccessible
I have installed powershell from Ubuntu's shop and now I can't clear my screen
I have no idea what is wrong. I don't see any powershell lines in ~/.bashrc
PS. removing powershell didn't help
I think this means you have no terminfo files
There should be files in /etc/terminfo, /lib/terminfo, and/or /usr/share/terminfo
on a real Ubuntu system stuff would be in the lib folder by default
Check if those directories contain files
@main olive if stuff is missing, try reinstalling ncurses-base: sudo apt install --reinstall ncurses-base
inside /etc/terminfo i have README file /lib/terminfo contains folders and files inside them /usr/share/terminfo is empty and following command did not solve the problem
maybe powershell overwrited something?
oh, now I have removed powershell, it doesn't work stil as normal user, but I is working as root sudo clear
tput: unknown terminal "xterm-256color"
Check the output of ls -l /lib/terminfo/x/xterm-256color
it is there
you mean something wrong with rights?
-rw-r--r-- 1 root root 3525 maj 23 10:08 /lib/terminfo/x/xterm-256color
that looks correct
did you turn it off and on again already?
Maybe there's just something wrong with the current session, which fixes itself if you log out and back in
will check
or possibly even open a new terminal at least already
π
nope
okay, it works now, i have no idea it stopped working after installing powershell
it was a problem caused by conda
conda install -c r ncurses
and $TERM was good: xterm-256color
@oak shell thanks so π
nice, okay π
Anyone know how to fix the arrow keys not working in Ubuntu 16, when inside the Python3 interpreter?
>>> ^[[A^[[A^[[A^[[A^[[D^[[C^[[D^[[A^[[D
instead of last line or moving cursor.
Did you see this? Seems like they're dealing with Python 2, but the problem may be similar. https://stackoverflow.com/questions/893053/seeing-escape-characters-when-pressing-the-arrow-keys-in-python-shell
So, pip install readline should do it
Had more issues than just that. Instgalled 3.7 and its all better π Cheers.
any1 know why I would get this error using pyautogui on ubuntu?
maim, my screenshot app of choice, is installed.
NotImplementedError: "scrot" must be installed to use screenshot functions in Linux. Run: sudo apt-get install scrot
the python code that causes that error is this
top_right_slot_empty = pyautogui.locateCenterOnScreen('images/top-right-slot-empty.png', grayscale=True)
I tried to but don't understand why maim isn't used
when pyautogui supports maim https://github.com/asweigart/pyautogui/blob/master/pyautogui/screenshotUtil.py
running which maim on my machine returns output /usr/bin/maim so i shouldn't need scrot
hmm, I see
looking at the code, https://github.com/asweigart/pyautogui/blob/master/pyautogui/screenshotUtil.py#L153 is weirdly indented
so unless maim depends on scrot somehow, I would consider this a bug
However, I don't know about either tool, nor pyautogui
You should probably write a bug report as GitHub issue
I see, thank you!
Oh man
I wonder how many problems have been caused by Python2 and Python3 both being aliases python
Like my VSC keeps trying to pip install things with python2 and then lint using python3 ,
you can specify the version
That's probably why PEP 394 exists https://www.python.org/dev/peps/pep-0394/
just had a weird behaviour with bsd-mailx
only from cron tasks though π€
something akin to mail -s "[ABC] Somesubject" root will work fine from the term
but the moment it's triggered as a cron it removes the square brackets
I assumed it was evaluation or w/e
but when escaped it produces an email with the subject "\[ABC] Some Subject"
idk, just seems odd that it's only from cron tasks
Β―_(γ)_/Β―
@zinc bobcat if only everyone was disciplined :(
Is there a way to register some sort of callback when a executable is run or process with a particular name is created on Linux?
E.g inotify but for processes
Ideally what I'd like to do is register a callback for when a process is created and another for when it dies
@gilded basalt what is the expected run time for the process? Long enough that polling for the start is possible? Monitoring a running process and doing something when it dies is rather easy, IIRC, but you'll have to get to know the PID at some point...
Since you cannot use inotify on /proc, I think you'd have to do some kernel dev π Or a daemon, which would be the simplest
Or net link + proc connector, you can Google that
Seems like you can retrieve events about process creation, exit, etc
Thanks guys
Expected runtime is not possible to know
Polling the processes regularly is my current thinking, however that's less than ideal. It takes more resources (process will wake regularly) and there would be a lag before I'm able to display the process is alive and start pulling data.
how do I go about installing python 3.7.1?
on ubuntu? Right now I use python3.7 by running sudo apt-get install python3.7
when I do apt-cache search python3.7, only packages about 3.7 show up. when I use apt-cache search python3.7.1, nothing shows up. i did python -V to verify that I am indeed running 3.7 atm
is it just too soon for it to be available in the ubuntu/debian repos?
They favor stability
ah π well thanks for the heads up.
@gilded basalt Well, what do you know about the processes you are looking for?