#unix

1 messages ยท Page 22 of 1

grave jolt
#

but alsa (aplay) is almost always available

main olive
#

we need more unix up in here..

hearty scarab
sage solar
#

:nixdab:

wary barn
#

Suprisingly quite here

vagrant fern
#

in LVM, how can I remove a disk that was unmounted previously?

#

LVM still thinks the disk is active for some reason

#
$ sudo vgs
  /dev/sdb: open failed: No medium found
  VG         #PV #LV #SN Attr   VSize  VFree 
  buster-vg0   1   5   0 wz--n- <1.82t <1.33t
#

sdb was an external HDD with another vg

thick ice
#

Did you create a volume group just for sdb ?

#

It's been a while since I had to use LVM

#

I googled it and I think this might do it

vgreduce buster-vg0 /dev/sdb

but there might be more to it

vagrant fern
#

The issue is that the device is already gone

#

so all the commands that operate on it don't really work

thick ice
#
WARNING: dmsetup can wreck serious havoc with your disks so anyone using this information in the future please make sure you read the man page.
#

That sounds dangerous

vagrant fern
#

I don't see anything related to sdb in dmsetup ls sadly

#

only the underlying crypt disk and my active lvs

#
$ sudo lvchange -a n /dev/sdb
  /dev/sdb: open failed: No medium found
  Volume group "sdb" not found
  Cannot process volume group sdb
thick ice
#

What do you get with this?

dmsetup info
#

does your volume group show in /dev/ as /dev/buster-vg0 ? I forget how VG's show

marble bluff
#

where do i put py3status module? i can't find anything about path in the docs

wary barn
#

Thinking about installing linux on my computer and gonna try to stick with it this time. Any suggestions on distro? I would like to be able to play csgo and dota 2 and I am not sure if distros differ for this (I guess they shouldnt differ much). I have always used ubuntu in the past, should I try something else?

oak shell
#

My daily driver is Ubuntu. It'w probably the one you will get most support for, and it's designed to be rather easy to use.

wary barn
#

Y I might go for that unless someone can give me a good reason to go for something else. I mean why make linux harder by not choosing ubuntu ๐Ÿ˜„

warped nimbus
#

There are so many distros out there. If you do the research, you may find something you like more than Ubuntu. But if you don't feel like going through all that, Ubuntu is a safe choice

#

The support argument is good - Ubuntu is a very popular distro

thick ice
#

I've worked with Red Hat 5 and 6 for a few years and thought I should learn about 7, installed CentOS 7 at home and tried to setup Plex. I got Plex working, but for some reason, it won't connect to the network on the Ethernet port, only wifi, which I don't want for a media server.

#

So, I'm going to just install Ubuntu

#

I'll learn RHEL7 at work when I need to, at home, I'm going to use Ubuntu

#

It has great support, great repos and a ton of software.

#

CentOS and Red Hat need EPEL to get a lot of "non-standard" software, like VLC... which can be a pain to juggle sometimes.

#

Do I get XYZ package from EPEL or the OS repos? Do I need a third or fourth repo to get the packages I want? Or do I build from source? All of those questions are moot when you have Ubuntu, I've rarely had to add a repo to apt for software

#

and that's just my 2 cents..

#

๐Ÿ˜„

vast topaz
#

As someone unfamiliar with kubernetes, can anyone translate this for me? https://blog.ubuntu.com/2019/02/28/canonical-adds-containerd-to-ubuntu-kubernetes?utm_source=MOTD
Like why would I want to run my Python stuff in a kubernetes containerd instead of a docker

February 28, 2019 โ€“ Canonical today announced support for containerd in its 1.14 releases of Charmed Kubernetes and Microk8s, improving security and robustness. โ€œContainerd has become the industry-standard container runtime focused onโ€ฆ

oak shell
gritty stirrup
#

I'm not great with shell

#

But I'm trying to edit a environment variable, and then store it again

#

echo 'export BRANCH="${$CIRCLE_BRANCH |sed 's#/#\-#g'}" >> $BASH_ENV

#

This should covert a branch name / to .

#

But my quotes are terrible.

#

Can anyone show me how I would fix it? thanks in advance

#

The error is a quote-mark error

oak shell
#

@gritty stirrup change ${ ... } to $( ... )

gritty stirrup
#

echo export BRANCH="${CIRCLE_BRANCH}" |sed 's#/#\-#g' >> $BASH_ENV

oak shell
#

${} is only for expanding variables

gritty stirrup
#

This works

#

But yeah thanks

oak shell
#

well, this is static though

#

it expands CIRCLE_BRANCH immediately and writes its current value to your file

#

whereas your previous attempt would read it from the variable every time the BASH_ENV file is sourced

#

not sure which you want

gritty stirrup
#

I will find out when my pipeline fails hahaha

wary barn
#

How do u guys use netflix in linux? For the moment I use chrome (which I really dont want to do but dont got much choice)

wary barn
#

Found a way to add it to my launcher ๐Ÿ˜ƒ

mortal plinth
#

I think chrome is the only way to do it with hardware acceleration @wary barn

#

Actually scratch that

#

Netflix and linux do not work well in harmony

wary barn
#

Chrome is the only supported browser yes

mortal plinth
#

I believe it's only 720p though

#

I thought only ChromeOS had HA

wary barn
#

yes but there is a plugin for 1080p

#

dont know if it works tho as I so far only watch star trek voyager which is not even 720p

#

I dont think atleast

mortal plinth
#

No hardware acceleration though

#

Just be mindful it will slam your CPU

wary barn
#

Not familiar enough with it to know how it effects the quality of life in netflix

mortal plinth
#

Is this for watching on TV or at a desk?

wary barn
#

desk

#

Its only at 15% of cpu chrome

#

not bad

#

fluxuating between 10-15%

vagrant fern
#

@wary barn I run Debian Unstable on servers and desktop, i have switched my ubuntu server to Debian when ubuntu started putting ads into t he server motd. ubuntu is probably a better first pick for desktop though

wary barn
#

Y I will keep using Ubuntu unless I find a good enough reason to switch

oak shell
#

"ads"

#

You can still disable that part if it bothers you

gritty stirrup
#
        read -p "Please enter the path for RethinkDB: " -r
        $WIND_PATH=$REPLY |sed 's,\,\\\\,g'
        echo "RethinkDB="$WIND_PATH'\\rethinkdb.exe'"" >> .env
#

The problem here is $REPLY = C:\Users\McArthur\projects\database\rethink

#

I don't know how to stop $REPLY being interpreted, as a directory, instead of a string

warped nimbus
#

Are you trying to pipe the value of reply into sed?

gritty stirrup
#

@warped nimbus yes

#

I need to make each \ = \\

warped nimbus
#

You should be using command subsitution

#

Let me show you

gritty stirrup
#

Thanks ;D

#

I've been googling and getting no where

warped nimbus
#
$WIND_PATH="$(echo "${REPLY}" | sed 's,\,\\\\,g')"
gritty stirrup
#

That makes sense. Thank you

warped nimbus
#

And yeah added the echo in there too

gritty stirrup
#

sed: -e expression #1, char 10: unterminated `s' command

#

@warped nimbus

#
$WIND_PATH="$(echo "${REPLY}" | sed 's,\,\\\\,g')"
warped nimbus
#

use 's/\\/\\\\/g'

#

you needed to escape the single backslash too

gritty stirrup
#

I'm bad sorry

#

Stack overflow isn't the best hahaha

#

Its still interpreting it

warped nimbus
#

What do you mean?

gritty stirrup
#
scripts/deploy.sh: line 38: =C:\\Users\\McArthur\\projects\\database\\rethink: No such file or directory

#
        $WIND_PATH="$(echo "${REPLY}" | sed 's/\\/\\\\/g')"
#

That's line 38

warped nimbus
#

When doing assignment, you don't need the $ in front of the variable name

gritty stirrup
#

smh that's it now

#

I should've realized

#

ty!

warped nimbus
#

You're welcome

gritty stirrup
#

Now to do it all again in powershell hahaha

warped nimbus
#

PowerShell is easier to grasp than shell scripting IMO

#

It's like a mini C# or something

grave jolt
#

yeah power shell treats stuff as actual objects with properties which is kind of nice

#

but its syntax and how it exposes and names stuff isnt great

warped nimbus
#

Anyone know how I can find the path to a certain systemd unit file?

#

Sometime I made a while back is now failing and I want to see what's inside so I can debug it

#

No idea where it is though

#

I've checked /etc/systemd/system/

grave jolt
#

systemctl list-unit-files --type=service maybe?

#

also there might be some in /lib/systemd/system/

warped nimbus
#

Ah it's actually a mount point generated by fstab, not a service

#

Though I was supposed to create a service too

#

So it's probably not working cause the service doesn't exist :\

#

Everything just took a huge dump

main olive
#

*this channel needs more unix.. *

hearty scarab
main olive
#

anyone alive..

#

how do I replace backslashes

#

in all my files

robust cave
#

can you reply to my question in the help channel where you asked the same question?

#

@main olive

main olive
#

Okay so

#

I started in #help-grapes but was told help would be better for me here with this

#

So I installed pillow to my VPS that my bot is hosted on. And then tried to reload the cog that uses it. (Note this works on my pc when I local hosted it) But when I tried reloading the cog that was going to use pillow I got this error

#
Ignoring exception in command reload:
Traceback (most recent call last):
File "/home/container/discord/ext/commands/core.py", line 62, in wrapped
ret = await coro(*args, **kwargs)
File "bot.py", line 253, in reload
bot.load_extension(extensionn)
File "/home/container/discord/ext/commands/bot.py", line 696, in load_extension
lib = importlib.import_module(name)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/container/cogs/leveling.py", line 11, in <module>
from PIL import Image
File "/home/container/PIL/Image.py", line 94, in <module>
from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/home/container/PIL/__init__.py)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/container/discord/ext/commands/bot.py", line 898, in invoke
await ctx.command.invoke(ctx)
File "/home/container/discord/ext/commands/core.py", line 1026, in invoke
await super().invoke(ctx)
File "/home/container/discord/ext/commands/core.py", line 611, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/container/discord/ext/commands/core.py", line 71, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ImportError: cannot import name '_imaging' from 'PIL' (/home/container/PIL/__init__.py)```
#

I was told to apt install python-imaging by one person but Mr. Hemlock said apk would be the correct thing as the sever i host on using linux, alpine

#

But apk is an unrecognized thing

#

ping when responded to please

edgy minnow
dull star
#

anyone know the default script that is run when i ssh into my Ubuntu 18.04.2 server

sharp shell
#

watcha mean cap?

dull star
#

well i want my .bashrc script to be run everytime i ssh into my vps

#

but ive tried putting the command to run it in all of the profile files

#

(.profile, .bash_profile, .bash_login, /etc/profile)

sharp shell
#

ah so which shell profile is loaded

dull star
#

and none of them worked

sharp shell
#

that's a bit odd

dull star
#

so i made a custom script to run it

#

and it works

#

but I dont know if i messed things up

#

because the stuff that used to happen when i log in doesnt happen anymore

#

like all of the info about my system doesnt show up

#

so obviously there is a script that isnt being run anymore

sharp shell
#

hmmmm

#

~/.ssh/rc?

#

maybe

dull star
#

tried that

#

didnt work

#

it was being run

#

but the bashrc wasnt working

oak shell
#

there's a different between tty and non-tty ssh sessions, one of them ignores some files...

#

I looked that stuff up some time ago, but remember only half of it

sharp shell
#

yeah, i think you can explicitly enable it by specifying the login is via interactive shell

#

but that's only half a solution imo

#

why not rely on ssh/rc

#

add commands in there to load the standard profiles

dull star
#

i checked and i was in an interactive login shell

oak shell
dull star
#

ive tried all those things lmao

sharp shell
#

it's odd how inconsistent things are between versions the more i look into it

#

at any rate, if rc loaded always before, why not just add the command to load the others in there?

dull star
#

it is in there

#

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

#

thats what my rc file looks like

#

and the bashrc profile wasnt being loaded

#

hm wait i have an idea

#

that didnt work

#

now im wondering if maybe it is being run, but the way im checking if its run is being overrun by something else

sharp shell
#

lol what if it's overwritten by another thing

dull star
#

what im wanting is for my PS1 variable (the prompt) to change

sharp shell
#

wouldn't it be better to just set a certain unique envar

dull star
#

which is unhelpful in telling me anything

#

but when i source .bashrc it look slike this

#

which is what I want

#

but when i tried just changing PS1 in rc, it was being changed (when i echo'd it , it showed the correct value), but it still didnt change the prompt

#

and when i source the rc file, it changes to the correct prompt

#

im so confused

#

yup, .bashrc IS actually being run, but something is overwriting the PS1 variable

grave jolt
#

that sounds like it is NOT being run but if you think its being overwritten check ~/.profile ~/.bash_profile /etc/bashrc /etc/bash_profile /etc/profile and so on

#

there is documentation online but tldr bash is stupid and there are a ton of places it might load and it changed depending on how you log in...

dull star
#

ive looked at all of those files though

#

and i know its being run because when i echo in the file it actually echos

grave jolt
#

ah echo in the script i see. so it prints out whatever when you create a new shell instance?
in that case id look up the bash profile loading order and browse all the files to make sure you didnt miss one. it might be loading them in an unexpected order so figure out what order it loads the system vs user ones

#

if it prints out when you create a new shell instance then its certainly another script overwriting it. but make sure you are testing by sshing in, creating a new terminal window etc

dull star
#

it still prints out in another window

#

and i didnt forget any scripts PepeHands

#

hmmm

#

i have an idea

#

Why do the stupidest smartest things always work

#

i just set the PS1 variable in /etc/environment and it works

#

thats all i really wanted anyway

#

why didnt i think of this sooner

rustic jacinth
#

I have a silly question.

I'm working on a box that I don't have admin rights on, just user.

I'm trying to get the f5-sdk module installed in my home directory so that I can use it for ansible. But I'm new to python and may be getting tripped up in naming trying to get this to work.

I've grabbed the source from pythonhosted.com and put thm in my home dir.
I've run "python setup.py install --prefix=~/python" and installed them, but ansible-playbook does not seem to know they are there.

I've tried adding the library path for ansible and the PYTHONPATH variable to the site-packages directory under ~/python and it doesn't work.
I'm sure this would be straightforward to someone more familiar. Is there a resource you can point me to to get me sorted? an Example?

main olive
#
File "/home/container/discord/ext/commands/core.py", line 62, in wrapped
ret = await coro(*args, **kwargs)
File "bot.py", line 253, in reload
bot.load_extension(extensionn)
File "/home/container/discord/ext/commands/bot.py", line 696, in load_extension
lib = importlib.import_module(name)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/container/cogs/leveling.py", line 11, in <module>
from PIL.Image import core as _imaging
File "/home/container/PIL/Image.py", line 94, in <module>
from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/home/container/PIL/__init__.py)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/container/discord/ext/commands/bot.py", line 898, in invoke
await ctx.command.invoke(ctx)
File "/home/container/discord/ext/commands/core.py", line 1026, in invoke
await super().invoke(ctx)
File "/home/container/discord/ext/commands/core.py", line 611, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/container/discord/ext/commands/core.py", line 71, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ImportError: cannot import name '_imaging' from 'PIL' (/home/container/PIL/__init__.py)``` @edgy minnow So we've tried installing it to the build and a good bit of other things but we still get this error
edgy minnow
#

any chance you installed Pil & Pillow?

#

if not looks like that line94 if you switch _imaging and core

main olive
#

@edgy minnow Didn't work Failed to load extension cogs.leveling. Traceback (most recent call last): File "bot.py", line 47, in <module> bot.load_extension(extension) File "/home/container/discord/ext/commands/bot.py", line 696, in load_extension lib = importlib.import_module(name) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/container/cogs/leveling.py", line 11, in <module> from PIL import Image File "/home/container/PIL/Image.py", line 94, in <module> from . import core as _imaging ImportError: cannot import name 'core' from 'PIL' (/home/container/PIL/__init__.py)

#

How do I know if pillow and PIL are both installed?

vagrant rune
#

pip list

main olive
#

would seem I have pillow

#

and not pil

#

but it works on my local hosting just not on the server

#

which I dont get

edgy minnow
#

is that a folder called PIL?

main olive
#

Yes

lucid harbor
#

When you install pillow for python 3.x it's actually named PIL

#

@main olive

main olive
#

venvs for python 3+ don't work
python 3.7 -m venv says that it exited with non zero status code
virtualenv -p python3.7 venv raises a shutil file already exists error

warped nimbus
#

you need to specify a path when using venv

#
python3.7 -m venv /path/to/new/virtual/environment```
rapid sable
#

Is there a way to pass a env file in the command line?

#

Like in docker I can do --env-file filename.env, anything like this for python?

nimble quarry
rapid sable
#

Saw this @nimble quarry and am using it now. No native support for this?

nimble quarry
#

@rapid sable well, you can use the usual source way:

source file.env && cmd
#

e.g.:

$ echo 'HELLO=world' > test.env
$ source test.env && echo $HELLO
world
rapid sable
#

ah true, thanks

warped nimbus
#

I use bash env $(cat .env | xargs) python script.py

#

That way the env vars only apply to a specific process

oak shell
#

Or just use a subshell ( source file.env && python script.py )

#

(assuming bash or compatible shell)

nimble quarry
#

@warped nimbus yeah that sounds like the best solution here, you might also define a script to simplify the call

warped nimbus
#

Perhaps it could be done with just an alias

#

subshell sounds like an even simpler solution though I'm not sure of all the implications using a subshell would have

oak shell
#

shouldn't cause any problems, as the Python process is separate anyway

#

one more layer in between doesn't change anything regarding what the python script can do or not

warped nimbus
#

If I activate a venv, pyenv just overwrites it anyway

#

.venv/bin is clearly on the path but things like gunicorn aren't recognised

#

For context, this venv was created by pipenv

#

Ok, even with pyenv disable I still can't use gunicorn

#

what gives??

#

It's like activating the environment does absolutely nothing

#

Ok, sure enough it's just pipenv creating busted virtual environments. thanks pipenv

jolly wolf
main olive
#

@jolly wolf apt-get?

jolly wolf
#

tried that too

#

same result

sharp shell
#

do you have python installed, and if so, can you directly use it as a module through it

jolly wolf
#

i do have python installed i think

sharp shell
#

python3 --version perhaps?

jolly wolf
#

i installed python3 im installing python now

sharp shell
#

and if good, try python3 -m pip --version

#

do you mean python 2?

main olive
#

@jolly wolf your running mac correct?

jolly wolf
#

no, linux

sharp shell
#

if you have python 2.7.9+ i'm sure it has ensurepip

main olive
#

what distro?

jolly wolf
#

ubuntu

#

18

#

my python version is 3.6

sharp shell
#

of which command

#

python or python3

jolly wolf
#

python3

#

and i tried the pip command you gave me, says i have no pip

sharp shell
#

does python not work?

jolly wolf
#

im sure it does

main olive
#
sudo apt install python3-pip
sharp shell
#

python --version says?

jolly wolf
#

2.7

sharp shell
#

2.7.?

jolly wolf
#

yea

#

oh

sharp shell
#

..

jolly wolf
#

15

sharp shell
#

thank you

jolly wolf
#

rc1

sharp shell
#

why rc

#

still, it should have ensurepip

jolly wolf
#

idk thats what it says

sharp shell
#

python -m ensurepip

jolly wolf
#

says its disabled

sharp shell
#

oof

main olive
#

python -m ensurepip --enable?

jolly wolf
#

that doesnt work

#

gives same message

sharp shell
#

did you do apt update first

main olive
#

that would be a big RIP lmao

#

if he didnt

jolly wolf
#

hm

#

what command

sharp shell
#

sudo apt update

main olive
#

sudo apt update

jolly wolf
#

okay

#

ill try that

sharp shell
#

actually, i'd prefer it if he didn't do it and it works

#

because after that i don't know anything more

jolly wolf
#

ay it works

sharp shell
#

short of rebuilding the system python

jolly wolf
#

thanks!

sharp shell
#

yw

main olive
#

things tend to not work if you dont update first

#

i run linux myself

sharp shell
#

for reference kazo, the apt update command is for updating package lists

#

not the packages themselves

#

so try use it everytime you go to install things if it's been a while

jolly wolf
#

oh okay

#

yea this is my first time using linux in about 5 years and i barely used cmd then

#

so i dont know a lot

sharp shell
#

you'll get the hang of it

main olive
#

if you want some pointers dm me @jolly wolf

sharp shell
#

i'd rather encourage keeping the help in here where possible

#

it benefits the general community better then

jolly wolf
#

yea, i think id rather keep it here too, just so i could get second opinions when i dont know i need one

main olive
#

๐Ÿ˜‰

main olive
#

this channel needs more unix..

cold pagoda
#

@main olive Why do you keep repeating that?

main olive
#

really?

#

lol.. I dont know.. it always gets me down this is the least active channel.. There used to be a small unix discord but it's not there any more..

#

feels like this is the last stand :v

green fog
#

There's quite a big linux discord.. Not sure wether it's official

green fog
#

It's linux as opposed to *nix, but eh.

oak shell
#

there are quite a few discord communities centered around a Linux distro, or Linux in general. I run one myself.

latent hamlet
#

hi gang

#

im using telnet to login to something

#

is there a way to telnet (ip) and then login (pw) in one command?

main olive
#

really? Im on one linux discord.. gentoo linux.. doesnt seem to be very active

oak shell
#

that is one of many

green fog
#

@latent hamlet I'm guess it's similar to SSH, where you can't do that with the bash command

#

I'd suggest looking for a python package

#

Like paramiko for SSH

green fog
#

There was a way you could use expect but it was a bit messy to setup.

dim apex
#

I am trying to setup a script to clone a private git repository on github. I have setup a pair of ssh keys that work normally (I can do git clone ssh_gitlocation) however when I put the same command in a script it does not work

#

The script I am using:```bash
#!/bin/bash

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

cd /home/pi
sudo rm -r DatabaseEndpoint
sudo git clone git@github.com:xedre/test.git

warped nimbus
#

Could sudo have something to do with it?

dim apex
#

?

warped nimbus
#

Have you tried cloning without sudo

dim apex
#

yes it does apparently

#

thank you ๐Ÿ’™

warped nimbus
#

np

main olive
#

how do you use regex with grep

#

I dont even know which regex type to use with grep x.x

#

is it perl..

main olive
#

anyone? :v

#

I want to do this

#

find dirnamehere -type f -exec grep 'name: "\d+"' {} +

#

but \d+ probably isnt right

main olive
#

...well is it? does it work?...

oak shell
#
  • is not interpreted by basic regex flavour
#

you can either use \+ in basic flavour or switch to extended with grep -E

#

and \d is only recognized by PCRE-compatible flavour, so grep -P is needed (which includes everything -E supports)

#

or you use [0-9] instead

#

any of these should work: grep '[0-9]\+', grep -E '[0-9]+', grep -P '\d+' @main olive

upper shale
#

is it possible to use philips hue motion sensor a script trigger on a linux system. i am not familiar with their api

main olive
#

doesnt work for me :<

#

not sure what I'm doing wrong

#

find dirname -type f -exec grep 'name: "[0-100]+"' {} +

#

oh wait.. got it

gilded basalt
#

Do you want the output of dirname?

main olive
#

what does -E and -P do

#

I pass my find results to grep

gilded basalt
#

I don't know, maybe look at the man page?

main olive
#
-type f -exec grep -E 'name: "[0-100]+"' {} + 
#

this worked

#

how do I access the man page

#

man grep ?

gilded basalt
#

Yes

main olive
#

oki

gilded basalt
#

There are also a number of websites that host the manpage

main olive
#

oh cool.. that's useful

gilded basalt
#

You can also search in the man viewer

#

Can't recall how, it'll show you if you press h or something

main olive
#

hmm.. I'll use the websites.. much easier to scroll through..

#

i did not know this before.. hindsight 2020

olive verge
#

Good tutorial for installation of Unix on windows8.1?

robust cave
#

what are you installing?

main olive
#

I vaguely recall there being an alternative for powershell..

cold pagoda
#

There are some terminal emulators that use Git Bash to give you a Linux-like terminal on Windows

#

In Windows 10, you can use Windows Subsystem for Linux as well

#

Although that's basically a cmd-line only install of a distro, but it does give you the functionality you're probably looking for

#

Unless you're talking about installing a dual boot (linux/windows), then ignore everything I just said

grave jolt
#

windows 10 has the linux subsystem for windows thing where you can install ubuntu as a windows program and have access to a lot of nice tools

main olive
#

I wana make this script run a .py file

#

but its in a different directory

#

and I need it to be run in that directory

#

never used .sh files before so looking to learn something new

#

especially why shebangs exist

oak shell
#

you can just cd /some/other/folder to change the working directory of your script

main olive
#

oh right lol

#

can you explain a shebang?

oak shell
#

when Linux sees a file that is marked as executable, it looks at the first few bytes to determine the file type so that it knows what to do with it

#

the shebang looks like a valid comment to most script languages

#

but it tells Linux the path to the interpreter this script wants to be executed with

main olive
#

what path?

#

if it needs the filetype why not just have bash?

oak shell
#

so if you have #!/bin/bash in my_script.sh, and run that script, Linux will execute the command /bin/bash my_script.sh

main olive
#

oh I se

#

so its like

#

cd but before running the script

oak shell
#

For Python, you'd usually use something like #!/usr/bin/env python3

#

which executes the /usr/bin/env command with python3 as first and your script path as second argument

#

it doesn't cd

#

just the absolute path to the interpreter executable

main olive
#

why can't they just have it by default

#

and why bin

oak shell
#

that's just where these executables normally are located

main olive
#

@oak shell but, why just the first folder that the executable is in?

#

why do you need it?

oak shell
#

wdym first folder

#

it's the full absolute path to the interpreter

#

not sure if the absolute or relative path to the script is passed, probably whatever you entered to call it

main olive
#

What does the path represent?

#

is it like the path to the script

#

then why just the bin part?

#

and not any folder before it?

#

and by what I entered to call it, like what?

#

@oak shell

#

sorry this is confusing for me

#

I am probably just not getting it

oak shell
#

/bin/bash is the full complete absolute path to the bash interpreter executable

main olive
#

so its so linux knows its bash?

oak shell
#

if you call your script containing #!/bin/bash as ./foo.sh, it will probably execute the command /bin/bash ./foo.sh, if you call the script /home/lime/foo.sh it will run it as /bin/bash /home/lime/foo.sh, I assume

#

whatever there is after the #! will be used to construct a command that gets the actual script path appended as last argument, and then will be executed

main olive
#

so is it always /bin/bash for .sh files?

oak shell
#

it is whatever you write

#

for Bash, you normally use /bin/bash, because on most Linux systems that is the absolute path where you would expect a bash interpreter

main olive
#

wait

oak shell
#

/bin/sh is also common for shell scripts that don't have bash-specific features

#

can also be e.g. /usr/bin/python

#

or everything, even your own interpreter, whatever that might do with the script it's supposed to run

main olive
#

oh waiiiiit

#

so like when you do python file.py

#

its the python part

#

so like its the same as
/bin/bash file.sh

#

is that what it is?

oak shell
#

yes

main olive
#

I GET IT

#

AAA

#

thanks so much :D

#

so if I have this .sh file:

#!/bin/bash
cd ../src
git pull
python3.7 myfile.py

is that valid?

#

so it git pulls

#

gets latest data

oak shell
#

yes, but it has flaws

main olive
#

im listening...

oak shell
#

first, shouldn't it be python3?

main olive
#

right

#

actually 3.7

#

since I have 3.5 installed too

oak shell
#

then, .. will be relative to your current working directory, which is any arbitrary location

main olive
#

how would I write it?

#

my directory looks like this:

  โ”œโ”€โ”€ bin/
  โ”‚   โ””โ”€โ”€ run.sh
  โ”œโ”€โ”€ src/
  โ”‚   โ”œโ”€โ”€ __init__.py
  โ”‚   โ””โ”€โ”€ myfile.py
oak shell
#

usually something like cd "$(dirname "$0")/../src" should work, I guess

main olive
#

2 things:
can you explain that syntax?
and second, lets say I run.sh by doing subprocess.run("../bin/run.sh") inside of myfile.py, is the current directory at myfile.py, or at run.sh?

plain bramble
#

$() is the subshell notation, so dirname "${0}" or $0 gets evaluated in the subshell, which then gets interpolated into the string. the 0'th parameter is the path it got invoked from including the script name.

main olive
#

im lost

plain bramble
#

hmm, that a bit simpler

#

Imagine you have a script like this

#!/bin/bash

echo "${0}"
#

if you call that, it prints
./script

#

if you have called it from the current directory that is (which it is in)

main olive
#

umm

#

why ./script?

plain bramble
#

script is just the name

#

./ is from current directory, call script

main olive
#

of what?

#

oh

#

JESUS

#

ok I got it

#

๐Ÿ˜…

plain bramble
#

it already knows it's bash because of #!/bin/bash

main olive
#

ok

#

uhh

#

all I want to do

#

and that runs my python program

#

but I need it to be able to do so, also when called from anywhere

#

so like

#

but also if I run normally

#

like inside its directory

plain bramble
#

two ways (*):

you find it, regardless of where you are

or

you use a hardcoded path, that does not change

or

you path the path as a variable
main olive
#

path the path?

#

hmm

#

what does that mean?

#

like send the path to the file?

#

how do I do that?

#

also question

#

if I run run.sh from anywhere, is the current directory where I ran it, or where run.sh is?

plain bramble
#

Stop confusing things:
your current path is determined by ${PWD} enviroment variable
The path your script is run is changing depending on what path you are calling it from
and the path of the argument, doesn't change at all, if you have one (that's not relative)

main olive
#

ok so the path used is the where you ran it from

#

gotcha

#

so uhh

#

${PWD} <- I am still confused on this

plain bramble
#

okay, sorry I didn't explain it

#

${} is basically the safe method of writing a shell variable
the contents of the brackets are the name of the variable

#

if on any unix/linux system you want to know which variables currently exist you can call set

#

pwd is shorthand for Pathname of current working directory

main olive
#

ok so then how do I somehow get my script to run correctly wherever I call it?
your first method is I find it wherever I am

#

how?

plain bramble
#

if you dont change the name of the script, you can use that as the searchkey

#

find . -type f -iname "scriptname" and use find to locate the script on the system

#

if you want a more cryptographic approach, you can embed a key in the file as a signature

main olive
#

hmm

#

why is it so hard just to make a sh file run regardless where you run it from

#

also how long will that find take?

plain bramble
#

Depends, if it's in the current directory it's quite fast (like not even a second)

#

but if you start from root, it can take quite long which is maybe not what you want

main olive
#

yeah lol

plain bramble
#

so you may rather want to look if the script exist in the path of the shell

#

which is the 'common' lookup path for shell-scripts

main olive
#

what

#

theres a shell

#

and a script

#

what do yo u mean the path of the shell?

plain bramble
#

for example if I want to use my shell and run a script that I previously made

#

I dont put it somewhere randomly on my drive or the directory I started working on it

#

but I put it under /usr/local/bin/

#

my shell knows that this directory exists, and looks there first

main olive
#

oh I see

#

but its like

#

the full path

#

hmm that works

#

so I just change the directory to a full path

plain bramble
#

yes, that's one way

main olive
#

ok,

plain bramble
#

sorry, I find those things more intuitively

main olive
#

yeah

#

ok so I do like

#

if windows

#

(as an example)

#

cd C:something/somethingels/ssdf

#

sorta

#

but the thing is

#

that only works on one system

plain bramble
#

windows has bad and different shell support

main olive
#

yeah but the idea is cd the/full/path/of/a/folder

#

also is there a command that gets the directory that the shell script itself is in?

#

extra side note, can you do git pull anywhere inside of the directory? not just the root folder of it?

plain bramble
#

that not a full path, that is a relative one
yes current directory as implied is pwd, and yes but it depends on if a git repository exists in the current dir, which may not be the one you want to git pull for

main olive
#

wait pwd?

#

so like

#

ok here is what I want to do right now:
get the path of where the script is, using pwd(?)

#

so its like

plain bramble
#

no

#

pwd give you the path the shell is currently displaying (aka the directory you are in or something of that kind)

main olive
#

how do I get the path of where the script is then

plain bramble
#

your shell script however, that's still where it is. pwd is not a program to search something with

main olive
#

in the simplest, universal way possible?

plain bramble
#

though you can use pwd to use the path for something other then the current

#

dir

main olive
#

oh I see

plain bramble
#

find / -type f -iname "script" for example

main olive
#

that uses pwd as the first place it checks?

plain bramble
#

no

#

wait

main olive
#

and checks farther and farther away from it?

plain bramble
#

this algorithm starts from root

#

we are talking about two things.

#

one is the logic and smartness of the shell

#

the other is that you can start searching with find from a given directory like root

#

if you are intelligent you may want to use good pathes first

#

find /usr/local/bin/ -type f -iname "scriptname"

#

and then check if the result is [ -z "${value}" ]... but I'm not sure if you want to go that way

#

if you really just want to call it easily

#

like that's all but another can of worms

#

/usr/lib/llvm/7/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin for example those are the pathes you could look at "first"

main olive
#

ok but how can I make it work regardless of the system?

plain bramble
#

you do it in python and use os.walk

#
import os, fnmatch
def find(pattern, path):
    result = []
    for root, dirs, files in os.walk(path):
        for name in files:
            if fnmatch.fnmatch(name, pattern):
                result.append(os.path.join(root, name))
    return result

find('*.txt', '/path/to/dir')
main olive
#

can you explain what is going on?

plain bramble
#

give me a second, i will be right back

#

ok

#

So this is a function that finds a file, given a pattern and a directory from which to start

#

and then is recursively 'walks' through the filesystem to look for that pattern, basically

main olive
#

hmm

#

so what do I put for /path/to/dir

#

is it pwd?

plain bramble
#

well depends on how you want to do things. You wanted to make it system independent, so you may not have pwd as you like it

#

the current directory you called something from is also different in python os.getcwd() vs bash pwd

main olive
#

I want a simple, system independent way, to get the path of where the script lies as fast as possible

plain bramble
#

I mean nothing hinders you from looking in the current directory first, but if it doesn't return the value you expect, then you have to check other directories too
and from a heuristical standpoint, each directory is differently likely to hold your script depending on the OS

main olive
#

how about this

#

can I force it to run only if it is run in the same directory?

#

but at the same time

#

can I somehow make python run script.sh but change directory first?

#

like make python run it, at its directory

plain bramble
#

yes or you can only run it if you give it it's paired script name as a parameter

#

if you know where it is, you can os.chdir() to it and call it. If you don't you have to find it first

main olive
#

wait so chdir, how does that work?

#

or lemme rephrase that

#

os.chdir("./bin") changes WHICH directory, to the bin folder

plain bramble
#

...

#

os.chdir("../bin") does change the current directory to it's parent directory, and then that parent's bin directory, if that exist
that is not the same as /bin/

main olive
#

cuz im so confused, you have the current directory, the then you have the path your script is run

plain bramble
#

./bin, is the current directory,

main olive
#

so like

plain bramble
#

I show you then

main olive
#

sorry ๐Ÿ˜ฌ Thanks for not giving up yet...

plain bramble
main olive
#

oh yeah I know .. moves to the parent directory

plain bramble
#

in my shell [test] display my current directory

main olive
#

just the way I described it was odd

#

so I just made it simpler and edited it

#

so for my .sh file

#

can I use the info on where the script was run from, and then check if that path has script.sh, if so, you called it in the same directory, else, close

#

like pwd

plain bramble
#

you probably dont have the info of where the script was run from

#

or do you mean from the shell?

main olive
#

uhh

#

idk anymore

#

you said like

#

pwd

#

I thought that was the info on where the script was run from

plain bramble
#

Sorry, I was just making sure the context was right. For example if you have a certain chain of events, the information may get lost.

main olive
#

ok...

#

so what do you know then?

#

also what do you mean by .sh files have parameters?

plain bramble
#

okay

#

If you have a shell script as I said earlier, ${0} is a parameter that contains the path the script is called from including it's name

#

if you path a second parameter like it would be denoted by ${1}, you can read that too

#

in python, depending on how complex you want to get, you have argparse or argv

main olive
#

wait so there a scripts and there are shell scripts?

#

is .sh a shell script or a script?

plain bramble
#

no

#

It would confuse you more then it should. I mean python is technically not a shellscript, but maybe in some cases if it's called from a shell.

#

so anyway that's stupid

#

I'm not quite sure, but do you want to call both ways, aka: python scripts calls shell script and shell script calls python script? So far, I assumed you wanted to use the python script to locate the shell script and call it.

main olive
#

Nonono

#

I have a python file, and in it, I want to call to this .sh file

#

But I need to call it to the .sh file while ensuring the the current directory is the same as where the .sh file is

plain bramble
#

give me a second, I have one other task, but then I can give you working code example of what you want

main olive
#

And some way to have the .sh file only run if the current directory is in the same place as the .sh file

#

Oh that would be helpful to study, thanks!

raven kernel
#

Is this where I ask a probably simple linux question?

main olive
#

you want to run a python script using an sh script?

#

do you want to pass arguments using the sh script too?

#

@plain bramble thanks for helping me btw, will you be able to have time to explain the working code snippet?

#

It's ok if you can't, ill just try on my own

plain bramble
#

I will take a while I guess, so you can start at subprocess in python if you want

main olive
#

Cuz like all the stuff done in python is os.chdir and then sp.run script

#

The next thing is figuring out how to get my script to only run when it is in the same directory as itself

#

Sort of like python's if name in main

#

The rest are just simple commands that I hope don't need anything

#

And I need to exit out of my python program at the end too

raven kernel
#

I have a question about zipping and unzipping files. On a server at work, we have a directory /pos/apps/ and in here are a few shell scripts example1.sh and example2.sh. These shell scripts are then zipped up and placed on remote pc's in different directories such as /home/user/bin/example1.sh /opt/environment/example2.sh. We unzip them using unzip -o: example.zip. My question is, how do you specify the path the files will go to once unzipped?

main olive
#

@plain bramble sorry to bother you again but

plain bramble
#
              An  optional directory to which to extract files.  By default, all files and subdirectories are recreated in the current directory; the -d option allows extraction in an arbitrary directory (always assuming one has permission to write to the directory).  This option need not appear at the end of the command line; it is also accepted before the zipfile specification (with the normal options), immeโ€
              diately after the zipfile specification, or between the file(s) and the -x option.  The option and directory may be concatenated without any white space between them, but note that this may cause normal shell behavior to be suppressed.  In particular, ``-d ~'' (tilde) is expanded by Unix C shells into the name of the user's home directory, but ``-d~'' is treated as a literal subdirectory ``~''  of
              the current directory.```
#

@raven kernel

main olive
#

How do you exit a python program?

#

Correctly

plain bramble
#

import sys
sys.exit()

main olive
#

I heard of os.exit

#

Oh sys.exit

#

Are there parameters?

plain bramble
#

it's quite graceful

#

you can pass a exit message

raven kernel
#

Thanks @plain bramble. That will definitely lead me in the right direction. I will look into this option more. Thanks again.

plain bramble
#

@main olive did you make any progress?

main olive
#

@plain bramble no, not really, I think I have figured out everything except only running when it is at the right directory, also you forgot to give me a code snippit.

#

my .sh file looks like this:

#!/bin/bash
cd ../src
git pull
python3.7 mybot.py
hasty thicket
main olive
#

@plain bramble are you there to help me?

plain bramble
#

@main olive
Not beautiful, but maybe just to find your script in a few common locations on linux/unix (as you are using bash)

 $(echo "${PATH}" | sed "s/:/\n/g" | xargs -I % bash -c 'find "%" -mindepth 1 -maxdepth 1 -type f -iname "script" -print -quit 2> /dev/zero' | head -n1) 

you could then assign that value to a variable by
scriptname = $(...
and run you script by python
python3.7 "${scriptname}"

#

@main olive you may also want to change the python version you call to run you script
by adding the shebang in your python script and just call it from bash aka ./script
the shebang would look like

#!/usr/bin/env python

if you want to run python from the enviroment variable but there are other way you can ensure only certain versions of python are run, if that's what you need

main olive
#

is it possible to run lisp from shell..

#

I'm trying to convert an expression to csv.. found cl-csv in lisp.. exhausted all my options at this point

#

it's an s-expression I've been trying to handle with pyparsing.. but can't seem to get around it

robust cave
#

can you explain further? @main olive

main olive
#

I have this weird s-expression .. nested within it are expressions that point to how sentences will be parsed... and sentences as well along with reference ids..

#

need a way to parse it and put it in a csv.. I can do it with regex, but I'm looking for something concrete

#

I tried sexpdata module.. it works.. a little bit.. If I can build off of that, it'd be cool..

#

because sexpdata recognizes comment lines # as part of the expression

robust cave
main olive
#

let me try this

#

this is similar to sexpdata.. I think I'll stick with sexpdata.. or try to rewrite it to suit my purpose..

#

because sexpdata is able to isolate symbols.. so I could use that as a reference field.. and see how much it is populated..

dull vigil
#

I have ubuntu 10.10

#

A really old server

#

And there is nothing in the user directory

#

So I canโ€™t run Sudo, apt, su, passwd, etc.

#

Can I just install the latest Linux?

#

Will it fix my issues?

#

Ok it has su

oak shell
#

wdym nothing in the user directory? /usr or /home ?

#

and yes, 10.10 is ancient and out of support for roughly eight years. IMO it's not even worth upgrading that system, especially if some things are potentially broken already. Back up all data and do a fresh install of the latest LTS release, i.e. 18.04

dull vigil
#

Back up the stuff to what?

#

I canโ€™t use clear so I spammed enter

#

Lol

oak shell
#

idk to what. whatever you have available. usb drive maybe? I don't even know if there is anything useful on the machine at all that's worth to be saved.

#

if the install is as broken as it seems to be, you might have to boot from a live system to be able to mount external drives and copy stuff over anyway

grave jolt
#

back when ubuntu 10.x was popular people recommended separating your main file system folders out to different partitions
its possible that someone physically removed the harddrive that contained /usr
just installing a modern linux distro will work, assuming the hardware is fine

dull vigil
#

My grandfather gave it to me

#

It was from 2003

#

Guess what is on here XD

#

Itโ€™s a really outdated version of wireshark

#

Called wireshark

#

I think they were programming it

#

Ima back it up and then upgrade this b

runic flame
#

Hello. I know this isnt Python but im lost.
I have my main PC that has built in Wifi Connectivity and an ethernet port. I then have a PC that has ethernet and no Wifi Connectors. So, Via Windows 10 I bridged the Wifi and Ethernet on my main pc and hooked it into the server.

When I do ifconfig it shows it shows the IPv4 as the same as my PC, But isnt getting any internet connection

#

any ideas?

grave jolt
#

did you enable dhcp on the computer that has to use the ethernet connection?

runic flame
#

I dont think so. Ill try

grave jolt
#

generally a bridge will let devices connected to the ethernet port act like they are on your wifi network. so you should be able to just enable dhcp to get an ip address and then it should route correctly by itself

runic flame
#

it worked. Thankyou very much

dull vigil
#

@grave jolt Hey can you help me make a bootable flash drive?

#

i dont know if i need a special ubuntu for a server

#

im pretty confused

#

@oak shell maybe you can help?

grave jolt
#

with a computer of that age you should be able to just make a regular bootable one with the tools available on the ubuntu website.
for a server you can run whatever, the only difference between versions is what user software is installed.
server ubuntu doesnt include a desktop environment.
desktop ubuntu generally includes a gui and everything a normal user would want like office software

#

you can install a gui later if you decide you want one

dull vigil
#

how do i just install the command line one

grave jolt
#

you go to ubuntus website, download the ubuntu server iso, then use a tool like rufus or whatever they recommend to write the iso to the usb drive

#

you dont just copy the file as like ubuntu18.whatever.iso

dull vigil
#

huh

#

im confused

#

sorry im new to linux

grave jolt
#

you have to use a tool to write the contents of an iso to your usb drive

dull vigil
#

will it accidentally install on the computer i am using to write it?

grave jolt
#

you would have to go out of your way to mess up and do that. generally they wont even list your main hard drive

#

it should only list removable drives and windows will likely refuse to let you write to the main hdd while booted

#

but if you have multiple usb drives plugged in you could end up overwriting the wrong one

dull vigil
#

can we hop in a call so you can assist me?

grave jolt
#

cant atm sorry

dull vigil
#

ok

#

do you know any1 who might be able to assist me

grave jolt
#

ubuntu has a little walk through on making one

dull vigil
#

im gonna screw up

grave jolt
#

you might fail if you try, but you already failed if you just give up

dull vigil
#

i am not a tutorial type of guy

#

if u know what i mean

grave jolt
#

just take a deep breath, read each step and then do what it said. it includes pictures of each step

dull vigil
#

this is for the command line only one?

grave jolt
#

it will install whatever version you download. in step 2 you choose which version to download, if you click the link they provide the second download is 'ubuntu server'

dull vigil
#

@grave jolt

#

which 1

#

also my usb stick is only 1 gb

grave jolt
#

so lts is 'long term support' ubuntu releases a new version every 6 months or so. if you want to be able stay on the same version for 5 years and still get security updates choose lts

#

that might be too small

dull vigil
#

i can upgrade while keeping data?

grave jolt
#

yes

#

ubuntu 18.10 server is only 881MB, there is a chance it will fit on your 1GB usb drive

dull vigil
#

i just got a 4gb

runic flame
#

sorry. But im back again after a few hours. I got the Bridge working and the Ubuntu server is actually connected to the internet. Issue is that it shares the same IP with the main PC that its connected to. Would it be possible to give it a new local IP to an unused one like 192.168.0.???

oak shell
#

if the network is actually bridged, the server should get its own IP by your local router's DHCP. If it has the same IP as the machine you use to share the internet connection, that means it is NAT and not a bridge.

runic flame
#

crap then. Does that mean no way to change it?

oak shell
#

it should be possible, but I haven't done that yet. not sure how exactly it works

runic flame
#

what would I search to try find what to do?

#

im lost now

dull vigil
#

@grave jolt what do i do after i wrote the usb?

#

also how can i un-write the iso file after im done with it

grave jolt
#

put the usb drive in your computer that you want to install ubuntu on. reboot that computer and go in to the bios and set it to boot from your usb drive. how to do this varies by manufacturer.
then when it restarts again it should boot ubuntu and you can follow the on screen menus to install it

dull vigil
#

do i want the computer on

grave jolt
#

to fix your usb drive back to a normal one you can use windows to reformat it

dull vigil
#

wait wait hold on

grave jolt
#

it doesnt matter for usb. you have to reboot in to the bios so you can start with it off then boot it, or just hit restart

dull vigil
#

what was that first thing you said

grave jolt
#

what do you mean

dull vigil
#

riffautaeToday at 3:32 PM
put the usb drive in your computer that you want to install ubuntu on. reboot that computer and go in to the bios and set it to boot from your usb drive. how to do this varies by manufacturer.
then when it restarts again it should boot ubuntu and you can follow the on screen menus to install it

#

thats so confusing

#

can you make it like a list or something

grave jolt
#

1: put the usb drive in to the computer
2: reboot the computer
3: while its rebooting look at the screen and figure out what key its telling you to press to get in to the bios. usually del or f12
4: go in to the bios, find the boot sequence, change it so that the usb drive is first
5: save and restart
6: ubuntu will boot

dull vigil
#

do i want the computer on

#

when i start it

#

the beginning of the list

#

do i want it on or off

grave jolt
#

it doesnt matter

dull vigil
#

k so i start with it off

grave jolt
#

at step 2 your reboot it or turn it on if its off

dull vigil
#

if i plug the usb into my windows laptop again will it screw up my laptop?

#

when i wanna make it a usb again

grave jolt
#

no, you would have to go through a ton of obvious steps to install ubuntu so you cant do it accedentally and mess up your laptop

dull vigil
#

ok so im plugging the usb in now

#

now turn on the computer?

#

@grave jolt

#

Yo help

#

Cmon man donโ€™t leave me hanging

#

God damnet itโ€™s frozen

#

Dude!

#

Idk what to do

oak shell
#

looks like your usb is before the internal sata hdd in boot order, that's good

#

it should just boot from the USB instead of the disk if you start the computer with the stick plugged in

dull vigil
#

K

#

Now I run startup?

#

Or do I restart computer

#

Oh itโ€™s auto restarting

#

Itโ€™s still 10.10!!!!

#

It didnโ€™t work

#

Iโ€™m restarting

#

@oak shell

#

Itโ€™s not working

#

All the same servers

#

I thing worked

#

Nothing

oak shell
#

on the BIOS POST screen, can you press some key to get a boot device menu (not the BIOS setup menu)? Maybe F9 or something like that

dull vigil
#

Can you call

#

That would make this easier

oak shell
#

nope, sorry

dull vigil
#

I hit f9

#

Idk what is happening

#

Great itโ€™s trying to start up again

#

Amazing

#

@oak shell

oak shell
#

can you just remove the hdd from the boot order completely instead?

dull vigil
#

What

#

What sub menu do I go to

oak shell
#

in the boot device priority or the hard disk devices on the screen you showed last, I guess

dull vigil
#

Now what

oak shell
#

can you change the SATA one to Disabled or anything else that removes it from the list?

dull vigil
#

Itโ€™s hard to explain

#

Whenever I change options

#

The entire list changes order

oak shell
#

I see, then go back and into the hard disk drives submenu instead

#

probably you can disable it there

dull vigil
#

Now what

#

@oak shell

oak shell
#

there's three of them? ๐Ÿ‘€

dull vigil
#

What

oak shell
#

all these SATA entries seem to be internal hard disks

dull vigil
#

Not internal

oak shell
#

internal enough

#

can you select each of them and disable it? only leave the USBs enabled in the menu

dull vigil
#

Those are storage no?

oak shell
#

yes, these are removable disks in the photo

dull vigil
#

Which usb do I use

#

Or do I just disable the hard drives externally

oak shell
#

no idea, leave both enabled for now

#

just disable the disks in the boot menu

dull vigil
#

I canโ€™t

#

Look what happens when I press change option

#

Just cycles

oak shell
#

oh, so that menu is just for changing order too

dull vigil
#

Yea

oak shell
#

yeah, then make sure the USBs are before the SATAs

dull vigil
#

Do I exit this menu or put both subs first

#

Ok

#

Ima run the thing again now

#

One purpley boi

oak shell
#

๐ŸŽ‰

#

looks good

dull vigil
#

Do I select install ubuntu?

oak shell
#

yes

#

the other MAAS options are for some cloud related stuff

dull vigil
#

Do I needa plug in Ethernet?

oak shell
#

it would be good, that way it can directly install updates, set the correct time, etc

dull vigil
#

Kk

#

Lemme grab a cable

dull vigil
#

The server wonโ€™t start

#

I lost power halfway into installation

#

It wonโ€™t start up again

#

@oak shell

#

Yo!

#

Help please

#

Dude

#

My thing is broken

#

Come on

oak shell
#

what do you mean it won't start?

dull vigil
#

It wonโ€™t start

#

I turn it on

#

And it doesnโ€™t do shit except blink colors on the box

oak shell
#

if you lost power during the installation, you will have to redo the whole installation process, I assume

dull vigil
#

It wonโ€™t turn on

#

At all

oak shell
#

no BIOS POST screen?

dull vigil
#

No

oak shell
#

then it's dead

dull vigil
#

And the few times I get one, it is frozen and doesnโ€™t do anything

main olive
#

What do you people say about devuan not debian or antix and arch or black arch?

dull vigil
#

What do you mean itโ€™s dead

#

Hey!

main olive
#

Hey!

dull vigil
#

Byte

#

What do you mean dead

main olive
#

Whats your opinion on these Linux distributions?

dull vigil
#

This thing is around 600 dollars

oak shell
#

Well, if the BIOS POST doesn't even show up, either some core hardware broke or the firmware got damaged

dull vigil
#

It does

#

Sometimes

#

Other times it just doesnโ€™t send any signals to the monitor

main olive
#

Okay nvm

dull vigil
oak shell
#

You can try disconnect all power for a while, in case any static has built up somewhere maybe, and you could try replugging all components

dull vigil
#

Could it not have enough power?

#

I moved it to a surge protector

#

InsteD of the one I was using

oak shell
#

I'm not sure. Possibly, if the power supply changed compared to earlier. Does it reliably turn on if you switch back?

dull vigil
#

Iโ€™ll try to switch back

#

It wonโ€™t turn on still

oak shell
#

๐Ÿคท

dull vigil
#

I hear it on

#

But no signal

oak shell
#

leave it completely disconnected from power for a couple minutes, replug all hardware components maybe, dunno

dull vigil
#

What is that thing that keeps turning red

oak shell
#

idk what you mean

dull vigil
#

In the video

#

Look at the video

#

The only other thing that could be the issue is the fact that I plugged in Ethernet

oak shell
#

the led above your finger when you turn it on? It's too blurry, I don't see what that is.

dull vigil
#

A stack of cylinders

oak shell
#

that is a Hard Disk symbol

dull vigil
#

Lemme try without Ethernet

#

What is a hard disk

oak shell
#

hdd

#

your regular (internal) disks

dull vigil
#

What about em

#

Does it not recognize them

oak shell
#

no idea what that LED being red means. maybe

#

a power cut can potentially destroy disk drives

#

maybe try to find the manual of your server to learn what the LEDs mean

dull vigil
#

I only have the server

oak shell
#

but even if the disks died, the system should still POST and get into the BIOS settings menu reliably at least

dull vigil
#

No manuals

oak shell
#

google online for the exact model name

dull vigil
#

I did

#

Never found anything

#

Itโ€™s from 2003

oak shell
#

can't help you there either then

dull vigil
#

Should I take out the drives and blow on them

oak shell
#

you can, sure

#

you could also try booting with them removed

dull vigil
#

Iโ€™ll do that

#

Booting with them out does nothing

oak shell
#

nothing as in still no reliable display, same as with them?

dull vigil
#

Yea

#

I put them back in

#

Same thing

oak shell
#

then it's probably not those

dull vigil
#

Lemme try booting without the Ethernet

#

Nothing

grave jolt
#

if its from 2003 its possible that it has finally died. check the power supplies and listen for beeps and stuff. if you can go online and download the manual and see what all the lights and beeps mean

#

also most servers from 2003 are not expensive. you can get something like an r710 which was released in 2009 for like 200 bucks. one from 2003 is not going to be worth more if its just a normal server

#

it has an intel core sticker on it, that means its from like 2006 or newer since those processors didnt exist before then

dull vigil
#

i checked for a bios error

#

the memory osculators arent connecting

#

i am going to take them to be cleaned

#

ok

#

the flat server above is a windows server

#

it is from 2003

#

it is supposed to manage traffic or something

upbeat peak
#

how do i upgrade python on debian?

#

it thinks 3.4.2 is the most recent version

vagrant rune
#

then compile it from source

#

@upbeat peak

upbeat peak
#

i fixed it but ty @vagrant rune

vagrant rune
#

what'd you do? @upbeat peak

upbeat peak
#

i ended up using wget and then getting 3..6.4 from the source, then building it etc

#

it was a bit of a long process lol

vagrant rune
#

yeah

wild canyon
#

Why does the python3 shell make a beeping noise loud enough to alert extraterrestial life of my presence whenever I backspace with no input present, even though I muted every single one of my audio devices, and how can I stop it doing that?

mint flint
#

i believe the beep is called "terminal bell". not sure how to disable it though...

wild canyon
#

I mean, surely, it would be muted if I muted all my audio devices, right?

#

But then again - linux

nimble quarry
#

@wild canyon nah, this is not related to audio devices

wild canyon
#

I mean, you'd expect a system sound to go through the system audio devices and not directly through the f-ing motherboard or whatever

nimble quarry
#

๐Ÿ˜

wild canyon
#

But yeah, ifixedit

main olive
#

what does reboot time depend on

plain bramble
#

how many services have to be killed, if you can load the system from a fast or slow disk. And so on

#

Like how many services you have to start before the system runs

#

How much time are we talking about and what system?

#

For my system for example, shutdown time can take as long as the watchdogs dying but start up is fast

main olive
#

lemme see.. it's a Debian Rodete.. 8 core machine.. feels like it takes forever to reboot

#

5minutes

plain bramble
#

Sounds quite long

#

It's better to have a boot up time of 3 to 8 seconds

main olive
#

hmm but then it's not local.. would that affect it..

#

I ssh into it

plain bramble
#

the ssh service takes a bit

#

until for example systemd starts it

#

you can also look at the targets, which are run first

main olive
#

like.. from the bashrc?

plain bramble
#

bashrc is quite high level