#unix
1 messages · Page 10 of 1
well, the commands I shared to check the system logs
okay
it's best to do it right after you notice the buggy behaviour since otherwise the relevant logs may be far back in the history
for example, I'm running into wireless adapter issues and in my case, there are error messages in the dmesg logs
(I've pretty much given up on fixing my wifi issues, it seems to be persistent)
by tagging u
which on adapter? external?
internal realtek
I have that shit problem for my front panel headphone
but eventually wifi adapter is not giving me that problem
the connection is timing out randomly and then it takes an unreasonably long time for the connection to be reestablished. given I've had the same issues on my previous laptop, I have little hope to fix it
Ubuntu is very good and fast compared to windows
I have that issue on windows , but now on ubuntu it automatically solved
do u know how can I fix front panel headphone issue
honestly it's a roll of the dice, some things don't work in windows and some things don't work in linux
computers are pain
"life is pain"
Honestly, you'll have to search the internet for answers. My general advice is to:
- Check the relevant logs if possible, they may give you error messages you can then throw into google
- Identify the linux kernal driver and device name that's causing you trouble and also throw them into google
- Update your kernel/system to the latest available
what was command for that
sudo apt update??
that and sudo apt upgrade
sudo apt update only updates the package lists available to install (it's like asking apt to fetch a new listing of the yellowbook)
Yeah, sometimes your linux install doesn't come with drivers that work nicely with your hardware and the thing with Ubuntu is that the packages available are usually one to several years out of date
but that solved in 23.10 version
I gues
guessss
yeah you'll have it better
I'm on 22.04 because I don't want to do whole system upgrades every year
Linux system issues are a pain to debug
but is teaches the core
!!
can I do ls /var/crash
sure why not
to check logs
Anyway, does Ubuntu list your internal microphone as an audio device, like does it even detect it?
wait, do you mean your front speakers are not working?
yup
but I didn't check that back panel sry
but in windows also I got that issues
front was not working back was working
let me check
no it's not showing any device on front panel
I just check the error logs
it says thiss
_opt_google_chrome_chrome.1000.crash _usr_bin_gnome-shell.1000.crash _urs_bin_gnome_shell.1000.upload _usr_bin_gnome-shell.1000.uploaded
sorry, a little busy at the moment
np
I think I removed that error in terminal now
by doing this command
sudo rm -i /var/crash/*.crash
and it shows this
rm: remove regular file '/var/crash/_opt_google_chrome_chrome.1000.crash'?
rm: remove regular file '/var/crash/_usr_bin_gnome-shell.1000.crash'?
I don't know what I did exactly
!
uhm, why did you delete the crash logs?
i dont't know i just read that in stackoverflow
the logs are meant to help you figure out what went wrong
they aren't an error themselves, they're the byproduct of one
this is answer I guess
new thing found!!
ls -al /var/crash
I did this
and got this
total 67360
drwxrwxrwt 2 root whoopsie 4096 Jan 3 21:45 .
drwxr-xr-x 14 root root 4096 Oct 16 16:09 ..
-rw-r--r-- 1 root root 0 Jan 3 21:47 kdump_lock
-rw-r----- 1 abhay whoopsie 47682317 Dec 30 22:28 _opt_google_chrome_chrome.1000.crash
-rw-r----- 1 abhay whoopsie 16705451 Jan 2 15:53 _usr_bin_gnome-shell.1000.crash
-rw-rw-r-- 1 abhay abhay 0 Jan 2 15:53 _usr_bin_gnome-shell.1000.upload
-rw------- 1 whoopsie whoopsie 37 Jan 2 15:53 _usr_bin_gnome-shell.1000.uploaded
-rw-r----- 1 gdm whoopsie 4569157 Jan 3 21:45 _usr_bin_Xwayland.123.crash
this is output
@primal sierra see this when u idle!
Does anyone know how to wake the computer up from suspension when AC power is connected? There's an option in BIOS that allows this to happen but only for when the entire computer is shutdown, when the computer is sleeping or suspended, AC power does not wake the computer up, instead it's either a keyboard press or a mouse, does anyone know how to configure AC power to also unsuspend the computer?
would sudo echo enabled > /sys/bus/acpi/[power device names]/power/wakeup make sense, I saw it similarly done with USB devices here: https://askubuntu.com/questions/848698/wake-up-from-suspend-using-wireless-usb-keyboard-or-mouse-for-any-linux-distro
Maybe change something in /proc/acpi/wakeup, I really don't know
Does anyone know?
so i just want to try KDE desktop environment, and it has the full, standard, plasma desktop
which one to go with
Whatever one you want. Use a live USB stick or VM to try them all.
Why this doesnt work in TCSH
find ~+ -name "*.gjf" | while read line; do cd "$(dirname "$line")" && sub-gaussian "$(basename "$line")"; done
Error is: Illegal variable name.
Can you really have "" within " in tcsh?
I tend to
for i in find ~ -name "*.gjf; do
cd $(dirname $line); ...
done
.. in bash (haven't used tcsh since 2002)
be aware that this kind of loop can very easily break if there is whitespace
In that case i would alter IFS, i.e
IFS="
"
@paper ibex @real vapor
I made that way:
find . -name "*.gjf" -exec sh -c 'echo "Running {} with sub-gaussian" && sub-gaussian {}' \;
but it says:
Running ./c6/c6.gjf with sub-gaussian. sh: sub-gaussian: command not found
even though
[pharmd@dock comp]$ which sub-gaussian
sub-gaussian: aliased to /lu/home/pharmd/gaussian.ssub
What's wrong?
sh doesn't have the alias
use the full path
or alternatively
shopt -s globstar
for f in **/*.gjf; do echo "Running $f with sub-gaussian"; sub-gaussian "$f"; done
should do the same thing
Exactly. When you use 'sh' it will start a new shell (bourne shell), which will not have the alias you created in tcsh
-exec "echo running {} with sub-gaussian" -exec sub-gaussian {} should do that, too, no? (without the need for sub-shelling)
Needs \;s
I don't think the shell language is the issue here, looking at Volcyy's fix
oh snoop, i didn't know this
Okey. find . -name "*.gjf" -exec sh -c 'echo "Running {} with sub-gaussian" && /lu/home/pharmd/gaussian.ssub {}' \; should work then?
I'm not sure find will know about the alias then either though, should it?
Yes
Ogh lets see
it would have to be in $PATH?
Not sure, tbh…I think it runs plain -exec in the current environment…but I'm probably wrong!
If which subgaussian shows it, then it is on $PATH
aliased to makes me think it was specified with alias, which is a shell-local thing
Oh, right…
I made this in the following way:
find . -type f -name "*.gjf" -execdir sh -c 'cd "$(dirname "{}")" && echo "Running {} with sub-gaussian" && /lu/topola/home/pharmd/gaussian.ssub "{}"' \;
And seems to be working. Thanks a lot.
👍 (even if I didn't really contribute anything much!)
right, this is why I end up dumping stuff in my personal bin path a lot
accessible from anywhere, unlike aliases
Well.. stuff in your personal bin is only available if you put that bin path in your $PATH, so you still have to do some work 😉
Switching to and setting up bash will on most platforms enable you to use both bash/sh
if the command you are running (gaussian.ssub in this case) with -exec can take multiple filenames you can optimize your command and lessen the overhead by changing \; (which will run the command once per file that find lists) into just a + (which will run the command as few times as possible by running the command with the maximum number of files as input as your environment allows for per instance)
Is there a tool I can use to distribute certificates on intranet? I have a bunch of machines with intranet-only websites. They can't get a letsencrypt certificate via HTTP-01 because they are not reachable from the internet, and I don't want to give every one of them access to the DNS zone to do DNS-01.
Is there a system I can use that would request the certificates on behalf of other machines and distribute them to them?
NFS or something simliar?
Could probably make my own mess of cron jobs and SFTP but I would rather not
need help with wsl, i want to make it so that everytime i open wsl2 ubuntu in terminal, it cds to a specific folder
You could add that to .bashrc or .bash_profile (I forget which executes for what login scenario, but they often are interlinked)
what do i modify exactly?
.bashrc and .bash_profile are files that sit in your home directory (~). Just put the cd command at the end of one of them
tysm!
don't do it in bash profile, only in bashrc
@modern fog ^
the "profile" file is meant to set up your execution environment for the current user, the "RC" file is specifically for interactive configuration
in bash it's a little confusing, it executes the profile in a "login" shell" and only execute the "RC" file in interactive shells that are not "login" shells.
at the end of your "profile" script, you can check if it's an interactive shell, and if so, run the "rc" script
note that bash supports both .profile and .bash_profile preferring the latter
if [[ -r ~/.bashrc && $- == *i* ]]; then
source ~/.bashrc
fi
put that at the end of ~/.bash_profile
Yea I did it there, thanks for letting me know
Aight
why would subprocess.run cause a segfault?
I have a program foo when I run normally it's fine, but when run in a subprocess in python is segfaults
my guess: the program itself is buggy, and when you run it from python, you're giving it a different "environment" than when you run it normally, and it freaks out.
By "environment" I mean the "process environent" but also stuff like: are stdout and stderr connected to terminals (as opposed to files), &c
its possible
I didn't write the program, but I have the source and it wouldn't be the first tiem I found a bug in it, so I'll take a look
in theory, you can debug a crash by using gdb. In practice, it's a pain
Might also get different libraries etc when you run it with subprocess
so im using nvmstarship shell prompt, and why is this accessing via node.js
what was the reason mv have double function, both moving and renaming
oooh
make sense
And neither of the operations changes the actual inode, unless of course you move it across filesystems
rsync -av --include='*.log' --exclude='biomolecules' --exclude='chelation' <remote> <local>
Why rsync download also other files instead of just .log?
Include tells rsync files to include in the transfer, i guess that it includes files not specified in the exclude args..
Does
--exclude='' --include='.log'
Works?
hi is anyone good at bash scripting? i have some doubts to clear
Try us 🙂
this is the right channel for bash questions. but "don't ask to ask". state your questions clearly, with example code if needed, and wait for a response. if someone doesn't know the answer, try again later.
I am trying to remember why i switched from tcsh to bash 20 years back. I know i was mad at the completion in tcsh and tired of the set/setenv confusion, any thoughts on why i changed? 😂
I recall not getting on with tcsh, but yeah, same - can't recall the details
well to me it makes sense to ask to ask, metaness is ok
it's ok to ask if a particular channel is the right place. but beyond that, it places undue burden on the people trying to help, forcing them to "interview" you in order to actually help you. "asking to ask" is a good way to not get an answer to a question.
maybe from someone who thinks what you think yes it is a good way to not get an answer
as people here are strangers it can feel akin to just walking up to a stranger and just asking a question, perhaps that is something which can be moved past but it is not so clear cut
all that was required in this case was "me"
at least not clear cut enough to be telling strangers for definite that it is the right way, maybe just indicate personal preference
It's a pretty standard stance across online learning fora (since the 90s, or possibly earlier!)
Even if someone "knows" X, they may not know the answer to your question about X. So asking your question directly filters to the people who both know and can answer
i have encountered it a lot too, maybe born from some article somewhere maybe from experience.
0: some say someone should do something expecting the fact that they are speaking from their own desires to be implicit,
1: some explicitly state that their statement is their own opinion,
2: some do not state that their statement is their own opinion and are trying to self assert
if telling someone bluntly, "dont ask to ask" is 0, then i understand, but if its 2 then it is rude to command people
i am currently speaking as in 0
Why not just do the whole thing with Python and/or a more appropriate folder structure?
Hello, i wanted to know if there's a python module to get symbol information from linux library archives (.a files) similar to what nm -A --defined-only --no-demangle can achieve on command line, I dont want to use subprocess since im trying to do this for a lot of .a files
pathlib.Path(__file__).parent is the usual incantation for getting the current file's directory
Doubt it, it would have to be super platform specific
I see, makes sense
But its a guess, even though i spent a minute on google 😉
Cant you run nm on multiple files?
Intresting with lots of .a files, i thought .so were more common
hm so my requirement is given an object file, check if it is a part of any of the archives and return the path of the .a file in which this object is found
If you will do it often you could create some kind of index with the symbols per .a file..?
yes, i figured that i could collect all symbols with just one subprocess call, thanks alot for the help
I just did a fresh install of Linux in my system and am having some trouble with python. I am installing python3 for personal projects and python2.7 for school related work.
I am trying to setup python with VSCode but I am facing a somewhat big issue. print("Hello World") in either versions doesn't work. I installed pip, and pylint but it won't run. Errors still show up in the problem screen (for example, just writing lol without anything else.
I am honestly a bit stuck because I (assume) I have set up the interpreters but no luck with the actual printing
after I run the program in a new terminal
python interpreter location
there is also this in the Debug Console:
Debugger Error: The number of constructor arguments in the derived class s must be >= than the number of constructor arguments of its base class.
Error
Error: The number of constructor arguments in the derived class s must be >= than the number of constructor arguments of its base class.
at /home/spokazzoni/.vscode/extensions/ms-python.python-2019.11.50794/out/client/debugger/debugAdapter/main.js:16:27311
at Array.forEach (<anonymous>)
at e (/home/spokazzoni/.vscode/extensions/ms-python.python-2019.11.50794/out/client/debugger/debugAdapter/main.js:16:26875)
at t.plan (/home/spokazzoni/.vscode/extensions/ms-python.python-2019.11.50794/out/client/debugger/debugAdapter/main.js:16:27386)
at /home/spokazzoni/.vscode/extensions/ms-python.python-2019.11.50794/out/client/debugger/debugAdapter/main.js:16:24044
at e._get (/home/spokazzoni/.vscode/extensions/ms-python.python-2019.11.50794/out/client/debugger/debugAdapter/main.js:16:23953)
at e.get (/home/spokazzoni/.vscode/extensions/ms-python.python-2019.11.50794/out/client/debugger/debugAdapter/main.js:16:22664)
at s.get (/home/spokazzoni/.vscode/extensions/ms-python.python-2019.11.50794/out/client/debugger/debugAdapter/main.js:68:141080)
at new _ (/home/spokazzoni/.vscode/extensions/ms-python.python-2019.11.50794/out/client/debugger/debugAdapter/main.js:1:268522)
at /home/spokazzoni/.vscode/extensions/ms-python.python-2019.11.50794/out/client/debugger/debugAdapter/main.js:1:271764```
That's not valid Python. Get rid of the space and the SS and try again?
Aliases can't take arguments in that way, the $1 etc. just resolve to the values from the shell its called from. It'll work close to what you expect if you define a function instead:
$ bla(){ echo "A$@ B$1 C$2 D$?" && echo '!!!' }
$ bla -F 0 1 2 3
A-F 0 1 2 3 B-F C0 D0
!!!
You also seem to misunderstand what $@ and $? do: $@ are all arguments together, and $? is the status code of the last command (normally 0 if the last command exited without errors)
Didn't Apple make the same change, originally the default shell for OS X terminals was tcsh and later on they adopted bash?
I see here that the change happened between 10.2 and 10.3 https://scottlab.ucsc.edu/xtal/shells.html
Didn't know that! Intresting.
And that was released in 2003 https://en.wikipedia.org/wiki/Mac_OS_X_Panther
Mac OS X Panther (version 10.3) is the fourth major release of macOS, Apple's desktop and server operating system. It followed Mac OS X Jaguar and preceded Mac OS X Tiger. It was released on October 24, 2003, with the retail price of US$129 for a single user and US$199 for a five user, family license.
The main features of Panther included a refi...
Wonder what NextStep used, can't remember
I had to use c shell in a job around 2010 but it was already way out of fashion
csh was out of fashion even a decade before that! (although still hanging around, as I recall)
What's the momentum on oil shell? And what's the common/elite opinion on zsh/bash?
I use zsh shell locally but I write bash scripts... I use bash shell on multiuser systems where most people are using bash so I can help them or screen share or whatever
I get a newsletter from the oil shell guy every now and then. But you're the first person I've ever heard mention it, besides him
I switched from bash to zsh maybe two years ago, because Apple nudged me that way. I don't regret it.
Hello, I have a question about git diff.
The book I'm reading (Pro Git) says that it compares between the staging area, and the working tree, assuming I've modified a file after running git add [myfile]. I've tried running git diff when no files were in the staging area, but were modified, and still showed output.
Does git diff simply compare working tree files to the previous commit, if there's nothing in the staging area?
Show changes between the working tree and the index or a tree, changes between the index and a tree, changes between two trees, changes resulting from a merge, changes between two blob objects, or changes between two files on disk.
I've already looked there, but it's hard to understand, as it states that diff can both compare between the working tree, staging area and last commit.. not when, In a clear way.
The atlassian documentation is probably as good, if not better. They explain most things with pictures of the trees, too…
Git diff is a multi-use Git command that when executed runs a diff function on Git data sources. Learn about git diff and how it helps with saving changes.
I think the answer to the question is "yes", but I can't recall without having a repository in front of me
Looking at the link you sent, it looks like the answer was yes. Weird.
It seems it's comparing the working tree to the last commit, and it will compare the index to the last commit if I add the --staged option.
Thank you for your help!
git jump diff can also open your editor with all the diff locations loaded (in vim's case the quickfix list will be populated)
You can also diff different commits. For example git diff HEAD~ will in effect show you the content of the latest commit.
This must be some third-party extension, git jump is not part of base Git.
the issue persists
I have installed an older version of the python extension because I need the debugger to be able to run python 2.7, but that worked fine on Windows
Hii can somebody help me suddenly on my screen many errors come like this:
[ 969.662626 ] EXT4 -fs (sda2) : I/O error while writing super block
I can't see mouse can't use keyboard don't know what happened suddenly
I'm ubuntu user.
uh oh
do you have the installation media (bootable flash drive/cd)?
that's weird
But working slowly
is this disk "external" by any chance?
like a USB drive or something?
in any case: back your important stuff up now
No it is my hard driver part
Is it about hard drive 'safe problem?
no idea what you're talking about, sorry
are you backing up your data? If not you should be
I will stop nagging now
I hate this 50% chances what should I do first back up my data?
backup when it's working
rather than trying to recover a corrupt hard drive(or worse) later
in anycase stuff like this generally doesn't go away on reboots. so expect it to come back.
Okay
After restarting it is still working well but like laggy
I'd suggest attempting to run fsck -f and fix any errors in the filesystem from live install media
Okay but will it erase any data?
I'd suggest BACKING UP NOW and running fsck only if the backup fails
I guess I lied
It seems something is serious
I've started backing up
I'll do that after backing up data
just mentioning in case you did not know,
fsck -f /dev/sda2 since that's the partition tripping you up
ok so a few days ago, i run an update and upgrade on my linux and the kernel was updated to 6.5.0-14. everything suddenly slowed down and just an hour ago decided to try and solve this problem by doing a clean install of my amdgpu-install stack, and i noticed that previously the driver was for 6.2, and now in the process of clean installation it builds for my current kernel version.
i didn't know this but do we have to manually reinstall and build drivers everytime we update to a new kernel?
Usually there are hooks to handle that, although manually built drivers might bypass that mechanism. (iirc, and my memory is sketchy ;) )
I wouldn't be surprised.
maybe not every time you update, but updating the minor version or "worse".
Like if you went from 6.5.0-14 to 6.5.1-1, I wouldn't expect you'd have to recompile
if you got your driver from the same distro source from which you got your kernel, I'd expect that to all be taken care of for you.
It is included in git contrib, it's included with git in some repositories.
Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documen...
i see
well in the end i had to rollback to 6.2 since my laptop's fan gone all weird on 6.5 lol
this is too cool
I didn't even know about contrib, fun times
I use git jump all the time. My workflow: https://github.com/kaddkaka/vim_examples/blob/main/git.md
I'm trying to convert a PS script to Bash and was wondering what the Bash equivalent of
if ($RepoLink -match '(?:git@|https://)github.com[:/](.*)/(.*).git') {
$RepoName = $Matches[2]
$RepoPath = $CurrentLocation
} else {
Write-Host "ERROR: Invalid git repository link. Exiting setup."
Exit
}
More specifically how can I use regex in Bash?
iirc you'd have to use something like Sed or Awk or Perl (or Python) to use REs in bash. Unless some of the extended matching now uses it... (I have a vague notion that I have seen it, but I can't think what the invocation was)
Looks like the perl-ism =~ can be used in bash...
https://stackoverflow.com/a/37935960/2098827
[[ $NEW_STRING =~ $REGEX ]] and then use $BASH_REMATCH[...] for the capture groups...
Bash Reference Manual
i think ripgrep provides regex support
Oh, of course, any version of grep, but then you have to process the output
that's what -q is for -- it suppresses the output, and merely tells you if the pattern was found, by exiting with 0 if so and 1 if not
But then you don't get the captured groups...
(although can you easily with greps output?)
I'll check this out thank you
and here i am switching some scripts to powershell from bash 😆
i think =~ & BASH_REMATCH is the right tool for the job here, but bash is so full of gotchas and footguns that it almost feels like a downgrade from powershell (which of course has many problems of its own, e.g. no set -e equivalent)
Not to mention having to use half a page of typing to do something that takes two letters in bash ;P
Yeah new AMD P-state drivers landed and were enabled by default in linux 6.2/4/5?
I haven't tested to see if there is any efficiency or performance improvements over the old generic ACPI driver, but there hasn't been any weird behaviour so far ...
Not sure if that's related, but that could cause funky CPU behaviour
what, powershell? i don't think bash is significantly more concise than PS
the names and args/flags, yes. but not in terms of functional lines of code / statements
It was the main impression I got from PS - it was very verbose
I'm obviously exaggerating on the two characters, but that's sort of my impression
I want to buy a Printer and i am using Ubuntu 22.04 LTS. How easy it is going to set up a printer with my Ubuntu? How good Ubuntu has support for printer? Is is going to pain or just fine? How many varieties of Printer Ubuntu have driver for? What company printer should i look for? HP? I have seen some printer driver in my /usr/share/ppd directory.
I think it's tolerable these days.
I'd get a cheap Brother B&W laser printer
I've had this for many years. I can't swear it'll work with Ubuntu -- crappy hardware support was, in fact, the reason I gave up on Linux on desktops -- but it probably will work.
https://www.amazon.com/gp/product/B00LZS5EEI
Linux should have pretty good printer support thanks to Cups
IIRC if you have something that supports Apple's printing thing (AirPrint?) that will almost definitely work
I use a Brother HL-2270DW and it works with Linux/CUPS but you need a driver from Brother
it's kind of annoying if you need to install it manually because they actually have 2 or 3 different drivers for the same printer and it's not clear which one you should use. But of course there's an AUR package for it
for network printing specifically i had some issues where CUPS could see the printer, but it said "printer is not connected" when i tried to do anything with it. i had to change an Avahi setting to get that to work
i think that's a separate protocol, but any zeroconf/Bonjour printer would work yes
eg my printer supports zeroconf/Bonjour but not AirPrint
ping 1.1.1.1 | awk '{print $0; fflush(stdout)}' | awk '{print $0}'
need to flush to stdout
another example would be like
ping 1.1.1.1 | awk '{print $0; fflush(stdout)}' >> /tmp/wot.txt
curl -s "$url" | grep -oP '<a href="[^"]*.mp3">'
grep also has a -P option that is for passing it perl style RE
Yes tndoes
Can someone tell me exactly how do I dual boot my laptop?
Trying to install google secret manager ran into multiple issues. Firstly protobuf wasnt being installed with it in the linux server while on my local machine it was being installed once i ran "pip install google-cloud-secret-manager". It was being installed but not inside the google package folder. To fix that i made a pip install to a target ocation for just protobuf and dragged the package into the google folder. Which worked and now facing another issue. The issue is regarding an ImportError" cannot import name 'cygrpc' from grpc._cython 😦 Please help
I've looked at the file and compared with the local version and its all the same or similar for most. Cant identify an issue
Yuck, don't. Use WSL, VMs, USB. But if you must dual boot, there are endless tutorials a web search away
Dual booting is a lot better if you have a machine that's not going to run a VM particularly well.
But, yes - there're plenty of tutorials out there. I imagine the Arch Wiki has a good take on it, which you can adapt for whatever distro you want.
In short you need to have a partition to hold your other OS, and tell your bootloader where that is. You can do this with Windows bootloader, but I think it's a lot easier with one of the Linux-aware ones, such as GRUB
Hmm...I see 🤔
does anyone have experience with network namespaces in linux? (ip netns) im trying to create 2 network namespaces, 1 gets its internet from eth0 using a virtual interface, and the other gets its internet from the first network namespace but from the tun0 interface on the first network namespace. (tun0 is an openvpn connection in this case)
Is your question how to create the setup you described?
What have you tried? Where did you get stuck?
what's the proper way of adding your github credentials if you're on a linux server with multiple users?
I think git config --global credential.helper store adds it in plaintext for anyone to see
@placid agate Sorry for ping, but you might know this and this channel doesn't seem very active.
@fallow tusk Also sorry for ping, I'm only doing this because it's slightly time sensitive and for some reason I can't seem to find an answer online. My google skills suck apparently.
are you not using SSH keys to authenticate?
We are
Does this mean that using the above command won't make it publically available?
We're using ssh keys to log into the server
but if you mean ssh keys for github, i haven't created a pair
yes, use SSH keys to authenticate with Github
Ok thank you very much!
usually every user has their own keys
This must be the reason for them creating private folders for each of us. I was wondering why they would do that given that we have to work together on projects, which means having read/write access to the same content.
https://git-scm.com/docs/git-config#_configuration_file
afaik .gitconfig goes in each user's home directory, so assuming people are only logging into their own user accounts and permissions are correctly protecting each home, it seems fine to me
I see. I don't actually know if that's the case. I do know that when we log in we are automatically put into our own private folder. While we can technically see and "access" other people's folders, the content is hidden and we don't have write permissions
I think I'll still go for the ssh way of logging in as that seems the most secure
@formal schooner on GitHub's page they show a PowerShell command to add it to the ssh agent, but I don't see a linux version? Do you have any idea how to do this?
When I search on Google it just refers me to this site or SO answers that don't go over this particular step, which makes me inclined to believe it's not necessary for *nix systems?
There's 3 versions to select
can someone help me with this error
The hint explains the error message, but you have to work through the terminology. A "ref" is just a branch. This means that there are commits on that branch in the remote repository that are not in your branch in your local repository
Git has no idea what to do with that situation and refuses to guess, so you get an error
usually you want to merge whatever is on the remote branch into your branch, but you should definitely inspect what's on the remote if you weren't expecting anyone to push anything else to that branch
what do you guys rrecommend for destrubution for linux thinking about debian and linux mint rn
debian stable
linux mint is also good and feels more user-friendly. my system is rather barebones
i really do like arch, specifically endeavour
rolling release very rarely breaks anything for me, although that's not why i like arch
i find debian-based systems "disorganized" in some ways
arch feels very tidy
fedora and suse are more tidy than debian as well, but i have other complaints about both that i don't have with arch
What's disorganized about them?
acumulated complexity and lack of clear structure in things like config files and startup scripts
I guess so. Arch is Installed and configured so many more times by hand that it's bound to be cleaner at this point.
so like have done some ubuntu before i think but is mint than the best as a pretty new linux user mainly use windows
but wanna get to learn linux better with my rpi 5
i actually think it has more to do with the arch philosophy of messing with upstream as little as possible
how can I access a subprocess in a signal handler?
something like
p = None
def kill_handler(sig, frame):
print("HERE")
print(p.stdout.read().decode("utf-8"))
sys.exit(0)
signal.signal(signal.SIGTERM, kill_handler)
signal.signal(signal.SIGINT, kill_handler)
def run_command():
global p
p = subprocess.run(["command", sys.argv[1]], stdout=subprocess.PIPE)
run_command()
I think p is only updated when the command terminates
but I want to get the output if it temrinates early
I dont know if anyone here uses arch linux on virtualbox but I have been on this screen for over 10 minutes now, not sure what i can do to make it quicker
i see
correct. you need subprocess.Popen
I have color codes for printing e.g. red messages when errors occur in my shell script
the issue I have though is that these colors, which are defined as constants at the top of the page, have to be inserted with a space at the end to be recognized. This means however that my output messages always have 1 space
is there no way around this?
e.g.:
LIGHT_RED = "\033[1;45m" #Random value
echo -e "\e[$LIGHT_RED ERROR HERE \e[0m"
prints ERROR HERE (with color) while
LIGHT_RED = "\033[1;45m" #Random value
echo -e "\e[$LIGHT_REDERROR HERE \e[0m"
prints no color and only HERE
${LIGHT_RED}ERROR
thank you
I don't know if I'm just inexperienced, but bash feels way clunkier than PS
Also I hate having to edit in nano that shit sucks but it's the only CLI editor I have available on the server, which doesn't have any window manager at all
I'm so used to the things modern editors provide that I sometimes feel like an idiot trying to use nano. Like what the fuck does M-6 even mean? How do I access that shortcut? What are they talking about?
As for bash... Well, it's not bad at all, but the syntax is a little odd imo. I don't like the fact that you can't define parameters for a function other than relying on position i.e. you have to - as far as I know - do this:
function download_repo() {
local link=$1
local src=$2
local dest=$3
# ...
}
What's that about?
PS does this too so it might be a scripting language thing idk
Either way I'm not a fan of it
Now that I think about my complaints are more about nano than shell lol
in nano, emacs, and vim, we use <mod>-<key> to denote the keyboard combination where <mod> could be C(trl), M (alt), S(hift). So M-6 would be alt+6
the notation could also be like C-M-a, which means ctrl+alt+a
Ohhh I see
there isn't really a concrete sense of keyword arguments in things like bash.
all we can be sure of is how "a bunch of space separated strings" are split into arguments -- depending on quoting and escaping.
the ./some-command --option=value is more of a convention. Use can parse the "value" out of it with external tools (like getopt, & others). but from the shell it only provides you with the list of arguments
speaking of getopt I am about to use that because I want the user to be able to provide a path to a text file and indicate that it is a list of repositories
and not a single one
I'm not sure I understand the purpose of e.g. shift though: https://stackoverflow.com/a/7069755/14996856
the shell scripting and related CLI convention takes some getting used to. but it becomes easier ones you understand it from the shell/cli's perspective -- what's happening under the hood
Yeah I gotta practice this a lot more
It's fun however, I like the "quirkiness" of the language
definitely not what i'm used to
a conventional way of parsing arguments is using a "case" block, it's like switch statements in modern languages.
so the problem arises when we want to loop through each argument and parse it.
shift helps this by making $2 be accessed using $1, $3 to $2 and so on, so you can reuse your "case" block logic
for sure!
Sorry could you elaborate on that last sentence? What do you mean by allowing $2 to be accessed using $1?
In the answer he states shift takes the first one away.
Is it because the first argument is always the name of the file or something?
I don't get it 🥲
say your list of arguments is:
a, b, c, d
so we access a using $1, b using $2, c using $3, etc
now we do shift
and the list of arguments is like this:
b, c, d
so we access b with $1, c with $2, and d with $3
so yes, the a is gone
what's the difference between using printf and echo in shell?
should I use echo or printf? what is the convention? i
if you don't need formatting, echo is good enough
for basic usecases where you're just passing a literal raw string to it, echo adds a newline and printf does not
Ok that's good to know, thank you
I guess printf is what I'm looking for then when I'm asking the user for input
So they can enter on the same line as the question they're asked
Is it possible to create an alias in e.g. ~/.bashrc to copy a value from a file? I can't use xclip as I'm not allowed to install packages on the server
Using cat will simply display, which is working for now, but it's not really what I'm looking for
Is it really not possible without xclip?
I can't seem to find anything
Seems like a basic thing to include in the system :/
Do you have vim installed on the system?
Yanking to the unnamedplus register is equivalent to copying to system clipboard
let me check
@shrewd stratus I do have vim how do i exit help
these fuckin cli editors man
:q
ok well that was easy
so how do I use vim to copy my stuff?
you said something about "unnamedplus register"? what does that mean?
You can select the text in the file and copy to the unnamedplus register
I'm afraid you'd have to learn the basics of vim to understand what I'm suggesting
but that defeats the purpose of an alias though as I could just do that in nano then
The benefit of knowing that vim can do this is that you can script vim to do this using a shell command
Using vim -c
I'm not really looking to learn vim just for this one purpose, could you not help me craft that shell command perhaps?
Would it simply be this in ~/.bashrc? https://stackoverflow.com/questions/1620018/copy-all-the-lines-to-clipboardi
alias getstuff='vim -c :%y+'
Wait no that can't be it, I have to include the path to the file that contains the content of course
you sure it's vim -c? Can't find any info on it
it's a little weird that yank is a legitimate term used by vim people lol
It is vim -c
And what does vim -c do? runs a command? where can I find some documentation on -c?
Open vim
:h -c
ok as far as I can see the path to the file is after whatever you put after -c
I'll try vim -c :%+ <path>
Nah that's not it, says invalid register name
vim -c 'norm ggVG"+y' -cq -e <file>
Well it runs
But when I right-click it simply pastes the above command you wrote and not the contents
Am I doing it wrong? is it stored somewhere else?

Remove the -e
No luck 🤷♂️
Wait. Are you ssh'd in to a server?
yes
Yeah, it won't work then.
How come?
The server's clipboard is not the same as your clipboard
Fair enough
Or just scp/rsync the file from the server
i can try asking the admin to install xclip
Installing xclip won't work for the same reason
^
Unless you forward your local X server to the server
too much work
Yeah
screw it i'll just use cat
cat 👍🏼
🐱
dude
all this time setting up git and shit
finally ready to create venvs for my python projects
and the sys admin forgot to install python
nvm i'm stupid it's python3 not python smh
BTW, you can also try setting up a reverse SSH tunnel to ease the copying
I'll look into it. Thank you!
Is pip not always included with python? why does it say this?
dea@ml01:/home/projekter$ python3 -m pip install -r requirements.txt
/usr/bin/python3: No module named pip
Oh it's pip3
why are they doing this
Nope not pip3 - cool
python3 -m ensurepip
no module named ensurepip
I'll just ask them to install pip, looks like they forgot
Weird that it isn't included in the standard installation
Debian packages it separately for some reason
debian also packages venv separately. ideally you'd have python-pip and python-venv on a debian system
or install your own python that isn't the one provided by the system. you can use pyenv to do that easily.
why would they do that
i don't get it
for the sake of "choosing yourself"?
I think it's to prevent you from messing up the system.
The Python installation packaged by Debian is (mostly) for use by other Debian packages. You install other Python dependencies into that environment by installing debian packages, e.g. python-requests is a package, which then makes requests available globally on that Python install. Debian packages using Python are carefully created/patched to work with the same version of a specific Python dependency.
TL;DR: The python package is not for serious use by the end user, but a dependency of other packages. Use a different Python install (e.g. via pyenv) for your own needs.
Well this is Ubuntu and they set it up specifically for AI development using Python, so I can't imagine any reason not to allow us to download all the packages we want. I sincerely hope I don't have to ask them every time I intend to use a new package. I'm not gonna do that shit.
But I get what you're saying
I just hope it isn't the case for us
Ubuntu is Debian with colors
so I can't imagine any reason not to allow us to download all the packages we want. I sincerely hope I don't have to ask them every time I intend to use a new package. I'm not gonna do that shit.
it is extremely bad practice to install pip packages for development into System python
because u enter the risk of breaking your OS if u will uninstall any wrong package from it / also u can't install any stuff not compatible with installed packages
best to create with venv new python envionments isolated per project
that makes better package management, as project has exactly it needs
We do have a venv for each project but what use are those venvs when you cant even create them or install the packages they require to begin with?
These venvs were created initially on Windows so they not exactly transferable through scp
Nor are venvs meant to be portable afaik anyway
yes, they aren't meant to be portable. They will break if u move its folder to different absolute path (it will work as long absolute path and OS type remains same though)
having dedicated venv for project helps to freeze dependencies meant to work for the project
The recipe is next one
Create requirements.txt, mention without version names of main packages (or specify minimum or maximum required versions if necessary)
Install necessary stuff
pip freeze > constraints.txt to freeze all EXACT versions u have installed for the project
now u git commit requirements.txt and constraints.txt to repository. those are file to replicate environment.
Any any other machine u can create and anotther venv and do pip install -r requirements.txt -c constraints.txt, and it will install exactly same packages.
If u will delete any main dependency in requirements.txt, and related dependencies will not be installed
Frozen packages is nice from the point of... project will not break when your libraries will update and your code will no longer be compatible with latest versions
All developers of the project will be able to replicate same working environment
I don't know why you're talking to me as if I haven't already done these things...
I'm not new to Python you know
lmao
Appreciate you trying to help though 🙏
😅 i don't know you, and i saw plenty of bad coded projects to not assume any present quality.
You would be surprised how many bad things people in average manage to make in projects.
Having python projects without any serious problems, that's exceptionally rare situation.
The most problems is made in projects usually by people which claim "I'm not new to Python you know"
Excuse me for skepticism, but it is how it usually is. Also it is in general bad strategy to presume anything.
I'm fairly certain that's not true and something you have concluded due to anecdotal "evidence"
it is not important to argue about.
How does Python relate to unix?
It was first written for unix and its written in C, which is the main unix programming language
Oh, so it pretty much always relates to unix. Since every OS is either unix or unix-like.
So on our server instead of storing my git credentials globally, I have decided to create an alias in ~/.bashrc that will allow me to temporarily log into git using:
alias gitasme='alias git="git -c user.name=\"myname\" -c user.email=\"my@email.com\""'
This would then allow me to commit the normal way:
git add "something"
git commit -m "something"
git push
But when I then have to push it asks me for my username and personall access token. Is there a way (similarly to the alias above) where add an alias that has inserts my username and token when pushing, pulling, and cloning?
Would using git config credential.helper store store my credentials publically or?
I may have found a solution that I will test now:
git -c credential.helper='!f() { echo "username=myusername"; echo "password=mysecretpassword"; }; f' git pull
YES they also installed gh so now I don't have to do these stupid aliases 😍
@tacit cliff SSH keys didn't work out?
Not Windows, but that's why Python on Windows can be pretty painful (at least without WSL)
The easiest way is to create a ssh key for git and use that key
Windows is painful, so why would python + windows be any different? 😇
Nah I had to use a personal access token instead
in which ways is python on windows painful?
In many different ways. You may or may not hit those depending on what exactly are you working with though. So for your particular purpose it may or may not be problematic. I'd go ahead and use WSL2 if I had to work on Windows though.
name just 3 examples
From my own experience, just off the top of my head:
- I find it much easier to set up build environment in Linux for when you want to or have to build from sources rather then use prebuilt binaries.
- I find Linux users/permissions management much more straightforward to deal with then windows one.
- Overwhelming majority of web servers are linux-based and thus most of the toolset is geared towards Linux rather then Windows.
While it's possible to overcome most or all of these challenges on Windows, most of the time it's much more time consuming and for Linux you'd get readily available recipes and stuff working out of the box much more often.
I do admit it does depend on your particular type of involvement with the language - i.e. what area you are working with - science, web, embedded stuff etc. All areas have their own special quirks. Over the years, I found Linux being much more dev-friendly though.
Also last time I worked with it - Windows paths were case insensitive, while e.g. web servers are case sensitive. Tends to be more painful then it sounds. Things may have changed since then, it was a while ago. Apparently, it can be solved to an extent now. But then again - optional case sensitivity is a source of potential pain for dev-oops teams or whoever will deal with deployment.
Thanks for the examples although the middle one seems like it doesn't really have anything to do with Python if I'm understanding you correctly, which I might not. Nevertheless thanks for explaining thoroughly. I think you're right in regards to one's field being an important factor here as I've personally mostly worked with data analysis and AI over the past couple of years where I didn't really stumble into any serious issues with Python on Windows. To be fair though, I didn't have a need to use Linux until a few months ago, so I might learn that I did do more work than necessary i.e. some things might've been easier on Linux compared to Windows.
Only time will tell. Feel free to share your experience as you go, I'd be interested to see this from the other PoV. Habits tend to make one biased. The very fact that I really don't know how to (and dont really want to learn) efficiently manage file permissions on Windows and already know how to do that to an extent on Linux makes me naturally biased towards Linux.
Bias does tend to cloud your head, I agree. I won't deny that I am a huge fan of Windows, so I am pretty biased. With that being said though, I used to daily drive Linux for 4 years and have used it on and off (just not in a work environment), so I am very much open to learning more about it. 😄
I settled with Windows for my personal stuff and gaming and Linux for work years ago. Both excel in those roles. You can do gaming on Linux and you can do web dev work on Windows, but in both cases I found experience to be not great for various reasons. If I could - I'd use Linux for both though. :)
Right tool for the job, as they say.
My main issue (and the reason I dropped Linux as a daily driver all those years ago) was that I had to constantly fix things just so that my system would keep working. Granted, I was tinkering with it and wanted to make it look better, but it annoyed the hell out of me that updates could break things so easily. Meanwhile in the 15+ years I've used Windows, I've had a total of like... 3 issues due to updates. 💀
Which is ironic because people often experience it the other way around. I don't understand.
I don't know what I did wrong with Linux or what people generally do wrong with Windows.
That was years ago, it's probably better now though
Linux that is
Yup, I can confirm that. Numerous issues with drivers, X servers randomly failing, weird quirks with sound. You name it. Modern Linux is miles ahead in terms of UX then what it was before though. It's much more user friendly then ever. Also Linux gaming thanks to Proton is in a much better state then ever before. Windows, on the other hand, became much more dev-friendly over the years. WSL2 would be a prime example. It's there for a reason. I'm pretty sure I can set up decent dev env with it and happily work on it. I'd even try that if I did not deal with sensitive data, in my case work and personal environments must be fully isolated from each other.
If I were to install Linux now for daily use, which distribution would you recommend?
Dealing with early Linux version issues and building Gentoo linux from source was all kinds of fun though. I felt like a real hacka. :D
I'm not interested in gaming, but I want it to look somewhat nice and have good support.
Haha I can imagine that being a huge task
Yeah. Didn't have what else to do with my much free time while studying in Uni... Oh well. :)
Building Gentoo from sources? You can say that, yeah. Felt like it, anyways. Especially when it (finally) worked.
Ubuntu is hands-down the most popular, has biggest community and probably best coverage docs and stackoverflow-wise. My personal favorite today is Manjaro Linux though. Love their rolling release process, didn't fail me once yet.
That was the one distro I hoped you wouldn't mention
It has the biggest support
but so help me god
Don't like it. Credits are where credits due though. ¯_(ツ)_/¯
it looks like ass
Oh wait
they updated it
This must be how it looks now? https://upload.wikimedia.org/wikipedia/commons/b/bd/Ubuntu_23.10_Mantic_Minotaur_Desktop_English.png
Yep.
Yeah that's nice
Last time I used it, it looked like this: '
🤮
I'll just do Ubuntu, I quite like the new look.
I got a spare SSD here somewhere
I'm going to upgrade my cooler this sunday
Might as well install the SSD too
It's a shame I don't have an Nvidia card
Although I recently found out I can request access to my work's server with an A100 for personal use
Good luck. :)
wdym? good luck with what?
With trying Ubuntu.
Ubuntu's pretty easy to get going with, I've used Ubuntu 18.04 and 20.04 LTS on two laptops without any serious difficulties.
My laptop's fingerprint reader isn't working, but that seems to be a linux "has lackluster drivers for fingerprint readers" wide kind of problem
huuui
Does someone wanna have a look at the install.sh script? Everything works fine besides the last part where symlinks to the home directory should be created. My bro's GPT4 & GPT3.5 are also clueless ^^
https://github.com/fschlegelone/.dotfiles/tree/main/dotfiles_home
for me it was ubuntu for a bunch of time but I discovered the beauty of fedora. And it's even available on apple silicon macs thanks to https://asahilinux.org/fedora/
Oh yeah I'm sure fedora and other distros are great, I'm just saying that Ubuntu isn't a bad choice.
At this point I've found what works for me and I can't be bothered to switch :)
A lot of stuff changed since then ^_^
i am fan of kubuntu LTS releases
familiar interface with Windows, Clock and Taskbar in expected places 😅
Easy installations of stuff via apt/deb/snap
Multiwindow terminal Konsole out of the box, by default enabled if u click anywhere
Who use Windows tiling
It probably just means that your router blocks the icmp packets needed for traceroute to work
debian, fedora, opensuse, pop os should all have u covered in that regard. they can all get gnome and kde, are stable and have decent package repositories
oh lol mb
I'll check them out. Thanks.
last time i tried fedora kde things went terribly
https://www.youtube.com/watch?v=X-D_Q6zicwI this one is 20% cooler
and pretty much more realistic in showing admin control of user over Linux / precise and full configurability
where should I find which library contains a certain head file so I can install it in Cygwin, for example, mpi.h?
Eww, people still use Cygwin in 2024? What's wrong with WSL?
Im a beginner and I dont understand, like, why I have to set ssh to use it as compilers in my CLion
nvm I dont have to, I think I was affected by this picture
but it seems CLion can automatically detect it
it worked pretty well for me for a while, but the fedora installer is horrible and fedora itself is kind of weird about their release cycle
i switched to endeavour kde instead and have had basically no problems since
I have debian for long time no issues
I think I am the only one allergic to debian.. perhaps that indicates that I should give it a forth change? 🤔😅
Driver issue? Broken apt dependencies? Those are the main Debian specific problems I had heard about.
If it's a work machine controlled by the IT department, they might not be very happy with WSL. I've used mobaXterm on work windows machines, though adding header files to that might be tricky. But it is so easy to get a linux machine on the cloud these days e.g. github codespaces
Anyone know why ssh keys don't auto load after restart?
it was auto loading before
- Come to work
- Get tasked with re-writing this shit
- Go to bathroom
- Cry
- Continue working
AAAAAAAAAAAAAAAAAAA
much like GNU, this ain't unix though, maybe belongs to another channel? If you can face it, rewrite it to use chaining, .pipe() and .assign() and the next person will thank you forever 😉
i actually don't agree with that ☝️
the current pandas code is inefficient, but obfuscating the behavior with pipe/assign doesn't change that
really all this code needs is some pandas style cleanup and better indentation / line breaks
lots of redundant astype and np.where
great example of why tests for data science code are just as important as for any other code: imagine refactoring that and having to manually check the output for correctness?!
i meant to post this in the off-topic channel and I definitely will improve it
probably not by chaining methods, but firstly by removing all the redundant shit
then I'm going to see how much of it is reusable and refactor it into a class
this script is 2k lines of this ^
welcome to The Real World 🙂
hello guys how to you resolve this issue with Github on Ubuntu?
fatal: unable to access 'https://github.coom/username/repo_name.git/': Could not resolve host: github.com
imo this is a common trap for people working with heavy data processing code
does refactoring it into a class actually reduce complexity?
is there actually repeated business logic here?
the #1 problem there is just wasteful bad pandas/numpy usage
i'd focus on that first. better/faster pandas also tends to be more readable
for example i cannot imagine a sound reason to call .astype(str) over and over
set the column once with .astype("string") (the nullable proper string array type, not boxed python str), or better yet set the dtype upon loading. then don't convert over and over
that should cut down significantly on noise already
np.where(x, y, z) should usually be replaced with y.where(x, z) or y.mask(x, z) as appropriate to avoid double-negatives
i'd strongly suggest not trying to encapsulate things until you have a handle on the basic style flaws and inefficiencies
There is lots of it. It can also be separated into 2 categories:
- normalizing
- the actual checking of data
Yes and improves readability by a lot
Re-writing the logic itself is on the "to do" list too 🙏
Thanks for this tip. Will keep it in mind. :)
The thing is the contents of this script is going to be integrated into an existing program that handles uploading to/downloading from a DB and communicates with the MS Power Platform, so it is already supposed to be part of a set of classes. I forgot to mention that. Otherwise I do agree that encapsulating small scripts unnecessarily complicates code without any real benefit.
See if you have been added as a contributor to the repo if it is private and not yours, otherwise check that you have the right git link.
Also check firewall if you have set that.
I am using the -p option for shell's read command to print the string before asking for input, but how do get the value entered afterwards? I used to do:
echo "Enter path: "
read src_path
Now I do:
read -p "Enter path: "
But I don't know how to access the value given. These don't work:
source=read -p "Enter path: "
$source=read -p "Enter path: "
read -p source "Enter path: "
Nevermind, you have to put the variable name after so:
read -p "Enter path: " src_path
yep, the default variable name if not provided is $REPLY
and just an extra tip here, docs are useful when exploring commands. if you take a look at either help read or read --help you'll see a synopsis that looks like this:
read [-p prompt] [...other options] [name ...]
it essentially tells you that it accepts optional "key-value" options (like -p) before the list of arguments "name" which would be the variable names that user input would be read to.
normally options and flags go before arguments especially when the command accepts an arbitrary number of arguments like read does.
Ah I see
Any idea why this isn't working? It says "No such file or directory".
As far as I can see the only difference between my code and this code is that their regex has no quotes. I tried without quotes though.
there are several things to unpack here.
In bash, when we want to make use of the value stored in the variable, we have to use the dollar sign $, unlike common programming languages -- so you need $regex (currently it is comparing $link with the literal word regex)
secondly, the if "statement" actually checks a command rather than a boolean expression in languages like python. so we need if <command>; then ....
here, "[[" is the command. and what does that mean? we must always use a space to separate a command from its arguments
so here, whitespace matters, we need a space in if [[ $link ...
lol that syntax highlighting is doing you a little dirty
yeah, it's quite misleading there
I'm not confident that bash allows parameter expansion on the RHS of =~
I tried a little toy example, seemed to work... although, shouldnt the expansion always happen before anything that [[ does?
[[ is a special built-in, so anything goes
maybe that was a zsh problem then? i can't remember, so many special cases
honestly the reason it's not working is that it's written in shell 🤣
Ohhhhh okay i see
It is messed up dude idk why it is so randomly colorful (you should see the rest, the pic doesnt do it justice)
I kinda like shell so far even though I still haven't gotten used to nano.
I keep pressing the wrong shortcuts and I just... I hate that you can't simply Copy + C/Copy + V
It annoys me greatly
well there are plenty of other editors. vim is one obvious choice.
maybe. In bash, I've confirmed that using a variable for the regex operand for =~ works as expected.
Does vim have "normal" shortcuts tho?
@forest furnace So I applied the fix (you were right, I had to add a space) but the regex seems to not work though.
Is there anything in it that I can't use in bash? It works in powershell.
function check_link() {
local link=$1
local regex="(?:git@|https://www.)github.com[:/](.*)/(.*).git"
if [[ $link =~ $regex ]]; then
echo ${BASH_REMATCH[0]}
else
echo "No match."
exit
fi
}
@unkempt hamlet ssh-add -l
It just say "The agent has no identities."
Did you not add through ssh-add?
how did you add your ssh keys
or are you asking how to add them
I used ssh-add command to add them
I've already done that
It was even auto loading them after I login
Try an uppercase L instead of lowercase
So ssh-add -L
see if it makes a difference
If not then I don't know. This command is what I use to display ssh keys ^
same output
That's odd
isn't there one to load them
not list
What do you mean by load though?
You usually use ssh keys to identify yourself at login and you said it already did that
when it is loaded it doesnt ask for passphrase
are you using these keys in relation to github? if so then try pulling/pushing/committing
it will ask you for your passphrase then
in which context are you using these keys? to log into a server? git?
some for server some for github
I haven't used them in a while
yea it ask for passphrase
If it's for GitHub then it will ask you to identify once you start actually trying to use Git.
If it's for logging into a server then it will ask you for the passphrase once you actually try to log into the server.
It only asks for the passphrase when you're doing the "thing" that you're doing, so you don't have to "load" them before e.g. logging into a server
oh ok
I swear there was a way to load them so i don't have to tpye password
You can initialize an ssh agent
and store your ssh keys into that
which should save it so you can "load" them later
@unkempt hamlet
wait
So if you add your key to an ssh-agent then you should be able to log in more easily
Maybe because i don't have this line in my config
I believe this is specific to github and not something you always need although i'm not sure
doesn't hurt to add it to the config
tried it
didn't do anything
wait
i think i found it
it is ssh-add --apple-load-keychain
i didn't know macos ssh is diff
anyways i added that to the zshrc file
now it auto load them
Anyone have any ideas? The regex works online (if I escape the forward slashes) and in PowerShell (without escaping the forward slashes). I have tried both.
Look at the tests
What is it about shell that makes my regex invalid?
bash uses ERE, not PCRE. So you need to check it's a valid regex according to that standard
My guess is it's the non-capturing group that's not supported
I'll try without. I also found out that it expect you to include the unquoted regex otherwise it simply does a string check
So far I have:
function check_link() {
local link=$1
local regex=(?:git@|https:\/\/www.)github.com[:/](.*)\/(.*).git/
if [[ $link =~ $regex ]]; then return 0; else return 1; fi
}
result=$(check_link "https://www.github.com/Test/Repo.git/")
echo $?
I'll try testing without the non-capturing group 2 sec
main.sh: line 3: syntax error near unexpected token `('
main.sh: line 3: ` local regex=https:\/\/www.github.com[:/](.*)\/(.*).git/'
Probably something else ERE doesn't support that PCRE does.
It's POSIX ERE I should be focusing on, right?
it expect you to include the unquoted regex otherwise it simply does a string check
that is only if you use the regex literally after the =~ rather than using the variable here.
this is fine:
regex="some regex"
if [[ string =~ $regex ]]; #...
this is NOT (it matches literal instead)
if [[ string =~ "some regex" ]]; #...
if you want to assign the regex expression into a variable, quotes are required, because there are special characters in the regex
this does not work:
regex=some regex
because it assigns some to var regex then tries to run command regex
the issue here is probably due to the regex format like leviathan said
Ahhh okay I see
How annoying that there even are different standards and not a universal one
This works:
function check_link() {
local link=$1
local regex="https:\/\/www.github.com[:/](.*)\/(.*).git/"
if [[ $link =~ $regex ]]; then return 0; else return 1; fi
}
result=$(check_link "https://www.github.com/test/test.git/")
echo $?
But doesn't support git@... type links
It's fine though, this will definitely do
@forest furnace 2 questions, if you don't mind:
-
Do you have any suggestions for a better way of confirming whether a link is a valid repository? Someone suggested using
git ls-remote <link>and claimed it would return a 0 or 1, but it returns a bunch of text instead. -
Is it
bashor is itshell? I'm confused. Some call it bash, but I was under the impression thatbashis the terminal, whileshellis the scripting language.
git ls-remote returns this if valid:
and remote: Repository not found. if not valid
Would it be a waste of time to try and parse this somehow? Is it too janky?
As in maybe I could check whether the string contains "remote: Repository not found" and if it doesn't it's valid
Because this would work with git@... and https type repository links
Nevermind, doesn't seem to work with git@.... Whatever.
Is it bash or is it shell? I'm confused. Some call it bash, but I was under the impression that bash is the terminal, while shell is the scripting language.
"Terminal (emulator)" generally refers to the GUI program that you interact with on a higher level, it receives your keypresses and sends it to the shell. It then displays the shell output for you to read. You can configure keyboard shortcuts here (depending on your terminal, you can set ctrl-c/v to enable copy/paste if you wnat to, for example (would not recommend it though, since ctrl-c is for interrupting a process)).
The terminal is also the thing that showed the green text. You can configure themes etc here as well.
There are two "shells" we can refer to:
- The general term "shell" is a program you interact with through the terminal. It's a general term because there are many projects that are "shells". It's like there are many projects such as emacs/vscode that are "editors". Bash is a shell, fish, zsh, are also shells. Shells support scripting (they can run "scripts" as if each line in your script is typed out manually on the prompt.)
- There is another "shell", called the bourne shell, it has a stricter syntax than bash for scripting in, and the default prompt and "UI" is also less fancy (by default) than shells like bash (on many linux distros, by default). You launch the bourne shell using
sh, and you launch bash usingbash.
For scripting, bash is fully compatible with sh but provides more features, such as the [[ built-in you use. (sh supports only [)
Whether you're using bash or the bourne shell depends on the shebang in your script (the first line that looks like #!/path/to/some/executable). if you use the path to sh there, then your script will be run by sh, and so on.
it can be a little overwhelming at first, all those terms that might be used interchangeably when other people talk about them
It sure is! It's the interchangeability (not sure if that's even a word) that muddles/masks the actual meaning of the terms
Also the fact that the bourne shell is referred to as "shell" doesn't help 😂
why not call it bsh 🤔
probably historical reasons
just like why you can't ctrl-c/ctrl-v for copy paste
back then editors like vim/emacs they invented their own terms for copy/paste, such as kill/yank/barf
(as far as I know)
(and to make matters worse, in vim when you "yank" it's similar to "copy" but in emacs "yank" is similar to "paste")
Seemed too good to be true
Sorry about the spam, but if you don't mind answering one last question
Apparently you can only return integers between 0 and 255
How can I use a string? I have this:
function extract_name() {
local link=$1
if [[ $link =~ $GIT_REGEX ]]; then echo "${BASH_REMATCH[2]}"; fi
}
It's supposed to extract the repository name from a link
How can I return the name and use it?
Since i ended up using the regex in 2 places, I turned it into a constant:
readonly GIT_REGEX="..."
Hence the variable you see above
lol turns out it's snarf, which does something similar to yank in vim, I believe
http://acme.cat-v.org/
it's from Acme
You're just making up words now /s
these words do sound made up, i thought you were making a joke when you tried to help me copy the contents of a file and you said i should "yank" the content out of the file using vim
only time i've ever heard "yank" before is in 90s shows when you "yank" someone's chain
you can print the something, then outside the function store the result in a variable
result=$(extract_name)
Ahhhhh so that's how
with the $(...) syntax you can run any command, as well as functions
cool cool
Lol
Any opinions/suggestions? https://paste.pythondiscord.com/3WWQ
It's not done yet as I need to add 1 last thing, which is support for lists. Its purpose is pretty simple, it should either install a single repository or a list of repositories given a file (only for python projects btw). I thought it'd be a good way to learn bash given the program's simplicity.
Oh just realized I included some debug prints in there 👀 ignore them
Hmm should probably use [[ .. ]] everywhere rather than [ .. ]
I should probably just keep the function install_repo() simple and move the logic of installing from a list outside the function
it looks like there are some typos, I take it you haven't tested the script? for example, echo -e "something" exit 1 would print exit and 1 literally
and for read, don't use a dollar for the variable name
i haven't tested it yet no
Updated: https://paste.pythondiscord.com/GWEQ
The function looks better when the list logic, which I'm about to add, is moved outside the function
Just gotta figure out how to loop and retrieve links from file
well that was easy:
while IFS="" read -r p || [ -n "$p" ]
do
printf '%s\n' "$p"
done < peptides.txt
gonna apply it to my script and test
Ok this should be it: https://paste.pythondiscord.com/4THA
What's up with this?
# Tjek om kildemappen findes.
if ! [[ -d $src ]]; then
echo -e "\e[${LIGHT_RED}[ERROR]\e[0m - Source folder not found."
read -p "Create the folder? (y/n): " answer
if [[ $answer = "y" ]]; then mkdir $src; else exit 1; fi
fi
Aren't I checking if $src doesn't exist (which it does in this case but still fails)?
Ok it fails because ~ doesn't work the same way in the program as it does outside
it's treated as a literal ~
rather than a short form of /home/dea
are you mixing up test_src with src_test?
If this is the Pandas code factor, maybe let's move to #data-science-and-ml
i'm happy to review it for you later today though
I appreciate it and I would love to have a look at the pandas code tomorrow (although I don't think it can be simplified more than it already has - confusedreptile helped me)
The link is for the bash script i made
I thought that too but it's because the input doesn't expand ~ to /home/user, it treats it as a literal string. Writing the full path works
Ah good then. I can look at that too if you want another set of eyes on it
I would love it - thank you. 🙏
Hello, I am getting below error when I run make qemu cmd in xv6 kernel folder. I searched for the error online but my issue didn't get resolved. Can anyone tell how to proceed and run the xv6 kernel? I was writing my own application program. Thanks in advance!!
Hey there everyone. I'm trying to build a barcode scanner on my macOS device for my college project using OpenCV and pyzbar library. When using pyzbar i needs the zbar library too which has to be installed using the command brew install zbar. But ever after installing the zbar library and setting up all the configurations the code doesn't run. I keeps on giving me the error ImportError: Unable to find zbar shared library.
And I also tried a alternative code in which i used opencv-contrib-python library. this code runs without any error but it doen't decode the barcode with correct output. It throws different decoded data in every run.
Please someone provide me the code for a barcode scanner which can be run on macOS device 🙏🏼. I've used ChatGPT, Claude, Bard, all the AI platforms still having errors. I'm providing images of both the codes. Please help me.
Seems like an LD_LIBRARY_PATH issue
Is anyone here familiar with syzkaller configuration? I have it running, but I'm having problems with understanding some of the error messages, and like where to go with diagnosing and fixing them
The following is particularly confusing to me:
2024/02/08 15:28:00 vm-1: crash: SYZFATAL: executor NUM failed NUM times: executor NUM: exit status NUM err exit status NUM
Anyone here have experience on GPG? I want to import a key from GPG 2.4.4 to GPG 2.2.27 but it got "gpg: packet(2) unknown version 5". Can anyone explain what this means?
it probably means you can't do what you want 😐
can you run 2.4.4 again and maybe re-export the key, this time using some option that tells it to be compatible with older versions?
I tried compliance options but no luck
Btw, I'm dealing with the secret key so that might be relevant.
🤷
tbh my experience with gpg is "I hate it and hope I never have to use it again"
Still it is a nice to have, and not much alternatives when comes to emails. I know it is subpar but that is still a major way to communicate
meh. I guess I don't have whatever problem it was intended to solve.
Just to add, not even the public key import work. LOL.
I had a read on the changelog but saw nothing breaking. God knows why
Guess the mailing list is the way to go
NVM. I found the problem. It is because a certify signature used version 5 which earlier version of GPG doesn't recognize
I removed some file accidentally and now my Ubuntu is not booting up, I have timeshift but can't access the shell to recover from snapshot? Can I recover from USB boot?
based on some threads i've just googled like this one, timeshift even has a special mode just for that. if I understand correctly, all you need is launch timeshift from a live usb and point it to the right location, and then you can restore to a snapshot.
EDIT: the github readme mentions it too: https://github.com/linuxmint/timeshift?tab=readme-ov-file#system-restore
i went to look at your pastes for the bash code but it's 404 so i assume it expired. just fyi i didn't forget 😆 no need to repost though unless you're still looking for feedback
so im using tilda terminal emulator and wanting to switch the shell it is using to fish, unlike Guake there doesn't seem to be an option in its preferences settings. anyone know how to do it?
if timeshift fails, yes usb boot should just about always work. it might not be easy to fix the damaged part of the system, but as long as your actual storage drives are in good condition, you should be able to mount the filesystem with the damaged installation and start debugging/fixing
i'm not familiar with tilda, but it's possible that it just uses your default login shell. that's normally controlled by chsh on mac and linux. see https://linux.die.net/man/1/chsh
aaah ok hen
that said @gilded cove , i see right here that there is an option to change the command that runs https://github.com/lanoxx/tilda
is that the same tilda that you're using?
go to the "Title and Command" section in the readme, it shows an option to run a custom command
you'd set that to /usr/bin/fish or wherever fish is located on your system
OH that does the trick?
TIL
ok lemme try
i don't know for sure, but it seems likely
I am! Although might first be tomorrow that ill get some time to work on it, ill hit you up
guys how do i remove the newline from starship prompt default
Any advice for beginners?
i did add add_newline = false but it's stll adding newlines
i'll dig more into it
The whole thing with newlines in Starship is actually why I stopped using it
I just use Powerlevel10k
is there just no way of disabling it?
that can't be right though
There should be but I thought it looked kinda dumb disabling it
huh
i guess i just gotta look at these presets that don't have new lines
As a beginner which is better, Kali or Ubuntu Linux
If you have to ask then you more than likely shouldn't be using Kali
i am fan of Kubuntu. it is Ubuntu with nearly windows like interface (KDE plasma interface)
easy to use, same unbuntu stuff, a lot of guides and support
LTS versions should be installed for stability (20.04 / 22.04)
Advice about what?
having issues with updating linux
https://pastecord.com/uragaxaxak
It says the default setting is auto. What's the question?
I wanna look up default settings for other options
I would say ubuntu for a beginner. But then again i don't think that any answers to questions like that here are truly objective;)
In the docs... isn't that where you found that one?
Aren't most (all?) of the docs in the manpages?
so i spent several hours figuring why my http python server not running as service; if you use systemd, and import a script from another script to get the variables, make sure also include WorkingDirectory, not just running the ExecStart. WorkingDirectory seem to help me reference other files needed to run my app and when I restarted the service output success
heck even just single file i gonna use that parameter for everything
yes, this is important if you don't reference every single file you use with an absolute path
That just seems list all the options
It doesnt show the default setting
hi
the problem is described further down in the answer: git config itself does not know the defaults. an unset config is returned to the calling function (inside Git) as unset, and the caller figures out what to do with that.
is that good design? hell no. are we stuck with it? possibly.
Linux: Why might umount fail with “device is busy” even if lsof +f -- /path shows nothing?
I'm trying to use the Arch Linux image building repository (https://gitlab.archlinux.org/archlinux/arch-boxes) to build custom cloud images, but I get this failure which terminates the build.
I can resolve it with umount --lazy, but I'm not sure why this might be happening.
Arch-boxes provides automated builds of the Arch Linux releases for different providers and post-processors https://app.vagrantup.com/archlinux/boxes/archlinux
Oh man this sounds like an interview question 🙂
are you absolutely certain that /path is the right path? 'Cuz I'd have expected that to work, too
open file handle in some process?
oh wow I didn't note the timestamp. I'm an idiot. My bad.
I don't wanna accidentally use system python with python3 command
Is it possible to remove or disable that command without touching any file?
Not beyond an alias, but that might break things
but luckily you can't break much without pip
You can have your editor or terminal auto source environments
My muscle memory is used create venv with python3 so they often get created with outdated python version
Prob good to not disable it cuz it prob break something
It is there for compatibility reason anyways
Install something like pyenv
Too much commands to remember
just gonna use python3.11 -m venv .vevn
What do you mean? You just install it and use Python as normal
Particularly useful when testing multiple Python versions in, say, tox.
pyenv is a tool that installs python into isolated directories and helps you set up your shell so that python points to the particular python installation that you want to use
you run pyenv install <version> and it installs that exact version to some location like ~/.pyenv/versions/<version>
from there, it has functionality to hook into your shell's PATH (and a few other things) so you can then set pyenv shell <version> and then python --version should show the version you want
Was it me you meant to reply to? \🤔 I already knew this
i thought you were confused about pyenv, but i was confused about who was confused
@unkempt hamlet ☝️ in case you're interested (and i suggest being interested if you want to solve the problem you posted about)
Completely certain, since the build.sh script uses a loopback (losetup) mount for its work.
It mounts the image, does some arch-chroot → pacstrap → systemctl setup stuff inside, then umount at the end.
Furthermore, the image and mount point is created within each invocation of build.sh as a mktemp temporary location, so it should not be possible that a prior invocation of the build script is interfering.
Basically…
readonly mountpoint="$(mktemp --tmpdir=/tmp)"
() { # init
truncate -s ... img
sgdisk ... img
losetup loopN img
mkfs.btrfs /dev/loopN
mount /dev/loopN "${mountpoint}"
}
() { # image setup
pacstrap ...
arch-chroot ... # more setup stuff
}
() { # cleanup
umount --recursive "${mountpoint}" # fails ???
losetup -d loopN
}
And if you lsof +f -- "${mountpoint}"… nothing.
I basically don't know how to debug umount on an uncoöperative mount point other than lsof +f -- ….
Not sure how it solve my problem
Also I don't like how it uses python. python should be only available inside a venv
if you want a specific version of python in a venv you first must have that version of python outside the venv to be able to create the venv with that version inside it, that's just how python virtual environments work
pyenv is a solution to the problem of having multiple python versions installed at the same time
you also don't need to "activate" the python env. you can just use it as an installer if you want. or use its underlying python-build script
I have a question regarding this (I have never tried). What if I use a python container to generate a venv with a specific version? It works just fine?
yeah, you can download a python container and run your code in the container, then i think a venv is mostly unnecessary
yeah I know, but not exactly my question
Venv is absolute path depended
It will work as long as absolute path between filesystems did not change
/your_path should remain the same for Venv created in one place and moved to other one
I just install multiple python venvs to do that though
python3.11 -m venv .venv3.11
With specifying python version I create different python version venvs
insert more pyenv upselling
I don't like it for messing with my shell to operate ^_^
Venv is better
... how do you think venv sourcing works, if I may ask
anyone have any experience in linking mariadb to an openvpn server to do its authentication?
Not sure I follow... Are you saying that instead of normal authentication you want to have your DB on a private network that requires incoming connections to use openvpn?
my guess is that it's the other way around, having mariadb as the user database for the openvpn server, but i could be wrong and your interpretation is just as valid, the question was pretty ambiguous
probably something along the lines of https://openvpn.net/vpn-server-resources/configuration-database-management-and-backups/#change-database-backend-to-mysql-or-amazon-rds
care to clarify which of the two you mean, or maybe we both got it wrong?
Anyone happen to know where I can view the output of a python program ran with systemctl on ubuntu?
[Unit]
Description=Survey Wolf Discord Bot
[Service]
ExecStart=/home/statwolfbot/discord_bot/bin bot/main.py
Restart=no
bot crashed, and I want to know why
and any suggestions on how to more easily see output
I'd guess it's in a log that you can view with journalctl
systemctl status unit_name
I assume you have a bad ExecStart though
you have a space and I get the feeling bin isn't an executable
so you probably need quotes
the bot seems to run. sooooo. I did think that it is weird that I dont have /bin/python3.10 or somthing though
you probably have a shebang
sorry, I am unfamiliar with that.
#!/usr/bin/env python3
print("Hello") # making sure it's known that this is a Python file o_O
``` or something like that
I guess, if it works it works 😅
Indeed \🤔
this worked thanks, had to sift through to find it
turns out journalctl is pretty powerful, but not super-obvious at first
bit of a learning curve
you can tell it which unit you care about, and also the timespan, if you happen to know it. That automates a lot of the sifting.
I've always just used systemctl status
https://www.amazon.com/Docker-Deep-Dive-Nigel-Poulton/dp/1916585256
i will run suggestion with learning docker in a structured way with Docker Deep Dive
and already building docker image of your application and using it for running.
U will kill a flock of birds with one stone in this situation
- having documented deployment procedure for bot
- optionally having saved frozen version for easier rollback back or redeployment later
- having uniform way to request its logs
docker logs container_name/id(there is optiona to tail in a real time logs) - having uniform way to launch programms into background (with docker) and requesting what is running with
docker ps
modern web deployment ecosystem is all built around docker, with giving easy attaching any other upgrades to it
it is uniform standard that allows deploying app to a lot of modern deployment systems
and it is just nice to use for simple your own app deployment or even in dev env (docker-compose is very useful there)
with docker you will not need to learn how to use systemctl or any other scheduling system. all modern enough people go for containers
it is a bit having not few small steps learning curve... but once u get it, u will tap into ecosystem of already a lot of made solutions
https://hub.docker.com/_/postgres
raising postgres database of specific version, or mysql, mongo, redis and etc or even wordpress stack
everything will become a matter of few minutes of fuguring out environment options and running a single command
Thing that could have taken day/days to setup for you will become a matter of minute
it opens a lot of doors, as a standard way to deploy apps and skipping all the other headaches tied to this
😅 my Discord bot runs in it as well. I don't even see myself today running web related apps not in Docker. it would have to be some very... strong reason to do that
I'd like to port my little URL shortener to docker, but getting nginx and some sort of letsencrypt thing going seems daunting 😕
I dont think that shows errors
I have used docker for another small project, i kinda limped my way through setting it up but I will definetly take a look. My only concern is I am currently using a cheap VPS not sure if docker requires a higher (then the VPS) end machine
don't think it requires anything other than a Linux kernel -- the the "docker" command
using nginx with docker is simpler than without it 😅
I gave up tbh trying to figure out manual manipulations with nginx and just enjoyed where u inject config into dockerized nginx and it just works
https://phoenixnap.com/kb/letsencrypt-docker
instructions are rather simple how to launch nginx+letencrypt together
u need to make sure though i think to have public access for your server i think. not sure if i remember it correctly, but i think letsencrypt makes validation of domain by running quering to server
i prefer not bothering with letsencrypt though...
just using nginx with self signed certs (i can share recipe for this)
and leting cloudflare replacing certs to valid ones 😅 more lazy solution
Thanks for that, I never saw it
I don't use cloudflare.
are there compatibility issues for python on different operating systems?
stupid question prob
yeah nah
I don't need something like pyenv cuz i prob only use python 3.11
- got used to typing python3.11
that doesn't mean it's without merit
if you're on anything *NIX with a system-installed version of Python, pyenv is almost a must at this point
im on macos
prob pyenv won't be useful
macOS is *NIX and does indeed come with a system-installed version of Python but I dunno if you can even access it easily by default
system-installed python is deprecated afaik
it is there for compatibility reasons with old software
i use python installed with homebrew
i think homebrew kinda work similar to pyenv
i can install diff version using @
like brew install python@3.11 or python@3.10
Im trying to get tensorboard profile to work, but it says that libcupti is not installed.
To fix the error below, I ran :
export LD_LIBRARY_PATH=/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH.
But even after that, the same error pops up. What would be a solution to this error?
I tried to check for libcupti with the below command, but it wasnt quite successful.
/sbin/ldconfig -N -v $(sed 's/:/ /g' <<< $LD_LIBRARY_PATH) | grep libcupti
/sbin/ldconfig.real: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
(from /etc/ld.so.conf.d/x86_64-linux-gnu.conf:4 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
(from <builtin>:0 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
(from <builtin>:0 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/usr/lib' given more than once
(from <builtin>:0 and <builtin>:0)
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 is the dynamic linker, ignoring
Can anyone point me where I should go to fix this problem?
so have you installed libcupti?
yes
it looks like you have corrupted cache
it comes with cuda toolkit if i know correctly?
How can I resolve that corruption?
you can check it
backing-up libc-bin and try to reinstall it may be a way to go
yeah im searching up the commands to do that sry
yeah i aint sure how to back up libc-bin, what is the command?
yeah weird thing is when i type ls ~ i only get: cuda_12.3.2_545.23.08_linux.run gcc tensorflow_datasets
- im running this on wsl2, so that may be causing some issues ig?
~ is you home directory, packages are stored in different folders
redhat-based or debian-based
i dont use wsl2 but google says wsl -l -v in powershell
Ubuntu
is the name of the distro
Linux LAPTOP-G2HCASDK 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
rowhan@LAPTOP-G2HCASDK:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
rowhan@LAPTOP-G2HCASDK:~$ cat /etc/issue
Ubuntu 22.04.3 LTS \n \l
try dpkg-query -L libc-bin
i think it is debian
- shouldnt have copied that all in
/usr/sbin/zic
/usr/share
/usr/share/doc
/usr/share/doc/libc-bin
/usr/share/doc/libc-bin/copyright
/usr/share/libc-bin
/usr/share/libc-bin/nsswitch.conf
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libc-bin
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/getconf.1.gz
/usr/share/man/man1/tzselect.1.gz
/usr/share/doc/libc-bin/changelog.Debian.gz
yes it is
so now i have to move libc-bin to tmp
ls -l /var/lib/dpkg/info/libc-bin.*
here is the output:
-rw-r--r-- 1 root root 86 Jan 2 22:22 /var/lib/dpkg/info/libc-bin.conffiles
-rw-r--r-- 1 root root 1238 Feb 26 11:52 /var/lib/dpkg/info/libc-bin.list
-rw-r--r-- 1 root root 1806 Jan 2 22:22 /var/lib/dpkg/info/libc-bin.md5sums
-rwxr-xr-x 1 root root 1273 Jan 2 22:22 /var/lib/dpkg/info/libc-bin.postinst
-rw-r--r-- 1 root root 440 Jan 2 22:22 /var/lib/dpkg/info/libc-bin.triggers
im trying to follow this: https://stackoverflow.com/questions/65933271/could-not-load-dynamic-library-libcupti-so-11-0-dlerror-libcupti-so-11-0-ca
does this seem fine?
not exactly your case
i thought changing the versions would work but ok
if you dont have backup for your environment you can copy below files to tmp
/usr/sbin/zic
/usr/share/doc/libc-bin
/usr/share/libc-bin
/usr/share/lintian/overrides/libc-bin
/var/lib/dpkg/info/libc-bin.*
your case looks more like https://askubuntu.com/questions/804997/dpkg-error-processing-package-libc-bin-configure
ok i will try the link after backing up
or you can just create a snapshot so you can rollback whatever bad happens
true
will this do it: dd /mnt/my_mounted_backup_drive/backup-sda1.gz bs=32M | gzip --decompress | dd bs=64M of=/dev/sda1 ?
although that'd require a usb so that out
rsync -aAXv --exclude={"/dev/","/proc/","/sys/","/tmp/","/run/","/mnt/","/media/","/lost+found"} / /tmp
ah god i will have to come back after 30 min on this
i will try asking again if i get stuck
Thx for the help
cheers
been a while but, i went your way and few other, but not much success. what other ways would be there to get tensorboard profiler to recognize libcupti? thx for the help
Mac is mid
based