#unix

1 messages Β· Page 18 of 1

uneven arrow
#

I thought that was what you meant

glacial quest
#

big move = more speed

#

yeah i hate it

uneven arrow
#

Ah

glacial quest
#

i prefer a fixed speed

uneven arrow
#

I thought it was usually tunable

glacial quest
#

especially since i play osu with my mouse, sensitivity is paramount

glacial quest
#

easiest to tune on windows (personal choice, not factual)

uneven arrow
#

I'm a long time unix nerd. Windows drives me insane.

glacial quest
#

gives you a whole new look into OSes

#

my first laptop had Ubuntu, I was 5 too

uneven arrow
#

started young I see

glacial quest
#

of course

#

but i was a kid

#

i wanted games

uneven arrow
#

yeah, windows have long had the main share there

glacial quest
#

so when i grew a noggin i moved to windows, then im back on linux

glacial quest
uneven arrow
#

kind of glad flash is long gone

glacial quest
subtle quail
#

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.

fickle granite
#

I worked in the NT group when they were developing it; I occasionally saw Dave Cutler in the halls. Scary guy.

rotund girder
nimble notch
uneven arrow
#

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.

fickle granite
#

Also: cameron's advice about WSL sounds right. I've never used it myself, but I hear it works well.

uneven arrow
# nimble notch How do I stick myself to unix for longer duration...I find windows better when i...

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 ^^

inland peak
#

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

fickle granite
#

Try Dart and Flutter. Probably very different from flash, but pretty slick

modern sail
quaint tulip
nimble notch
quaint tulip
#

This is the most exciting thing I did with schemdraw, which I admit is not terribly exciting

dusky hawk
#

Hi people, what are some good resources to learn about WSL or Linux in general?

wise forge
wise forge
dusky hawk
#

my zoomer brain is a bit too adhd for books tbh

wise forge
dusky hawk
wise forge
dusky hawk
wise forge
dusky hawk
quaint tulip
ocean anvil
#

I need a good friend

dusky hawk
#

is wsl just as good as native linux or are there any caveats I should be aware of ?

broken forum
#

so there are integration and performance cost

dusky hawk
vital bay
prime magnet
cobalt haven
#

Can anyone tell me how can i use windows .exe in my linux?

vital bay
wise forge
wise forge
# dusky hawk is wsl just as good as native linux or are there any caveats I should be aware o...

No. Wsl is not as good as native Linux. Besides performance overhead from having Windows in background:

  1. 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

  2. Also weird port forwarding issues to see web stuff from wsl in your browser

  3. 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

  4. expect possible issues with Filesystem differences. It is always issue when distributing cross OS stuff

drifting coyote
#

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.

dusky hawk
#

should I use uv with system unit

trail sapphire
surreal scarab
#

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.

fickle granite
#

what do you expect the other shoe to be? It sounds like a good idea to me

uneven arrow
#

The other shoe maybe being every package needing that degree of control? Or does ubuntu provide that work?

surreal scarab
#

At least by default.

surreal scarab
#

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?

uneven arrow
trail sapphire
trail sapphire
#

reproducible builds is a good thing in my book at least

trail sapphire
#

it's just another security measure in addition to signing the packages

oblique mulch
#

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

shy yokeBOT
#

6. Do not post unapproved advertising.

spark mulch
#

!kick 1504280833672872087 we are not a job board

shy yokeBOT
#

:incoming_envelope: :ok_hand: applied kick to @analog pewter.

dusty furnace
#

locate is a magnificent thing, guys

prime thorn
#

Indeed

dusty furnace
#

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

vestal turret
#

I've had a server fill up with SQL logs before

#

Though that was only 20gb

quaint mirage
#

oh dope i just saw this

oak shell
#

GWcmeisterPeepoLove this channel

scarlet hawk
#

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)

oak shell
#

🀦

uneven silo
#

what did you expect tbh

tepid scaffold
#

btw why isnt there a linux and mac channel?

vestal turret
main olive
oak shell
#

Linux and mac are kinda unix-oid systems

vestal turret
#

macos is posix certified iirc

uneven silo
#

mac os kernel is a Mach hybrid

#

the name even says "X is not Unix"

dusty furnace
#

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.

main olive
#

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)

dusty furnace
#

shawn just posted copypasta

#

he's not, like, a GNU expert. it's just a meme :D

main olive
#

oh πŸ˜ƒ

scarlet hawk
#

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

inner bridge
#

Nerd

main olive
oak shell
#

@inner bridge YOU

#

damn, Discord is so small...

inner bridge
#

@oak shell I've been here for ages

oak shell
#

*3 months

inner bridge
#

@oak shell I left

#

Then I came back

main olive
#

this is MY channel, hell yeah

oak shell
flint carbon
#

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

vestal turret
#

you shouldnt run pip under sudo

flint carbon
#

error: could not create '/usr/lib/python2.7/dist-packages/httplib2': Permission denied

#

thats what happens without sudo

vestal turret
#

why are you using sudo?

flint carbon
#

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

vestal turret
#

yeah,you should run as few things as possible with sudo

flint carbon
#

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

vestal turret
#

for some things it is required

zinc bobcat
gilded basalt
#

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

royal marlin
#

@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.

gilded basalt
#

^

#

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

vestal turret
#

~/develop/venvs for me

gilded basalt
#

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

hazy bobcat
#

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? )

vestal turret
#

In your webserver you should be able to add differences per URL

hazy bobcat
#

well it doesn't have a cpanel so I have to configure it myself

vestal turret
#

What are you using as a web server

hazy bobcat
#

I'm using uwsgi for flask app, But I need to add a php site. Maybe i should just convert the site to flask πŸ˜„

vestal turret
hazy bobcat
#

I'm looking into setting up docker. That way it would be cleaner πŸ˜„ I hate having a mess on my servers

tawny sky
#

This really isn't the channel for any of these questions :P

#

.. The other dev-ops

hazy bobcat
#

oh I though since it is a linux server this was the right channel

#

sry

royal marlin
#

@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 Pipfile when I change directories, check if a venv exists, and then activate it. This makes it super easy for me to cd project/dir/token-slinger and have the venv for that project activated automagically.
soft isle
#

ey yall, setting up hp printer here, anyone know if it's assumed I add myself to the cups group or nah?

royal marlin
#

just check...?

tawny sky
#

That doesn't really have anything to do with Python

#

So it goes in an off-topic channel

soft isle
#

that's unfortunate

royal marlin
#

yet, still okay

tawny sky
#

Well, yknow, this is the Python server

soft isle
#

linux hp tooling is written in python, so we gotta be good

royal marlin
#

facepalm.tiff

#

no one is installing your printer for you because the tools you haven't even tried to use yet are maybe python.

soft isle
#

chreist mate, take a chill there

royal marlin
#

whispers in a soothing ASMR chill "gooooooooooo.... oooooooooooooogle"

gritty stirrup
#

How do I make a tilux profile that automatically starts a SSH session?

main olive
#

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

scarlet hawk
#

Linux users, what distro do y'all run?

sage solar
#

Fedora arch Debian and Ubuntu (from fav to I don't really want to)

main olive
#

Arch and Debian

#

Arch on client, Debian on server

scarlet hawk
#

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

main olive
#

i3 : )

#

i3 on all my desktops actually, Debian or Arch

scarlet hawk
#

how's the learning curve on i3? I see it all the time on r/unixporn and it seems neat

uneven silo
#

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

vestal turret
#

Arch and antergos

#

Just a KDE setup

#

KDE connect is awesome

main olive
#

i3 takes about 1 hour to get used to

#

then you won't go back

#

: )

vestal turret
steel kraken
#

Antergos and xfce

#

Tiling don't look good on my small screen

scarlet hawk
#

mmm

#

how big

rustic sky
#

i left i3

#

no regrets

scarlet hawk
#

whatd you elave it for

vestal turret
#

better ux

scarlet hawk
#

i mean

#

what do you use

deft raft
#

Joseph made his own from toothpicks, floss and a whole lot of duct tape

vagrant fern
#

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

gritty stirrup
#

Windows 10 on my PC, Ubuntu on my server, and libuntu on my laptop and rpi

vagrant fern
#

95% of my time (excluding work) i use my macbook for all sorts of programming though

gilded basalt
#

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

uneven silo
#

The UX on i3 is totally up to you

#

if its bad, that's your fault tbh

rustic sky
#

@scarlet hawk late response, but now use bspwm

scarlet hawk
#

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

gilded basalt
#

Always remember man, |, >, and Google

rustic sky
#

also get tldr

scarlet hawk
#

whats tldr

gilded basalt
#

Googles

scarlet hawk
#

sounds lovely

rustic sky
gilded basalt
scarlet hawk
#

ooooooo

rustic sky
#

It's really useful

scarlet hawk
#

Hell yeah

gilded basalt
#

npm install tho

rustic sky
#

not everything is on there, but what is on their is quite useful

scarlet hawk
#

loool

rustic sky
#

oh is it npm

scarlet hawk
#

let's fork it

#

: )

gilded basalt
#

So does that mean Node is a dependency?

rustic sky
gilded basalt
rustic sky
#

it is a python script >:(

gilded basalt
#

I use Shellcheck with all my scripts now, you can either apt install it, or compile it from scratch to get the latest

rustic sky
#

is the tldr server node maybe?

gilded basalt
#

Explain shell is awesome for learning though

rustic sky
#

it's not node, but it isn't python, it's...

#

alot

gilded basalt
#

Oh

#

Damnnnnnnnnnnn

#

Holy shit that's a lot of distribution methods

#

And of course, there's a Docker image

rustic sky
#

lmao

#

webscale man pages

gilded basalt
#

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

hazy bobcat
#

does anyone know how to setup dkim , spf with postfix. I can't get my mails to pass the email secyrity check

royal marlin
#

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)

gritty stirrup
#
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?

light haven
#

Are you using an encrypted filesystem

gritty stirrup
#

No

scarlet hawk
#

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

balmy arch
#

Just to confirm - yes, they can have a big impact

royal marlin
#

@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.

gilded basalt
#

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

uneven silo
#

your computer also has to have linux drivers for the specific management features

gilded basalt
#

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.

uneven silo
#

my asus laptop doesn't have nix drivers for the keyboard backlight

gilded basalt
#

Yeah

uneven silo
#

it recognizes the leds and whatnot, but can't actually turn them on

gilded basalt
#

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

uneven silo
#

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

gilded basalt
#

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

uneven silo
#

uh

#

i built my pc

#

tbf, its an athlon chip, but a good one

gilded basalt
#

Athlon..

#

Those are still around?

#

Huh

uneven silo
#

one of the new ones

#

760K

#

Quad core 4GHz

gilded basalt
#

When you said Athlon I instantly thought of Athlon64 πŸ˜›

uneven silo
#

not one of the old mostly-pcb athlons lmao

#

no

#

nonononono

gilded basalt
#

IIRC my first PC was a overclocked AMD K6

#

Ah ok

uneven silo
#

k6

#

wew lad

gilded basalt
#

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.

uneven silo
#

K6 was a good ol chip

#

me too

gilded basalt
#

Yeah

uneven silo
#

but arch (and linux in general) is just so light

gilded basalt
#

I had a TON of them, ended up e-wasting some of them last year

uneven silo
#

unless you have ubuntu with unity

gilded basalt
#

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

uneven silo
#

discord eats my battery, but if its not running, my laptop can last a good 4-7 hours depending on use

gilded basalt
#

Yeah Discord is often times the most resource intensive thing on my system

#

Only things that match it are PyCharm and sometimes VSCode

uneven silo
#

that's why i use sublime πŸ’™

scarlet hawk
#

Sublime nonfree [angry richard stallman]

bitter flint
#

How does one deploy a cli script that uses virtualenv for dependencies on a Ubuntu server?

proper aspen
#

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?

bitter flint
#

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.

proper aspen
#

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

vestal turret
#

(source /path/to/env/bin/activate && python script.py)

#

Would that work

#

() creates a subshell in bash

proper aspen
#
(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

vestal turret
#

But directly using the venv python binary would be better imo

bitter flint
#

@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>
languid gorge
#

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

sage solar
#

What happens when they crash

#

Any output etc?

languid gorge
#

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

sage solar
#

Can your run it like

python3 bot.py > log.txt

languid gorge
#

okay will do

sage solar
#

Or did you do that in order to create discord.log

languid gorge
#

no I just ran like that

#

lets see πŸ˜„

halcyon beacon
#

rm -rf *

#

$yolo

languid gorge
#

@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.

sage solar
#

If your code did any prints or error msgs exceptions whatever it should've been put inside that file

languid gorge
#

nothing inside.

#

the file is empty

#

and my bot did crash

sage solar
#

What exactly are you running it on / in?

languid gorge
#

Ubuntu 16.04 Server

#

1GB Ram 1 core.

sage solar
#

Hm

#

Should not really be a problem

languid gorge
#

I even compiled Python3.6.5 myself.

#

My code works completely fine of Windows.

sage solar
#

That is not a good idea usually

languid gorge
#

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```
sage solar
#

Hmmmmm

languid gorge
#

normal way I would do is above

sage solar
#

I guess you sshed into it and ran the command?

languid gorge
#

mhm

#

using screen

#

I tried using nohup too.

autumn walrus
#

soft ghost voices in the distance: doooockeeeerrr

sage solar
#

And screen should stop the program from quitting once the session is closed

#

Stop ghosting inver

languid gorge
#

use docker?

autumn walrus
#

:D

sage solar
#

Yeah that's usually a good idea

languid gorge
#

then CTRL + A + D

sage solar
#

You could try doing a systemd service maybe

languid gorge
#

kk never used docker yet need to look into that O.o

sage solar
#

Does the server get auto rebooted or something like that regularly?

autumn walrus
#

using screen in this day and age is a big no no imo, systemd or docker are preferrable

sage solar
#

What is the age Inver

languid gorge
#

It shouldn't do, I did consider it however I'm running a Bitcoin node which was still active.

autumn walrus
#

it's the age of containerization and microservice architecture

languid gorge
#

anyway to check last boot up? lemme google one sec

sage solar
#

Webscale β„’

autumn walrus
#

no webscale was 4 year ago

sage solar
#

Oh

autumn walrus
#

uptime Zumy

sage solar
#

What did they use to webscale

languid gorge
#

who -b

sage solar
#

How does one webscale without containers and the database for big ideas

languid gorge
#

nah last reboot | less

#

lists all reboots πŸ˜„

sage solar
#

And?

languid gorge
#

im gonna run again and see if dates change

languid gorge
#

bot still crashed and server didn't reboot @sage solar @autumn walrus

#

Using scree.

sage solar
#

Try a systemd service

languid gorge
#

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

sage solar
#

because i really have no idea whats happeniong here

languid gorge
#

yeah that's what I did waiting for a reply still

main olive
#

alright @oak shell

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.

uneven silo
#

You should not override your system/pacman python with your specially compiled python, but it's fine to compile python and install it

scarlet hawk
#

g n u s l a s h l i n u x

halcyon beacon
#

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

main olive
sage solar
#

Grep to find element in string is just

echo "string" | grep s
Isn't it?

vestal turret
#

yes

oak shell
#

that shows you all lines containing an "s"

sage solar
#

Yes

gilded basalt
#

@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

main olive
#

Anyone who masters sed and awk can do anything on a Unix system :p

halcyon beacon
#

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?

vagrant fern
#

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

weary canyon
#

Is there a way to run any terminal command through a python script?

autumn walrus
#

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)
weary canyon
#

Thanks @autumn walrus and @main olive

#

And is it possible to do git push <link> without having to put my credentials everytime?

autumn walrus
#

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?

weary canyon
#

Not even a bit

#

I use this format^^

autumn walrus
#

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

weary canyon
#

So i have to do this git remote add origin master {the ssg link} git push -u origin master

autumn walrus
#

that's a step in the middle of a longer setup process

weary canyon
#

Where can i find that "longer process"?

autumn walrus
#

oof good question, I don't have a link handy

weary canyon
#

Ohh ok

#

Will google it

#

Thank you very much buddy

autumn walrus
#

no worries, I'll also google real quick and see if I can find something that looks right

autumn walrus
#

the outcome will essentially be using git without having to use username and password as the key will handle all authentication

weary canyon
#

That's great

oblique kernel
#

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?

autumn walrus
#

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

oblique kernel
#

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

autumn walrus
#

nice as a dev box?

oblique kernel
#

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 ❀ ❀

autumn walrus
#

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

oblique kernel
#

go ahead

autumn walrus
#

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?

oblique kernel
#

nope - I'm using virtualbox on a windows 7, zero idea what vagrant is, I'm gonna google πŸ˜›

autumn walrus
#

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

oblique kernel
#

wow, great

autumn walrus
#

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)

oblique kernel
#

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)

autumn walrus
#

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

uneven silo
#

@autumn walrus your subprocess module can be shrunk a bit

autumn walrus
#

do tell, as I imagine it's not by putting it in cold water?

uneven silo
#

"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)

autumn walrus
#

ah yes! good tips

snow terrace
#

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

snow terrace
#

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

sage solar
#

nvidia drivers want EFI partition space?

snow terrace
#

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

sage solar
#

nvidia should not interact with EFI

#

it should really not

snow terrace
#

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

uneven silo
#

tias

#

if it hibernates and comes back on with boot unmounted, assume it works

buoyant hatch
#

Good ole NVIDIA drivers lol

#

^haven’t been on in a bit. Just saw the above convo.

main olive
#

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

oblique kernel
#

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

half pewter
#

@oblique kernel
Atom
SublimText
Or minimalistic Geany/VimGui/Xed

vestal turret
#

vscode

main olive
#

^

#

The pop ups are annoying tho

vestal turret
#

I haven't noticed any annoying pop ups

zinc bobcat
#

What popups?

finite ferry
#

@vestal turret $ sudo apt-get install zlib1g-dev Password: sudo: apt-get: command not found is there any problem?

oak shell
#

What OS do you use?

outer reef
#

Mac

vestal turret
#

ah i misread that

oak shell
#

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

finite ferry
#

I am using mac os mojave

vestal turret
#

homebrew, but that's not installed by default

outer reef
#

Is there a reason you're trying to make it?

#

There is an installer on the Python site

vestal turret
#

xcode-select --install

#

according to zlib issues on github

finite ferry
#

That did not work either

finite ferry
#

@outer reef No . I am just trying to install python and set up an enviroment for me to write codes

outer reef
#

Then I suggest using the link I just posted

finite ferry
#

Thank you. After installing how do I start ?

outer reef
#

Have you ever worked with Python before? Just learning?

finite ferry
#

Yeah

#

just learnign

outer reef
finite ferry
#

I am sorry but I appreciate your time

outer reef
#

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

finite ferry
outer reef
#

Yeppers

finite ferry
#

Got it thank you so much @outer reef

outer reef
#

Any time

uneven silo
#

yall need to plug the no starch humble bundle

#

they got lotsa good books

main olive
#

@oblique kernel how would I get rid of P2 when I install P3 tho

sage solar
#

you dont want to get rid of python2

#

lots of stuff under several major linux distros wants python2

oak shell
#

rule of thumb: never remove a Python version that came preinstalled with your system.

vestal turret
#

or change python from 2 to 3 or vice versa

#

not all scripts may have been nice enough to specify the version they require

oak shell
#

yep, don't mess with system binaries

#

bash aliases are fine though (except that they will confuse you if they shadow different commands)

faint valve
#

xfce master race

#

kde is trash

main olive
#

I think xfce is horrible to tbh

#

(Both in speed and look'n feel)

faint valve
#

wtf

#

in speed?

#

maybe i can understand look argument, but speed?

main olive
#

It's better than the other 2 (talking about gnome and KDE), it's still quite slow

faint valve
#

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

main olive
#

I use i3 and sway (for Wayland)

faint valve
#

i like i3 but to compare something like XFCE or KDE to i3 or hell fuckin' emacs is just disingenuous and you know that

main olive
#

They serve the same purpose

#

So they can be compared

faint valve
#

but they don't m8. it's like comparing C to Python bluntly.

main olive
#

@vestal turret I just want to use Py3.7 on PyCharm so I can continue my projects

faint valve
#

i mean just have some perspective lol

main olive
#

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.

faint valve
#

....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

main olive
#

Because it's not shipped as default in many distros

faint valve
#

ok unity isn't shipped as default in many distros

#

hmm

#

πŸ€”

main olive
#

That's why I don't know Unity, as I dislike Ubuntu

faint valve
#

well i can agree with that one

main olive
#
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

vestal turret
#

3.6.5 is the newst version in the repo's of ubuntu

main olive
#

hmmm

#

any changes/differences between that and 3.7?

sage solar
#

bascially everything new 3.7 brought to python?

main olive
#

which is what

#

thats the question

#

like how significant it is

vestal turret
snow terrace
#

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

main olive
#

@snow terrace agreed, gnome is mature, modern and well-rounded

#

there's a reason why Canonical has switched back to it

snow terrace
#

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.

uneven silo
#

kde best tho

main olive
#

kde is good

#

but then ram

#

Best IDE to bundle with Anaconda in Unix bdw?

main olive
#

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

main olive
#

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

kind latch
unborn rampart
#

@kind latch you really don't need to spam in every single channel..

kind latch
#

I did not find Unix eaelier

#

Its deleted in all other channels

main olive
#

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

uneven silo
#

install distutils

heavy warren
#

How can I go about setting up a media centre on my old Dell Optiplex 380?

sage cove
#

@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

heavy warren
#

ok, what's a good minimal linux distro? I've tried puppy and lubbuntu but both of them are eh

sage cove
#

I haven't tried it yet, but maybe Kubuntu?

heavy warren
#

I'm going to try the blank lubuntu installation (so there's no programmes on it aside from termial)

#

(and internet browser ofc)

main olive
#

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

heavy warren
#

I'm not the greatest at linux tho

#

so that doesn't sound good for me

main olive
#

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

heavy warren
#

"Upon installation, only a command-line environment is provided" wait what

main olive
#

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

gilded basalt
#

PSA: if you're creating a bootable OS image (e.g. installing Linux, live CD), use Etcher: https://etcher.io/

main olive
#

@heavy warren, what was the problem with Lubuntu?

#

oh, he left. nvm.

deft raft
#

Does pip come installed with a fresh raspberry pi I solved le issue

gilded basalt
#

Yes

safe sluice
#

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 ?

main olive
#

Did you check clusterssh ? It might do what you need

safe sluice
#

kinda looking for a solution without the need to install stuff

main olive
#

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

safe sluice
#

it can be ugly - I will try thanks!

gilded basalt
sage cove
#

@safe sluice
In bash, define your own function.
In python, use paramiko

weary canyon
#

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

uneven silo
#

screen, tmux, or pm2

weary canyon
#

Do you have links to them @uneven silo?

uneven silo
#

pm2 is an npm package, the others should be in apt

#

dunno what you mean by links

weary canyon
#

Aah, i meant docs

#

Thanks for helping though

uneven silo
#

man

lavish radish
#

anyone on Gentoo ?

#

did you have any issues setting up python3.7 so far?

uneven silo
#

u building from source?

lavish radish
#

@uneven silo yes ofc, there's no *-bin (precompiled) pkg yet

sage solar
#

Doesn't using binary packages kinda defeat the point t of Gentoo?

lavish radish
#

it does @sage solar

#

that's not how this distro works though

uneven silo
#

there isnt really a precompiled linux package available from python.org

lavish radish
#

@uneven silo yeah but you wanna tweak it however you want, why would it be πŸ˜›

uneven silo
#

why did you mention a binary package then

lavish radish
#

I didn't mention it, you did man

#

not downloading it from python.org, but from portage

uneven silo
#

why lol

lavish radish
#

it's the same

#

that's how this system works

#

install it via package manager

uneven silo
#

i mean yes, but..

lavish radish
#

your question is like, why do people install python via apt πŸ˜›

uneven silo
#

no

lavish radish
#

oh

uneven silo
#

can you specify build options with portage?

#

or change ./configure flags?

lavish radish
#

yes, you can add them in the USE flags

#

from your /etc/portage/make.conf

uneven silo
#

oh it's global lmao

lavish radish
#

or local

#

via /etc/portage/package.use/python

#

and applies to that package strictly

uneven silo
#

but what about configure?

lavish radish
#

didn't try that way, but that was the old way

#

you can still do it that way

#

but no one does that anymore

uneven silo
#

uh

#

./configure [options] is how you setup python. Do you not compile with optimizations or anything?

lavish radish
#

I do

uneven silo
#

how then

lavish radish
#

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

uneven silo
#

wut

lavish radish
#

you ever used Gentoo ?

uneven silo
#

no lol

lavish radish
#

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?

uneven silo
#

i guess it works if configure only changes flags

slow sandal
#

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?

uneven silo
#

do you want to build it from source or not?

slow sandal
#

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

sage solar
#

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?

uneven silo
#

you can get customized optimizations when building from source

slow sandal
#

ok, in my case I dont.
python36u
Isnt the latest version of python 3,7?

sage solar
#

yes

#

but not all major libraries support it yet

#

so you might be better of with 3.6

slow sandal
#

Ok, thank you

uneven silo
#

idk why they say that, unless you are using asyncio, you likely won't have an issue

slow sandal
#

@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` ?
sage solar
#

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

slow sandal
#

ok

uneven silo
#

i dont use centos

shy grotto
#

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.

sage solar
#

@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

shy grotto
#

oh okay sure

karmic vessel
#

has anyone here installed postfix and tried to pipe the mail?

main olive
#

Already done that yeah

#

Though I just remember following a tutorial and that's pretty much it

main olive
#

@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

karmic vessel
#

@main olive I don’t honestly know. But I want it to work lol so either way possible I want to try

vivid vault
#

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!)

main olive
karmic vessel
#

@main olive do you mind if i pm you m8?

uneven silo
#

@vivid vault u dont need to install certificates, because that only helps when the certificate isn't recognized. Did you read the error?

vivid vault
#

i figured it out, i edited the message with the solution i used

sage solar
#

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?

vestal turret
#

another fresh install

sage solar
#

thats giving up

#

and for such a little issue unacceptable

sage solar
#

interesting

#

so after i reboot i can now copy paste in a few applications

#

hmmmmm

vestal turret
#

did you reload the files after modifying them?

sage solar
#

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

main olive
#

are you using X or Wayland ?

#

@sage solar

sage solar
#

i tried on both

main olive
#

should work on X though

sage solar
#

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

main olive
#

Is the "source" of your copy/paste still open when you paste ?

sage solar
#

yes

#

i already explained above

main olive
#

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

sage solar
#

as i already explained

#

i tried under wayland AND Xorg

#

to be precise
Gnome Wayland
Gnome Xorg
Gnome Classic
LXDE

main olive
#

Under Xorg, that's another problem, as no issue seem to be open on this

sage solar
#

yes I am looking at bugzilla myself already

#

well have looked until i gave up for today 30 minutes ago

main olive
#

can't test myself sadly

#

I hate Fedora, so.. πŸ˜ƒ

sage solar
#

i mean i got my perfectly working laptop with fedora here

#

checked all the config files i could find about it

#

they fkin match

main olive
#

are you copy/pasting with keyboard, or with the mouse ?

sage solar
#

both 😦

tawny sky
#

On fedora and other red hat-based systems there can be a problem where your window manager is using a different clipboard to x

sage solar
#

i mean i could paste like once in chrome

tawny sky
#

Try using shift+insert for pasting

sage solar
#

like i copy
then paste (works)
then paste again (doesnt work)

#

lemme fire up my machine again......

#

nope @tawny sky

tawny sky
#

hmm

#

no idea, in that case

sage solar
#

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

vestal turret
#

you are reusing an old home folder?

sage solar
#

no its a fresh fedora install

#

but i just thought about reinstalling

#

no its a fresh fedora install

sage solar
#

so reinstalling using my hold home partition worked

#

yay

hazy bobcat
#

Guys how do I run a python script from cron when I need to change to a virtualenv with workon

vestal turret
hazy bobcat
#

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

vestal turret
#

Run a bash script that activates the env and runs the code

cold pagoda
#

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

hazy bobcat
#

It works If I do it with source to activate env

#

gonna try the cron now

weary canyon
#

any commands to get my static IP address?

vestal turret
#

wether that is static depends mostly on your isp

severe basalt
#

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?

oak shell
#

Can you paste the full output you got?

severe basalt
#

the actual crash report is crashing on open, so I can't copy it

vestal turret
#

I think it's a problem with one of the libraries

severe basalt
#

so I'm stuck trial and erroring? :/

outer reef
#

Or uninstalling and reinstalling the libraries

severe basalt
#

trying that now

#

ok, seemed to work, guess it was a corrupt install

tender ocean
#

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.

gilded basalt
#

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 πŸ˜‰

vivid vault
#

sorry, i fixed the problem and deleted the message but i forgot i sent more than one

tender ocean
#

@gilded basalt damn, good point man. Thanks

gilded basalt
#

Is it a reverse shell?

tender ocean
#

@cerulean pagoda What're you trying to accomplish?

hearty scarab
#

hmm... which user did you removeed ?

#

ls -la /lib/systemd/system/stop-bootlogd.service

broken canopy
#

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

vapid depot
#

If linux was as popular as windows is, I can't see why you would ever want to use windows

gritty stirrup
#

@vapid depot driver support would be great

vapid depot
#

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

gritty stirrup
#

Ye

slow sandal
#

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 ?

hearty scarab
#

You dont need a "fake screen". You just need a headless webdriver

slow sandal
#

so simply installing the browser (chrome for example) and its webdriver and runnign in headless doesnt require something like Xvfb ?

slow sandal
#

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
vestal turret
#

Browsers run websites in a sandbox for a reason

sturdy ember
#

and please post the exact error you get

#

saying that you got a 500 error wont help much :P

vapid depot
#

brought a ubuntu sticker to cover up acer on back of my laptop (75cmm) and a little powerd by linux

old hamlet
old hamlet
#

Anyone who can help me with this?

main olive
#

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

oak shell
#

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

main olive
#

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

oak shell
#

uh....

#

does tput init work?

main olive
#

tput: unknown terminal "xterm-256color"

oak shell
#

Check the output of ls -l /lib/terminfo/x/xterm-256color

main olive
#

it is there

oak shell
#

can you paste?

#

are the permissions and owner correct? Maybe it became read-only

main olive
#

you mean something wrong with rights?

#

-rw-r--r-- 1 root root 3525 maj 23 10:08 /lib/terminfo/x/xterm-256color

oak shell
#

GWchadThinkeyes 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

main olive
#

will check

oak shell
#

or possibly even open a new terminal at least already

main olive
#

new terminal doesn't help

#

i go restart

oak shell
#

πŸ‘Œ

main olive
#

nope

oak shell
#

what does echo $TERM say?

#

and do you use any multiplexers like screen or tmux?

main olive
#

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 πŸ˜‰

oak shell
#

nice, okay πŸ‘

pulsar fjord
#

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.

cold pagoda
#

So, pip install readline should do it

pulsar fjord
#

Had more issues than just that. Instgalled 3.7 and its all better πŸ˜ƒ Cheers.

weak skiff
#

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)

oak shell
#

did you read the error message?

#

it tells you all you need to know

weak skiff
#

I tried to but don't understand why maim isn't used

#

running which maim on my machine returns output /usr/bin/maim so i shouldn't need scrot

oak shell
#

hmm, I see

#

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

weak skiff
#

I see, thank you!

mortal plinth
#

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 ,

main olive
#

you can specify the version

zinc bobcat
quaint mirage
#

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

#

Β―_(ツ)_/Β―

mortal plinth
#

@zinc bobcat if only everyone was disciplined :(

gilded basalt
#

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

oak shell
#

@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...

main olive
#

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

gilded basalt
#

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.

weak skiff
#

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?

vestal turret
#

They favor stability

weak skiff
#

ah πŸ˜ƒ well thanks for the heads up.

oak shell
#

@gilded basalt Well, what do you know about the processes you are looking for?