#unix

1 messages · Page 37 of 1

digital haven
#
 130 function dirr_funct() {
 131     # I want to see the stack, but not all on one line. This is mainly so that
 132     # I can use p5 or something (defined below) to get back to a particular
 133     # directory.
 134     clear
 135     echo $(dirs | sed 's/ /\\n/g') | cat -n | head -n 20
 136 }
 137 alias dirr=dirr_funct

and this will print out (part of) the stack with number

main olive
#

that's... incredibly complicated

digital haven
#

😬

main olive
#

what exactly are you trying to do

digital haven
#

print out the stack on different lines with line numbers

#

pass an arg to popd to pop a given number of dirs from the stack

main olive
#

that's

#

what

#

that's

digital haven
#

idk how else to explain it

#

that's that

#

well ha... from the cdr command the other day

digital haven
#

i found that i sometimes wanted to get back to where i was, but couldn't easily... so I wanted a command for that - but popd would just go back one

#

so, it's to address that 🤔

#

or to make 4 problems instead of 1

main olive
#

why not just make a "super push d" and "pop d" alias which saves the pwd to a variable and cd's back to that when popped

digital haven
#

i tried that first actually but the var didn't want to save so i did this

main olive
#

var didn't want to save

#

hmm?

#

odd?

digital haven
#

i had something like PREVIOUS_DIR=$(echo pwd) or something

main olive
#

did you just VAR=value or did you export as well

digital haven
#

yeah - i can't remember exactly, but i couldn't seem to get the pwd to save as a var that i could access later

main olive
#

also echo pwd will literally just return pwd

digital haven
#
 154 function cdr_funct (){
 155     pushd $(git rev-parse --show-toplevel)
 156     clear
 157 }
#

i would have put it in there

#

i guess

main olive
#

$(pwd) by itself would've returned the current dir

digital haven
#
 130 function dirr_funct() {
 131     # I want to see the stack, but not all on one line. This is mainly so that
 132     # I can use p5 or something (defined below) to get back to a particular
 133     # directory.
 134     clear
 135     CURRENT_DIR=$(pwd)
 136     echo $(dirs | sed 's/ /\\n/g') | cat -n | head -n 20
 137 }
#

so like that?

#

ah that's in the wrong place

#
 152 function cdr_funct (){
 153     DIR_BEFORE_CDR=$(pwd)
 154     pushd $(git rev-parse --show-toplevel)
 155     clear
 156 }
 157 alias cdr=cdr_funct
 158 alias rdc="echo $DIR_BEFORE_CDR"

so this is what i would expect to work there

#

cdr - get to the root
rdc - get back to where i was

#

( it does not work )

#

'echo' 🤦

#

ok it works 🌚

#

thank you

fickle granite
#

gaah a single global? really? feh

digital haven
#

@fickle granite is that bad? 🤔

fickle granite
#

it -seems- bad

#

like if you do two cdr_functs in a row, you'll only ever be able to get back to the most-recent one

#

imagine your web browser's history only remembered the last page you were at

digital haven
#

yeah, that's probably ok for this ha

#

i have the pops monstrosity for anything further 😄

digital haven
#

I'm interested to hear others thoughts on functions vs aliases now 🤔

why wouldn't i just use functions instead of aliases

fickle sparrow
#

I don't think there is anything an alias can do which you could not with a function. There is the alias command that lists all aliasses though..

digital haven
#

@fickle sparrow yeah, the aliases command is handy actually... I can't think of any other reason to use an alias over a function though

#

perhaps it's more explicit?

fickle sparrow
#

I would say so, yes.

digital haven
#

how can i see the definition of a function at the shell?
so if i have some function f defined, i want to do something like whats f and it will (at the prompt) display the code that defines f
not sure if that's a thing

warm wolf
#
trishmapow@tpc:~$ hello () { echo "hello"; }
trishmapow@tpc:~$ type hello
hello is a function
hello () 
{ 
    echo "hello"
}
#

@digital haven

digital haven
#
-> % x (){ echo 'this is x' }
-> % type x
x is a shell function

ah, @warm wolf thank - seems that zshell doesn't give this information

humble onyx
#

Is there any difference between

export PATH="$PATH:$HOME"
PATH=${PATH}:$HOME

#

Why do I have export method anyway?

oak shell
#

normally, shell variables are for your shell only, but not exported to the environment of child processes

#

the export command changes that and switches a variable from shell-only to exported

#

PATH is exported by default though, so in this special case, both lines are equivalent, because once exported variables stay exported

humble onyx
#

Are they essentially the same?

oak shell
#

for PATH, yes. For most other variables not.

humble onyx
#

Oh I get it

#

thanks

oak shell
#

Have a look at this example

humble onyx
#

shoot

oak shell
#
$ FOO=bar

$ printenv FOO
 
$ export FOO

$ printenv FOO
bar
#

here printenv is an external executable. It does not receive the value of unexported shell variables, but once it is exported, it can be read

humble onyx
#

clear

#

thanks

glass rock
#

can i ask linux related question here?

oak shell
#

yes, just ask. Preferably they would be somehow related to Python development, but small general questions are okay too.

glass rock
#

i mean im making "auto mount usb" script with python, so its python related too 😄

#

so about the question, it looks very simple but im stuck and couldn't find any solution

#

im listing plugged drives, volumes with

gio mount -l

or
from gi.repository import Gio
etc etc

so this gives me the result i want, but when i add my script to cron it only shows the main boot drive and floopy/cdrom etc

#
gio mount -l  >>> the result i want
sudo gio mount -l   >>>> the result i don't want
sudo -u myuser gio mount -l  >>>> the result i don't want

#

even though i just use that command without sudo, i don't get what iwant

dusty basalt
#

anyone around here messing about with the jetson-nano?

lavish badger
#

(github question) Say a Windows user has core.autocrlf=false and pushes code with crlf line endings. If a Linux user with above set to "input" or "false" downloads it, they would get code with crlf line endings?

fickle granite
#

dunno. If i had that question, I'd just try it and see.

#

That'll take some effort, especially if you don't have a linux box handy; but it has the benefit of being authoritative

lavish badger
#

Ok. Thanks offby1.

digital haven
#

@main olive i know it was horrendous but those dirr and pops functions have been pretty handy 😛

digital haven
#

when I display polish chars on my terminal they're mangled by tree, but not by ls, i don't understand why

#

🤔

#
tree -f --du -h -C -L 1
ll -lh

those are the two commands

main olive
#

@digital haven try tree -N

#

or tree --charset utf8

digital haven
#

Ah, N worked, I didn't think to look at the man for char settings

#

Thanks

cyan isle
#

hey guys I'm having probs tryna set a python version to default

#

anyone know??

#

nvm got it

#

haha

jade crater
#

Would it be better to use a python virtualenv for additional system packages? to prevent messing with python that comes with the OS

main olive
#

yes.

#

assuming you mean venv

#

it comes with python

carmine ridge
#

venv starts off with whatever package you have installed right?

#

its not completely fresh?

daring osprey
#

it should be a closed system if you don't tell it to hook into system site packages, afaik

spice relic
#

does cp -a preserve the permissions?

white solar
#

venv starts off with whatever package you have installed right?
if you do python3 -m venv venv it starts of fresh

copper sand
#

Hello, trying to see an example of how you would parse the output of a command and then append that parse to a file on a different machine.

So you would start your script on the machine that has the command you want to do.

You would then parse the output of the command, for example a network address

Then have that captured network address appended to a file on a SEPARATE machine

Any help would be greatly appreciated! I am just trying to learn bash scripting.

warped nimbus
#

If you have access to the other machine over ssh you can use scp to transfer the file

main olive
#

from machine 2, you'd do:

ssh user@machine1 'parse_script $(my_command)' >> file_of_things.txt
fickle granite
#

careful about quoting

#

I cannot predict whether that $() will run locally or remotely

#

remotely I guess since it's in single-quotes

main olive
#

runs the output of my_command through parse_script on machine 1 and appends the output to file_of_things.txt on machine 2

#

aye, single quotes is important here

fickle granite
#

I kinda hate the shell

main olive
#

single quotes = don't expand/evaluate my shit

#

double quotes = go wild dog

gilded basalt
static mountain
#

I have a problem, its probably because i run it as root, how can i run python not as root?

cold pagoda
#

By default, if you just use python with your user account, it should not run as root

static mountain
#

Weird

cold pagoda
atomic ginkgo
#

Can anyone help with an issue I'm having packaging a C-based Python package as a manylinux2014 compatible binary wheel?

main olive
#

is there a vsl flag in curl

main olive
#

I'm trying to automate some things for the first time due to working with server side coding thats more tediouis than what im used to. So I started very simple.

I discovered this while playing around

woot@wsi:~$ cat start
#!/bin/bash

cd project/
echo "Should Have changed directory but"
pwd
source environment/bin/activate
echo "Should have opened environment but"
which python3
echo "Ready"
woot@wsi:~$ ./start 
Should Have changed directory but
/home/woot/project
Should have opened environment but
/home/woot/project/environment/bin/python3
Ready
woot@wsi:~$ pwd
/home/woot
woot@wsi:~$ which python3
/usr/bin/python3
woot@wsi:~$

At first it seemed like it was ignoring me. But it seems its doing everything in a subprocess and then escaping back to the shell I was in before, right? How would I go about something like this. My server is running ubuntu and nginx.

I apologise if my bash/server knowledge is very minimal.

south star
#

Exactly

#

One way to achieve what you want, is to run bash at the end, so it'll give you a shell in that env, when you are done, you can exit it with ctrl-d and be back to your original dir/venv

main olive
#

Thank you.

#

@south star I assumed you meant exec /bin/bash right?

south star
#

i would just have put /bin/bash but i guess exec would work as well, it'll just replace your current process with the bash one, not sure what happens to cwd and env variables in that case, but it's worth trying.

main olive
#

This accomplished keeping me in the working directory expected in the script but didnt maintain the venv activation.

south star
#

so probably env vars are lost

#

that was with or without exec ?

main olive
#

with exec lets try it different

#

same effect

south star
#
gabriel@gryphon:~$ which python
/usr/bin/python
gabriel@gryphon:~$ source /home/gabriel/.virtualenvs/kivywheels/bin/activate
(kivywheels) gabriel@gryphon:~$ bash
gabriel@gryphon:~$ which python
/home/gabriel/.virtualenvs/kivywheels/bin/python
gabriel@gryphon:~$ exit
exit
(kivywheels) gabriel@gryphon:~$ which python
/home/gabriel/.virtualenvs/kivywheels/bin/python
(kivywheels) gabriel@gryphon:~$ exit
#

the venv is still active, even if not visible in the prompt

main olive
#

interesting

#

also the case over here

south star
#

probably because bashrc resets the PS1 variable

main olive
#

yeah, the most confusing thing about bash for me when it gets to complicated redirection is how variables constantly lost. Its the primary reason I dont use bash for anything that involves logic. But I figured a series of commands to the shell makes sense for it

#

At first I thought I would be using $() a lot to do things that you can't use that to do because it open a subshell and any values you were using are gone.

#

It reminds me almost of scope only I dont know how to send it values as params

#

Either way thank you

south star
#

yeah, things are only available to the subshell if they were exported, and of course if the subshell doesn't overwrites them

#

the --norc option of bash solves it for me

main olive
#

I will have to look at the option. It means dont use the config file Im guessing?

south star
#

yes

#

as you already have all the settings you want in the parent shell, it'll just inherit them, no need to reset to defaults

main olive
#

Good stuff.

#

I see what you mean about it forcing the cwd out.

#

I didn't realize that display of the prompt was a .bashrc thing.

#

I should look into that file ive been using linux long enough haha

south star
#

yep 🙂

#

you can set your own aliases/functions in there, can be useful to improve your productivity

main olive
#

for future reference, if you want to change the variables and cd inside your current shell and not a subhselll, you need to source it instead of executing it

#

ie

$ . myscript

instead of simply

$ ./myscript
#

or the full source command instead of the dot .

main olive
#

interesting, I didnt even know about that. I only use source for venvs and otherwise have never checked it

#

Time to bust out the man page

#
virufac@box:~$ man source
No manual entry for source
virufac@box:~$ source --help
source: source filename [arguments]
    Execute commands from a file in the current shell.
    
    Read and execute commands from FILENAME in the current shell.  The
    entries in $PATH are used to find the directory containing FILENAME.
    If any ARGUMENTS are supplied, they become the positional parameters
    when FILENAME is executed.
    
    Exit Status:
    Returns the status of the last command executed in FILENAME; fails if
    FILENAME cannot be read.
virufac@box:~$ 
#

Well then

#

This led me down the interesting line of thinking...

#

What is in my activate script. While there is quite a lot in a deactivate function as well as some zsh hacks and making sure you are not running without using the source command...

#
VIRTUAL_ENV="/home/woot/project/environment"
export VIRTUAL_ENV

_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH

# unset PYTHONHOME if set
if ! [ -z "${PYTHONHOME+_}" ] ; then
    _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
    unset PYTHONHOME
fi

if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
    _OLD_VIRTUAL_PS1="${PS1-}"
    if [ "x" != x ] ; then
        PS1="${PS1-}"
    else
        PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}"
    fi
    export PS1
fi

seems to be the bulk of it

#

export is a command I also dont understand very well

#

I have never manually adjusted PATH or any environment variables. IF I need a script to be in PATH, I will typically put it somewhere that is already in path.

warped nimbus
#

It basically prepends the venv's path to the PATH env var, so that it takes priority over any other Python interpreters that may already be on your PATH.

#

PYTHONHOME is an env var that you may have set to change the location of Python's libs, so this script just makes sure it's unset while the venv is active.

#

The ps1 stuff at the bottom just changes the terminal prompt so there is a visual indication the venv is active

main olive
#

thanks.

humble onyx
#

I have a question. I have a python file which is not by itself an executable. when I try to run with python on command line it runs but when I do ./file.py I get permission denied error(chmod +x file.py works fine that's not the question).
I have she bang line at the top of the file so it should be an executable isn't it? what did I misunderstand?

./file.py # Permission denied. There is a shebang line at the top of the file```
main olive
#

the shebang simply tells the shell what to open the file with (it doesn't automatically know it's python)

#

you still need to actually mark any files with the executable permission to directly execute them

#

@humble onyx

humble onyx
#

I got it now thanks

humble onyx
#

padding = "\x21\x41\xf4\x08"

print(padding)
!A
padding = "\xf4\x41\xf4\x08"
print(padding)

#

xf4 breaks the hex

#

what is happening?

main olive
#

its not a valid ASCII character so it doesn't get printed

#

it's still there, it just breaks your term a bit

humble onyx
#

x41 prints A

#

I have x41 in both strings

#

@main olive
when xf4 at the beginning it doesn't print A

main olive
#

like I said, it confuses your terminal and it stops printing it

#

don't try to print things which aren't real symbols

humble onyx
#

well I was trying to do something else

#

I was doing stack overflow

#

EIP becomes 0x00000000

#

that is the thing

main olive
#

and for what it's worth, my terminal prints the second line fine

humble onyx
#

I have python 2.6 on my virtual machine

#

Do you think that may be the issue?

main olive
#

no, it should just work

#

just don't try printing it

#

if your IP is null then you're doing something wrong

#

something else, I mean

main olive
#

Not sure if this allowed here, but when I have a hard drive in my system with files I put on it under Windows, what happens to those files when I boot into Linux? Can I access them on Linux even though they were written to the drive under Windows?

#

On a dual-booted system

sage solar
#

Yes

#

However

#

Your Linux will most likely have it's / file system formatted as ext4 which is a file system windows won't understand

main olive
#

I made the mistake when I first got into Linux of using NTFS as my default storage (not OS) drive. It works. But I would recommend against doing this. While you can see into NTFS, it's better in my experience to use Ext while on Linux for youre regular file use. If you need something, copy it over. But work with it on the correct file system.

Do people who are more expertise with this agree that that is best practice?

#

Ther reason I ask is because in the early days of my Linux use... There were unexplained corruptions and sometimes just disappearances of data that I wish I could go back with the knowledge I have now and figure out why that happened. But it was too long ago now.

#

I have always attributed it to the file systems tho

#

I do recall though at that time I was regularly booting into and out and the two OSes and I was sharing the different drives like they were not essentially different.

main olive
#

the NTFS driver is considered stable, but NTFS itself is horrible from a quality-of-life and performance standpoint

#

on linux, it doesn't make sense to use NTFS due to the heavy reliance on symlinks and such

#

on linux, xfs or ext makes much more sense

lavish badger
#

Will running: (venv) $ pip3 install --upgrade pip from inside a python3 virtualenv affect system pip/python at all?

main olive
#

no

lavish badger
#

Thanks @main olive

main olive
#

also @lavish badger it's good to know that venv and virtualenv are different things

#

so when googling for things, you won't get conflicting information

lavish badger
#

ooh

#

Thanks very much.

main olive
#

👍

worn aspen
#

how would I go about creating a sys tray icon and menu as lightweight as possible?

worn apex
#

there's a library called pystray that seems to handle this @worn aspen

balmy smelt
#

Hey all!
I want to build a static binary of the Python interpreter, but I also want to include some modules. Let's say I want to have the apt module. Is this possible?
I have followed this: https://wiki.python.org/moin/BuildStatically
But there are only some modules there (I guess they are only some essentials) but I have no idea how, or if even possible, to also include other modules like the apt module?
Do you know if such a thing is possible? If not, what would be the right approach?

fickle granite
#

if the module is written in python, it's hard to see how you'd get that code into a static library

#

static libraries contain object code, and the only way I know of to make object code is to compile an Old Skool language like C

#

the only other thing I can think of is if python has a way to load modules, then dump its memory into a new executable, but I don't recall anything like that in the Python build process. (GNU Emacs does this, but it's weird 🙂)

sage solar
#

Not only c can do that....pretty much any compiled language will be able to, c, c#, rust, go and what not

digital haven
#

quite often there are a few directories that i want to navigate to in a project, and cd-ing about is a bit of a chore, is there an easy way around this? I currently have the dir stack printing out as

echo $(dirs | sed 's/ /\\n/g') | cat -n | head -n 30

and a function that'll enable me to jump to a dir there using pop, but that will lose information, and i can only get somewhere I've previously been. Even though it's pretty janky, i make use of it a lot, i just wish there was something a little more robust.

something that could perhaps like

tree -d -L 3

where the lines were numbered, and i could choose a line to go to, that would be nice

#
-> % tree -f -d  | cat -n
     1    .
     2    ├── ./a
     3    │   └── ./a/b
     4    │       └── ./a/b/c
     5    └── ./x
     6        └── ./x/y
     7            └── ./x/y/z
     8
     9    6 directories

so here 4 would take me to a/b/c

oak shell
#

why that echo? 🤔 You could replace that whole alias with dirs -v

#
$ dirs -v
 0  ~/Pictures
 1  /bin
 2  /etc
 3  /tmp
 4  ~
#

about the tree navigation, I'd suggest you use a tool for that... let me try remember the name

digital haven
#

why that echo
@oak shell because i don't really know what i'm doing 😄

#

@oak shell how would i know -v, it doesnt' seem to be in the man page, is this a standard flag?

oak shell
#

help dirs

#

the help command shows you infos about shell built-ins

digital haven
stray marten
#

when using stat command

#

what is the real size of the file_

#

?

#

size or io blocks?

#

size * blocks?

#

or next power of 2 of size * blocks?

small panther
#

That is the real size.. Size: 724

#

It's in bytes however. So bytes * 1024 = kb

#

And kb * 1024 = mb

stray marten
#

and the size of the blocks?

#

u cant know from there, right?

#

u need %B

#

which is 512

#

so how many space does this file occup?

#

8 blocks * size per block?

#

@small panther

small panther
#

I don't understand what you're asking

#

Size is the actual number of bytes of that file's contents. IO Blocks is the 'chunk size' for the data being read/written from the disk itself.. in your screenshot that would be 32KB minimum per read/write to the disk itself

#

The file occupies 724 bytes, like the screenshot says

#

Unless you are asking about lower-level size on the physical layer or related to inodes or something, which i don't know that detailed

stray marten
#

yes, but on the disk

small panther
#

Maybe that can be of some help to you

stray marten
#

it occups more than 724

#

right?

small panther
#

Probably. I'm not sure. There needs to be some sort of pointer to the memory and the file name, I believe. That would occupy space. I don't know if the size reported in stat is only the file contents, or if it contains any meta-data as well.

stray marten
#

@small panther one last thing. For linux, day 0 is sunday or monday?

#

okey 0 is sunday

small panther
#

That would entirely depend on what you're doing with it

stray marten
#

with the crontab

small panther
stray marten
#

0 6 * * 1

#

means all mondays at 6:00 AM?

digital haven
#

does anyone know how i can start vim with a command? I want an alias that will start vim with NnnPicker command (but not always)

#
vim -c "NnnPicker"

all good

stray marten
#

@small panther and last last thing XD how can i remove all subdirectories from a given one?

#

i wanna remove everything inside /user/foo

#

but i dont wanna do rm -r /user/foo

#

i wanna delete all inside foo

#

rm -rf /user/foo/*?

digital haven
#

Also - re earlier - i think autojump might be pretty much what I was after @oak shell , thought I'd let you know

swift heron
#

How can i use lolcat -a to animate a whole file rather one line at a time?

main olive
#

i don't think you can without a script

#

also that can be a very heavy task for your terminal emulator

main olive
#

Hi im on linux trying to get pip since it dident come with python idk why

oak shell
#

what os?

main olive
#

Mint

oak shell
#

try sudo apt install python3-pip then

main olive
#

do i need to reboot?

oak shell
#

nah

#

after that, pip3 (or better python3 -m pip) should be available.

main olive
#

ah thanks

#
Collecting cryptography
  Using cached https://files.pythonhosted.org/packages/45/73/d18a8884de8bffdcda475728008b5b13be7fbef40a2acc81a0d5d524175d/cryptography-2.8-cp34-abi3-manylinux1_x86_64.whl
Collecting six>=1.4.1 (from cryptography)
  Using cached https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Collecting cffi!=1.11.3,>=1.8 (from cryptography)
  Using cached https://files.pythonhosted.org/packages/f1/c7/72abda280893609e1ddfff90f8064568bd8bcb2c1770a9d5bb5edb2d1fea/cffi-1.14.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography)
  Using cached https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'setuptools'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-sozflehp/pycparser/
oak shell
#

that's weird, the python3-pip package should depend on python3-setuptools 🤔

main olive
#

🤔

humble onyx
#

Hey guys can somebody help me understand what setuid mean? Wikipedia says it gives root privileges to the user but I don't fully grasp it. I have always been the only user on my laptap that may be the reason.

#

Like how is it different than chmod 777 file. Anybody can do anything with the file already

sage solar
#

if you execute a binary that has setuid set the binary itself gets executed with admin privileges even if the current user does not have admin privileges

#

that way you can let users do specific things that would usually require admin without actually granting them admin privileges

#

however this of course also makes such binaries interesting targets for hackers, because if they can control what they do they essentially have admin privileges on your PC

humble onyx
#

does it give root privileges or owner's privileges? If I have write permission on a file which has setuid bit. Can I do whatever I want?

main olive
#

setuid runs the binary as the owner of the binary

#

setgid does the same, except for the group which the binary belongs to

#

it's most often used to allow regular users to run binaries as root

humble onyx
#

What can a binary do with root privileges but it cannot do without setuid bit.

echo laurel
#

In case of suid,
if the owner is root, you have access to everything root has access to.
if the owner is someone else, you have privilege of that user.

#

same for giud, but in this case the binary is run with the group the binary belongs to

humble onyx
#

@echo laurel What if everybody has write permission on that file?

echo laurel
#

that means everyone can write to the file.

humble onyx
#

Can anybody manipulate the file to do whatever he wants to do that requires root's privilege?

echo laurel
#

again, this has nothing to do with root.
ONLY if the owner is root, you will get root permissions

humble onyx
#

I understand now.

#

thanks

main olive
#

@humble onyx suid bit is dropped when the file is modified

#

so if you have write access to a suid binary as a regular user, you can't simply modify the binary to do any malicious thing you want

humble onyx
#

@main olive Thanks all clear now

swift heron
#

How can i automatically have a specific user only be allowed to stay logged in for 30 seconds when they login? because from what i have tried so far while its waiting for the 30 seconds to pass they are unable to type or use commands

#

Emphasis on specific users, I don't want to implement this system wide

main olive
#

when will an env var set with export VAR="value" be unset?

digital haven
#
 372 project_funct () {
 373     pwd
 374 }
 375 export PROJECT_HOME=project_funct

is there any way to make this work? and why isn't the above working

#

ah, bc it's run when the script is sourced, ok that's obvious 🤦

#
amkproject (){
    export PROJECT_HOME=$(pwd)
    mkproject $1
}

i just went with this 🤷‍♂️

#

probably not worth it I guess, though there are some hooks and stuff I might use for mkproject so, eh

digital haven
#

@fickle granite only pinging because it's something that you'd explicitly mentioned before, but I've only just realised that I did install gnu tools for OSX, but that everything has a g prefix, so rather than setting find to be GNU by default I have BSD find, and also have gfind.

If I run ls -lat | awk '{print $9}' | egrep '^g' then I can see all that start with g, but there's stuff like git-cvsserver that i never use, and am pretty sure isn't a mirror of Gnu and BSD or whatever.

what I'm wondering about, is whether there's a straightforward approach to saying I just want the GNU stuff. I was considering just setting a bunch of aliases, as in alias find=gfind, but I'm not sure if this is a sensible approach

#

actually alias won't work because then i can't use things like man find, what a load of crap

young sphinx
#

is there a cool lib to make unix commands in python?

#

instead of making .sh scripts

main olive
#

You need to, you just make a bash file that has the path to a python file. Let me show you hold on

#

Oh nevermind

#

lol

#

What is the outcome that you want to be different than using bash to call the python?

young sphinx
#

can u still show me tho, i'm curious how u merge python and unix.
Currently i do subprocess.Popen / os.system ish, and then i created an alias to python myscriptpath.py with my desired cmd name in ~/.bashrc.
But with i only manage to ask for args with input() instead of taking them inline.
Plus, I suppose this is not the easyiest way to make such command.

main olive
#

Okay I'll show you what I do

#

one sec

young sphinx
#

sure

main olive
#
virufac@box:/bin$ ll | grep nsr
-rwxr-xr-x  1 root    root         58 Oct  4 12:44 nsr*
virufac@box:/bin$ cat nsr
#!/bin/bash
exec ~/Git/nameless-space-replace/nsr.py "$@"
virufac@box:/bin$ 

so, in the bin directory.... there are the average unix commands that are added to path if you look there. I displayed it showing the permissions and how its necessary to add executable permissions for it to work. You also have to do the same thing with the python file which notice how all the bash script is is executing a path to the python file. That bit at the end $@ just means send all of the arguments to the python file, in case you write a script that takes arguments. So now it works exactly like any other unix command

#

if you dont know how to add executable permissions

young sphinx
#

chmod +x

main olive
#

right

young sphinx
#

i'm reading btw

#

thanks a lot

main olive
#

mm hm

#

I will add that you should probably only put a bash call for a python file in /bin/ if you are really okay with that script being executed anywhere on the fs.

#

But sometimes thats what you want

fickle granite
#

@digital haven I think homebrew gives you an option to install the gnu stuff without the leading g. But I have the vague fear that something somewhere will break, if it was depending on getting the MacOS/BSD variant, and now gets the gnu variant.

digital haven
#

: (

fickle granite
#

looks scary

#

I'd do a complete timemachine backup first

digital haven
#

🌚

#

i don't like that it handles some of the shell stuff 🤔

#

esp as bash isn't even the default in osx anymore afaik

south star
#

i hoped that linuxify install to ~/.local or something, but it install to the system, using homebrow, seems a bit radical indeed 😬

#

i would probably try it anyway if i was forced to use osx, i've had some rage about its differences with linux in the cli

digital haven
#

@south star yeah I think I just ran it then asked questions here after 🙃

#

however, man find still just returns BSD find, which is super annoying

fickle granite
#

I've dealt with it by defining a lot of shell functions that run the right program

#
# Use gnu find instead of the MacOS version.
find ()
{
    local find=$(type -ap find)
    local gfind=$(type -ap gfind)
    if [ -n "${gfind}" ]
    then
        find=${gfind}
    fi

    $find "$@"
}

e.g.

#

that is slightly buggy, now that I think of it: if you change PATH after the shell defines that function, you'll still get the find that it first found

digital haven
#

@fickle granite if you run man find does this give you the correct man page?

fickle granite
#

heh no idea

#

let's see

digital haven
#

🥁

fickle granite
#

nope

digital haven
#

😩

fickle granite
#

I almost never use "man" so I've never noticed

digital haven
#

god damn osx sucks

fickle granite
#

no it doesn't

#

it's just not GNU

digital haven
#

god damn bsd sucks

fickle granite
#

not sure I agree there, either. Get Colin Percival's "AMI" for ec2 and give it a whirl; it's different than what you're used to but it's pretty solid

digital haven
#

no i'm sure people have worked hard on it and that it has merits and reasons, but whatever the reason for this being a faff I'm not a fan of.

fickle granite
#

well you're allowed to not like it 🙂 I don't like it either

#

just not used to it, mostly

digital haven
#

yea - i thought it'd be more straightforward ha... I only realised that I had gfind today though. You and others suggested switching, which i wanted to do bc of the options but installs weren't working. However, they were working, it's just that I now have two versions of everything

fickle granite
#

I have a small EC2 box running gen-you-wine Linux, for all my Linux needs.

digital haven
#

i haven't got into this kinda workflow, but would like to

#

so if you're working on something, you can just zip it over?

fickle granite
#

that's one way

#

I tend to keep my life in git

digital haven
#

if there was a seamless way, or very short way, to move between vm and system that'd be great. I only have 8gb of ram 😬

fickle granite
#

I have the same setup and home and at work: laptop + ec2 instance. So I have a total of four machines I use regularly

#

I don't use VMs much on the laptop

digital haven
#

but it wouldn't make a difference i guess - in that you could have that workflow

fickle granite
#

I have 8GB on my home laptop as well

#

might have more on the work one; I've never checked

digital haven
#

example from the other day, i had a couple of 5GB files that i needed to work with

fickle granite
#

yow

digital haven
#

if i could have just transferred easily to a vm then that would have been handy

fickle granite
#

that's not gonna be easy no matter how you do it

digital haven
#

:<

fickle granite
#

you can configure virtual machines to share your laptop's file system.

#

I've played with "virtualbox" and "vagrant", depending on the virtual OS, it's easy

#

can't remember which OSs are good at that though

digital haven
#

main thing for me would be able to be in this kind of position and easily move over to VM and carry on, if that was a thing (it must be) then I'd spend a day going through a workflow, I've not had time / justification yet though as I don't know enough i guess

fickle granite
#

you should try vagrant -- it makes setting up, starting, and stopping VMs quite easy

digital haven
#

@fickle granite cool thanks - for some reason i thought that vagrant was just local, rather than being attached to a server

#

probably because i've never really used it 🤦

fickle granite
#

Can't type. Cat on forearm.

fickle granite
#

Free at last, free at last, thank God almighty, I'm free at last.

digital haven
#

i've managed to break my ssh config 🤔

#

probably shouldn't have blindly run scripts

#

adding IgnoreUnknown AddKeysToAgent,UseKeychain seemed to fix it 🤷‍♂️

south star
#

hm, doesn't that make it auto matically accept host keys the first time you connect to them without prompting?

fickle granite
#

I like the idea of warning about an unknown host, but in practice it's an annoyance

#

I have never seen anyone do anything other than just say "yeah yeah whatever" and add it

#

that includes me of course

blissful sage
#

could someone please help me out

#

im freaking out

#

none of my scripts are working

#

i recently tried to install ipython

#

and i think i screwed some thigns up

#

when i try to run a script i get a Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

#

when i open terminal i get a

#

@fickle granite sorry to ping you, but you've always been helpful and I think it's an emergency

digital haven
#

@south star i've no idea, i've no idea why it suddenly started doing it either 🙃 it worked though

blissful sage
#

I might have broken references to my virtual environments

digital haven
#

any nnn users - i thought capital R would let me rename all in a directory, it does nothing, is there something I've missed?

#

ctrl+r works for a single file

#

( I'm on OSX )

novel bramble
#

Is getting CompTIA certified in Linux a good choice?

tepid sphinx
#

^ same

main olive
#

I think its about time I learned what the use cases of docker are. I don't think I can even count the number of times Ive mentioned a problem on a more sysadmin oriented group I'm in that they mention docker. At this point I feel like its one of those things im going to shoot myself for not having learned sooner

south star
#

Docker is nice to know yeah

#

It's like ligher and more manageable VMs

#

Easier to replicate and coordinate

digital haven
#

Is it possible to recreate a directory structure from tree?

#

I would like some kind of way of being able to do tree -d on my system, then some kinda makedirs the-tree-from-before on another

south star
#

Rsync probably has a way to only copy the directory structure if that's what you need.

digital haven
#

@south star without the contents?

#

maybe I need to just send the directory with all the files deleted 🤔

south star
#

Hm, can't find an option for that in the man :|

digital haven
#

i mean - i can just copy teh dir, then find . -type f -delete

#

i just thought maybe there was a way to send a directory structure as a file that could be recreated 🤔 , maybe it's a daft thing to do though

#

problem is that we all have data dirs, that are in gitignore, and then they diverge lol

#

I think I've every dead-end of project planning so far over the past few weeks 🙃

#

thinking about it - rsync would probably be good if we had the data stored on a server or something, and could rsync to that regularly so that we all had something kinda similar... hmm

fickle granite
#

find . -type d | ssh "while read d; mkdir -vp $d; done" or something

swift heron
#

I would like to see who is connecting to my VM. i would like to know either what device they are using or what operating system they are using, for example iOS, windows, linux, mac... etc.

How can i achieve this?

oak shell
#

are you talking about ssh connections? Getting the remote IP is easy, that's logged and also reported by commands like who.

swift heron
#

Yes @oak shell

#

Yeah i know about the who command, and also the /var logs too

#

But anything to capture OS or device?

oak shell
#

I don't think that is transmitted with the ssh protocol at all... 🤔

#

or at least I can not find anything. I believe it's impossible.

swift heron
#

😦

magic basin
#

Could you not use nmap os detection?

light elbow
#

Looked more like user-agent kind of question

#

I would like to see who is connecting to my VM. i would like to know either what device they are using or what operating system they are using, for example iOS, windows, linux, mac... etc.

How can i achieve this?
@swift heron which problem are you solving?

swift heron
#

@light elbow You can get user-agent through ssh?

#

Please guide me through that

blissful sage
#

still desperately need help

#

none of my scripts are working, I think I messed up by installing different versions of python

#

now i get this message every time i open terminal

#

-bash: /usr/local/python3.7.3/bin: No such file or directory

#

and my ide can't find the image

light elbow
#

@swift heron i was referring to the general direction of the question and the http "user-agent" header.

If i remember correctly, ssh clients do send something similar. Do ssh -vvv SERVER to see. I don't remember whether it includes the OS. Again, what's the problem you are solving?

#

@swift heron

I'm asking about the problem because
https://en.m.wikipedia.org/wiki/XY_problem

The XY problem is a communication problem encountered in help desk and similar situations in which the real issue, X, of the person asking for help is obscured, because instead of asking directly about issue X, they ask how to solve a secondary issue, Y, which they believe wil...

magic basin
#

i deleted history with history -c how can i retrieve them back?

main olive
#

you can't. not easily anyways

magic basin
#

am i able to stop users bypassing bashrc using paths like /bin/sh or something like ssh -t user@host bash --norc --noprofile

#

I rely on the bashrc to call for python programs upon startup

main olive
#

no, but you can change their user shell to whatever is calling your scripts (which finally drops into bash)

#

so, for example

swift heron
#

yes i can connect into bash without bashrc

main olive
#

you set up a script /usr/bin/scripts_and_shell, which has:

#!/bin/sh
python my_python_thing1.py
python my_python_thing2.py

exec bash
swift heron
#

But that can be ignored too?

main olive
#

then you chmod +x that and chsh [username]

#

and change the shell of that user to the new script you made

#

when they ssh in, that script is automatically executed with no way to bypass it

swift heron
main olive
#

(unless they do -N, but that's a different story altogether)

#

@swift heron yes, that does -N.

#

i'm assuming this is out of the scope in this case

swift heron
#

yeah

azure flume
main olive
#

what error are you getting?

azure flume
#

cannot find cmake

#

do I just clone the repository then copy the files to ~/python3.6/site-packages?

main olive
#

no, you still need cmake

#

the readme also says you need cmake

#

on ubuntu, you'd install it with something like sudo apt install cmake

#

don't try copying the files like that, that won't work

#

the setup.py installer does things other than that as well

azure flume
#

its specifically failing at thiasds block:

       os.chdir('multicore_tsne/release/')
        return_val = os.system('cmake -DCMAKE_C_COMPILER="C:/MinGW/bin/gcc.exe" -DCMAKE_CXX_COMPILER="C:/MinGW/bin/g++.exe" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RELEASE ..')

        if return_val != 0:
            print('cannot find cmake')
            exit(-1)
main olive
#

looks like the install script is using hardcoded values for windows/mingw... not good

azure flume
#

yeah. haha. and the readme implies that it works with ubuntu, but the setup.py was obviously made for windows

#

i thought i might be missing something basic about the understanding of python modules/cmake and stuff

main olive
#

nah, it just looks like a crappy module, no offense intended

azure flume
#

thanks @main olive ill probably veer away from this module for now. 🙂

full sky
#

Hi, im on ubuntu 18.04

#

Hello, I've been trying to install ndiswrapper for some wireless drivers with make when this error came up: Make[1]: gcc: command not found
when i typed cat /proc/version, the printout said i have gcc 7.04
how can I fix this error

fickle granite
#

@full sky you need to install gcc

#

probably a whole C devlopement suite

#

@full sky what you saw in /proc/version doesn't mean that you have gcc; it means that your kernel was compiled with gcc

twin gust
#

ndiswrapper :(

full sky
#

Right thanks, and yes,kill me now

twin gust
#

personally I'd consider if the component lacking native driver support can be swapped for one that does

fickle granite
#

hosted on SourceForge, so you know it's good

twin gust
#

I feel your pain

full sky
#

yeah, ill mess around a bit more but if that doesnt work ill just change the hardware

#

thanks anyways 👍

blazing wolf
#

Anyone knows how to get python3.7 on manjaro?

#

how to specify package version to pacman?

main olive
#

manjaro is based on arch and is rolling-release, which means you'll always be on the latest

#

you'll have to install the older version manually

#

perhaps the easiest way to do that is to use pyenv @blazing wolf

blazing wolf
#

Im trying another method, using source code and then

main olive
#

yes, you can also compile from source

#

but pyenv might be useful in the future as well, I still recommend looking into it

blazing wolf
#

and running this

    ./configure
    make
    make test
    sudo make install```
#

okay

#

this method is taking ages

main olive
#

yeah, compiling from source takes a while depending on the hardware

blazing wolf
#

yea I got a crappy one haha

main olive
#

bear in mind...

#

pyenv also builds from source

blazing wolf
#

it took 8min to run make test

main olive
#

but iirc it skips tests (the third line)

#

yeah

#

tests take a while

blazing wolf
#

oh

#

I will try it next time (If i need to)

#

finally installed

main olive
#

ooh unix

#

nice choice

main olive
#

hi

#

how do I pass yes to a sh script

#

right now i'm doing

#
git clone <gitlink> && myscript.sh
#

but I want to pass yes to the shell script.. because it prompts to confirm

dreamy wing
#

is the script yours ?

sage solar
#

yes is a command that just keeps printing a character followed by a new line (default character is y)

full sky
sharp cove
#

python3 is not a directory, as the message says

#

it's just a file

full sky
#

ah right

dreamy wing
#

/usr/bin is your binary directory and not where your libraries are stored

full sky
#

ah

#

how would Ifind where my libraries are stored

dreamy wing
#

/usr/lib/python*

full sky
#

kk

#

there isnt a lib in /usr for me

#

what am I doing wrong?

dreamy wing
#
  • was the version number
full sky
#

sorry for really noob questions lmao

#

ah ok

#

thanks

full sky
#

hi again, ive been trying to install numpy with pip but it keeps installing to the wrong location, could anyone help?

#

actually scratch that

#

ive gotten it to download to the right location, but it only installs the numpy-dist-info folder

#

any idea why this is?

#

ah, so now I've found that the python path is configured as python 3.6 for me

#

how do I change this?

tame crystal
#

how can I use the pwd in another command?

#

I need to pass it as an argument to a unix command

main olive
#
./my-prog.sh $(pwd)
#

@tame crystal

#

that's called a subshell

#

subshells are executed first, and replaced with the output of the subshell

#

so, for example, if i did

#
ping $(echo "example.com")

that would expand to

ping example.com
```
tame crystal
#

Thanks

fiery badger
#

pass the command itself or its output?

#

If output, then pwd | anothercommand

proper bison
#

Can i use multiple After= statements in a ubuntu service?

final trench
#

Good day! I have a problem installing Ubuntu on my laptop. The distributor I bought it from, told me that this model of notebook does not support OS other than Windows 10...
and I am not sure in that. But here comes the problem. When I make a rufus usb with ubuntu 18.04 and plug in the usb, I boot the Ubuntu successfuly, however I get an error in like 1 minute and the notebook shutdowns... When I try to install it, this happens again. I used to research a bit and I found that the error has something to do with the GPU
This is it for now... Down below is more technical info.

  • Notebook: MSI GF63 9RCX
  • Error type: nouveau or smth like this...

When I boot the notebook with the linux usb it shutdowns in like 1 minute, showing that error - nouveau, failed to do smth...

dreamy wing
#

Probably missing firmware. Would be helpful if you gave the full error and dmesg / lspci

final trench
#

Ok I am going to send a photo but it is not with the best quality :/

#

There is also an option next to test boot - install for manifacturers

#

can it be the right one ?

south star
#

nouveau is the open source driver for nvidia

#

you could try installing with the alternate image

#

and once it's installed, you should be able to install the nvidia driver from command line, if it's not already

#

@final trench

#

ah, or with the normal installer, maybe adding the "nomodeset" option to the kernel (in the menu where you can chose "install ubuntu" or "try ubuntu without installing" there is an option to edit the kernel line, on which you can add this option)

final trench
#

Yes thank you nomodeset worked out for me

full oriole
#

Get this error when using ftp. How do I log into the server otherwise?

220 GNU FTP server ready.
Name (ftp.gnu.org:willgoldby): anonymous
230-NOTICE (Updated October 13 2017):
230-
230-Because of security concerns with plaintext protocols, we still
230-intend to disable the FTP protocol for downloads on this server
230-(downloads would still be available over HTTP and HTTPS), but we
230-will not be doing it on November 1, 2017, as previously announced
230-here. We will be sharing our reasons and offering a chance to
230-comment on this issue soon; watch this space for details.
230-
230-If you maintain scripts used to access ftp.gnu.org over FTP,
230-we strongly encourage you to change them to use HTTPS instead.
230-
230----
230-
230-Due to U.S. Export Regulations, all cryptographic software on this
230-site is subject to the following legal notice:
230-
230-    This site includes publicly available encryption source code
230-    which, together with object code resulting from the compiling of
230-    publicly available source code, may be exported from the United
230-    States under License Exception "TSU" pursuant to 15 C.F.R. Section
230-    740.13(e).
230-
230-This legal notice applies to cryptographic software only. Please see
230-the Bureau of Industry and Security (www.bxa.doc.gov) for more
230-information about current U.S. regulations.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd gnu/diction
250 Directory successfully changed.
#

Never mind. Will use wget. Thanks

main olive
#

@main olive maybe a simple .sh script which cd's to the correct directory first (you can get the path of the python file with realpath -P file.py) and then calls the python file.

vagrant fern
#

is installing unattended-upgrades on debian enough to have it automatically upgrade packages? from reading the configuration files supplied it looks like it, and apt-daily-upgrade.timer is running .. or is there something else that needs to be added?

main olive
#

@vagrant fern I'm pretty sure that's it

#

I don't remember doing anything else besides that to get unattended upgrades working

humble onyx
#

Hey guys I have a question. I am the owner of a file but I am unable to change the permissions of the file. How is that possible?

livid verge
#

sorry this was false information - you actually can change it

main olive
#

@humble onyx what filesystem? ext4?

humble onyx
#

Yes

#

I connected to a remote server and tried to change the permission on a file. It said the the operation is not permitted

#

Owner is the user that I logged in

main olive
#

odd

#

can you post the output of ls -l [file]

humble onyx
#

bandit21@bandit:/etc/cron.d$ ls -l /etc/bandit_pass/bandit21
-r-------- 1 bandit21 bandit21 33 Oct 16 2018 /etc/bandit_pass/bandit21
bandit21@bandit:/etc/cron.d$ chmod +w /etc/bandit_pass/bandit21
chmod: changing permissions of '/etc/bandit_pass/bandit21': Operation not permitted

main olive
#

is the root filesystem (or wherever /etc/ is) mounted as rw and not ro?

#

or rather, can you modify the file at all?

humble onyx
#

nope

main olive
#

post the output of mount?

#

also can you use codeblocks

#

!codeblock

shy yokeBOT
#

Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.

To do this, use the following method:

```python
print('Hello world!')
```

Note:
These are backticks, not quotes. Backticks can usually be found on the tilde key.
• You can also use py as the language instead of python
• The language must be on the first line next to the backticks with no space between them

This will result in the following:

print('Hello world!')
main olive
#

makes it a bit easier to read

humble onyx
#

what output you mean?

#

do I just write mount and hit enter?

#

I am a little noob

main olive
#

yeah

#

it lists all the current mounts if you pass no arguments

humble onyx
#
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime,hidepid=2)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=2010476k,nr_inodes=502619,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=403068k,mode=755)
/dev/mapper/vg0-root on / type ext4 (rw,relatime,errors=remount-ro)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
pstore on /sys/fs/pstore type pstore (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=806120k)
/dev/mapper/vg0-boot on /boot type ext4 (rw,relatime)
/dev/mapper/vg0-tmp on /tmp type ext4 (rw,relatime)
none on /cgroup2 type cgroup2 (rw,relatime)
main olive
#

yeah that seems fine

#

no idea, i'm stumped

humble onyx
#

somebody told me that i bit was set

#

i have no idea what i bit means

#

file could be +i for immutable

main olive
#

yes, that could be possible

#

what does lsattr [file] say?

humble onyx
#

well I did man chattr

       written to the file.  Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.```
main olive
#

yep

humble onyx
#
----i---------e---- /etc/bandit_pass/bandit21
main olive
#

there you have it

#

do chattr -i [file]

#

may need sudo

humble onyx
#
chattr: Operation not permitted while setting flags on /etc/bandit_pass/bandit21```
main olive
#

like I said, may need sudo

humble onyx
#

so I gotta be in sudo group to perform chattr on any file ?

main olive
#

you just need to have root permissions or be able to execute sudo

humble onyx
#

I got it thanks 🙂

vagrant fern
#

thanks @main olive

left ingot
#

New Unbuntu 18.04 user here, anyone know of a solution regarding low wi-fi signal? I dual-boot windows 10 and see a stark difference in performance.

#

I've come across a couple solutions, with this one being the most promising. I didn't notice any difference. Is this a catch-all solution? Or is it hardware specific? Am I barking up the wrong tree here? https://askubuntu.com/questions/1058379/wifi-signal-is-weak-in-ubuntu-18-04-with-rtl8723be

main olive
#

@left ingot could you please post the output of sudo lspci -vmm (assuming your WiFi card is internal and not, say, an USB dongle)

main olive
#

Typically I can find the cause of 502 responses on my Ubuntu webserver...

#

But this time I'm fairly stumped. Where in logs might such an error exist? I wasnt sure if this is more suited for web dev or here because its more sysadmin related.

main olive
#

2020/03/05 15:35:49 [error] 1997#1997: *67 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 192.168.1.152, server: wsi, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "192.168.1.197" I found it. Not very helpful though. I know that its not the configuration of gunicorn or nginx. Its something in my Django app that Im just gonna have to have to revert recent changes to find.

main olive
#

does the webserver's account (perhaps www-data) have rw access to /run/gunicorn.sock @main olive

main olive
#

Good day, I did something silly and delete something from my Linux, I'm running mxlinux that runs on debian. I can't open anything that uses authentication for root, that pop up does not come any longer. Only way I can open in term or through terminal with sudo. Anyone know what I delete? What's the name of the package that pops up asking for root password? Any help would be appreciated

sonic garden
#

@main olive is it perhaps the gksudo package?

main olive
#

Should it? I'm fairly new to running this server.

-rw-r--r--  1 root root  341 Feb  7 19:10 gunicorn.service
-rw-r--r--  1 root root  112 Feb  7 19:03 gunicorn.socket

@main olive
I did manage to get it working again though. It will sometimes thrwo that 502 response when I have some type of syntax error in Django. I usually just go back and correct it but this time I couldnt find it.

It probably has something to do with not being able to proxy pass.

I probably should be developing on a development test server and not a pretend production server.

main olive
#

the web server needs to be able to send commands to gunicorn - ie, it needs read and write permissions for the socket

limpid sapphire
#

Not python related but if anyone knows I might aswell ask.
default acl for a directory : default:user:my_user:rwx
rsnapshot takes a backup of some files everyday, acl for the files : user:my_user:rwx #effective:---
What's the point of setting acl if the effectives permissions don't reflect it ? ...

main olive
#

i'm guessing they are masked? @limpid sapphire

limpid sapphire
#

mask::r-x and default😷:rwx for the directory but mask::--- for the file yea

#

I just don't understand where that mask::--- on the file comes from

dark knoll
#
[ 5291.078522] ata3: hard resetting link
[ 5296.966378] ata3: link is slow to respond, please be patient (ready=0)
[ 5301.126293] ata3: SRST failed (errno=-16)
[ 5301.126300] ata3: hard resetting link
[ 5302.134319] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[ 5302.141865] ata3.00: configured for UDMA/33
[ 5302.141899] ata3: EH complete
#

i found this error in dmesg is this a sign of hard drive failure

main olive
#

it might be, or it might not be. there's no way to know without doing proper diagnostics on the drive

quaint mirage
#

you can check the health status of your drive using S.M.A.R.T. information

#

sudo smartctl -H /dev/sda

#

or whatever drive you want to target

#

oh, you might need to check if S.M.A.R.T. is supported / enabled on the drive (should be) with sudo smartctl -i /dev/sda

#

there are also tests you can run using smartctl, check the manual

humble onyx
#

I have a question about manual page syntax.
git [--version] [--help] [-C <path>] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] [--super-prefix=<path>] <command> [<args>] here there are <command> and [<args>] I am told that angle brackets indicate that the enclosed element is mantadory and as for the square brackets, the enclosed element is optional. What is meant by [<args>] then?

limpid sapphire
#

Maybe that depending on the command args may or may not be mandatory @humble onyx

main olive
#

@humble onyx angle brackets do not indicate that the enclosed element is mandatory. Angle brackets instead indicate that it is a "variable" - ie, you should replace the <thing> with something meaningful. Elements without angle brackets mean they should be input as-is

#

for example

#

in your help message

#

[--git-dir=<path>]

#

the square brackets indicate that the entire thing is optional. The angle brackets around path indicate that it should be replaced with something meaningful - ie, the actual path to the git directory

#

there are no angle brackets around --git-dir=, which means it should be input as-is

#

so [<args>] means that it takes optional arguments after <command> - however, those arguments are variable and should be replaced with whatever you're trying to do

#

i hope this makes sense

humble onyx
#

@main olive Thanks It makes a lot of sense

candid igloo
#

diff path/to/file1.txt path/to/file2.txt
[nothing]
diff -y path/to/file1.txt path/to/file2.txt
bunch of output... but as far as I can tell I don't see any differences between the left side and right side of this side by side

meanwhile I'm trying to port over my python web scraping with selenium over to linux and in windows there's a powershell commandlet that pretends to be diff but all my output is straight up empty and I don't know if there's a side-by-side/-y option in the powershell (hence one of the reasons I'm trying to run my code in linux)

my head is spinning. how on earth could the layout of the output change whether or not there's any output at all? that makes no blasted sense.

is it possible there's whitespace changing? spaces, newlines, and tabs could be invisible...wait, nope, I've opened my two files in notepad++ and they look the same and that thing shows me spaces and tabs. OK yup I'm officially lost

#

does diff have a character limit per line?

warped nimbus
#

Does sound like a whitespace issue

#

Have you checked it's not a line ending difference? e.g. LF vs CRLF

#

diff has some flags for ignoring whitespace changes

candid igloo
#

Oh! I will read on that. 🤞 fingers crossed that's it

#

sha256sum a b
same. something is FUNKY with hashlib because EVERYWHERE else things check out

candid igloo
#

but I do the same in powershell on windows and the hashes are different.

humble onyx
#

hey guys I have a question how does $0 by itself get executed? I understand that in a script $0 refers to the script name. I tried this in vim :!$0 a new bash process took up the whole screen. It just doesn't make sense

oak shell
#

this seems vim specific. tbh, I only know how to quit it, but I will just assume that :!whatever will run that command in a shell

#

then for that new shell process, $0 would be the shell executable itself, i.e. bash.

sturdy fractal
sturdy fractal
#

tried again, it worked

fickle granite
#

good

#

I have a big pile of stuff that I need whenever I build python from source, but I can never remember it all

charred lake
#

hello guys i wonder if i can find someone that can explain a little bit how can i use docker offline

atomic ridge
#

Hey so i recently reinstalled Opensuse Leap 15.1 and kept my home directory. Re-downloaded the Jetbrains Toolbox and told it to reinstall Pycharm and Intellij, but even after that the .desktop files dont work. I can start both just fine with the Toolbox and with the .sh directly, but not via the desktop icon. It bounces for a short time (KDE) but then it stops and nothing happens. This is the .desktop:

[Desktop Entry]
Categories=Development;IDE;
Comment=Python IDE for professional developers
Exec="/home/technofab/.local/share/JetBrains/Toolbox/apps/PyCharm-C/ch-0/193.6494.30/bin/pycharm.sh" %f
GenericName=
Icon=/home/technofab/.local/share/JetBrains/Toolbox/apps/PyCharm-C/ch-0/.icon.svg
MimeType=
Name=PyCharm Community
Path=
StartupNotify=true
StartupWMClass=jetbrains-pycharm-ce
Terminal=false
TerminalOptions=
Type=Application
Version=1.0
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=
#

when i run this in the console it works fine: "/home/technofab/.local/share/JetBrains/Toolbox/apps/PyCharm-C/ch-0/193.6494.30/bin/pycharm.sh" %f

quaint mirage
#

tried removing %f?

primal snow
#

Howdy folks. I'm on Deb 10 (raspbian) and I seem to have installed python, python3, pip, pip3, and venv without error, but virtualenv foo returns

ERROR:root:failed to read config file /home/pi/.config/virtualenv/virtualenv.ini because OSError(13, 'Permission denied')

and /.config/ does not even seem to contain such a file as virtualenv.ini. Any hints?

main olive
#

tried making the file in that location?

#
mkdir -p ~/.config/virtualenv
touch ~/.config/virtualenv/virtualenv.ini
#

@primal snow

main olive
#

@main olive can you post the output of echo $PATH for me?

#

ubuntu generally doesn't ship without python as far as I know, so unless you removed it yourself it's just missing from your path

#

also you appear to be using /bin/sh?

#

its the PATH

#

odd, can you post the output of ls -l /usr/bin/python*?

#

@main olive

#
lrwxrwxrwx 1 root root       9 Oct 25  2018 /usr/bin/python3 -> python3.6
lrwxrwxrwx 1 root root      16 Oct 25  2018 /usr/bin/python3-config -> python3.6-config
-rwxr-xr-x 1 root root    1018 Oct 28  2017 /usr/bin/python3-jsondiff
-rwxr-xr-x 1 root root    3661 Oct 28  2017 /usr/bin/python3-jsonpatch
-rwxr-xr-x 1 root root    1342 May  1  2016 /usr/bin/python3-jsonpointer
-rwxr-xr-x 1 root root     398 Nov 15  2017 /usr/bin/python3-jsonschema
-rwxr-xr-x 2 root root 4526456 Nov  7 10:44 /usr/bin/python3.6
lrwxrwxrwx 1 root root      33 Nov  7 10:44 /usr/bin/python3.6-config -> x86_64-linux-gnu-python3.6-config
-rwxr-xr-x 2 root root 4526456 Nov  7 10:44 /usr/bin/python3.6m
lrwxrwxrwx 1 root root      34 Nov  7 10:44 /usr/bin/python3.6m-config -> x86_64-linux-gnu-python3.6m-config
lrwxrwxrwx 1 root root      10 Oct 25  2018 /usr/bin/python3m -> python3.6m
lrwxrwxrwx 1 root root      17 Oct 25  2018 /usr/bin/python3m-config -> python3.6m-config
#

so it's there, but there's no symlink from /usr/bin/python to /usr/bin/python3

#

workaround: use python3 to call scripts instead of just python
solution: create the symlink manually. Generally not recommended unless absolutely necessary

#

ya i called it python3

#

and it works, yes?

#

no same

#

error

#

wat

#

can i see how you're calling the script?

#

sure on emin

#

so something inside the script is probably calling python via system calls, which is... very bad

#

can you do sudo ln -s /usr/bin/python3 /usr/bin/python and try again?

#

nthing came

#

yes, that's normal

#

now try the script again

#

ty now wrking....

primal snow
#

@main olive yea I got it straightened out with chown, ty

main olive
#

alright, cool

magic basin
#

How do i force a user to run a script without using the bashrc

main olive
#

you change the user's shell to the script and add exec bash to the end of it

#

is the most surefire way

#

@magic basin

magic basin
#

But they can login without a shell @main olive

main olive
#

ok, this seems like a xy problem

#

what are you trying to do?

magic basin
#

I told you

#

To get them to run a script when logging in?

#

Your solution doesn't fix it

main olive
#

"logging in"? that's a vague concept

#

you can't login via tty without invoking the shell

#

ssh-ing in isn't the same as "logging in"

magic basin
#

connecting, then.

main olive
#

connecting to what?

magic basin
#

And yes

#

It's under protocol options

#

Connecting to a linux environment

main olive
#

I'm going to assume you mean via ssh

magic basin
#

you're aware of -F right?

#
 -F configfile
     Specifies an alternative per-user configuration file.  If a
     configuration file is given on the command line, the system-wide
     configuration file (/etc/ssh/ssh_config) will be ignored. The default 
     for the per-user configuration file is ~/.ssh/config.
main olive
#

what?

magic basin
#

-F /dev/null

main olive
#

this has nothing to do with the daemon config

#

this is the client config

magic basin
#

that's the sshd config

main olive
#

please read the text again

magic basin
#

yes

#

/etc/ssh/ssh_config

main olive
#

mainly where it mentions /etc/ssh/ssh_config and ~/.ssh/config. Those are user configs

#

the daemon config is /etc/ssh/sshd_config

#

notice the d

#

if you could bypass the daemon config, that would be a HUGE security issue

magic basin
#

So it is not possible?

main olive
#

what's not possible?

#

the thing you're asking for? it's very much possible, reference: the link I posted

#

bypassing the ssh server's daemon config? no, that's not possible.

magic basin
#

Maybe not the whole daemon config but specific variables in the config

#

Can be overrun by the client

main olive
#

dude, no they can't

#

a connecting client can not change or bypass config values set in the daemon config file

#

a LOT of options would be meaningless otherwise, such as the chroot options, or anything starting with Allow

#

can you please show me how you'd bypass ForceCommand?

magic basin
#

What?

#

There's no variable for that

main olive
#

you're saying you can bypass or disable ForceCommand

#

how would you do that?

magic basin
#

But there is for passwordless authentication

main olive
#

... what?

#

did you read the link I sent you

magic basin
#

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no (hostname)

#

this

main olive
#

yes, those are modifying user config variables

#

not the daemon config variables

#

ForceCommand is a daemon option

magic basin
#

yes

#

i am aware

main olive
#

so i return to my previous question

#

how would you bypass ForceCommand?

#

i'm curious what your thought process is

#

and how i can help

magic basin
#

Idk?

main olive
#

because currently I'm not sure what's wrong with the solution I've given you

magic basin
#

Well for starters exec bash isn't even recognised

main olive
#

exec bash was for the shell-based solution, not the sshd config one

magic basin
#

So what is your solution?

main olive
#

the link I sent you

#

is my solution

magic basin
#

ah

#

ForceCommand

main olive
#

... yes

#

the thing we have been talking about for the last 10 minutes :p

magic basin
#

Doesn't stop them deleting the file with ftp :p

main olive
#

if your users can delete /etc/ssh/sshd_config, then there's something seriously wrong with your system

magic basin
#

I'm not talking about that

#

I'm talking about the file being invoked by ForceCommand

main olive
#

the script doesn't have to be modifyable by the users

#

you can place it somewhere like /usr/local/bin and make sure that only root owns it via:

chown root:root /usr/local/bin/myscript.sh
chmod 644 /usr/local/bin/myscript.sh
magic basin
#

If root owns it

#

I don't think they would have permission to even run it

main olive
#

uh

#

most binaries/scripts on your system are owned by root

#

do ls -l /usr/bin/ping for example

#

you'll see that it's owned by root (root root - user and group)

#

you'll also see rwxr-xr-x

#

you can split that into rwx, r-x, and r-x - owner, group, and everyone else

#

meaning the owner can __r__ead, __w__rite, and e__x__ecute it, but the owner group and everyone else can only read and execute it

magic basin
#

Yeah you're right this solution does actually work

main olive
#

👍 no problem dog

magic basin
#

dawg

#

But give me some time i will find a work around

main olive
#

please do ping me if you do

craggy hamlet
twin gust
craggy hamlet
#

yeah its installed directly to the SSD in the pc

twin gust
#

I have a NUC running Debian which seems to be incapable of keeping a drive reliably connected on half its ports.

craggy hamlet
#

yeah mines similar to a NUC, its a lenovo micro pc

#

once it gets to that blank screen though it stays there

twin gust
#

probing into it i found other people complaining about the same hardware, and said front vs. back ports are ever so slightly different in how much power is delivered.

#

moving the drive to the front USB3 port ended my problems.

#

as for the SSD, no idea ...

#

probably out of scope for this server? i'd be talking to my distro support in a case like this.

#

as this is about as far from a python problem as you can get :)

main olive
#

can you not just do ForceCommand "command1; command2"

spice relic
#

when i type systemctl edit httpd.service it's a black vim page. Is it supposed to be empty?

#

blank page*

#

I thought it's supposed to have sections like [Unit]

twin gust
#

it's only overrides unless you say --full

#

(though often overridding is all you'll need, so no need to do --full)

wheat ridge
#

Got sent here...

How do I go about replacing an old version of python that's within a virtual environment with a new one? I want to switch to 3.7 from 2.7. I thought it WAS 3.7 but apparently it's not.
The virtual environment is on a raspberry pi, raspbian distro, for a django webserver using apache2 and mod-wsgi. Or, that's the plan when I fix this python problem...
I had an error on a super basic Django thing, and was like... What? Which python and python --version told me it was using 2.7 X_X

warped nimbus
#

The easiest way is to just re-create the venv.

#

If you want to save the dependencies you could use pip list to export them to a file then install them back with pip install -r requirements.txt once you have the new venv made.

#

Well unfortunately both pip list and pip freeze output version info. The latter would at least result in a valid requirements.txt file

#

You probably will end up with some outdated packages

#

If you don't have a lot of packages installed to begin with it's probably easier to just install them again manually

digital haven
#
-> % vim --version | grep python
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           +python3           +visualextra

does this mean that I have python 3 support built into vim but not python? i'm trying to setup vim for python stuff at the mo

main olive
#

i'm fairly certain python is for py2 and python3 for py3

#

not a 100% tho

digital haven
#

hrm, I can't run

:python import sys; print(sys.version) 

from within vim, it gives error:

E319: Sorry, the command is not available in this version

just trying to see what's up atm

#

(can others run this?)

main olive
#

use :python3 instead. also see :h python-2-and-3

digital haven
#

use :python3 instead
🤦

#

note - if anyone has any python + vim suggestions i'm all ears

main olive
#

neovim has had better integration with python for me personally

magic basin
#

Hi, i'm trying to ssh to my remote server automatically from my client desktop, using a .bat batch file, but it is not working...

main olive
magic basin
#

Okay

digital haven
#

@main olive fair, i was getting that impression over the last hour or so and have started setting up nvim instead

#

though it seems they use some stuff that's nvim only and some stuff that's vim only, so idk if they've just smashed together random links there 🤔

digital haven
#

is there a quick way to select 'range' from this drop down in vim? I'm finding that I have to press the down arrow, which seems a bit of a pain. I would have expected either ctrl+j to work or to be able to tab through them, something like that

magic basin
#

@main olive Hey

main olive
#

hey yourself

magic basin
#

Do you know where this is stored

#

on openssh

main olive
#

that's a putty thing

#

default openssh doesn't do that

magic basin
#

what do you mean

#

username and password prompt for ssh

main olive
#

the prompt "login as" is only displayed by putty itself

#

the ssh server expects the username as part of the authentication process itself

#

as such, the username is prompted by putty before connecting

magic basin
#

welp :/

#

what about password

#

i want to modify that

#

but idk where it's stored

main olive
#

the password for the authenticating user?

#

you can set that with passwd once you're in the server as the user

#

(or passwd [username] if you're root)

magic basin
#

I want to change the prompt for it

#

Not the actual password

main olive
#

that's entirely a putty thing

#

or whatever the connecting client is

#

openssh or whatever

magic basin
#

Sad

main olive
#

my honest suggestion? use ssh keys

magic basin
#

I seen a guy with custom username/password prompts, it was the same on every client

#

and different colour

#

but he was on telnet

#

not ssh

main olive
#

yeah, telnet behaves differently

magic basin
#

yeah i use keys, they are cool

main olive
#

telnet's "password prompts" are controlled by the server

#

so the server can set them to whatever it wants

magic basin
#

do you know what i can do to prevent users sharing their ssh keys and sharing accounts?

#

so that they use their own

main olive
#

only reasonable thing i can think of is IP whitelisting

#

but that creates hurdles on its own

magic basin
#

i thought that too

#

i love nano

main olive
#

wait til you learn vim ;)

magic basin
#

never

#

🤮

warped nimbus
#

What's this sort of syntax called in bash? command <(another_cmd)?

runic roost
#

| pipes (pipelines) the standard output (stdout) of one command into the standard input of another one. Note that stderr still goes into its default destination, whatever that happen to be.

warped nimbus
#

What would be an equivalent way of doing that if I wanted the output of another_command to be in another variable?

#

I'm trying to pass some stuff to comm

#

So it's important that delimiters are preserved properly, whatever properly even means

#
x="$()"
y="$()"
comm "${x}" "${y}"

was my naïve attempt

#

Ah I just realise it expects files, so I need to pipe them instead somehow?

runic roost
#

Something like this maybe:
$ ls | grep test > text.txt

If you want to list all files in a folder starting with the name called test and the output of that will be put into a file called test.txt. Is that something you want to achieve or do I have no idea what you are talking about? If that last one is the case than I’m deeply sorry 😊

warped nimbus
#

Oh did you just paste the documentation for pipe?

#

I was asking about <() not |

#

But maybe you were onto something anyway, I probably do need to pipe somehow to achieve what I want

#

But comm wants files and I don't have files - I have outputs from two commands.

#

And I'd rather avoid writing to temporary files.

#

<() works but it's just kind of ugly, even if I break up the command into multiple lines. I just thought it'd be nicer to have them in separate variables but it seems to complicate things.

runic roost
#

I think I understand what you are trying to achieve but I really have no clue how to help you with that one. I’m sorry.

oak shell
#

<() is called process substitution @warped nimbus https://wiki.bash-hackers.org/syntax/expansion/proc_subst - it creates a temporary FIFO file descriptor (also known as named pipes) and substitutes itself with that fifo's path - so your command ends up getting a filename as argument, but it's actually getting the output of the command fed into it.

warped nimbus
#

Thanks

wheat ridge
#

@steel verge Getting a 'sys is not defined' error when I try to run the django server via manage.py runserver

#

Is the issue an issue of permissions, I wonder? I have no idea, I have no idea how to tell, and i have no idea how to fix it if that's the case, or how to know WHEN it's fixed

#

This is actually a new one, django has not broken like this before

#

Error # 100 for this project lmao... Oh god what am i doing

steel verge
#

this is indeed weird

#

comment out the lines we just added

wheat ridge
#

k

#

Yep, works just fine when that's commented out

steel verge
#

Now, the files are in a home, did you add that user to wsgidaemonprocess?

#

WSGIDaemonProcess frontend.wsgi user=wsgi group=wsgi threads=1 like this for example

wheat ridge
#

Wait, is sys something that needs to be imported by itself? I thought it was a part of os...

steel verge
#

this is from my flask

#

yes, you need to import sys

wheat ridge
#

ah heck, sec. That might be my problem

#

k, server is up, sec...

#

gonna refresh pg and see what the error is, if any

#

same, 500 server, checking apache2 error log...

#

Same ol error as last time

#

I don't remember where to edit/check WSGIDaemonProcess and that config stuff

#

uhm... checking notes lool

steel verge
#

sorry back

#

can you show the vhost?

wheat ridge
#

Ok, so the .conf files are in /etc/apache2/sites-available, and there is... 000-default,conf, default-ssl.conf, and webserver.conf.

#

vhost?

steel verge
#

yeah, the configuration of the virtual host

wheat ridge
#

I'm sorry, I don't know what that means...

steel verge
#

It is either one of those files you just mentioned

wheat ridge
#

I'll show you both.

steel verge
#

where you defined the django server

wheat ridge
steel verge
#

okay, so one of those must go first

wheat ridge
#

This is the part of the whole problem/series of problems that I am the most shaky on, I don't know wtf to do with these two conf files. I don't know which one takes precedence, I don't know what they're doing, I don't know what needs to lead to where or if something's broken I don't know what needs to be fixed

steel verge
#

Each one of those is a so called virtual host

#

a website if you will

#

so you got 2 conflicting configurations

#

are there 2 in sites-enabled as well?

wheat ridge
#

Can I get rid of 000-default.conf altogether?

steel verge
#

/etc/apache2/sites-enabled

wheat ridge
#

sec

#

Yes, same ones.

#

They're blue in my CLI... o_O

steel verge
#

a2dissite 000-default.conf

#

Yeah, they are links

wheat ridge
#

a2dissite ?

#

2 s's?

steel verge
#

yeah

wheat ridge
#

Could not remove, permission denied. Sudo it?

steel verge
#

yeah always sudo in etc

wheat ridge
#

disabled. Reload as it says?

steel verge
#

yep

wheat ridge
#

done

steel verge
#

ok, now we use the other one as a basis for the web

wheat ridge
#

reloaded site, URL not found, tail'd error log, seeing this...

#

oh

#

Ok, so we're not done.

steel verge
#

what error did you get?

wheat ridge
#

What is looking for that wsgi script, so I can fix that path?

steel verge
#

So, the issue right now is that you have the files in your home of the user pi

#

but apache isn't that user, it probably cannot read the files and not the venv

#

What you must know, is that Linux has a very strict user policy and very strict rights

#

it isn't like Windows

#

well, user desktop Windows

#

This isn't recommended, but it will do. Addthis: user=pi group=users to the line with WSGIDaemonProcess

wheat ridge
#

The one in /sites-available/webserver.conf ?

steel verge
#

you can also edit it in sites-enabled, but yeah

#

It's the same file, the one in sites-enabled just links back to the other one

#

like a shortcut in Windows

wheat ridge
#

Is there a particular place in the line I should add those?

steel verge
#

You already have that line with WSGIDaemonProcess

#

append it

wheat ridge
steel verge
#

4th from the bottom

wheat ridge
#

I mean like where in the line

#

Like that?

steel verge
#

webserver needs to be in front

wheat ridge
#

Better?

steel verge
#

yeah

#

reload it and see if it can find it

wheat ridge
#

yeh doing that now

#

no, tailing error...

steel verge
#

ok one step further

#

oh yeah, I actuall saw that

#

The name of the process group and WSGIDaemonProcess need to be the same

#

WSGIDaemonProcess has webserver and the ProcessGroup has webserverprocess