#unix
1 messages ยท Page 49 of 1
noones hating on kali
Ok so?
its just that running kali as your main os is stupid
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
ok?
What the fuck else do you use it for
No I don't work as a pentester but I'm usually doing ctfs or doing other shit for my education
cool
Wtf else am I suppose to do on a computer?
so use kali for the pentesting/ctf specific stuff and your main os for everything else
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
๐คฆโโ๏ธ
I dual boot windows so if I wanna play some games I can do that there but other than that
Eh
What do you mean?
Kali isnt just used by professionals
It's also used by students
I'm not sure if you know
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
For real though kali on a little eee pc or something like that would be nice
does anyone know how to generate .mpd files on the command line
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)
kali has a more open kernel
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
Official documentation of Kali Linux, an Advanced Penetration Testing Linux distribution used for Penetration Testing, Ethical Hacking and network security assessments.
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
Also see https://kali.training/topic/recompiling-the-linux-kernel/ opening section 9.2. The kernel is obese.
@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
Yeah, it's upstream is debian-testing which is possibly less stable than debian-stable
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
Are you making the directory with python?
i'm making the directory using the command mkdir
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
sorry for censorship
some of the dirs and the dir im trying to create contains my name and my surname
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.
Try mkdir without the ~/
Does it work if you do it with a different directory name? Like mkdir example_dir
whats that
its a package to manage different python version
installing and uninstalling is a piece of cake
is it with apt
pyenv install 3.8.6, pyenv global 3.8.6 to make it the global version
you are using kali right?
you should google on how to install pyenv on kali
as i dont have experience with its pckg manager
oh yeah its with cURL
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
okay
@neon hare https://www.kali.org/docs/general-use/using-eol-python-versions/ found this article which should be helpful to you
oof
for some reason
did you do pyenv global 3.8.6
nice
it does nothing
wait
lol
here we go
thanks
np, you can install any python version you want and set the default by pyenv global version
ok
mp
search for how to make python 3 as default python in apt based system
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
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
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
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)
what is sys.playform
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
https://docs.python.org/3/library/sys.html @willow ferry
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.
that doesn't work bc the reason why I had it on was to see if there was an error or something bc it wasn't opening
maybe it's using a different version of pip or something?
it's using a different version of everything seemingly
Is the VS Code terminal running in a venv?
@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...
VS Code plugins?
im using the python plugin from microsoft if that's what you're asking
Is your interpreter set to the one in the virtual environment? is it different than your os interpreter?
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
does your os have 3.9?
i'm on pop too. if you type 'which python3' in terminal what does it say?
/usr/bin/python3
code can't find that? ...odd
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...
is it installing it in a VS Code created directory inside the project directory. Sometimes it will create a hidden folder to install stuff
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
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
Does anyone else have any suggestions? These is starting to get frustrating as it makes zero sense...
I've managed to be able to use dearpygui, but that's using python 3.8.5, not 3.9 like I'd prefer
@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.
@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
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.
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"?
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
will do, thank you ๐
You're welcome
My bad, confusing it with another ide
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
any background processes?
Maybe your windows is on your SSD and linux on your HDD ๐ค
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
Ok ok
And I kind of figured why it was happening, My mouse wasnt clicking Sometimes, Probably Problem of the mouse driver
Lol
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)```
I think it's not UNIX-related problem, maybe #algos-and-data-structs ?
Thanks @amber garnet, I posted it there.
bruh
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
ยฏ_(ใ)_/ยฏ
Guys any one has used GNU Radio ???
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
<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>>
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 ?
@weak schooner pep8 says 4 space indents, so vscode auto-converts by default
hmm cause when i do tab in sublime its a line instead of dot and when its dot when i open it in another editor it make the indention all messed up
: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).
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.
Are you using a headless browser?
ssh_exchange_identification: Connection closed by remote host when trying to connect via. WAN
Are ports open?
You'd get a "Connection refused" if not, not "Connection closed by remote host"
Yes i guess.. I've added ssh rules in public firewall
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...?
add it to ~/.zshrc
@rustic pollen
Thanks buddy....๐ค
how do u delete a folder through the terminal in mac (zsh)?
rm -r 'directory_name'
The quotes may or may not be needed, depending on the name, but it's always safe to have them.
i got it thankyou
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
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.
im using github actions to automatically run the script for me i just need to figure out how to write it :)
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
its an SSH setup that runs a script
# 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 ^
I am a bit late, but yes, there are self hosted runners https://docs.github.com/en/free-pro-team@latest/actions/hosting-your-own-runners/about-self-hosted-runners
You can host your own runners and customize the environment used to run jobs in your GitHub Actions workflows.
@main olive i am having compiling python code. This is my dream project please help me. (You can dm me)
this is the error I am getting
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!
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)
Why not f""-n {temp_subdom_scans}"?
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
@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"
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?
It works now. I didnt do anything. Literally left it alone for 2 hours
You may want to see: https://github.com/microsoft/WSL/issues/4103#issuecomment-691161307
@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
You are welcome!
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? ^^^
What do you mean by "I couldn't write a password"?
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.
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
Exactly
how am I supposed to recover that
Ah, is that password for the root account?
how do I delete it
You installed it from the Microsoft Store, aren't you? Just uninstall it by right-clicking on the start menu entry.
I got it from microsoft store but idk what you mean by start menu entry
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.
can some one tell me y open command is not workin g
Try nautilius
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.
Try explorer.exe wonderland.jpg if you are on WSL.
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.
yes you can
cmd.exe /c start wonderland.jpg
start is a "shell builtin" for cmd
@stray current
@amber garnet no x11 server
?
what is unix
another os
You need xdg-open (https://wiki.archlinux.org/index.php/Xdg-utils#xdg-open), and an alias possibly as well.
FWIW you can add an X server if you want. I use WSL with VcXsrv.
*vanilla wsl
I was trying to upgrade setuptools and this came...
I'm using python 3.8.5
with anaconda 4.9.2(if this is any help)
pip install --upgrade --user setuptools
why are you trying to upgrade python
@rustic pollen
I was not able to install discord
doesnโt work, help
How about reinstall? Reboot?
reinstalled, turns out repos were the problem
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
@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.
Interesting. I'm not surprised that things have to be that complicated
When does the prompt get redrawn?
I should have said drawn, not redrawn. Every time a new prompt is displayed, PROMPT_COMMAND runs, and you can hook into that to handle when the file has been written
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.
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?
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.
@narrow condor GIYF, found this right away
What do you want to learn about
this is my city
naw man its mine
@storm sundial dpkg --get-selections > ~/Package.list
then later you can dpkg --set-selections < ~/Package.list
and apt-get dselect-upgrade -y
many thanks!
I have been pulling my hair for hours, anyone has an idea? Github issue didn't help
Try with complete path @valid wadi
I tried os.path.abspath
@valid wadi What text editor is that?
vim
you have pretty terminal colours
Did you literally enter the full path in the program?
dracula colorsheme
arch i assume?
Gotcha, sorry to make ya do that again, seemed like the most obvious thing though
np no harm in trying
the default path still doesn't work even though I have put the files there as well
Is it possible your data is the issue?
I used wget to download from github
i even redownloaded it
gave it 777 premission
I just installed tesseract and tesserocr
Training data and teser are on the same version?
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
Yea I've no clue, sorry. Best of luck
np thanks anyways!
I wouldn't recommend you to try and change the distribution, or even use Kali as your daily driver
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
@mellow narwhal I have figured it out. Those files that I downloaded weren't enough. There were some configuration ones. dumb mistake....
Ah. Well glad you fixed it ๐
64, always 64
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.
UnicodeDecodeErrors. Could anyone help me???
@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
idle is kinda bad
use ipython
so much better than vanilla repl
or for ides
use vscode or pycharm
@jolly cairn i simply type python?
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?
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
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
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
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?
@hourly will work fine, unless you're on some obscure distro
ubuntu
that's cool
@opaque ginkgo I will try this right now. Thank you for the quick response friend ๐
and that was the trick
another quick question though semi unrelated to python
I am learning python and bash
is there something better than bash
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
@mellow narwhal hmmm i dont know the difference between an interactive shell and scripting
do not understand what you mean there
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
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
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
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
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
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
You will most likely have to interact with the shell a lot, but yea, python for automating.
is shell code = asm?
No.
It's commonly written as assembly code, translated into machine code, but it depends on what vulnerability you're trying to exploit.
and theres a lot more to asm than just writing shellcode
@neon cloak http://shell-storm.org/shellcode/ you may want to check out this site to get an idea of how it looks like
debians also a good choice, and kalis based off of debian so you can just hand pick the tools you want when you want
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?
Your CPU cache? That's not something you should ever clear. There's no good reason you ever would. What are you trying to accomplish?
Unless you mean something other than your L1 and L2 cache
i dont think thats something you can even access
does x86 even let you do that at the assembly level?
Why do you want to clear the page cache?
Why would you rather the memory be sitting unused rather than doing something useful?
what if the cache is using something that is not necessary
Pages will be dropped from the page cache as needed to make room for other stuff
Oh
Sorry about that. I honestly thought that cache had to have some sort of maintenance
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.
Alright
https://chrisdown.name/2018/01/02/in-defence-of-swap.html will teach you a lot on this topic.
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
A memory leak is when a process allocates memory and forgets to free it. The memory is reclaimed when the process dies.
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
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
So it might have been caused by a windows update?
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.
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
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.
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
Can someone help me use linux on windows by using virtualbox or anything like it?
WSL is not enough?
better install linux
and use both os win and linux using boot grub loader
simple dual boot
it has more advantage
@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.
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
dual boots work fine
I understand
@gray fulcrum
Yes?
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!
If someone could help, I would appreciate it ๐
@delicate tendon I probably misunderstood but there is a tool "scp" to transfer files through ssh
Basically what I wanted was to transfer files through SSH from the QEMU to my local computer
@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
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?
just read the man page I am pretty sure it'll solve your problem
Right, I appreciate, sorry for the poor explanation a few answers ago tho
"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
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?
I never used qemu, I use virtual box.
you need to refer to qemus manual for that
or more specifically https://wiki.archlinux.org/index.php/QEMU#USB_redirection_with_SPICE
Thanks again!
you are welcome
"qemu manual"
links to the arch wiki
though qemu official docs are pretty awful xd
it's still a qemu manual ๐
I want to be able to use SSH to transfer files from and to a filesystem image(EXT4).
use rsync
that may or may not be due to the fact that the arch wiki is possibly the best wiki
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
pythonnotpython3./Scripts/activatenot./bin/activate
Any others? How would you shell script this in windows?
Feel free to @ me, i might be working
Can anyone look at #help-dumpling it has to do with starting a script on boot on my RPI
Do you have bash, PS or what on this Windows?
wsl or cygwin
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.
this is exactly what I ended up doing. I used very simple bat files to just call python files. Thanks.
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
Which is better, freebsd or linux
Also, What is main diffrence between debian and Arch
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.
In my opinion you should start with Ubuntu rather than Debian. I never used Arch but spent some time with Fedora.
@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
Comparing a testing release to a rolling release is pretty unfair
you can use debian sid
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?
can you not get pycharm running nativley on debian?
Oh hi. Sorry, I just started using discord and I'm floundering a bit
it's alright
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
oh ok that makes sense
I think i should start putting my linux code into a venv
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)
yeah
I am less than 3 years from retirement and I feel responsible to leave behind something my colleagues can make sense of
so you want to move windows code over to linux? then have ssh to run that code on linux
in fact half the code is written in perl 8-)
oh
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
it seems the transition between those languages wouldn't be too bad
i remember some P.R. for the perl language that said "the three virtues of perl programmers are laziness, impatience and hubris" 8-)
i'm too young for perl, but kinda want to mess around with it in the future
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
yeah
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 ...
sounds useful
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?
i mostly just write discord bots and other small stuff
flask is pretty fun too
Hey guys pls answer :
Can we ' copy to clipboard ' using the linux terminal or using the subprocess module ?
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
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
hello
Does it have to be a command line utility?
Sed can no doubt do it but I couldn't think of the command off of the top of my head
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
Seems unwise. There are lots of normal mode commands that start with g that you won't be able to use anymore.
you'll have trouble using any of these: http://vimdoc.sourceforge.net/htmldoc/vimindex.html#g
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.
I would think there's some sort of trck you can do, like a Paste command but backwards, or a columnate
This isn't great but it's a Python one-liner:
$ echo 'C1 23 15 64-C2 14 62 46' | python -c 'import sys; import numpy; print(numpy.rot90([x.split(" ") for x in [x.rstrip("\n").split("-") for x in sys.stdin][0]])[::-1])'
[['C1' 'C2']
['23' '14']
['15' '62']
['64' '46']]
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
That is indeed More complicated than I expected
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
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
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...
i tried this and it was working well restarted the system after it was done and it wont connect now
its showing this now
@bleak urchin your network interfaces seem down. turn them back on
ip link set <interface>
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
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
I have no idea sorry
Does anyone here knows how to use Minix?
tried installing - https://github.com/ownport/portable-ansible
[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
What do you see if you do this? py import enum print(enum) That should print something like: <module 'enum' from '/usr/lib64/python3.8/enum.py'> but I'm betting for you it prints a different enum.py in a different directory.
the enum that comes as part of the Python standard library with Python 3.8 definitely does have IntEnum.
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
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
Which is it, and what is happening?
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
You can run it with ~/.local/bin/delete-tweets
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
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 ?
@median crown I think you can run pip installed modules with python3 -m <module>
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?
does anyone know how to use cron to execute a scrypt when user logs in?
@fresh plinth all users, or a certain one?
probably just stick it in /etc/profile or ~/.profile, you dont need cron
i m supposed to do it with cron and w/o root privs
can you even do that with cron
I am not sure that crontab has such kind of features
why do you have to use cron
That sounds like a job for the system daemon, systemd most of the time
Hey guys I can't access ipython through the terminal, how can I make it accessible?
Please help. I really appreciate it.
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?
When I do vim .zshrc this is what I get.
a) you probably want ```sh
export PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:$PATH"
b) Perhaps you haven't started a new shell since adding that line? Is `zsh` your shell?
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.
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.
if a command is available in multiple directories, yes
what do you mean by that
if there's multiple versions of a program on your computer, the order determines which of those will get used.
ooh
generally, you'd want the things you've specifically installed to take precedence over any other versions that might have already been installed.
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/
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/
right
also, like I said: it should almost certainly be PATH=/new/thing:$PATH instead of PATH=$PATH:/new/thing
@boreal pebble anyway, use a linux vm if some modules aren't supported on windows
Hello , is there a way to disable kernel NX bit (not the gcc one)?
What do you need?
I am not master of Linux but all depends on your question
@amber garnet Yes my question is that can we use windows drivers on Linux (Ubuntu).
I guess that is not possible
see i am getting very confused now
some people say it will work
some people say it will not work
๐ซ
In my opinion it cannot work since Linux drivers need to work next to Linux kernel - Windows doesn't have Linux kernel, has he?
because i am asking it because i am thinking to switch windows to Linux.
You can use WSL on Windows
what is that
https://aka.ms/wsl - Linux kernel working as Windows application
So you can install Linux in some VM like VirtualBox and here you are
but drivers not working
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.
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?
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?
if i'm understanding this correctly you can do, sysctl -w kernel.randomize_va_space=0 or just edit the file /etc/systctl.conf like this: kernel.randomize_va_space = 0
isnt that for disabling system wide kaslr
I was looking for disabling NX bit in kernel allocated pages
Anyways , does someone know how to disable kernel stack canary?
so many chats lol
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.
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.
Thatโs a fantastic idea. Linux is perfect for reviving old computers
There should be an iptables save command correct?
Is this something you have experience doing? Is there a resource you recommend other than a cursory google search?
A great resource would be
https://linuxmint.com/documentation.php
Linux Mint is an elegant, easy to use, up to date and comfortable GNU/Linux desktop distribution.
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.
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.
Will do!
btw I just rebooted my server and I have to manually restore the saved rules this isn't what I was expecting lol
@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?
Yes
Dew it
When you install Linux mint I think it removes all data
I'm not sure why I still had to defragment after the windows reinstall because I lost all the data anyway
Well, it depends on how you install it
How many disks do you have, what partitions do you have, and what you will have
I'm good to just say goodbye to windows on this machine. I'll buy another when I'm ready to game again
I am guessing that it is an NTFS partition?
No idea.
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)
@fresh saddle I'm confused, are these questions aimed to help me dual boot?
I do not want to dual boot
But I don't know any of the terminology here so I don't know why you mentioned a "second disk" earlier
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?
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
You can generally re-create the same feel of one on the other. Default experiences depend on the distro used but unix tends to lean more towards command-line tools.
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.
You also have to install build tools (see !build) on Windows for some Python libraries, which can be off-putting.
ah i see thank you
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
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.
oh so i run the command again then? o- o or do you think something might've been broken by updating half of it
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?
hmm
cuz if i wanna reinstall it i'd rather do it rn than when i have projects that i'm developing on it
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.
i guess... anyways thanks
Looks fine to me
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
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
๐ฎ thanks for the tip i have used linux in the past (like 5 years ago) just getting back into it o- o
I like to automate apt with cron
Have it run automatically in the background every day at xx:xx pm
nice ๐ฎ though i'm running a virtual box so it might not be on at a fixed time everyday for me
Fair enough
Is there a way to ignore eof in scrypts?
Show us the code @fresh plinth
#!/bin/bash
passwd
There's no EOF in passwd
you can skip changing password with ctrl D
What are you trying to do?
is a user launches this script i want them not to be able to just exit
There are better ways to do that
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;
}
use the trap command: https://mywiki.wooledge.org/SignalTrap
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
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?
I'm just going to start over ๐
That works too haha
I already had everything I needed installed
This is so sad.
You should revert the driver update then
Idk how to do that
And I don't know how to tell if an instruction online is correct for my problem case
Press esc during the grub boot, ctrl + F1 to switch to the tty1, remove the old drivers, reboot, grab a beer, celebrate
Idk what grub boot and tty1 are
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)
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.
Try to press F10, maybe?
I already started
Fair
@fresh saddle thanks anyway ๐
No problem haha
Is this for help with Linux?
Tooling, setup and configuration related to Python development on unix or unix-like systems such as Linux or MacOS.
@amber garnet
Thanks
Hello could anyone help with some basic unix bash script ?
Im first year on this so it isnt anything demanding really
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.
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
Let me invite you to something
alright
You could also ask in off-topic @proper pulsar
aight
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
shouldn't ps/top/htop display the full cmd line
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
@gritty karma
Looks like pip failed to install pandas-datareader, missing lxml dependencies on the raspberrypi, install 'libxml2' and 'libxslt' development packages & try again
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?
create an alias in ~/.bash_profile or which bash file you use
I'm making a virtual environment in python that feels like linux. Does someone have any suggestions?
right now its very basic
GUYS
Pls help meee
im dying
pls tell the correct strptime for this
I CANT figure it out
nvm fixed it
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?
month/day/year, hour:minute:second GMT looks like US time format
i fixed it bro
No one knows why month is before day
๐
I never used extfstools but you can use cpio to create rootfs as far as I know
that is for cpio format right , I have rootfs compressed into ext2 format
I am aware of cpio
How do i uninstall ptrhon 3.6 and install py 3.9 on ubuntu
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
Which version of Ubuntu?
how do i check
/etc/os-release
What? In my Ubuntu is just a symlink to /usr/lib/os-release with chmod 0644
Is it your computer?
Use cat command to read content
cat os-release
Like cat /etc/os-release
Must provide full path or change directory
also im using nohup to run my bot while the terminal is closed
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
The first command, ./IoT.py works fine, but the second one, ./AABot.py doesn't
nvm got it
I don't understand, rly
Make sure that there is +x chmod permission
And shebang is correct
can anyone who knows tkinter go to user-interfaces please
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*
I tried it too
The way a solve it was opening jupyter from anaconda-navigator instead of from terminal
use docker for this, do not install different / multiple versions of python on your system directly
Why?
why, what?
hi, I want to run a privileged program from apache. Should I simply set SUID on the program? or should implement some other mechanism?
Why I shouldn't install different versions of Python on my system?
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
"C:\Users\user\AppData\Roaming\" if os.platform == "else" "/home/user/.config/"
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
I mean, it will do that under the hood