#unix
1 messages · Page 51 of 1
yes, I got that figured out this morning
doesn't seem to actually write to a file, is it necessary to create a blank requirements.txt file for it to write to? I assumed it would just create it
oh it actually did save to a file on the drive, just double checked, thanks!
just expected to see it in the file explorer in VS Code, used to that in Windows Pycharm
cool 👍
thanks Vivek 🙂
no problem 😄
why is managing packages on macos a pain?
Removing systemd-timesyncd (247.3-1~bpo10+1) ...
/usr/sbin/policy-rc.d returned 101, not running 'stop systemd-timesyncd.service'
Errors were encountered while processing:
systemd
E: Sub-process /usr/bin/dpkg returned an error code (1)
facing to this error when i want to install resolvconf with apt
im using debian 10 buster
i upgraded my kernel to 5.10 recently
what does that mean? sorry for the late reply
why can't my spyder detect modules installed through conda?
(on 5.10.16, manjaro)
it works for some but not for others
for example i've installed discord.py through conda-forge and i can import it
but not triangle even though conda list shows that i ahve it installed
A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that is based upon the Linux kernel and, often, a package management system. Linux users usually obtain their operating system by downloading one of the Linux distributions, which are available for a wide variety of systems ranging from embe...
wiil u be able to help me with git?
I don't mean to be rude, but these are things that can be easily googled. Here is a tutorial to send you on your way https://git-scm.com/docs/gittutorial
yes i have been referring and have done lot of google work
but i did not understand few things
@sudden mirage how do i run a program from command line?
in order to get aquainted with git each one of us pushed pow of 2, power of 3 ... 7. Now we want all these to a main program so that when the user is prompted for which power he wants, the result will be computed by corresponding function. So my question is how do we combine all these files into a single program and execute it (the main function is another push)
i spent almost a week searching these, yet failed to find a solution.
Also thank you for patiently answering my queries
any further help in this would be welcomed
thanks in advance @sudden mirage
anyone who can help me out with this are also welcome
You can run a python program from the command line like this:
python myprogram.py
or, depending on your distribution
python3 myprogram.py
sorry u got me wrong
im asking smthg related to git
i have given a description above
@median needle are u familiar with git?
What does git have to do with running programs from a command line?
Git isn't design to run programs. It's designed to do version control of files.
im using git from command line
if u have different functions uploaded in git (which are part of a main program) then how do u run them by clubbing alltogetherin a single program?
You need to pull them from the remote repository with e.g. the git pull command.
Then those files will show up on your local machine.
And you'll be able to do whatever you want with those files, like execute them.
oh !!!
then i think ive complete;y gotten the ,idea of git wrong
clarif my understanding that i have got from ur explanation rn
@warped nimbus
is it like each day u work on a same project byimprovising ur code with neccessarycommit msgs indicating ur changes and then there will be one final program for us to run ultimately
right?
Basically yes.
You can work and change existing files, add new files, delete files. Then you can commit and push those changes, typically to a remote repository that is on the internet like GitHub, GitLab, etc.
And at any point, anyone can pull the files from e.g. GitHub and run the code on their machine.
y do we add new files
Because complicated programs are spread across more than a single file.
pls do bear with me @warped nimbus i liked the way u r explaining
For organisational purposes among other things. It's difficult to work with really long files.
so how to we link one file into another then
And you may have other files like images, data, etc. that your program needs.
exactly
Well, you don't need to "link" them as far as git is concerned. They'll just all be part of a single repository. You cannot pull individual files with git - you always pull the full repository.
thenby only specyfying the name of the file they ll be directly accessed into a program>
when they are part of same repo.
my q is related to images thingy
Git preserves the directory structure you have locally. So if you have a code.py inside the source directory, it will be the same on GitHub too, for example. When you pull the repository, git will create a source directory and put code.py inside of it.
So if you have another file, it can reliably do from source import code.
No, that's code that you write if you want to use another python file. That's just a basic Python concept; it's not related specifically to git.
yes ive done that while working with python files on system but not with git so hence i had got that doubt
hope im not disturbing u
i have few more qs
cos i dont know if its day or night there
Yeah it's night here and I will indeed be leaving soon. Just ask anyway. If I can't answer then someone else might. If you have questions about git, #tools-and-devops is a better channel since your questions so far haven't been specific to unix.
jus consider this small example - i have a git repo ,with each file with different functions and uploaded em.
now i have another file in same repo that has a main function and that has a code related to all of the func present in above files . now if i run the main fun file code will it run properly?
or shud i include from source import file1 file2 ....
in the main func program
If you rely on code defined in other files then your main file will need to import the other files. If you want to learn more about it look at these articles https://realpython.com/lessons/import-statement/ https://realpython.com/python-import/ it's getting off-topic for the unix channel.
oh ok @warped nimbus thanks for ur time and u have really helped me a lot
thanks a ton
You're welcome
Thanks buddy got it with ur solution, im gonaa delete the post from #tools-and-devops group
how to run some python code if active window changes in linux?
i am looking for solution that do not need infinite loop for checking active window to determine whether active window is changed
my first thought would be to use an event listener
listening for the file change
some system/gtk related file that would contain information about which window is active
but i couldnt find online
any information
on what that file is
i could only find how to retrieve the current active window via higher level tools like the one above
import psutil
pid = subprocess.check_output(["xdotool", "getactivewindow", "getwindowpid"]).decode("utf-8").strip()
prevpid=pid
print(pid)
while(True):
pid = subprocess.check_output(["xdotool", "getactivewindow", "getwindowpid"]).decode("utf-8").strip()
if prevpid!=pid:
process=psutil.Process(int(pid))
processName=process.name()
print("Current Active Process is "+processName)
prevpid=pid```
i have tried this code, it works but i think it is super inefficient
how can i eliminate that while loop?
guys how to create a new folder in desktop by using linux terminal
any idea or is it impossible?
mkdir command makes a new folder.
??????????///
mkdir -p ~/Desktop/MyNewFolder/
should i come back to linux lads? i had archlinux, went fine for me but idk i think i liked linux more. the reason i moved is because i have got a 2nd monitor connected to my laptop (laptop has an intel gpu and nvidia gpu) and on archlinux it doesnt wanna work. would it auto work on gnome or an other de? i used i3-gaps before so im not sure
did not work either @main olive
How long ago was this? Are you interested in a full DE or a window manager?
i dont know, i liked i3-gaps a lot
how can we cd to desktop @main olive
cd ~/Desktop
OMG thank you so much
i had been spending months to get this
😐
why doesnt the ususl cd work and what does this mean
~ is the home dir
yeaah i googled jus to find no answer
and Desktop is located in the home dir
I would have to read through the i3 docs again. Also look at sway wm if you aren’t using an nvidia hour
where do u find home in desktop is it ur name thingy?
Or gpu not ‘hour’
yea got it and thanks a ton
well i got 2 gpus as mentioned, one integrated and one external
~ this means home dir?
@covert belfry
now im unabl to cd into folders present in desktop @covert belfry why is that so
stop trolling
when ur in desktop
im newbie
do cd folder
Sorry, forgot that part already. Nvidia is working on a wayland driver, but eta is this summer. My advice is to try manjaro on a live usb. If you can get monitors working, then switch. If you think it’s close and will do some ts, switch! If it’s a hassle, stay where you are.
mkay
do ls
and see if u have that folder there
what distro do you enjoy?
Fedora
im thinking about manjaro
aftr creating the folder im not able to find it on my desktop
can we find it or is it that way only
anyone to help me here?
Just type the name of the binary
./name.sh
And to make a folder do mkdir folder
i did that but im not able to find the folder in my desktop screen
u mean wsl2?
You mean WSL
yesss
Then it won’t work
y
lol
WSL is not integrated into windows
that was rude
oh k
If you want Linux commands to work as they are meant to
so no other alternative
🙁
but wts the use of getting into desktop
do this @real swan
That too
why?
But WSL is not the best Linux experience if you want the real thing
its not supposed to be
Yeah ik
It’s supposed to be a good drop in experience
Which in all honesty it is
then wt are those folders which i can find present in desktop which is shown in terminal
Ok
WSL is basically a little VM to put it simply
So the command line is pretty much the only way you can access it
I’m pretty sure you can do explorer.exe to pull up the file manager
i dont know all these things
got u here
what is explorer.exe?
Just type it in
im always scared that i wud end up messing up with my system
It’s WSL
The worst thing that could happen is you break WSL
And if you’re so scared then at least check what the commands do
we actually are doing a small hobby project and there are nobody to help with technical issues
so im refraining from doing such things
i dont even know how to dual boot my system
Just watch a YouTube video
I did it
Pretty easy tbh
To dual boot?
im litrally scared of backing up
Fine...
will u accept my friend request cos im not able to pin u also. orelse u want me to type in here?
there are lot of servers right in here
Just type it in here
okie
thank you so much
i never found people on discord who understood and responds to me this way
as soon as i say i dont know to dualboot they pass on ironic comments here
telling wrt my situation or u telling they are not wrong from their point of view?
whatever it might be the way you communicate is really good ...
also @sudden mirage have you ever used git?
i have few qs on that too
Yes I use git
so wn we do a project what are we supposed to push and how do we build em
i have some idea about it
but building a project is making me think something difficult
cos ive seen ppl uploading individual files but how do they run the entire project?
Where are you pushing the project to
they dont even specify from ___ import * or something like that
a repo
Python has nothing to do with git
On GitHub?
Like I said before, python and git are mutually exclusive
What you do with python won’t change what git can and can’t do
jsu a moment ill post a qs which i posted on pther server
i had posted it here only
in order to get aquainted with git each one of us pushed pow of 2, power of 3 ... 7. Now we want all these to a main program so that when the user is prompted for which power he wants, the result will be computed by corresponding function. So my question is how do we combine all these files into a single program and execute it (the main function is another push)
and got an idea but i dont feel that was right
That makes absolutely 0 sense
You can’t push individual function
You can only push files and directory
And all you have to do is combine functions in one file
And I don’t think this is the right place for this
Try one of the help channels
are u availab;e there too?
Frankly, I’ve got things to do and places to be, so no, I don’t think I will be available there
😐 yes i understand sorry if i had troubled you
It’s fine, don’t worry about it
bye
you cant
re-running the same process like xdotool is your only option like i said in my original answer
you're looking for sudo bash -c "some shell commands"
but also, that's a roundabout way of doing it in the first place
Yyep. Knew something was amiss
Tried to do both instructions separately hut it just wouldn't
you can just do sudo ./pyenv/pingenv/bin/python pingaso.py instead
Duly noted. Thanks a lot 🤗
is someone familiar with "Pack Distribution Project by Peter Krisensen" I can't get any info out there about him or his project
seems to be a very old project, not alive anymore. Found a reference to it here: https://www.usenix.org/legacy/events/lisa98/full_papers/oetiker2/oetiker2.pdf, and the site they reference http://sunsite.auc.dk/pack/ doesn't exist
This is may be the same person given their location https://github.com/zmartify https://github.com/ZmartifyPKR
my pygame game window isnt visible when running on debian
Are you using WSL?
I resumed my VM today and discovered that sudo is rejecting my user password. I switched to root with su and used passwd to update my user's password, but sudo is still saying my password is incorrect. What's going on?
Maybe I just need to reboot, but I'm concerned that if I do that I may get locked out of my user.
Okay rebooting actually fixed it. Really strange.
I didn't even actually change my password I just set it to presumably what I had all along.
Thank u a lot rtobar and mark ❤️
How would I delete the latest or current line of output?
I know \r puts me at the beginning of the line but that's not what I'm going for
sys.stdout.write("\033[K\033[F") maybe?
use curses if you need to manipulate the terminal window.
yes
@sudden mirage is it possible to insert an image from git repo to our latex files
is it possible to insert an image from git repo to our latex files
then it won't work
wsl has no integration to windows in regards to GUI apps
yes got to know 2 days back and hence installed vware @sudden mirage
It can be made to work if you install an X server
back in the day you could use dpkg --set-selections, no idea in this brave new snap world. i switched to arch linux, personally.
apt-mark hold?
hi
hi
hi
charlie@charlie-GF63-Thin-9SCXR:~$ sudo isw -w 16R3EMS1
Writing config to EC...
Traceback (most recent call last):
File "/usr/bin/isw", line 499, in <module>
main()
...
File "/usr/bin/isw", line 336, in ec_write
with open(EC_IO_FILE,'r+b') as file:
PermissionError: [Errno 1] Operation not permitted: '/sys/kernel/debug/ec/ec0/io'
Even though im using sudo, it doesn't give the script enough perms, how do i permit the script to run with its permission?
what are you trying to do? Writing to files under/sys requires a great deal of caution., and many of them the kernel will not allow to be written by any user.
I'm trying to install an application that lets me control the fan speed
ok, that is a valid reason to manipulate /sys, but perhaps the app you are trying to use is not doing a very good job of it... what happens if you run cat /sys/kernel/debug/ec/ec0/io ?
It shows me one file with root prefixed
did you get this program from pypi?
I got it from a public github repo
imo the fact that it's throwing unhandled exceptions while trying to manipulate files under /sys means it might be worth rethinking if this is the best software to do what you are trying to do
I can control the speed of my fans by just manually writing files under /sys if I feel the need, I'd feel much more comfortable using a small script i wrote myself instead of something from guthub that has already proven that it doesn't work right
old_val=$(cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:102/APP0001:00/fan1_output)
cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:102/APP0001:00/fan1_max > /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:102/APP0001:00/fan1_output
<fan goes to max RPMs>
echo $old_val > /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:102/APP0001:00/fan1_output
<fan returns to normal rpms>
By default, if you don't have ufw active will you automatically deny access to general ports like 80 443 etc? (on Ubuntu)
Is it using iptables or how do I figure out what it is doing?
nine: ufw is a frontend for iptables, iptables -L will show your rules
I've successfully logged into my raspberry pi with PuTTY.
I can log in with pi@raspberrypi
I want to SSH into my pi using Ubuntu/WSL.
Every time I try, I have to log in with turtle@raspberrypi.
I want to log in with pi@raspberrypi
is there a way to do this?
somewhat new to linux, fyi.
You can create a new user named pi or change the username.
pi is already created on the pi, as i've logged in successfully via pi using PuTTY
Do you have a user/group-specific ssh policy set up to only allow turtle to login remotely?
no. that's just how it defaults when using WSL.
Oh, I've never used Windows 10 sorry.
can't you just do ssh pi@raspberrypi
exit
You are creating own OS
if you are creating how can help you in your project
What's the best way to create a supervisor service for an API
Currently we are runnning a cron job which does a health_check call for the API and if it doesn't respond restarts
This cron job is scheduled every 1minute
Is there any better way to create a supervisor service?
what up, well i have a problem... I own and use a Macbook for python programming but all my friends don't. Now my question is HOW in the world do i make my mac python Programm work on Windows? And is there a way to make it work universal?
yep, but windows guys wont care
from my experience
nah, so ofc it's meant to work universilly, but there are ofc ways to break this
for example importing certain packages that rely on a specific OS
and if nothing helps
just dockerize it
you will have to elaborate on the "dockerize" part for him
most python programs should work cross platform
as long as you don't rely on os-specific features like the filesystem hierarchy
unless your program does mac related stuff it will work on linux & windows just fine without problems
I have a script like so
#!/usr/bin/bash
command_to_run="$@"
echo $command_to_run
When I do ./script Hello\nwith\nnewline, i expect the output to be Hello\nwith\nnewline, but I get the output to be Hello with newline. What am I doing wrong here?
Consider to try with -e, so echo -e $command_to_run
I suggest you use printf instead. Its behaviour is easier to understand.
I tend to only use echo with string literals.
i.e. strings without any expansions etc.
Hey @autumn forum!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
https://paste.pythondiscord.com/usuwugagic.py
Hi, I need some help with a class project. If you can run this script on a Linux system and send me the file it creates. Make sure to audit the code before you run it. Stay safe. Thank you
BASTON: it is so easy to run a vm, different OS etc, why would you need anyone else to do such a thing?
if you have windows you can use wsl
but you should be able to run it cross platform if you remove the unnecessary subprocess call at the end
checkout supervisord
Hey everyone, I want to get back into developing python (and other stuff). My editor of choice is vim. Are there any "state of the art" type plugins for vim (or anything else for that matter) I should know about?
Hi @unique thunder #tools-and-devops might have more useful vim info
Oh ok. It was either there or here. :) Thanks!
@unique thunder your welcome
@unique thunder They mightnt have answers... and others might be round this way later with stellar suggestions, luck of the draw really. I barely know how to get my fingers in and out of vim unscathed
No worries, thanks.
so i have a problem with my server. I use crontab to update some data in a db every hour and it works fine, till I run another script with .python3 main.py and when this script is running, the data doesn't update. Seems like crontab can't execute the task. What am I doing wrong?
this might help
I'm going to try that
ok thank you very much guys 🤝
nop, still the same issue. Cronetab is doing it's job well, but when I run my main script (ubuntu@ubuntu:$ python3 main.py cronetab stops the process
what is the cronjob you have? does it have the fully qualified path to python and the script you want to run? you can capture output and stderr into a file to see what is going on
you can even run the cronjob in a screen session you can resume later to see what executed
so the cronjob looks like this: * * * * * cd /DiscordBot && /usr/bin/python3 /DiscordBot/update_income.py
that looks reasonable. if i was you i would look at capturing stdout/stderr, add some logging statements etc.
yeah, I'll try that tomorrow, if not I'll try it with multiprocessing
how do i install requests to ```py
import requests
hi
I'm having an issue with installing tkinter using pip in linux
I'm currently using 3.8.5
but
when I try to install tkinter it says that there's no matching distibution
pip install requests
Not working?

try pip uninstall and then pip install again
Also the command is pip install tk not pip install tkinter
oh
thanks a lot
it won't work so I found another solution using mulitprocessing. Now i have my own crontab xDD
I need a new name now because someone made a website with my name in it and now thats all google shows
@sharp hedge u don't need to install tkinter vis pip
tk is stdlib
if youre using a distro without it included in the main stdlib package
Then install it through your package manager
ex:apt install python3-tk on debian/ubuntu
@sharp hedge tk on pypi is some random other package
@vivid sequoia ^ btw
Anyone bothered by search being broken in pip?
The only package manager without search functionality...
downsides to having no verification on packages
I miss old internet
The main thing I hate about pip is that there's no upgrade functionality.
Like, yeah, you can manually upgrade a package with pip install --upgrade, but who's going to go through every single package they have installed and try to upgrade it?
yes I'm using ubuntu
that should work then
thanks
I deployed a text-based game utilizing websockets to a server running Linux. This text-based game uses the sleep function for pausing before sending a JSON object containing text to the client. My development environment is Windows.
In Windows, the sleep function works properly and the server pauses accurately before sending the data to the client at the specified time.
However when in Linux, either in the development environment or during production, the client receives the websockets event data all at once as if the server didn't even pause, but the server IS pausing for the appropriate amount of time.
I dont know why the event signal is getting received all at once like that. Any help?
@kindred basin You can make an alias
alias pip="pip install --upgrade"
pip install module
there is also:
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
or
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U```
What library are you using for the web sockets? That sounds as though something is being buffered, and a flush is needed before sleeping, perhaps.
Excuse me if not supposed to ask this here , but , I have a remote test service which is dumping an executable in the form of hex literals (something like - ELF\x10\x00\x30 , and I want to recieve this data and convert it to its ascii form so that I get the proper executable, does anyone know how this could be done using python?
If you have control over the remote test service, it would make your life easier, and make the transfer faster, if you had it send the executable as base64 encoded text, rather than printable ASCII with embedded hex escapes.
i dont have control over the remote service
That's unfortunate.
so is there a way to convert all that hex literal data into executable format?
Wait... Does it return "ELF\\x10\\x00\\x30", or does it return b"ELF\x10\x00\30"?
If the latter, it's already binary data, and you just need to write it to a file:
with open("filename.ext", "wb") as f:
f.write(data)
oh thanks alot!!
that doesn't even work, also you probably shouldn't shadow pip like that
Works for me @opaque ginkgo
I built the asgi function myself in django.
@summer trail where usually are the events being buffered? Is this in the WSGI/ASGI software (im using uvicorn/gunicorn) or somewhere after this?
I'm not familiar with with websockets to be able to offer any specifics, I'm afraid
Thank you for this hint tho!
Yo, Does anyone know how I can make it so that when I'm in python on my bash terminal I can use the up arrow key just like in bash to do the previous command. PS, I'm using python as a calculator It's sooooooo usefull.
what it works by default
i think it depends on readline.. it works for me by default in linux as well
answer might be in here somewhere; https://stackoverflow.com/questions/6558765/how-do-you-see-the-entire-command-history-in-interactive-python/7008316
oh you must make
.python_history(betwen interpreter invocation it works by default in 1 session)
in your's home dir
hey everyone, I want to use a raspberry pi with a camera connected to it as a 'remote' webcam for another machine. Does anyone know whether it is possible to register a video stream so it can be used by software like skype and discord?
@harsh owl @dapper musk Thank you but I'm an idiot that copied code from the internet into my .pythonrc that broke that feature.
xd clear it
Struggling to get ubuntu server online. Is this right channel to ask for help? :)
@void sleet thanks!
Hey everyone. I'm looking for a nice monospace unicode-aware font to use in my terminal. I'm using Deja Vu Sans Mono at the moment with noto as a fallback but I can't see any of these unicode characters in my terminal: https://www.unicode.org/Public/security/8.0.0/confusables.txt
Nope, but I want to. Keep finding excuses to put it off or I don't have time to migrate.
I'm putting up with a VM
ThunderboltSH: for the last 25 years.. ;)
for 2 years because programming on windows from my experience was nightmare.(lack of Package manager and this awful paths importing in this awful UI from windows 95)
😅
NOICE
yes
I set up dual boot
and I hardly boot into windows
yes true file paths in windows are annoying
my beefiest box is actually generally a windows machine.. purely for gaming.. i try to keep the windows hassle to minimum but it manages to annoy me fairly often
yes sadly gaming on linux is awful especiali if your's hardware is lower end.
it is acctualy 1 reason that i have dualboot
yea i dip back into linux gaming on occasion, way better than it has ever been but still just not really comparable for any higher end game
yes but some developers are making native versions for example linux factorio version works beter than windows one + for some reason company of heroes 1 works beter in wine that on real windows lol
There's technology being actively developed to allow sharing the GPU with a VM. It's still not mature enough unfortunately. Currently what people do for VMs is have a separate GPU for the host and the VM.
well if you have intel igpu i think you can use it for linux and linux desktops generaly(not GNOME) are light
As a guest, yes.
on their webiste i see only windows host binaries(maybe debian repo has one)
Because the typical model of distribution for linux is via source and building locally
That's what package managers do
i know i pointed out to debian
sadly my PM do not see it
- .deb is for some reason not compatiblie with non debian based
I feel linux is good for gaming as well. It's true that less games are supported. But we can use wine
try Zorin OS
does anyone know how to create a video device like /dev/video0? I want to stream a video across a network and into that device, so it can be used as a webcam
i am struggling to use sed to add suffix to each line of a document i am using sed 's/$/.mp4/g' filename
I settled on Roboto Mono last time I went looking for a programming font
It appears to handle many of those confusables, at a quick glance.
lemme give it a try
which is better? Arch or Debian?
Debian is my opinion
arch imo debian repositories are preaty old i know abount debian unstable but still compiling anything is awful beacouse almost always source requires more modern packages than debian have.
Yep, it's big problem of Debian which I noticed 
but it have 1 + it is super stable it eaven ran 1 year non stop on my rpi
I didn't say that!
Guys in my department have many Debian production servers and all are working fine
yes I mean in my opinion
I prefer distros derived from debian
oh i ment debian based for example distors as ubuntu and deepin are mailny GUI changes
cli is ~ exacly the same
yes some minor changes like we are not added to sudo users for example in debain
which is kind of annoying
Thanks for the suggestion.
I have a question. For me, uname -r returns 4.1.2-finnix how do I change that to generic?
it says your kernel relese
so in order to change it you must install new one
and you realy should 4.1.2 is preaty old
if you are concerned why you are geting 4.1.2-finix not 4.1.2-generic then it is distro specific
and mainly it is the same thing
Hi
Hey
Sup
not if you run testing 😛 (5.10.0-5)
it is sill old😛
i said that lol
imo arch is beter for personal use
and debian for servers
and this is just my opinon
was't cent os killed by redhat?
"we" are you in dev team?
I'm not 100% sure where this should go, but this is the closest channel to the topic I think, so recently I've learnt mmaps and how they are quite efficient. but is there's a time where you don't want to use it? like, can I just use mmaps all the time as opposed to normal .opens?
yes
but minor one
for example you on 32 bit systems you can directly addres up to 4GB of fille
and for example you cannot load fille from some potrafle device and then unplug
and mmu are faster but only on hardware that suports it
if hardware do not does so mmap ill be handled as normal open but it ill acess only small amount of data so well it will be inefficient
- it can have somme additonal error for example if 1 program is writing to file and 1 reading it but it should be handled by OS
oh then gl working on it
in what?
why are you doing it in root directory?
if you realy need to
then type sudo before
but you realy shouldnt clone to root
So where to do?
and linux file structure
what do you think the issue is based on the error message?
can't find that command somehow
did you instaled this?
can you link this github page?
ok
yes i told her/him to change that
o nice command
XD
m1?
oh i wanted to buy m1 air
ah F
well apple pricing
witch model did you bought?
pro 16 inches
?
so you maxed it out
does it have problems with thermal throttling?
good to hear. maybe i ill consider geting x86-64 macbook above ARM one if termal throttling is not an issue
.topic
hi
can these two commands
grep -w -- $dm $newFile >> "$existingFile"
grep -w -- $dm $newFile | head -1 >> "$shortFile"
be written as
grep -w -- $dm $newFile >> "$existingFile | head -1 >> "$shortFile"
Like @dapper musk wrote, it can be done with tee
grep -w -- $m $newFile | tee -a "$existingFile" | head -1 >> "$shortFile"
Not tested!
Hello i am wanting to kickstart a discord server focused around linux, does anybody want to help me with this and be partners with me?
How to access ~/.local/bin
what
what do you mean by acces?
if you want to change directory then cd PathToDirectory and if it is the issue then you should read unix cli basic guide
Hello , I've been facing a little trouble with vim recently , when p is pressed after space immediately , it shows <Plug>PeepOpen , so I have to wait for a second before typing p for it to work normally , is there a fix to this?
Not change I mean to reach
why each time getting need permissions?
I am at home fodler
@main olive can you show what command you are trying to run, and the error you are seeing?
@tender plinth it looks like you installed a plugin that assigns <plug>PeepOpen to p . does this only happen in normal mode? try :verbose map p to see which plugin did it. i really dislike plugins that automatically override standard mappings...
yeah it happens in normal mode
this is the output of :verbose map p
how I can check if database is created?
it looks like vim-yankstack did it then. remove vim-yankstack or consult its documentation to see if there is a way to disable the mapping
yeah thanks alot!
Hi, I'm currently trying to install python3.9 on a debian server. I have read that I should add the repository ppa:deadsnakes/ppa. However, apt tells me that
N: Updating from such a repository can't be done securely, and is therefore disabled by default.```
Should I set allow-insecure=yes or is there a better option?
Gudrun: cant you just edit the sources file and s/http/https, then apt update? or thats what i would try anyway
you mean sources.list?
meh I don't think I'll keep trying since the only reason I needed python3.9 was brand new builtins like str.removeprefix() but I just wrote that myself now
But I'm not quite sure what you mean - how would manually entering the repository make it more secure? Like, for what reason would apt stop complaining?
godlygeek: in /etc (something like /etc/apt/sources.list.d) there are files that contain the links to repos apt uses
sorry godlygeek mean @Gudrun :)
anyhow - http is plaintext, https is secure
right exactly
well, I would just like to remark that when I enter that in my browser, it appears to not have a valid certificate
so that'd probably not work either
interesting - anyway, like i said, thats just what i would try. not that its guaranteed to work. its been a while since i used ubuntu, switched to arch linux a while back
well as I said I've already implemented the python3.9 function I needed myself
thanks for the help though
cool. yea that ppa seems like a bit of a mess tbh looking at it
one of the reasons i like arch; many things are packaged well. yet to not find anything i wanted in aur. they are on python3.9 already by default which is nice
hi
how to allow remote connection to sql server 2019
so that i can access it through windows
the remote instance of sql server doesn't allow external connection by default?
in practice usually if you want to dev locally you would connect to the db via tunnel node for extra layer of security
As far as I know by default servers use localhost to handle incoming connections - which means that only local machine is able to connect 
If you developing something locally why do you need extra node as a proxy?
oh he mentioned remote so I assume it's outside his local network
but if you can, use postgres. sql server doesn't scale that well
Then he need to have static IP 
https://docs.sdl.com/801922/570899/sdl-tridion-docs-13-sp2/microsoft-sql-server-ports
Enable remote connections to your SQL Server.
Open SQL Server Management Studio. Right-click your server's name and select Properties. Tick the checkbox Allow remote connections to this server. Select OK.
Open ports as well
oh yeah you can only allow certain IP to connect. but in production usually someone will set up vpn or tunneling for you to overcome local dynamic ip issue
Right, it seems that it can work
don't ask to ask. ask away
how can i install garuda without grub ?
yes you can(in theory) but 1 st you can f up your linux and 2 it is hard
if you want simply to do not see grub at boot
edit /boot/grub/grub.cfg (back up your piervos .cfg please)
set GRUB_DEFAULT to gradua
GRUB_TIMEOUT to 0
GRUB_DISABLE_OS_PROBER to true if gradua eaven have it instaled (it is not nesecary)
GRUB_CMDLINE_LINUX_DEFAULT to "quiet splash"
GRUB_CMDLINE_LINUX to ""
and run grub-update
hmm what's the consequence of replacing python-dbus with extra/dbus-python?
name change lol
thanks lol idk why there's so many updates today
same nearly 5Gb
6.7GB biger that eaven mine well they at least do something
yeah i've got like 1100 pkgs through pacman xD
xd i have 1650 acctualy but propably most of them did not get update
obligatory neofetch time?
nah hardware section ill be awful
is dis the place for linux?
This is for unix-likes. So, Linux is included.
OHHHH
so i'm trying to install solus linux, it will install but after i restart and unplug the boot device (or however you say it) it won't boot without the boot thing. if someone could help i would appreciate it.
when I try to include , linux/uaccess.h or asm/uaccess.h , both give me file not found error , does it need some dependency to be installed?
Hi help me
@main olive you have to ask to have answers 🙂 Also @tulip badger your question makes no sense at least to me. You installed solus, but it won't boot? Did you set the drive you installed solus on as first boot device from bios?
My question is how make hive sync I mean to retrieve data from hive blockchain and store it in postgresql database?
This is api
https://pypi.org/project/psycopg2/ or maybe https://www.sqlalchemy.org for storing data to postgresql. Maybe https://pypi.org/project/requests/ for making http requests to the api.
I am using ubuntu
thats fine
Hi pls help me to reset ubuntu password
passwd username
if you forgot your root password then you can make bootpen boot into it and edit /etc/shadow
I already did passwd username, and changed password but still can't login with new password
and you cant with old ethier?
bootpen boot how?
Hi I can login in tty linux but not via GUI ubuntu what's wrong?
where
really?
So can I now login via GUI?
not still not works
Hey there, what are the advantages of using WSL?
Still login via GUI not works
Hi
how2 RW /proc/X/mem? Operation not permitted even under root
Please where to run hive sync?
1: proper cli not this awful thing that microsfot did to its
2: acces to linux software liblary
3: package manager
Don’t need to have heavy VM
How do i detach from a tmux session? Ctrl B + D isnt working for me
ctrl b + d should exit to a normal shell. wdym
Hello , I've started using tmux just a while back , and noticed that when u enable the mouse mode , u cant select text normally like we do in bash , so is there some work around that I could add into my configuration to select text even with the mouse mode on?
Hold shift whilst selecting
yes , but thats clumsy compared to normal text selection on a terminal right
A little, but that's the price of having mouse mode enabled. You could create a command that toggles mouse mode on and off
like multi line selection with mouse can be done with double click on normal bash , but in tmux , its not really good
If you press and hold shift you can still do that
well , that doenst happen with me , im not really sure why
On ubuntu I did a force unmount of ext4 partition of my main drive now I cant do anything wont shutdown terminal wont open chrome wont open only like calendar opens
so unexpected how anyone could guess that when you basically did equivalent of disk unplug system would break?
never use --force if you do not know what you are doing
BarneyLovesYou: you will need to reboot, i suggest having a recovery method such as a usb boot drive or dvd so you can fsck the drive. ext4/xfs are fairly hardy, you might lose a little data though, depends on what you had going on. the longer you leave it running likely the worse things will be, especially if you open anything important and try to write it
I installed ubuntu today, nothing important was on the drive is the good part, I was trying to make a windows bootable usb. the tutorial said to unmount ext4
good for you. next time read errors and do not use --force 1st
yea --force is almost always the wrong option. though i recently quit a job and my last command was sudo rm -rf /
and if you are doing anything with disks make sure that you are working on disks that you are sposed to do(fdisk comes handy here)
lol i guess you didn't like them especially
it was on my remote workstation hehe.. everything business related was off the box, checked in etc
i did a really long transition / training handoff for all the important stuff
well still quite nice farewell "gift"
oh it wasn't font problem
Guys, I am trying to turn a normal TV with a USB and HDMI ports into a smart TV. What Linux distribution would be suitable? Also what could make the screen of the TV interface with code on the flash drive?
What I found from research:
- There doesn't seem to be anything similar.
- The other alternatives were a dongle (Chromecast, Apple TV) or just plugging in an HDMI cable from a PC which is not very exciting.
Edit: Also the TV manufacturer also does not provide an API and I couldn't find how the multimedia player on the TV was made.
I tried installing virtualbox but it said I needed to reboot. I didn't have time to do that so I tried to cancel the install. Now I don't have the option to turn the computer off through the UI
I have these processes running
root 2830 0.0 0.0 14148 5284 ? S 08:29 0:00 sudo apt install virtualbox
root 2831 0.0 0.1 18944 10344 ? S 08:29 0:00 /usr/bin/python3 /usr/local/bin/apt install virtualbox
root 2834 0.1 0.8 80360 67112 ? S 08:29 0:06 /usr/bin/apt install virtualbox
steele 9656 0.0 0.0 9032 736 pts/2 S+ 09:57 0:00 grep --color=auto -i apt
can I safely kill them?
I killed them and I think it's fine.
I thought about that however I didn't want to send wrong advices 
we'll see what happens next time I reboot, I guess
hi
i have a linux
and i want to code in python
i can do the basic stuff from terminal
but cant do turtle and tkinter
when i download python from the browser
it shows a lot of files
i dont really know what to do next
can anyone please help me
pls ping me if u reaply
Which distribution do you have?
ubuntu
You can try to install python3-tk by executing
$ sudo apt-get install python3-tk
zdr
What does it mean?
sorry that was typed by mistake
Oh, okay
it says command not found
Which command?
$ sudo apt-get install python3-tk
Paste without $ sign
ok
why apt-get if you can just apt
I wanted to show that you should execute this command in the terminal
its downloading something now
You can, ofc
its finished now what
try launching python from the terminal i guess or something
Try it
Paste your code
What are you trying to execute
And error message if appears
just trying to import the turtle
there is no error message but also no canvas arrises
You need to execute code, not just import
Try it
from turtle import *
color('red', 'yellow')
begin_fill()
while True:
forward(200)
left(170)
if abs(pos()) < 1:
break
end_fill()
done()
but in the book im using says that a canvas will appear when i import turtle
This is example from this page https://docs.python.org/3/library/turtle.html
TYSMM IT DID
Yay, nice
pog
I was able to safely kill them and reboot
What if you have program which is not responding?
are directories just a file array, if you were to look at them under the hood?
They have their own metadata, so I'd think not.
simplifying yes but they do not use arrays
here is diagram how it works
(btrfs)
meanwhile in UFS(unix file system) directories are just files
containing pointers to files inside it
so more like linked list
i want to put a python script in /usr/local/bin so everyone can use it. it has a dependency.
- Is making a virtualenv with that package installed and pointing the shebang line to it the correct way to make it go?
- If so, where is the linux-iest place to put that virtualenv? Something under
/usrseems right, but I'm not sure.
For /usr/local/bin, I personally tend to put it at /usr/local/share/{my-app-name}. But I don't know; I'm not an expert at this.
Is making it a package that's installable with pip not the direction you want to go in?
it is pip installable. but i don't want to install it (or anything for that matter) into the system python environment
also i don't want it to stop working if someone has a different virtualenv active. i want it to work as easily as any other system executable
You can do a --user install. If you want it available for all users then I suppose the "proper" way is to create a package that is compatible with your distro's package manager. At least that's what I do on Arch. I don't know if that's too annoying on other distros.
cool, i appreciate the replies!
Pretty stupid question but how can I install the default windows 10 font, I think its segoe ui? to my ubuntu machine? i am missing alot of emojies and other stuff
are directories a file?
i like that you have us see a man using a urinal as a profile picture very very nice :kappa:
@main olive check out https://discord.gg/ubuntu
I can't tell if the progress bars mean anything or what I'm supposed to do. Clicking "Ok" does nothing and there's nowhere to enter commands.
I'm just trying to install virtualbox.
oh something is happening
virtual box can have major isues with secure boot
if you do not need it then well disable it
what distro/os is that?
how do install CGICC on linux
I'm installing pop! Os right now, and I need to know what the /boot partition is. Can anyone help me with that
do you guys use any noise cancellation software in linux? if so, which one?
You mean like motherboard fan speed control or audio signal processing?
UbuntuStudio has a serious collection of apps for the later, most are available on any debian based build with ease of installation
@blazing wolf you could try a parametric eq from https://calf-studio-gear.org/ allows you tune out some annoying frequencies. Probably require a lot more processing to reproduce what krisp apparently does.
alright, I will check em out, thx 👍
yo
try ifconfig
i did
thats what it showed me mate
look at the screenshot
the circled thingy is my machine IP addy right?
yeah thats the vpn ip pretty sure
if you werent connected on a vpn you would see something different
damn bruh
so, in this case, that would be your ip
i aint even connect to no vpn
odd..
hold on
uh wtf
it says im from washington
even doe im not
ya its a vpn
but i aint conencted to one
aight homie i was connected to an extention vpn on mi browser
ok im pretty sure thats ur local ip, not ur public ip used to connect to the Internet
so in your home, you have connections between others in the same home
that ip is used to identity you in that space
delete that
but yeah the thing you circled is your machine ip
must be tuple not str
oh
wait
it should be
sock.bind((<ip str here>, <port>))
you had a type error thats all
str for what wait?
can u gimme a better example
with an ip and port
socket.bind(('1.1.1.1, 8080')) like that
kk wiat
more like
socket.bind(('1.1.1.1', 8080))
did it work?
i thought i made a mistake
that was my original one
then i was like oh wait the single quotes suposed to have the port within them too
so i extended it lol
damn bruh
ty
nah it takes a tuple,
ip for str and port as an int
np
got it
nice
I discovered new way to kill linux
If you try deleting old python3 version from ubuntu desktop....half of your systems get erased in addition.
Almost same as deleting /
not really enough of information
except that I can see some unit tests failing
Yeah but what reason they failed?
possible reason, wrong command to launch tests
Unit test also failed. Cover was 8 percent
Paste output, don't put here screenshot
!!!!!!! Interrupted: 1460 errors during collection !!!!!!!
====== 1 warning, 1460 errors in 230.33s (0:03:50) =======
ERROR: InvocationError for command /home/zymantas/Desktop/hivemind/.tox/tavern/bin/pytest --workers auto --tests-per-worker auto --durations=0 (exited with code 2)
________________________ summary _________________________
ERROR: tavern: commands failed
So I found this code reading file metadata that Windows keeps. https://stackoverflow.com/questions/12521525/reading-metadata-with-python
But I want to do that with metadata kept by Dolphin on Linux. Any idea where I can find this metadata?
If you search this, all you find is people who want permanence to their tags and ratings in dolphin, or people who cant get metadata to show.
What I want to know is where that metadata that is has can be found
Google dolphin file metadata location -tags -ratings didnt help
If I could read that data rather than process the files it would save me time.
More like stuff like this
os.stat information is pretty easy to get, but this kind of information requires me to open the file, process it in some way, and sometimes that is time consuming.
If this data already exists, it must have a location somewhere.,
This program is Dolphin.
pathlib pure path do not require this and idk that dolphin have
any python integration
or any integration with any pl
But, dolphin is a linux program, its made up of files, and they must exist somewhere.
what png image etc is in ram
it is not saved
yes evrything is file but idk if you want to mount your ram and search for dolphin
How does it know the height and width of every file without opening every file and determing this?
no i dont lol
or perhaps, does it open every file to display this info
you can check source code
fair enough. No one has ever asked this before, anyone who has anything to say about KDE and metadata is only there to say, "I dont have metadata"
I might try that.
but I dont follow C++ very well.
i found this
Im looking through the code now looking for the Detailed View stuff
it loads as fiev bytes as possile
did you found anything?
Its possible that getting the file dimensions and type this way is not even as taxing as other stuff that I cant get any metadata on... like opening videos to determine the frame data, like fps and frame count, which takes significant time to do for each file.. Right now im using cv2 to do it.
And to be honest, dolphin isnt even showing data like aspect ratio and fps for many files, so I might not be able to get it that way as easily as I would have liked.
-- as for the Dolphin code, no... I think its probably here tho https://github.com/KDE/dolphin/tree/master/src/views
dolphin acctualy loads them
np
how to share clipboard, in gnome boxes virtualized oses?
Boxes or GNOME Boxes is virtualization software for GNOME Desktop Environment. It is similar to Oracle VirtualBox but features a simple user interface. Boxes also pose some challenges for newbies and VirtualBox users, for instance, on VirtualBox, it is easy to install guest addition images through menu bar but the...
found this almost useful guide
but I don't get it, am I supposed to install those tools inside the box in order to run?
tried it already many times, but it is not looking to work (I have Ubuntu 20.04 desktop and tried to virtualize Ubuntu 20.04 Server)
already
trying exactly virt-manager at the moment
thanks for advice anyway)
it makes me reassured
that I am walking right way
can it be run on server, where I have only console?
first tool I need, will be only for desktop
erm.
well, the main objective for myself in Ubuntu Desktop
Secondary objective... to have the same in Debian Server
yeah
already installed and trying
is it only redirecting traffic? or I could directly install on server with thing above?
after installation, would be virtualized instance of image still running on server after I killed ssh connection from my desktop?
great
and if I am using Image ISO from my local pc
is it transfering it to server?
well, no problem
thank you very much
I learned so much
and this is tool to learn even more
crazy run of learning!
virtual sandboxes are quite cool things to play with)
That is the most horrific thing I've read in a while
I'm interested, why do you use bash for somethingthis complicated? Do you actually like the language?
In most cases I would much rather use a language like Python or hell, even PowerShell.
I find it difficult to write safe bash code - properly handling errors, checking exit codes, etc. It's really clumsy in that regard.
And the fact that values can't really be returned from functions - have to serialise them to a string (which is especially annoying for data structures like arrays and dicts) or use global variables.
Syntax is a bit complicated and language has many gotchas, but shellcheck helps immensely with that.
I understand it can work cause I've done it myself, but it was quite the journey. It's only something I'd use if I feel masochistic.
if theres anyone familiar with kde plasma or kde neon, what is a notification catcher and how do i use it, also a friend suggested me to use a notifcation catched as whenever I use discord app it freezes
Hello , I've been trying to understand how linux memory management works and came across this kmem_cache_alloc_trace function , tried looking at it's source code but couldn't make sense of it's basic function , can someone give an insight into this?
@main olive @wise forge Hello, please only send messages relevant to channel topics. We have a #bot-commands channel to test out commands. Sorry about the double ping 
quick question
if 7z is showing 4 processes (htop) does it mean it's using multiple cores, or it's just something else?
I am extracting a 90GB zip and it's taking atleast 2 hours
Awesome_Ruler_007: not sure on htop, but with top if you have a multicore machine you can just press 1 to display all the proc info. or start with top 1
What's the difference between the command python3 and sudo python3?
sudo is how you run commands with superuser privileges. so it causes python3 to run as superuser. generally not what you want
generally stuff like installing packages system-wide, rebooting, configuring network/storage etc
stuff that would impact other users of the system tend to require admin privs, since these systems were designed to support multiple users
i am hosting a postgres database on a VPS and i was wondering what the best way to access it would be through my local machine. an SSH?
hale: yes, just ssh in, you dont want to punch a hole through firewall and expose the db to internet. unless perhaps you have a static IP, but even so not advisable
Are you asking about accessing VPS or database?
It is good to use it in mostly all commands, cuz thats how u can get all possibe info
enter the sudo mode by running sudo su, then use ur commands
Hmm, I can say nope. You shouldn't run everything by using root account or admin privileges
making script that makes dump from database directly, I think more easy solution
depends on your database size/security things and e.t.c.
ssh is not bad solution too ;b just more steps to do in some cases
Maybe, its just my second day since i shifted to linux
You can create a huge vulnerability by doing everything with sudo
oh
@harsh owl If I am correct I need to setup my postgresql database for SSH as it is not able to be accessed by default?
hale: postgresql isnt what provides ssh. what kind of vps? does it have an actual OS? that is what you would ssh into. you can also do stuff like port forwarding over ssh into vps to access the db directly on your local machine. like a proxy
@harsh owl It's a Vultr VPS running Ubuntu 20.04, I want to SSH to my local machine
I'm fairly new to the devops stuff. I know how to navigate Ubuntu but the networking side of things I haven't quite figured out yet
how are you trying to use the db? if you just need cli access, you can ssh into vultr vps and connect to db there. if you want to access db from your laptop or whatever, i would suggest ssh port forwarding rather than opening postgresql port to internet
it looks like they open ssh by default; https://www.vultr.com/docs/how-to-access-your-vultr-vps - so you'd just need to know the IP and creds

