#unix

1 messages ยท Page 49 of 1

main olive
#

It's like tradition at this point

opaque ginkgo
#

noones hating on kali

main olive
#

Ok so?

opaque ginkgo
#

its just that running kali as your main os is stupid

main olive
#

And a bunch of people use kali

#

What's the difference

#

๐Ÿ˜‚

opaque ginkgo
#

main os

#

kali is good at what it does

#

but not at general os shit

main olive
#

If you spend majority of your time coding etc

#

I mean come the fuck on

#

Idk bout you but when I use my laptop/desktop

#

I usually use it to get work done

opaque ginkgo
#

ok?

main olive
#

What the fuck else do you use it for

opaque ginkgo
#

is your job pentesting

#

and do you never do anything else

#

other than pentesting

main olive
#

No I don't work as a pentester but I'm usually doing ctfs or doing other shit for my education

opaque ginkgo
#

cool

main olive
#

Wtf else am I suppose to do on a computer?

opaque ginkgo
#

so use kali for the pentesting/ctf specific stuff and your main os for everything else

main olive
#

I don't really do anything else I use my computer for learning shit so it might be Linux/cyber security/networking/coding etc

#

Kali has most of the tools you need

#

So it's just convenient

opaque ginkgo
#

๐Ÿคฆโ€โ™‚๏ธ

main olive
#

I dual boot windows so if I wanna play some games I can do that there but other than that

#

Eh

main olive
#

Kali isnt just used by professionals

#

It's also used by students

#

I'm not sure if you know

opaque ginkgo
#

yes i know that

#

because i use kali too

main olive
#

Alright so we are on the same page

#

You just use kali on a VM

#

I don't

#

Big deal

#

๐Ÿ˜‚

#

Anyways I don't know why I'm going bat shit crazy of kali fucking hate that distro

#

Shit never works the way you want it

#

#parrot

lusty veldt
#

For real though kali on a little eee pc or something like that would be nice

main olive
#

does anyone know how to generate .mpd files on the command line

devout fable
#

What is so bad about kali as a desktop os anyways? I always see people saying not to use it, but basically every Linux distro is the same

#

(Iโ€™ve never touched kali before)

main olive
#

than other distros

#

because it's meant to be used as a tool for offensive testing

#

you can read 2020 kali devs blog post and they said they did make some changes to make the kali a little more tolerable as an every day distro

#

but they still said to not use it as a daily driver

main olive
#

I've heard the contrary

main olive
#

one of the reasons is that it has a lot of outdated and therefore insecure tools pre-installed even on the live version

#

since most of tools like that were written during Backtrack days I assume

inland gulch
#

Also see https://kali.training/topic/recompiling-the-linux-kernel/ opening section 9.2. The kernel is obese.

main olive
#

@main olive i didn't notice what message did you reply to, as to the kernel

#

kali uses upstream kernel patched for a wireless injection

inland gulch
#

Yeah, it's upstream is debian-testing which is possibly less stable than debian-stable

quartz blaze
#

hi i'd like to ask a question

#

why is it not allowing me to make a directory saying "File exists" when it actually does not

inland gulch
#

Are you making the directory with python?

quartz blaze
#

i'm making the directory using the command mkdir

inland gulch
#

Can you share a complete input/output?

#

Unix typically won't tell you it exists if it doesn't exist, that's kind of a big thing with respect to the filesystem

quartz blaze
#

sorry for censorship

#

some of the dirs and the dir im trying to create contains my name and my surname

inland gulch
#

Can't really tell because of the white blotches, try listing the directory ~/ with ls -al and see does it show what your trying to create present.

quartz blaze
inland gulch
#

Try mkdir without the ~/

quartz blaze
#

already did

#

same results

inland gulch
#

Does it work if you do it with a different directory name? Like mkdir example_dir

austere jolt
#

@neon hare so

#

it would be best to use pyenv

neon hare
#

whats that

austere jolt
#

its a package to manage different python version

#

installing and uninstalling is a piece of cake

neon hare
#

is it with apt

austere jolt
#

pyenv install 3.8.6, pyenv global 3.8.6 to make it the global version

#

you are using kali right?

neon hare
#

yes

#

dpkg

#

is my package manager

austere jolt
#

you should google on how to install pyenv on kali

#

as i dont have experience with its pckg manager

neon hare
#

oh yeah its with cURL

austere jolt
#

but after you have installed it and added it to your ~/.bashrc, you can just use the command pyenv install 3.8.6, then pyenv global 3.8.6, after that you can run python main.py

#

ah but before running you will have to instal the pip packages

neon hare
#

okay

austere jolt
neon hare
#

after updating

austere jolt
#

wait

#

type python --version again

#

which one does it show

neon hare
austere jolt
#

oof

neon hare
#

for some reason

austere jolt
#

did you do pyenv global 3.8.6

neon hare
austere jolt
#

ah

#

then do python3 main.py

#

also when you install pip packages use pip3 install

neon hare
austere jolt
#

nice

neon hare
#

it does nothing

austere jolt
#

hmm, is it supposed to?

#

what is your script?

neon hare
#

the bot doesnt come online

#

wdym

austere jolt
#

wait

neon hare
#

wow my dumb ass

#

forgot

#

to save

#

the file

austere jolt
#

lol

neon hare
#

here we go

austere jolt
#

happens

#

epico

neon hare
#

thanks

austere jolt
#

np, you can install any python version you want and set the default by pyenv global version

main olive
#

@neon hare can you gibe me the script

#

i want to make my bot online to

main olive
#

ok

main olive
main olive
#

search for how to make python 3 as default python in apt based system

lilac geyser
#

Open your .bashrc file nano ~/.bashrc. Type alias python=python3 on to a new line at the top of the file then save the file with ctrl+o and close the file with ctrl+x. Then, back at your command line type source ~/.bashrc. Now your alias should be permanent.

#

by creating permanent alias fro python=python3

fresh saddle
#

Sourcing .bashrc isn't the best idea

#

If you want to restart your shell, you should use exec $SHELL

#

This way you can truly restart everything

trim wedge
#

Hi, not sure if this is the best channel for this, but I'm trying to deploy a flask app via uwsgi and I'm having trouble figuring out how to get uwsgi to run as python 3.7. It defaults to 3.6. Has anyone dealt with that before?

#

All this is happening in a venv:
(venv) โžœ venv which python
/apps/venv/bin/python
(venv) โžœ venv python --version
Python 3.7.5
(venv) โžœ venv which uwsgi
/apps/venv/bin/uwsgi
(venv) โžœ venv uwsgi --python-version
3.6.9

main olive
#

so I'm trying to make a .desktop file for my project (on ubuntu)
and I made it so it generates this file

[Desktop Entry]
Name=Python Paint
Exec=/home/unbuntu/Documents/python-paint/dist/main
Icon=/home/unbuntu/Documents/python-paint/images/icon.png
Terminal=true
Type=Application
Categories=Game;

but for some reason it just opens the Terminal for one second and then closes
here's all of the installer.py too

import sys,os
if sys.platform == "win32" or sys.platform == 'cygwin':
    pip='pip'
    os.system('py -m pip install -U pygame --user')
elif sys.platform == 'linux' or sys.playform == 'linux':
    pip='pip3'
    os.system('sudo apt-get install python3-pygame')
    os.system('chmod +x main.py')
    desktop = os.path.join(os.path.join(os.path.expanduser('~')), 'Desktop') 
    apps = os.path.join(os.path.join(os.path.expanduser('~')), '/.local/share/applications') 
    os.system('pyinstaller main.py --onefile')
    
    pp = open(f'{desktop}/Python Paint.desktop','w')
    pp.write(f"[Desktop Entry]\nName=Python Paint\nExec={os.path.abspath('dist/main')}\nIcon={os.path.abspath('images/icon.png')}\nTerminal=false\nType=Application\nCategories=Game;")
    pp.close()
    os.system(f"cp '{desktop}/Python Paint.desktop' ~/.local/share/applications")
else:
    os.syetem('python3 -m pip install -U pygame --user')
    pip='pip3'
deps = ['pickle','PyZenity-0.1.7.tar.gz','easygui']
for dep in deps:
    os.system(f'{pip} install {dep}')
#

(it's not finished)

willow ferry
#

what is sys.playform

main olive
#

@main olive set terminal = false

#

If still doesn't work then do manually

neon hare
#

i need serious help with my linux dualboot. as soon as i boot into the machine and login, i cant operate it. cant type, cant close windows, folders dont show up etc. only the terminal is fully functional

opaque ginkgo
vale plinth
#

When I use pip3 list in my Linux terminal, I get a different set of packages compared to when I use it in VSCode. I'm trying to use DearPyGui, which shows in my terminal but not the vscode terminal...

What's happenining here? I'm brand new to Linux and a relative noob at Python, so I'm a bit lost.

main olive
main olive
vale plinth
#

it's using a different version of everything seemingly

supple harbor
vale plinth
#

@supple harbor it's not

#

I'm not even sure how I would do that...

#

It's so strange, I do whereis python3.9 and none of the locations actually have it...

supple harbor
#

VS Code plugins?

vale plinth
#

im using the python plugin from microsoft if that's what you're asking

supple harbor
#

Is your interpreter set to the one in the virtual environment? is it different than your os interpreter?

vale plinth
#

well they're set to two different intepreters yes

#

so I just used files to go to /usr/bin/python3.9

#

but in vscode when I go there to select a python intepreter it doesn't show up

supple harbor
#

does your os have 3.9?

vale plinth
#

yep

#

that's what I can use through my terminal

#

i'm using pop os if that matters

supple harbor
#

i'm on pop too. if you type 'which python3' in terminal what does it say?

vale plinth
#

/usr/bin/python3

supple harbor
#

code can't find that? ...odd

vale plinth
#

If I run which python3.9, it returns /usr/bin/python3.9

#

I'd be fine using Python 3.8.5 but when I pip install dearpygui through the vscode terminal, it still can't find the package...

supple harbor
#

is it installing it in a VS Code created directory inside the project directory. Sometimes it will create a hidden folder to install stuff

vale plinth
#

As far as I see, no

#

what I don't understand is how VSCode can't seem to find python3,9

#

even after I restarted linux

supple harbor
#

in the code terminal, what does 'which pip3' return?

#

yeah, that's odd

vale plinth
#

Returns /usr/bin/pip3

#

It's like I can use python 3.9 outside of vscode, but I can't use 3.8.6 outside of it

#

and vice-versa

#

VSCode states dearpygui is installed for pip3 using python 3.8.6, yet I can't do from dearpygui import core, simple=, as that gives an error

#

so I'm very confused here... lol

vale plinth
#

Does anyone else have any suggestions? These is starting to get frustrating as it makes zero sense...

vale plinth
#

I've managed to be able to use dearpygui, but that's using python 3.8.5, not 3.9 like I'd prefer

inland gulch
#

@Karsteski#4177 Vscode uses virtualised python by default iirc. Even if you ask it to use system python (which you shouldn't do) vs code will use the system python to create a virtual python for vscode python packages. every python interpreter has 'its own' pip, better you use python -m pip... to do pip operations. With respect to 'which python' interpreter is in use, you can postfix the interpreter major&minor version. For details on setting vs code to use one of your installed pythons see https://code.visualstudio.com/docs/python/environments
But if you are looking to play with various versions of python, I'd recommend learning https://github.com/pyenv/pyenv first, the pyenv you create will be selectable in vscode.

Configuring Python Environments in Visual Studio Code

vale plinth
#

@inland gulch thanks for the detailed response, I had no idea that's what vscode does by default

#

It's extremely confusing that they do actually...

#

I just want to use python 3.9 at all times, not create virtual environments but this seems to be a best practice so I'll look into it

#

thanks

#

still doesn't really explain why vscode can't even see my interpreter but maybe I'll learn after doing some reading

inland gulch
#

You might want to use 3.9 at all times but your operating system might have a different opinion on it ๐Ÿ™‚ installing multiple os level python is a pain, use pyenv and you can install nearly every python and vs code will be able to see them, it's to do with symlinks, os.path and where programs will search for available interpreters. don't bother getting sidetracked by it, pick a tool (pyenv) that's fairly sturdy and get on with the real task at hand. Happy coding.

vale plinth
#

okay cool, i'll follow this route

#

I get that removing the default python installations breaks linux but am I safe using "sudo apt remove Python3.9"?

inland gulch
#

sudo apt purge... is the command I think, but no, I'd leave it alone if your not willing to scrap the entire o.s. and start from scratch (not saying it'd come to that, but its a legit risk in this case) just put it out of mind and leave the system level stuff alone, go 'all in' on virtualised pythons and don't look back

vale plinth
#

will do, thank you ๐Ÿ™‚

inland gulch
#

You're welcome

opaque ginkgo
#

@inland gulch vscode never defaults to creating a venv

#

@vale plinth

inland gulch
#

My bad, confusing it with another ide

main olive
#

Why is Linux So much slow on MY laptop than windows 10

#

I have an i5 10th gen

#

Dual boot

#

sorry if you think this is a shit post

opaque ginkgo
#

any background processes?

frail storm
main olive
#

No

#

I have partitioned on a ssd

#

It boots in 3 seconds

#

But apps in linux like terminal for eg loads in 2-3 minutes, I tried Reinstalling today, It worked

frail storm
#

Ok ok

main olive
#

And I kind of figured why it was happening, My mouse wasnt clicking Sometimes, Probably Problem of the mouse driver

#

Lol

summer sonnet
#

I might be asking in the wrong channel, but I'm trying to parse a JSON file - one whose format I can not control - and it has both a list and an actual key : data pair named the same thing "listpicker_5". How can I get Python to look at JUST the key : data pair and ignore the list? (I'm trying to use python3 installed by Ubuntu 18.04.)

"listpicker_5": {
  "selectedNames": [
    "John"
  ],
  "selectedScores": [
    "0.000000"
  ],
  "selectedValues": [
    "John Smith"
  ]
}

[ ... more stuff ...]

"listpicker_5": [
  "John Smith"
], ```
#

My simple code so far is this:

#!/usr/bin/python3
import os,json

file = os.path.abspath('/some/path') + "/sample.json"
json_data = open(file).read()
json_obj = json.loads(json_data)

roObserverName = json_obj["listpicker_5"]
print(roObserverName)```
amber garnet
summer sonnet
#

Thanks @amber garnet, I posted it there.

main olive
#

do {}

#
{
"listpicker_5": {
  "selectedNames": [
    "John"
  ],
  "selectedScores": [
    "0.000000"
  ],
  "selectedValues": [
    "John Smith"
  ]
}

[ ... more stuff ...]

"listpicker_5": [
  "John Smith"
], 
}
#

like that

#

nvm

#

that wasn't the problem

#

or

#

ยฏ_(ใƒ„)_/ยฏ

left anchor
#

Guys any one has used GNU Radio ???

weak schooner
#

anyone use m1 macbook with vs code insider?

#

having couple issue with it first being unable to open vscode with command code . in the terminal. have tried install and uninstall in command to path in vscode it still show command not found

main olive
#

<Message id=791213457613258762 channel=<TextChannel id=491523972836360192 name='unix' position=41 nsfw=False news=False category_id=409692123944714240> type=<MessageType.default: 0> author=<Member id=218346935805935617 name='USB' discriminator='3285' bot=False nick=None guild=<Guild id=267624335836053506 name='Python' shard_id=None chunked=False member_count=122192>> flags=<MessageFlags value=0>>

weak schooner
#

another issue is these dots mean its space right? but shouldnt it be tab?

blazing otter
#

Hello guys. i have an selenium wordpress bot that is connecting to my forum and doing some stuff. The script works perfectly on windows/mac/Linux all the day, without any issues.

#

But when i put it on a unix server (without desktop environment), the script works just for a few minutes

#

after that, i noticed it is unable to load new pages with driver.get()

#

also, when it stop loading, i saved the page_source to be able to see what actually the browser is loading

#

the html code is :

<html><title></title><body></body></html>
#

i have google it, find that i need to add some browser arguments like --debugging-port-9222

#

bot nothing helped

#

have anyone seen the same problem ?

opaque ginkgo
#

@weak schooner pep8 says 4 space indents, so vscode auto-converts by default

weak schooner
shy yokeBOT
#

:x: According to my records, this user already has a mute infraction. See infraction #25587.

#

:incoming_envelope: :ok_hand: applied mute to @gritty ocean until 2020-12-23 21:44 (9 minutes and 58 seconds) (reason: burst rule: sent 9 messages in 10s).

thorny solar
#

lol

#

@gritty ocean Spamming is no way to get into the voice chat. We implemented the system to incentive higher quality messages, not spam. Your mute has been extended to 1 day.

tidal vessel
stark tide
#

ssh_exchange_identification: Connection closed by remote host when trying to connect via. WAN

summer trail
#

You'd get a "Connection refused" if not, not "Connection closed by remote host"

stark tide
rustic pollen
#

on my mac I was trying to install a package
warning: unable to access '/Users/<USER-NAME>/.config/git/attributes': Permission denied
This came...
What to do...?

#

Also, Is there a way... that whenever I open terminal a certian commands always executes...
I use iTerm2 with zsh...?

opaque ginkgo
#

add it to ~/.zshrc

#

@rustic pollen

rustic pollen
solemn snow
#

how do u delete a folder through the terminal in mac (zsh)?

summer trail
#

rm -r 'directory_name'

summer trail
solemn snow
#

i got it thankyou

proven bane
#

Alright, so i want to do this:

1) Update local files from a git repo
2) Stop a service running my webserver
3) Install requirements.txt inside a venv
4) Start my webserver service

how would i go around doing this? a link to a blog/guide would be appreciated

#

im running a flask server with gunicorn

#

am on debian

rugged swift
#

You might want to learn about cron job to run a (Python/BASH) script file, especially for task number (2) and (4). But I guess, there's a better way to do this.

proven bane
#

im using github actions to automatically run the script for me i just need to figure out how to write it :)

formal schooner
#

can github actions run code on your server?

#

i doubt it

#

unless you have the github action runner ssh into your server but that's all kinds weird and sounds very insecure

#

you could definitely just do this in a bash script

#
#!/bin/bash

# -e: exit on error
# -u: error if using an unset shell parameter
# -x: echo all commands to stderr
# -o pipefail: cause pipelines to fail if the rightmost command fails
set -eux -o pipefail

# step 1

# step 2

# step 3

# step 4
proven bane
#
# This is a basic workflow that is manually triggered

name: Deploy Main to OskarsMC-02

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
  workflow_dispatch:
  push:
    branches:
    - master

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  Deploy-SSH:
    runs-on: ubuntu-latest

    steps:
    # SSH into server and run pull sctipt
    - name: Run SSH command
      uses: garygrossgarten/github-action-ssh@v0.6.3
      with:
        command: /home/oskar/OskarsMC-Scripts/git_automation/pull_oskarsmc_main.sh
        host: ${{ secrets.HOST }}
        port : ${{ secrets.PORT}}
        username: ${{ secrets.USERNAME }}
        password: ${{ secrets.PASSWORD }}
#

thats the workflow ^

fresh saddle
plush zephyr
#

@main olive i am having compiling python code. This is my dream project please help me. (You can dm me)

peak quarry
#

Hey All, having a problem passing a bash script arguments from my py script. One of the arguments is a path of a file which doesn't seem to be getting translated properly in the call to the bash script via subprocess - any help is appreciated, will DM further details!

peak quarry
# amber garnet Can you paste code here?

Sorry - sure. I have only included the relevant parts below

temp_output="/home/brandyn/bounties/"
subdom_out = temp_output + str(date.today()) + "subdomstemp.txt"
args = ["/home/brandyn/bounties/livehosts.bak", f"-t {subdom_out}", "-n temp_subdom_scans"]
scanning = subprocess.run(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
amber garnet
peak quarry
#

I could but the problem here is with the -t part, for whatever reason the bash script its being passed to isn't picking up on what that param {subdom_out} actually is

opaque ginkgo
#

@peak quarry you need to separate the flag from the value

#
args = ["/home/brandyn/bounties/livehosts.bak", "-t", subdom_out, "-n", "temp_subdom_scans"]
#

assuming said program follows normal conventions

#

otherwise it will recieve one arg that's just "-t /home/brandyn/bounties/blah.txt"

#

instead of 2 args "-t" and "/home/.../blah.txt"

slender rapids
#

Hejhej! I'm trying to install unix on my android tablet using Termux. It worked fine until i put "pip install --user matplotlib" into the cmd prompt. Now I seem to be stuck in a install process, which is done.
My Problem is .. I can't get to the $ again. It's almost as if I'm in a file, but entering exit() or exit doesnt work either. so yea... i got it to a point of almost working, but now I'm stuck and googling the problem doesnt seem to help, since I seem to ask the wrong question... Can anybody help me?

slender rapids
#

It works now. I didnt do anything. Literally left it alone for 2 hours

rugged swift
main olive
#

@rugged swift the first link, I did what the top comment suggested and it didn't work. I'm going to try again and take a futher look into both websites provided.

#

@rugged swift Update: Thanks

rugged swift
#

You are welcome!

main olive
#

I was setting up my Kali Linux and when I typed my username, I clicked away to something different on another monitor only for me to come and try to put a password and it not work. I couldn't write a password so I thought I should just close kali and re-open it. Apparently, I had already made a password. Now that I need the password for something, since I didn't see what I inputted (I assume nothing since there was nothing shown but without a password it wouldn't have worked) I can't get access. I don't even know how to uninstall everything I installed previously relating to kali linux (I also installed Ubuntu in desperation) so I can do it over again. How can I fix this.

#

@rugged swift apologies for the ping but do you know the solution to this? ^^^

rugged swift
#

What do you mean by "I couldn't write a password"?

main olive
#

I literally couldn't input anything.

#

I tried numbers, letters, nothing showed up.

rugged swift
#

It'll not show up anything, it's for security reason tho.

#

But you can just straight away type in your password and then press [enter/return] key.

main olive
#

So you're telling me I just clicked a bunch of random letters and numbers on my keyboard and I couldn't even see it!?

#

yikes

main olive
#

how am I supposed to recover that

rugged swift
#

What do you mean?

#

Recover from what?

main olive
#

my password

#

how do I get it back

#

I put something random thinking it was glitchy

rugged swift
#

Ah, is that password for the root account?

main olive
#

yes

#

and idk it :/

rugged swift
#

Well, I don't know then.

#

Maybe, reinstall the Kali Linux. ๐Ÿ˜ฆ

main olive
#

how do I delete it

rugged swift
#

You installed it from the Microsoft Store, aren't you? Just uninstall it by right-clicking on the start menu entry.

main olive
#

I got it from microsoft store but idk what you mean by start menu entry

rugged swift
#

Uh, I meant just uninstall it from the settings.

#

Just like other Windows programs.

main olive
#

alright, I got rid of ubuntu and kali linux

#

I'm going to try to reinstall now

#

@rugged swift Installing is giving me an error. I feel like I'm getting a better grip on this all so I think I'm going to let it go right now and come back later. I'm tired to the point where if I even installed it I wouldn't even bother doing anything. Your efforts were well appreciated nonetheless, couldn't have done any of this without you. Cheers.

stray current
amber garnet
covert orchid
#

This is not a Linux group but I hope you can help.

#

Hi, I have issues to repair the grub after reinstalling Windows 10 in a second disk. Now I just boot into Ubuntu 20.04. Before that I reinstalled Windows, the grub works perfectly but after that i tried some "solutions" that I found on internet and nothing worked. I hope you could help me.

rugged swift
#

I doubt you can run open blablabla to open a file image with Windows Image Viewer from WSL. Since open is for OSX, xdg-open is for Linux, and start is for Windows. But we cannot do start.exe blablabla from WSL either if the command isn't registered in the system path.

opaque ginkgo
#

yes you can

#

cmd.exe /c start wonderland.jpg

#

start is a "shell builtin" for cmd

#

@stray current

#

@amber garnet no x11 server

amber garnet
opaque ginkgo
#

nautilus is gui

#

wsl has no gui b/c no x11

amber garnet
#

Try explorer

#

I didn't know that it's WSL

main olive
#

what is unix

south arrow
#

another os

vital spire
summer trail
opaque ginkgo
#

*vanilla wsl

rustic pollen
opaque ginkgo
#

pip install --upgrade --user setuptools

#

why are you trying to upgrade python

#

@rustic pollen

rustic pollen
#

I was not able to install discord

rotund stirrup
amber garnet
rotund stirrup
#

reinstalled, turns out repos were the problem

warped nimbus
#

I want to put this in my bash profile eval $(docker-machine env --shell bash default)

#

The problem is that it's a bit slow, so it slows down the opening of a new shell

#

For context, what this does is set some environment variables

#

This is exactly what the command returns ```bash
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.0.45:2376"
export DOCKER_CERT_PATH="C:\Users\Mark.docker\machine\machines\default"
export DOCKER_MACHINE_NAME="default"
export COMPOSE_CONVERT_WINDOWS_PATHS="true"

Run this command to configure your shell:

eval $("C:\Users\Mark\scoop\apps\docker\current\docker-machine.exe" env --shell bash default)

#

Is there a way to make bash run the command in the background and set the variables in the parent shell when they are ready?

#

This command isn't urgent so I don't need it to block the rest of the shell when I open it. It's fine if these environment variables get set 20 seconds later or whatever

#

I've tried the obvious & at the end of the command but this doesn't end up setting the variables in my shell.

#

Since I'm out of ideas, I'm going to look into how to assign a static IP to the machine so I don't have to rely on the command and can use constant code to export the variables

summer trail
#

@warped nimbus my idea would be redirecting the output to a temp file, checking if the temp file has any data in it yet each time the prompt is redrawn, and if so sourcing it and then removing the hook that's watching for it.

warped nimbus
#

Interesting. I'm not surprised that things have to be that complicated

#

When does the prompt get redrawn?

summer trail
warped nimbus
#

Oh I understand

#

That's quite clever, but also convoluted. Wouldn't have thought of it myself

#

I'll keep it in mind. I did away with docker-machine cause it's not really maintained actively so for now I side-stepped the issue.

warped summit
#

Any idea how could I define 2 aliases with the same name to build on top of each other?

1st alias, in a file sourced by .zshrc:zsh alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"' 2nd alias, in separate file, also sourced by .zshrc:

alias wget='wget -c'

Problem is that it will only use the second alias, and completely ignore the first one, it won't build on top of it

I need to somehow ensure, that the second alias defines itself using the previous alias. I was thinking of using something like $(wget), but that just gets me into a recursive loop. Is there some good way to reference an already existing alias with the same name while defining a new one?

I was maybe thinking of somehow getting the content of the first alias and only concatenating that with my new flag so that it will build on the previous alias, I'd probably also have to do some handling to fall back to the real command if the command wasn't already aliased before.

Any idea how could I implement something like this? Or of some better way to do it?

narrow condor
#

Is it just me; or for pyautogui; the locateCenterOnScreen just replies none to it. Is it just a mac issue; or what exactly is the case. Be sure to dm me if you can help me.

static cosmos
#

@narrow condor GIYF, found this right away

lethal gate
#

can someone suggest me some good books for unix

#

?

static cosmos
#

What do you want to learn about

main olive
#

this is my city

main olive
#

naw man its mine

livid verge
#

@storm sundial dpkg --get-selections > ~/Package.list

#

then later you can dpkg --set-selections < ~/Package.list

#

and apt-get dselect-upgrade -y

storm sundial
#

many thanks!

valid wadi
mellow narwhal
#

Try with complete path @valid wadi

valid wadi
#

I tried os.path.abspath

radiant crater
#

@valid wadi What text editor is that?

valid wadi
#

vim

radiant crater
#

you have pretty terminal colours

mellow narwhal
#

Did you literally enter the full path in the program?

valid wadi
#

dracula colorsheme

radiant crater
#

arch i assume?

valid wadi
#

artix

#

hardcoded full path doesn't work either

mellow narwhal
#

Gotcha, sorry to make ya do that again, seemed like the most obvious thing though

valid wadi
#

np no harm in trying

#

the default path still doesn't work even though I have put the files there as well

mellow narwhal
#

Is it possible your data is the issue?

valid wadi
#

I used wget to download from github

#

i even redownloaded it

#

gave it 777 premission

#

I just installed tesseract and tesserocr

mellow narwhal
#

Training data and teser are on the same version?

valid wadi
#

they say 4.0 ad UP

#

i might thy the fast one to see if its the issue

#

just a sec

#

nope

#

this data doesn't work

#

I hate this

#

this was supposed to be a quick addition to the workflow

mellow narwhal
#

Yea I've no clue, sorry. Best of luck

valid wadi
#

np thanks anyways!

fresh saddle
#

I wouldn't recommend you to try and change the distribution, or even use Kali as your daily driver

misty vessel
#

if you are a novice just use something like ubuntu (format kali, install ubuntu), it is the most supported and pretty easy to use distro

#

@jolly cairn

valid wadi
#

@mellow narwhal I have figured it out. Those files that I downloaded weren't enough. There were some configuration ones. dumb mistake....

mellow narwhal
#

Ah. Well glad you fixed it ๐Ÿ˜„

misty vessel
#

64, always 64

tame root
#

hello friends. I have a question that is fairly basic.

#

How can I tell if my script is using python

#

I am new its just a hello world script

#

thats what I do not know lol I mean i just type echo hello world

#

I dont put a !#/bin/bash like for my bash scripts

#

fuck I figured I was fucking something up it uses print right?

#

Btw sweet pic man.

timid grail
#

UnicodeDecodeErrors. Could anyone help me???

tame root
#

@jolly cairn shit its not working >.<

#

im using terminal

#

kali linux vm

#

If i were to be working on a server though

#

wouldnt idle be a gui?

#

or is idle a program to which i could put my python scripts

opaque ginkgo
#

idle is kinda bad

#

use ipython

#

so much better than vanilla repl

#

or for ides

#

use vscode or pycharm

tame root
#

@jolly cairn i simply type python?

main olive
#

Hello, I bought vps some time ago and came up with a problem.

While my bot is working it saves pictures and also there's a db.
How do I automate my routine when I have to do a bunch of things to move db and pics in direction, just cloned from github with new update?

#

How do people usually manage with their dbs when making new update?

tame root
#

I am having issues executing python scripts

#

is anyone available to assist? any help would be greatly appreciated

#

never mind. I was using the wrong command. I dont understand though

#

I was trying to run the script like i normall run my bash scripts. ./scriptname

#

however when i typed python scriptname it ran

hardy grail
#

you're probably missing the execute permission on the script file

#

if you have that, you just need the file path to run the script

mellow narwhal
#

@tame root You have a shebang?

#

With correct perms and shebang it should work.

nova hazel
#

hey uh, I have 2 python scripts. I want to run them hourly. I found out I can do this by cron. so if I edit /etc/crontab ar 01:44 pm, then when will the scripts run?

#

also, will @hourly python3 <myscript> work?

#

sorry I am new to cron

lavish heart
#

i'm trying to pipe the output of a script, like an equation 1+1 then eval it and pipe it back as an output

#

any ideas?

lavish heart
nova hazel
#

ubuntu

lavish heart
#

that's cool

tame root
#

I do not have a shebang

#

I have to use the command python and the name of my script

opaque ginkgo
#

@tame root well you need one

#

#!/usr/bin/env python3

tame root
#

@opaque ginkgo I will try this right now. Thank you for the quick response friend ๐Ÿ˜„

#

and that was the trick

tame root
#

another quick question though semi unrelated to python

#

I am learning python and bash

#

is there something better than bash

mellow narwhal
#

ZSH, Fish

#

ZSH is the best shell in my opinion, look into oh my zsh @tame root

#

If you're scripting across machines though you usually just want to use SH or Bash, though. ZSH's main use is as an actual interactive shell rather than a scripting tool

tame root
#

@mellow narwhal hmmm i dont know the difference between an interactive shell and scripting

#

do not understand what you mean there

mellow narwhal
#

The difference is what's interacting with the shell. If the machine is interacting with the shell through a script, that's scripting. If you're the one interacting with the shell, that's something else

#

ZSH is great because it makes your interactions with the shell streamlined and overall a better experience through stuff like autocompletion and better coloring

#

A script isn't gonna appreciate any of that at all, so it's somewhat useless, even more so when you consider that ZSH doesn't come built in on most distros where bash does.

#

ZSH does have better loops and somewhat better logic IIRC but really it doesn't make much sense to script in it.

#

@tame root

tame root
#

good info. I will look into it

#

thank you

mellow narwhal
#

Sure thing. Get yourself ZSH, oh-my-zsh, and grab a nice theme + the plugin zsh-autosuggestions

#

That will save you a massive amount of time when working with your shell

opaque ginkgo
#

honestly you shouldn't be writing that many shell scripts in the first place

#

better to use a higher level language like python

#

because shell is a pretty bad language

mellow narwhal
#

There's a time and place for them, and depending on what you're working with it can make sense to write a lot of them

#

Personally if I have more than one if statement or loop in a program I usually just switch to python, but sometimes that's not an option

opaque ginkgo
#

shell is fine for short scripts

#

the longest shell script in my bin is 18 lines

#

otherwise i just write in py

#

almost every linux distro already has python installed anyways

#

or it is easily installed by the package manager

tame root
#

im getting into cyber security i am guessing i will be automating tasks with python over bash or shell correct?

#

you guys are the shit btw

#

much love to my dawgs

mellow narwhal
#

You will most likely have to interact with the shell a lot, but yea, python for automating.

neon cloak
#

is shell code = asm?

warped nimbus
#

No.

twilit bolt
#

It's commonly written as assembly code, translated into machine code, but it depends on what vulnerability you're trying to exploit.

opaque ginkgo
#

and theres a lot more to asm than just writing shellcode

humble onyx
radiant crater
tender lark
#

So on Ubuntu, I am trying to set up a time frame in Crontab for how frequent it should clear my CPU cache.

#

Do you guys have a rule of thumb for clearing out cache, or does it vary depending on the workload?

summer trail
#

Unless you mean something other than your L1 and L2 cache

formal schooner
#

i dont think thats something you can even access

#

does x86 even let you do that at the assembly level?

tender lark
#

I'm referring to PageCache

#

@summer trail

#

Sorry for the confusion.

summer trail
#

Why do you want to clear the page cache?

tender lark
#

So the memory dosen't get clogged up

#

or cause a memory leak

summer trail
#

Why would you rather the memory be sitting unused rather than doing something useful?

tender lark
#

what if the cache is using something that is not necessary

summer trail
#

Pages will be dropped from the page cache as needed to make room for other stuff

tender lark
#

Oh

#

Sorry about that. I honestly thought that cache had to have some sort of maintenance

summer trail
#

There's some tunables you can adjust to control which types of memory are reclaimed first when there's memory pressure, but to be hand wavy about it, you want most of your memory to be in use at all times. It's doing something useful that way, and it'll be freed if needed to make room for other stuff.

tender lark
#

Alright

summer trail
tender lark
#

On a sidenote, Is there ways to prevent Memory leaks with Ram on Linux?

#

I know deleting old software updates help, but are there other things I should know about

summer trail
#

A memory leak is when a process allocates memory and forgets to free it. The memory is reclaimed when the process dies.

tender lark
#

I remember 2 months ago I had a big memory leak on my windows 10 os(it used 16 gbs of ram on start) and many of the processes that were hogging up the memory were from system processes from the os itself

#

I didn't want to tinker with those processes so I decided to do a full restart with windows

#

it lucky worked but it also caused some of my applications to be deleted

summer trail
#

A memory leak is a bug in a particular program, where it loses track of memory it allocated without ever freeing it. It's possible for system processes to have such a bug introduced, but if they do there's nothing you can do about it other than wait for an update to fix the bug, roll back to an older version without the bug, or live with the bug by restarting the process periodically

tender lark
#

So it might have been caused by a windows update?

summer trail
#

If it's a new bug in a Windows system program, it could only be introduced by a Windows update. That's the only thing that ever updates Windows system programs.

tender lark
#

Yikes

#

Microsoft really be forcing buggy updates

#

I assume Linux dosen't have the same problem?

#

since it's open sourced and dosen't force people to update

summer trail
#

No one tries to introduce bugs. Updating less frequently isn't a good idea, that's how you leave yourself vulnerable to known security vulnerabilities.

tender lark
#

Yeah I know

#

I'm just saying that in a general sense

nimble quarry
#

Hello, do you know of any program/utility/read reading user input and able to echo the full input at every keystroke (accounting for character deletions etc.) ? Something similar to cbreak(3x), but keeping track of line editing

gray fulcrum
#

Can someone help me use linux on windows by using virtualbox or anything like it?

main olive
#

and use both os win and linux using boot grub loader

#

simple dual boot

#

it has more advantage

tight mural
#

@gray fulcrum Just start with WSL and if you find it lacking, consider HyperV or virtualbox. If you rely on Windows apps, dual-boot is a pain.

#

docker and vagrant may also suit your needs.

main olive
#

check your sources.list

#

I stand corrected, this isn't possible

gray fulcrum
#

Does dual boot work fine? I use windows mostly for all my other work. But I want to get used to using linux for my projects

main olive
#

dual boots work fine

gray fulcrum
#

Okay cool

#

Thanks

gray fulcrum
#

I understand

main olive
#

@gray fulcrum

gray fulcrum
#

Yes?

delicate tendon
#

I know this is a more Python related server, but I have a doubt if anyone could help.
I want to be able to use SSH to transfer files from and to a filesystem image(EXT4). I read that to do so I must copy the openssh package builded while cross compiling with buildroot, so I did the following:

sudo umount output/images/rootfs.ext4 ../mnt_temp
cp output/build/buildroot-config/br2/package/openssh ../mnt_temp
sudo umount ../mnt_temp

I used, as seen, buildroot to cross compile the kernel, and the output/... directories are the ones buildroot generated inside a directory I've created. My goal is to test these functionalities on QEMU. But now, how can I check if SSH is working with local files? (SSH already works with remote servers)
How can I test it?

Thanks in advance!

delicate tendon
#

If someone could help, I would appreciate it ๐Ÿ™

humble onyx
#

@delicate tendon I probably misunderstood but there is a tool "scp" to transfer files through ssh

delicate tendon
#

Basically what I wanted was to transfer files through SSH from the QEMU to my local computer

#

@humble onyx

humble onyx
#

you need at least one way communication. if you can talk to the qemu's ssh I don't understand what is stopping you from doing that

#

can you connect to ssh server on qemu

#

if yes then use scp

#

@delicate tendon

delicate tendon
#

Yes I can use ssh to a remote server let's say gmail.com on QEMU. What you saying is that, given this, I can scp to my local machine?

humble onyx
#

just read the man page I am pretty sure it'll solve your problem

delicate tendon
#

Right, I appreciate, sorry for the poor explanation a few answers ago tho

humble onyx
#

"I want to be able to use SSH to transfer files from and to a filesystem image(EXT4)" this part got me confused but your question is how can I transfer files from/to a virtual machine through ssh

#

as long as you have network adaptors set up correctly

#

you are fine

delicate tendon
#

Just one more question, now that you're here, if you don't mind @humble onyx
When I open my QEMU, I can't see my usb devices under /dev. I have to pass it to QEMU, in order to see it, right?

humble onyx
#

I never used qemu, I use virtual box.

#

you need to refer to qemus manual for that

delicate tendon
#

Thanks again!

humble onyx
#

you are welcome

opaque ginkgo
#

"qemu manual"

#

links to the arch wiki

#

though qemu official docs are pretty awful xd

humble onyx
main olive
main olive
finite crater
#

So, Im posting this here because this is bash, but what I want is for something like this to work in Windows....

EXECUTEONCE=".executeonce"
if [ -f "$EXECUTEONCE" ]; then
  echo "Attempting to install virtualenv"
  python3 -m pip install virtualenv && echo "virtualenv installed"

  if [ ! -d 'venv' ]; then
    python3 -m virtualenv venv && echo "Initialized a virtual environment"
  fi
  source venv/bin/activate && echo "Sourced into venv"

  if [ -f 'requirements.txt' ]; then
    python3 -m pip install -r requirements.txt
  else
    echo "Cannot find requirements.txt"
    return 1
  fi
  echo "Attempting to execute 'sudo chmod u+x ./main.py' -- need password..."
  sudo chmod u+x ./main.py || return 1
  rm $EXECUTEONCE  # remove to skip this on next execute
  echo "Setup complete."

else

  # if already setup just execute
  ./main.py || {
    touch "$EXECUTEONCE";  # on error, reset for next execute;
    echo "$EXECUTEONCE" reinitialized;
    exit 1
  }
fi

Can anyone help?
If something is wrong with the bash lmk.

But yeah, I dont really use Windows and I need something like this. I know the main differences are

  1. python not python3
  2. ./Scripts/activate not ./bin/activate

Any others? How would you shell script this in windows?

#

Feel free to @ me, i might be working

sonic crypt
#

Can anyone look at #help-dumpling it has to do with starting a script on boot on my RPI

amber garnet
opaque ginkgo
#

wsl or cygwin

warped nimbus
# finite crater Feel free to @ me, i might be working

On Windows you'll likely write this in PowerShell. Stay away from cmd. However, given the machine already has Python, writing this script in Python is also an option. In fact, it may be a better option if you're already familiar with Python. The Python code would just be more verbose when dealing with subprocesses. If you need help understanding some of the shell syntax so you can translate it, feel free to ask.

#

venvs have an activeate_this.py script which can be used to activate a venv from within Python.

#

It's an analogue to the activate shell script.

#

That only exists if using virtualenv. It also has a Python API you could use to create the venv.

finite crater
#

I dont know PS or cmd at all. I use Windows, but not really for tinkering very often. I mainly just wanted to give someone a script and have them be able to use it, not knowing how to set it up themselves.

#

Its really the only time ive ever written such a script for a Windows user so i just never thought about it before..

#

I started this

def install(install_check: Path):
    if not install_check.exists():
        return
    else:
        if os.name == 'nt':
            try:
                subprocess.run([sys.executable, '-m', 'pip', 'install', 'virtualenv'], check=True)
                subprocess.run([r'.\venv\Scripts\activate.bat'], check=True)
                subprocess.run([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt'], check=True)
            except FileNotFoundError as e:
                print(e)
        else:
            subprocess.run(['bash', 'install_linux.sh'], check=True)

        install_check.unlink()

But then I decided to scrap that for some reason I cant remember and just did this

# install_win.bat
python.exe -m pip install virtualenv
python.exe -m virtualenv venv
%~dp0\venv\Scripts\python.exe -m pip install -r requirements.txt
%~dp0\venv\Scripts\python.exe script.py
pause

Not all fancy and robust but for the use case, it allows a user to run the code and dispose of it.

Its possible that fancy and robust bash isnt the best idea anyway. When I try to do it, its always a bigger time sink than I think it will be and then it has problems I didnt consider.

#

Keeping it simple with bash seems to be best

#

Im better at it than i used to be at least

main olive
#

Which is better, freebsd or linux

#

Also, What is main diffrence between debian and Arch

finite crater
#

Never used bsd, but the answer is probably neither is better.
The main difference is debian is old and mostly stays the same. Its source repositories are often outdated a bit but stable. It often takes work building many things from source to get started with it..

Arch is the same way in being minimalistic, but rather than have sometimes outdated but stable software with limited access to update it without doing it yourself, Arch gives you everything you need to be on the cutting edge of the newest versions and install them from many sources. This means often the code you are using is in development and liable to break

Look into "rolling release software ditrubution" vs traditional version release. That is arch vs debian..

#

Arch also requires more familiarity with following documentation to get started. I do not recommend either as a first distro.

amber garnet
scarlet pagoda
#

@main olive use arch if u want no bloat else use debian with alot of bloat

#

my os artix with runit + i3wm + tmux takes only 120MB ram initially

opaque ginkgo
#

@finite crater debian has a rolling release too

#

debian testing

fresh saddle
#

Comparing a testing release to a rolling release is pretty unfair

main olive
#

you can use debian sid

sharp perch
#

I have a bunch of .py on debian, and I now wish I had it in PyCharm (as I do for other projects on Windows.) Where I type is Windows. Up to now I just access the linux hosts via SSH. Would I be better off switching to remote X11 to get PyCharm running on Linux, or can I somehow set up a WIndows PyCharm project to edit code on the Linux host?

#

And is there something else like Jupyter or iPython that I should be looking at?

main olive
sharp perch
#

Oh hi. Sorry, I just started using discord and I'm floundering a bit

main olive
#

it's alright

sharp perch
#

yes, we have X11 on our debian systems. I'm nmore wondering what will be more practical for me. I want to work on code that can run from the linux command line, but take advantage of PyCharm's IDE features. I've got PyCharm all set up on Windows already

main olive
#

oh ok that makes sense

sharp perch
#

I think i should start putting my linux code into a venv

main olive
#

defenitly

#

pip makes a mess

sharp perch
#

it wouldn't be bad to have it run from windows, but the other people in my team prefer linux (i do both about equally easily)

main olive
#

yeah

sharp perch
#

I am less than 3 years from retirement and I feel responsible to leave behind something my colleagues can make sense of

main olive
#

so you want to move windows code over to linux? then have ssh to run that code on linux

sharp perch
#

in fact half the code is written in perl 8-)

main olive
#

oh

sharp perch
#

I'm kind of dreaming of finding a workable perl-to-python translator

#

i rely heavily on python dictionaries, which in perl were called associative arrays

#

really I could just start rewriting all the perl in python from scratch, clean it up and make it more object based

main olive
sharp perch
#

i remember some P.R. for the perl language that said "the three virtues of perl programmers are laziness, impatience and hubris" 8-)

main olive
main olive
sharp perch
#

it had a pretty good module ecosystem when I was using it. Python packages seem to be the Borg

#

I don't see ever going back. I starting migrating to python to keep current and compatible

main olive
#

yeah

sharp perch
#

I do tech support for UofT's engineering department, and a lot of our users started asking for python

#

also the climate modellers seemed really into it

#

I am currently living off the benefits of one python package "openpyxl" which can read and write .XLSX files

#

it can do virtually everything - column widths, fonts ...

main olive
#

sounds useful

sharp perch
#

someone asked for a volunteer to write something in Excel macros, and I said sure, as long as I can substitute python

#

gathering input in XLSX from many users, merging into one consolidated report. It's working smoothly. THe first two months were a hellscape of "oh, this user inserted an extra row into the Excel tempate so all the input fields are off by one" and "oh, this user entered a Dingbats checkmark instead of the plain letter X we asked for"

#

and the user who thought they would use cell background colour to indicate which cells were yes, instead of typing an X like the sample template asked for

#

but my code included plenty of error checking so I caught all of these

#

so anyway...

#

what kind of stuff do you do in python?

main olive
#

flask is pretty fun too

vale marsh
#

Hey guys pls answer :
Can we ' copy to clipboard ' using the linux terminal or using the subprocess module ?

opaque ginkgo
#

xclip or xsel for subprocess

#

there's probably a python library that lets you avoid a subprocess and interact with x11 directly

#

pyperclip is a 3rd party lib for this

#

which is also cross-platform

vapid quarry
#

Which simplest solution unix utility can convert multiple lines delimited like this:

C1 23 15 64-C2 14 62 46

into columns delimited by the -, like this:

C1  C2
23  14
15  62
64  46 
thorn shale
#

hello

mellow narwhal
#

Sed can no doubt do it but I couldn't think of the command off of the top of my head

main olive
#

any vim enthusiasts in there? I want to replace the double gg to go to a certain line with just a singular g, and yes i am aware of the upper case one

summer trail
#

I use g# and g* and gv and gq every day. And gu and gU pretty regularly, and gf and gF a bit less regularly.

vapid quarry
shy fractal
shy fractal
#

Okay, after a bit of code golfing, I have this:

echo 'C1 23 15 64-C2 14 62 46' | python -c 'import sys, numpy; print("\n".join([" ".join(x) for x in numpy.rot90([x.split(" ") for x in [x.rstrip("\n").split("-") for x in sys.stdin][0]])[::-1].tolist()]))'
C1 C2
23 14
15 62
64 46
vapid quarry
#

That is indeed More complicated than I expected

atomic ember
#

Hello, i know it's not related to python, but i just installed manjaro kde and i have no audio, i look on google but nothing works

humble onyx
#

channels are usually muted you need to unmute

atomic ember
#

I think the problem it's because alsa doesn't see my audio card

#

but i still don't know how to fix it

#

i don't know what i did but it's working now

#

thanks

bleak urchin
#

hey can anyone here please help me get a linux remote connection

#

Install Kali Linux on Windows 10 in under 5 minutes (full tutorial) using WSL 2. (Windows Subsystem for Linux 2)

โžก๏ธSupport NetworkChuck: https://bit.ly/join_networkchuck
โ˜•or buy me a coffee: https://ko-fi.com/networkchuck โ˜•

Checkout @David Bombal 's WSL2 playlist: https://bit.ly/2NOFcem

(affiliate links below)

๐Ÿ”ฅ๐Ÿ”ฅBOSON SUMMER SALE 25% OFF EVE...

โ–ถ Play video
#

i tried this and it was working well restarted the system after it was done and it wont connect now

humble onyx
#

@bleak urchin your network interfaces seem down. turn them back on

#

ip link set <interface>

delicate tendon
#

Anyone knows how to solve mdadm: /dev/<name_of_device> is not a block device?
I've created test_dev using :

mknod test_dev c 1 5
humble onyx
#

c = character

#

b= block

delicate tendon
#

Right, confused b with binary

#

I know get an error saying mdadm: cannot open /dev/test_dev: No such device or address, but they do appear under /dev

#

@humble onyx

humble onyx
#

I have no idea sorry

lament remnant
#

Does anyone here knows how to use Minix?

vernal harness
#

[usstg2@usstg2 ansible]$ python ansible localhost -m ping
Traceback (most recent call last):
File "/usr/lib64/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib64/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "ansible/main.py", line 72, in <module>
import shutil
File "/usr/lib64/python3.8/shutil.py", line 10, in <module>
import fnmatch
File "/usr/lib64/python3.8/fnmatch.py", line 14, in <module>
import re
File "/usr/lib64/python3.8/re.py", line 145, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

#

[usstg2@usstg2 ansible]$ cat /etc/redhat-release
Fedora release 32 (Thirty Two)
[usstg2@usstg2 ansible]$ python --version
Python 3.8.6

summer trail
#

the enum that comes as part of the Python standard library with Python 3.8 definitely does have IntEnum.

mellow narwhal
#

I believe I've done it before, what's the issue?

#

Maybe not Catalina actually

main olive
#

hey yall

#

can someone remind me wtf you use to cut some data out to make it easier to read

#

for example

#

echo $PATH | .local/bin

#

im trying to check if .local/bin is in my path

#

wtf was the command to print it out

#

it was grep

#

just remembered

#

thanks anyways

hexed matrix
#

is this a good place to find a good IT guy that can help me?

#

a dependency broke my rpi

#

can't install/remove anything because a package seems to be bugged

#

a python package that controls the GPIO pins

mellow narwhal
#

Which is it, and what is happening?

median crown
#

im using a google cloud instance to try an install a script from pip, installed the script with 'python3 -m pip install delete-tweets' and it successfully installed, but when i try to execute 'delete-tweets' in the console I get -bash: delete-tweets: command not found. I'm assuming this has something to do with $PATH and I'm not very well versed in the directories that may affect this. Any help would be greatly appreciated.

python3 -m pip show delete-tweets
shows that the package is installed in Location: /home/machinez/.local/lib/python3.7/site-packages

summer trail
#

And, when you pip install something that creates a script, if the bin directory it installs into isn't on your $PATH then pip will print a warning telling you how to add that directory to your $PATH

median crown
#

Ha now that warning makes sense. Cheers I appreciate it. I always seem to run into things like this when I'm trying to install things from pip or just do unix things in general.

Since this is a huge blindspot I continue to have, and the learning courses for python and things I've taken have only asked me to copy and paste commands to get things done without explaining what's actually going on here, what resources can I take advantage of to better familiarize myself with all things unix and package management for python/npm/etc ?

humble onyx
#

@median crown I think you can run pip installed modules with python3 -m <module>

main olive
#

guess that's too general

#

but whenever you c/p some command you dont know, try to look up what it does

#

and understand what's behind

#

and whenever you got a specific question, come back here (or somewhere else) and ask it

#

What does XY do?

fresh plinth
#

does anyone know how to use cron to execute a scrypt when user logs in?

opaque ginkgo
#

@fresh plinth all users, or a certain one?

#

probably just stick it in /etc/profile or ~/.profile, you dont need cron

fresh plinth
#

i m supposed to do it with cron and w/o root privs

opaque ginkgo
#

can you even do that with cron

fresh plinth
#

i know, right?

#

that's why i m asking here

amber garnet
opaque ginkgo
#

why do you have to use cron

fresh saddle
#

That sounds like a job for the system daemon, systemd most of the time

solemn snow
#

Hey guys I can't access ipython through the terminal, how can I make it accessible?
Please help. I really appreciate it.

solemn snow
#

Hey so when I try to install a library I get this warning

but the location that warning said is in path, but why do I still get this warning?

summer trail
solemn snow
#

ye it was the second one

#

thankyou though

summer trail
#

you should probably make the first change, too, though. That controls the order that things are searched in - does it look in that directory after (the way you have it) or before (the way I'm proposing) all the other directories it searches.

solemn snow
#

ooh

#

hmmm

summer trail
#

echo $PATH will show the directories that will be searched, in the order that they'll be searched. Earlier directories takes precedence over later ones.

#

right. So it searches those two directories last.

solemn snow
#

i see

#

but does the order matter?

summer trail
#

if a command is available in multiple directories, yes

solemn snow
#

what do you mean by that

summer trail
#

if there's multiple versions of a program on your computer, the order determines which of those will get used.

solemn snow
#

ooh

summer trail
#

generally, you'd want the things you've specifically installed to take precedence over any other versions that might have already been installed.

solemn snow
#

right

#

Ok stuck again

#

So I am trying to make it so that when I do code something it will open up vsc with that file open.
I used to be able to do this in windows but rn I can't
When i do vim .zshrc
This is what I get

export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/3.8/bin/
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/13/bin/
export=$PATH:/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/

But when I repoen the terminal and do code it says command not found.
Also when I do echo $PATH
this is what I get

inheritance@Inheritances-MBP ~ % echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin/:/Applications/Postgres.app/Contents/Versions/13/bin/
summer trail
#

that last line in your .zshrc is wrong, right? Shouldn't that be:

export PATH=$PATH:/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/
solemn snow
#

ye

#

also not double equal to

#

but thankyou

summer trail
#

right

#

also, like I said: it should almost certainly be PATH=/new/thing:$PATH instead of PATH=$PATH:/new/thing

solemn snow
#

Finally got everything added to path

#

gotcha

main olive
#

@boreal pebble anyway, use a linux vm if some modules aren't supported on windows

tender plinth
#

Hello , is there a way to disable kernel NX bit (not the gcc one)?

main olive
#

Does anyone know linux well

#

i need help

amber garnet
#

I am not master of Linux but all depends on your question

main olive
amber garnet
main olive
#

see i am getting very confused now

#

some people say it will work

#

some people say it will not work

#

๐Ÿ˜ซ

amber garnet
#

In my opinion it cannot work since Linux drivers need to work next to Linux kernel - Windows doesn't have Linux kernel, has he?

main olive
#

because i am asking it because i am thinking to switch windows to Linux.

amber garnet
main olive
#

what is that

amber garnet
main olive
#

this thing i know but

#

it's not very well

#

i have also installed it

amber garnet
#

So you can install Linux in some VM like VirtualBox and here you are

main olive
#

but drivers not working

reef radish
#

my question is that can we use windows drivers on Linux (Ubuntu)
i've been using linux for quite some time and as far as i know, not necessarily. ubuntu already comes with the necessary drivers for the system but in the case of proprietary drivers you need to add them by going to System Settings > Additional Drivers.

also, before you use linux, use a virtual machine and just get used to the system a bit.

ocean sentinel
#

Guys I'm having a problem with ubuntu when creating a file i doesn't get refreshed on the file explorer in windows unless I press f5

#

And since I'm a bit new to this I still need to see what I do whether I move, delete, create a file/folder

#

do you know why this would happen?

reef radish
#

I'm having a problem with ubuntu when creating a file i doesn't get refreshed on the file explorer in windows unless I press f5
im a tad confused. you stated that you need help with ubuntu but you're also mentioning windows, could you elaborate?

reef radish
tender plinth
#

I was looking for disabling NX bit in kernel allocated pages

tender plinth
#

Anyways , does someone know how to disable kernel stack canary?

low tiger
#

so many chats lol

granite aspen
#

I'm considering wiping my windows laptop and installing linux on it to squeeze a few more months of use out of it. It's becoming almost unusable.

humble onyx
#

hello I am trying to block client-to-client vpn traffic with ufw but it doesn't seem to apply. I ran " ufw route deny from 10.8.0.0/24 to 10.8.0.0/24" am I doing it wrong?
I know how to do it with iptables but it resets after reboot.

dawn bloom
dawn bloom
granite aspen
dawn bloom
#

Yes

#

First of all have you ever used linux ever?

#

If not I reccomend Linux mint

humble onyx
#

yeah go with linux mint more user friendly imo

#

and thank you @dawn bloom

dawn bloom
#

No problem

#

Been using Linux my whole computer life, only ever used windows at school

dawn bloom
granite aspen
# dawn bloom If not I reccomend Linux mint

Mint is what I use on my work computer. I only keep windows on my personal computer for games but at this point I don't get good gaming performance out of this computer anyway.

dawn bloom
#

Well then I would recommend that you stick with mint for now, and if you ever want to get into learning Linux really deep use virtualbox to test out different distros.

granite aspen
#

Will do!

humble onyx
granite aspen
#

@dawn bloom I have made virtual machines with mint in the past--i remember one flavor was lighter weight than the others. I think cinnamon is the heavier one?

#

A related question: I actually wanted to dual boot this machine, but I can't because I would first have to defragment it and that would take days. I'm not sure why I still needed to defragment it because I had just finished a factory reset. Will wiping windows and installing linux have the side effect of making any data previously on the hard drive completely gone?

dawn bloom
#

Yes

dawn bloom
#

When you install Linux mint I think it removes all data

granite aspen
#

I'm not sure why I still had to defragment after the windows reinstall because I lost all the data anyway

fresh saddle
#

Well, it depends on how you install it

#

How many disks do you have, what partitions do you have, and what you will have

granite aspen
#

I'm good to just say goodbye to windows on this machine. I'll buy another when I'm ready to game again

fresh saddle
#

I am guessing that it is an NTFS partition?

granite aspen
#

No idea.

fresh saddle
#

Hmm it is the default, so if you haven't played around with it, it probably is NTFS

#

In this case you will have to move to an ext3 or 4

#

Do you have a second disk in the meantime?

#

(if you use less than half of the disk, that could work too)

granite aspen
#

@fresh saddle I'm confused, are these questions aimed to help me dual boot?

fresh saddle
#

Oh

#

Dual-boot

#

Nevermind me then

granite aspen
#

But I don't know any of the terminology here so I don't know why you mentioned a "second disk" earlier

pastel perch
#

Hello, is there a significant difference between writing code on windows, vs writing it on unix? or is the difference only for compiling and packaging?

vocal mist
# granite aspen A related question: I actually wanted to dual boot this machine, but I can't bec...

I tried to download ubuntu at my xps 9500 I followed the steps when I clicked install linux it said you have to dissable the intel rapid technolohy a.I replace rapid with AHCI but it broke my whole system when I return to default there was no problem.ahh .I love linus but I hate to deal with system problems I remeber last year when I was using my hp elitebook 8670w I both linux and windows interesting thing is when I updated my windows it broked all my system again there was only a command line and a whole black screen my.Now I am runing linux in virtual box I love it is fast and very responsive

warped nimbus
#

It's easier to install tools and libraries on linux since distros come with package managers. On Windows you need to install a package manager separately, but then the experience feels pretty much the same.

granite aspen
#

You also have to install build tools (see !build) on Windows for some Python libraries, which can be off-putting.

pastel perch
#

ah i see thank you

eager spire
#

hey o- o i'm relatively new to linux can someone tell me if i did sudo apt update && sudo apt -y upgrade and closed the terminal by mistake are the updates still running in the background?

#

or did i mess shit up

twilit bolt
#

no they're not running in the background

#

you'd have the run the command detached from your terminal if you wanted it to continue detached.

eager spire
#

oh so i run the command again then? o- o or do you think something might've been broken by updating half of it

twilit bolt
#

No you're probably fine.

#

But you're right there could potentially be problems.

eager spire
#
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Fetched 109 kB in 4s (27.4 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

o-o uhh... i ran the command again

#

it says that

#

i just installed this os you think i should just let it be or reinstall it?

twilit bolt
#

hmm

eager spire
#

cuz if i wanna reinstall it i'd rather do it rn than when i have projects that i'm developing on it

twilit bolt
#

I'm not too sure, I probably wouldn't.

#

But, if you don't mind, then you can if you want to be sure you're okay.

eager spire
#

i guess... anyways thanks

eager spire
#

nah i just had multiple terminals running and closed the one with the command running by mistake xD so i thought it might do shit but it didn't

paper ginkgo
#

If you want to run commands you can append &, like so: sudo apt update & && sudo apt upgrade -y &

#

You can also run the commands like you normally would and press Ctrl+Z

eager spire
#

๐Ÿ˜ฎ thanks for the tip i have used linux in the past (like 5 years ago) just getting back into it o- o

paper ginkgo
#

I like to automate apt with cron

#

Have it run automatically in the background every day at xx:xx pm

eager spire
#

nice ๐Ÿ˜ฎ though i'm running a virtual box so it might not be on at a fixed time everyday for me

paper ginkgo
#

Fair enough

fresh plinth
#

Is there a way to ignore eof in scrypts?

paper ginkgo
#

Show us the code @fresh plinth

fresh plinth
#

#!/bin/bash
passwd

paper ginkgo
#

There's no EOF in passwd

fresh plinth
#

you can skip changing password with ctrl D

paper ginkgo
#

What are you trying to do?

fresh plinth
#

is a user launches this script i want them not to be able to just exit

paper ginkgo
#

There are better ways to do that

fresh plinth
#

i don't really know

#

i'm new to this stuff

paper ginkgo
#

What happens when you exit a script with Ctrl+C or whatever is signals

#

You can disable these signals or even redirect them to other commands

#

I haven't worked with Bash signals in a long time, but in C you can:

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>

void handler(int sig)
{
    if (SIGTERM == sig) {
        do_something();
    }

    return 0;
}

int main(int argc, char **argv)
{
    /* Ignore SIGHUP */
    signal(SIGHUP, SIG_IGN);

    /* Remap SIGTERM */
    signal(SIGTERM, handler);

    return 0;
}
opaque ginkgo
granite aspen
#

I put linux mint 20 on my computer yesterday and everything was fine, but the resolution unexpectedly changed and now it's too small to do anything and no other resolution options exist

#

It also won't respond to my mouse even though it did yesterday

#

I think auto updating the drivers must have ruined it

fresh saddle
#

Thatโ€™s what you get for using Mint :P

#

Maybe you could stop the grub boot and swtich to a tty to try and fix it?

granite aspen
#

I'm just going to start over ๐Ÿ˜…

fresh saddle
#

That works too haha

granite aspen
#

This is so sad.

fresh saddle
#

You should revert the driver update then

granite aspen
#

Idk how to do that

#

And I don't know how to tell if an instruction online is correct for my problem case

fresh saddle
#

Press esc during the grub boot, ctrl + F1 to switch to the tty1, remove the old drivers, reboot, grab a beer, celebrate

granite aspen
fresh saddle
#

GRUB is your bootloader, it is the first part of the boot sequence when you see text flying around

#

the tty1 is the first actual terminal (not an emulator this time) of your installation, you cannot access it once you switched to a graphical interface, thatโ€™s why you need to cancel the boot sequence

#

(tty2 is also a thing)

granite aspen
#

I tried hitting escape when you said and now there's just a flashing line in the corner

#

I'm just going to redo it. I'd rather spend an hour doing something that I know will work rather than gamble on ten five-minute fixes and risk having nothing to show for it at the end.

fresh saddle
#

Try to press F10, maybe?

granite aspen
#

I already started

fresh saddle
#

Fair

granite aspen
#

@fresh saddle thanks anyway ๐Ÿ˜…

fresh saddle
#

No problem haha

hollow sky
#

Is this for help with Linux?

amber garnet
hollow sky
#

@amber garnet
Thanks

proper pulsar
#

Hello could anyone help with some basic unix bash script ?

#

Im first year on this so it isnt anything demanding really

tawny flume
#

I was going to say just ask haha, that's what people will say.

#

However, I still believe this channel is related to Python stuff in a Unix environment.

proper pulsar
#

ah

#

i thought its just off topic unix

#

like, everything goes

#

coz i have no idea where else to ask and couldnt find any unix/bash releated server

tawny flume
#

Let me invite you to something

proper pulsar
#

alright

fresh saddle
#

You could also ask in off-topic @proper pulsar

proper pulsar
#

aight

main olive
#

Hi, I have two python3 processes ran on my machine and I often confuse them when killing ๐Ÿ˜…

#

what can I do?

#

they use about same amounts of ram

#

and I run em one after another immediately

opaque ginkgo
#

shouldn't ps/top/htop display the full cmd line

gritty karma
#
pi@raspberrypi:~ $ pip install pandas-datareader
Collecting pandas-datareader
  Using cached https://files.pythonhosted.org/packages/14/52/accb990baebe0063977f26e02df36aa7eb4015ed4e86f828cd76273cd6f1/pandas_datareader-0.8.1-py2.py3-none-any.whl
Collecting lxml (from pandas-datareader)
  Using cached https://files.pythonhosted.org/packages/db/f7/43fecb94d66959c1e23aa53d6161231dca0e93ec500224cf31b3c4073e37/lxml-4.6.2.tar.gz
    Complete output from command python setup.py egg_info:
    Building lxml version 4.6.2.
    Building without Cython.
    Error: Please make sure the libxml2 and libxslt development packages are installed.
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-0pxHCo/lxml/``` no idea why this is happening
inland gulch
#

@gritty karma
Looks like pip failed to install pandas-datareader, missing lxml dependencies on the raspberrypi, install 'libxml2' and 'libxslt' development packages & try again

gritty karma
#

i've already installed lxml parsers before

#

hmmm

main olive
#

You probably need libxml2-dev and libxslt-dev

#

I mean, the system packages

solemn snow
#

How would I add a folder to path?
So I have to cd into a folder to do this command python3 -m some_other_folder but I want to be able to do this from any dir, how can I do that?

hardy grail
#

create an alias in ~/.bash_profile or which bash file you use

main olive
#

I'm making a virtual environment in python that feels like linux. Does someone have any suggestions?

https://github.com/GGORG0/TurBOX/

#

right now its very basic

compact cave
#

GUYS

#

Pls help meee

#

im dying

#

I CANT figure it out

#

nvm fixed it

tender plinth
#

Hello , I have a rootfs.ext2 , I extracted the files with extfstools , and now I have added files and want to recompress it back , does anyone know how to do it using extfstools?

amber garnet
compact cave
#

i fixed it bro

amber garnet
#

No one knows why month is before day

amber garnet
amber garnet
tender plinth
#

that is for cpio format right , I have rootfs compressed into ext2 format

#

I am aware of cpio

dark bear
#

How do i uninstall ptrhon 3.6 and install py 3.9 on ubuntu

main olive
#

Do not uninstall standard python on Ubuntu

#

the OS relies on it. It will probably break things, like the terminal

#

just install 3.9 in your system and use it, where you need it

amber garnet
dark bear
amber garnet
#

/etc/os-release

dark bear
#

๐Ÿคฆโ€โ™‚๏ธ

amber garnet
#

Is it your computer?

amber garnet
dark bear
#

cat os-release

amber garnet
#

Like cat /etc/os-release

dark bear
#

?

#

ok there we go

amber garnet
#

Must provide full path or change directory

dark bear
#

19.1

#

tessa

amber garnet
# dark bear

And sudo apt-get install python3.9 is not working, right?

dark bear
amber garnet
dark bear
#

ยฏ_(ใƒ„)_/ยฏ

#

i mean

#

its like a month old

#

so i dont see how

dark bear
#

but it doesnt work

#

I'm saying ./AABot.py & to run it but it returns that error

#

but i use ./ with other files and it works

#

nvm got it

amber garnet
amber garnet
#

And shebang is correct

dark bear
#

@amber garnet no i got it working

#

i forgot to convert the EOF

#

to unix

main olive
#

can anyone who knows tkinter go to user-interfaces please

covert orchid
#

Hi, everybody. I'm trying to use a package installed by pip. When I imported it and run the script by terminal works well but when I try to import it into jupyter lab. Any suggestion?

#

I'm working on a virtual env

#

Into jupyter lab, shows that it is not installed*

covert orchid
#

I tried it too

#

The way a solve it was opening jupyter from anaconda-navigator instead of from terminal

wet sapphire
wet sapphire
#

why, what?

opaque ginkgo
#

"uninstall"

#

@dark bear whats your ubuntu version

humble onyx
#

hi, I want to run a privileged program from apache. Should I simply set SUID on the program? or should implement some other mechanism?

amber garnet
main olive
#

is there a cross-platform py3 alternative to c#'s Environment.GetFolderPath(SpecialFolder.ApplicationData)?

returning:
on windows: C:\Users\user\AppData\Roaming\ ( %appdata% )
on linux /home/user/.config/ ( ~/.config )
on mac whatever i dont use mac cuz its trash

fresh saddle
#

"C:\Users\user\AppData\Roaming\" if os.platform == "else" "/home/user/.config/"

main olive
#

no plz i really dont want using if os.name == "sth" or if "sth" in os.name...

#

is this really the only way?

#

i can use a pip module too

fresh saddle
#

I mean, it will do that under the hood