#unix

1 messages · Page 10 of 1

unkempt edge
#

and then what to type after that $ sign

#

means what command should I type

primal sierra
#

well, the commands I shared to check the system logs

primal sierra
#

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

unkempt edge
#

okay thanks

#

I will also click photo and post here

primal sierra
#

(I've pretty much given up on fixing my wifi issues, it seems to be persistent)

unkempt edge
#

by tagging u

primal sierra
#

internal realtek

unkempt edge
#

but eventually wifi adapter is not giving me that problem

primal sierra
#

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

unkempt edge
#

Ubuntu is very good and fast compared to windows

unkempt edge
unkempt edge
primal sierra
#

computers are pain

fickle granite
#

"life is pain"

primal sierra
# unkempt edge do u know how can I fix front panel headphone issue

Honestly, you'll have to search the internet for answers. My general advice is to:

  1. Check the relevant logs if possible, they may give you error messages you can then throw into google
  2. Identify the linux kernal driver and device name that's causing you trouble and also throw them into google
  3. Update your kernel/system to the latest available
unkempt edge
#

sudo apt update??

primal sierra
#

that and sudo apt upgrade

unkempt edge
#

oh yeah

#

i did that

#

already

primal sierra
#

sudo apt update only updates the package lists available to install (it's like asking apt to fetch a new listing of the yellowbook)

primal sierra
# unkempt edge i did that

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

unkempt edge
#

I gues

#

guessss

primal sierra
#

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

unkempt edge
#

!!

#

can I do ls /var/crash

primal sierra
#

sure why not

unkempt edge
#

to check logs

primal sierra
#

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?

unkempt edge
#

but I didn't check that back panel sry

#

but in windows also I got that issues
front was not working back was working

unkempt edge
unkempt edge
#

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
primal sierra
#

sorry, a little busy at the moment

unkempt edge
#

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

#

!

primal sierra
#

uhm, why did you delete the crash logs?

unkempt edge
primal sierra
#

the logs are meant to help you figure out what went wrong

#

they aren't an error themselves, they're the byproduct of one

unkempt edge
#

this is answer I guess

unkempt edge
#

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!

elfin hearth
#

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?

elfin hearth
#

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

elfin hearth
#

Does anyone know?

gilded cove
#

so i just want to try KDE desktop environment, and it has the full, standard, plasma desktop

which one to go with

ember quiver
indigo anchor
#

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.

paper ibex
#

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)

real vapor
paper ibex
#

In that case i would alter IFS, i.e

IFS="
"

indigo anchor
#

@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?

vagrant fern
#

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

paper ibex
#

Exactly. When you use 'sh' it will start a new shell (bourne shell), which will not have the alias you created in tcsh

fallow tusk
#

-exec "echo running {} with sub-gaussian" -exec sub-gaussian {} should do that, too, no? (without the need for sub-shelling)

#

Needs \;s

indigo anchor
#

Oh

#

Damn, I generally use SH but this time was given console with TCSH ._.

fallow tusk
#

I don't think the shell language is the issue here, looking at Volcyy's fix

indigo anchor
#

Okey. find . -name "*.gjf" -exec sh -c 'echo "Running {} with sub-gaussian" && /lu/home/pharmd/gaussian.ssub {}' \; should work then?

vagrant fern
#

I'm not sure find will know about the alias then either though, should it?

indigo anchor
#

Ogh lets see

vagrant fern
fallow tusk
#

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

vagrant fern
#

aliased to makes me think it was specified with alias, which is a shell-local thing

fallow tusk
#

Oh, right…

indigo anchor
#

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.

fallow tusk
#

👍 (even if I didn't really contribute anything much!)

paper ibex
#

Whatever floats your goat 🙂

#

Glad it works now

real vapor
#

accessible from anywhere, unlike aliases

paper ibex
#

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

trail sapphire
# indigo anchor I made this in the following way: ``` find . -type f -name "*.gjf" -execdir 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)

tulip dock
#

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?

prime magnet
#

NFS or something simliar?

tulip dock
#

Could probably make my own mess of cron jobs and SFTP but I would rather not

modern fog
#

need help with wsl, i want to make it so that everytime i open wsl2 ubuntu in terminal, it cds to a specific folder

fallow tusk
#

You could add that to .bashrc or .bash_profile (I forget which executes for what login scenario, but they often are interlinked)

fallow tusk
#

.bashrc and .bash_profile are files that sit in your home directory (~). Just put the cd command at the end of one of them

modern fog
#

tysm!

formal schooner
#

@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

modern fog
tacit wolf
#

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

fickle granite
#

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

tacit wolf
#

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

fickle granite
#

in theory, you can debug a crash by using gdb. In practice, it's a pain

paper ibex
#

Might also get different libraries etc when you run it with subprocess

gilded cove
#

so im using starship shell prompt, and why is this accessing via node.js nvm

gilded cove
#

what was the reason mv have double function, both moving and renaming

spark mulch
paper ibex
#

And neither of the operations changes the actual inode, unless of course you move it across filesystems

indigo anchor
#

rsync -av --include='*.log' --exclude='biomolecules' --exclude='chelation' <remote> <local>
Why rsync download also other files instead of just .log?

paper ibex
#

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?

formal schooner
umbral folio
#

hi is anyone good at bash scripting? i have some doubts to clear

paper ibex
#

Try us 🙂

formal schooner
paper ibex
#

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? 😂

fallow tusk
#

I recall not getting on with tcsh, but yeah, same - can't recall the details

silk herald
#

well to me it makes sense to ask to ask, metaness is ok

formal schooner
silk herald
#

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

fallow tusk
#

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

silk herald
#

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

ember quiver
#

Why not just do the whole thing with Python and/or a more appropriate folder structure?

tender plinth
#

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

fallow tusk
#

pathlib.Path(__file__).parent is the usual incantation for getting the current file's directory

paper ibex
#

basename ?

#

Or in this case perhaps dirname

paper ibex
tender plinth
paper ibex
#

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

tender plinth
paper ibex
#

If you will do it often you could create some kind of index with the symbols per .a file..?

tender plinth
stable tusk
#

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```
ember quiver
spark mulch
#

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)

quaint tulip
quaint tulip
#

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...

paper ibex
#

Wonder what NextStep used, can't remember

quaint tulip
#

I had to use c shell in a job around 2010 but it was already way out of fashion

fallow tusk
#

csh was out of fashion even a decade before that! (although still hanging around, as I recall)

rotund girder
#

What's the momentum on oil shell? And what's the common/elite opinion on zsh/bash?

torpid cipher
#

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

fickle granite
#

I switched from bash to zsh maybe two years ago, because Apple nudged me that way. I don't regret it.

queen void
#

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?

fallow tusk
queen void
fallow tusk
#

The atlassian documentation is probably as good, if not better. They explain most things with pictures of the trees, too…

#

I think the answer to the question is "yes", but I can't recall without having a repository in front of me

queen void
#

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!

rotund girder
#

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.

spark mulch
stable tusk
#

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

rustic cloud
#

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.

fickle granite
#

uh oh

still brook
rustic cloud
#

No

#

I restart my pc and it is working normal now

still brook
#

that's weird

rustic cloud
#

But working slowly

fickle granite
#

is this disk "external" by any chance?

#

like a USB drive or something?

#

in any case: back your important stuff up now

rustic cloud
fickle granite
#

back up now

#

it might be fine ... or it might die in 10 minutes.

rustic cloud
fickle granite
#

no idea what you're talking about, sorry

#

are you backing up your data? If not you should be

#

I will stop nagging now

rustic cloud
still brook
#

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.

rustic cloud
#

After restarting it is still working well but like laggy

still brook
#

I'd suggest attempting to run fsck -f and fix any errors in the filesystem from live install media

rustic cloud
fickle granite
#

I'd suggest BACKING UP NOW and running fsck only if the backup fails

fickle granite
rustic cloud
#

It seems something is serious

still brook
#

sooo

rustic cloud
still brook
gilded cove
#

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?

fallow tusk
#

Usually there are hooks to handle that, although manually built drivers might bypass that mechanism. (iirc, and my memory is sketchy ;) )

fickle granite
#

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.

rotund girder
rotund girder
gilded cove
torpid cipher
#

I didn't even know about contrib, fun times

rotund girder
tacit cliff
#

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?

fallow tusk
#

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...

cunning nexus
fallow tusk
#

Oh, of course, any version of grep, but then you have to process the output

fickle granite
#

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

fallow tusk
#

But then you don't get the captured groups...

#

(although can you easily with greps output?)

tacit cliff
formal schooner
#

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)

fallow tusk
primal sierra
#

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

formal schooner
#

the names and args/flags, yes. but not in terms of functional lines of code / statements

fallow tusk
#

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

vagrant frigate
#

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.

fickle granite
#

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

vagrant fern
#

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

formal schooner
#

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

formal schooner
#

eg my printer supports zeroconf/Bonjour but not AirPrint

runic goblet
#

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

finite crater
#

curl -s "$url" | grep -oP '<a href="[^"]*.mp3">'

grep also has a -P option that is for passing it perl style RE

tropic lark
#

Yes tndoes

cold plank
#

Anyone with experience regarding pip install of google?

#

Secretmanager? Protobuf?

nimble notch
#

Can someone tell me exactly how do I dual boot my laptop?

cold plank
#

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

ember quiver
fallow tusk
#

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

main olive
#

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)

warped nimbus
tacit cliff
#

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.

formal schooner
tacit cliff
#

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

formal schooner
#

yes, use SSH keys to authenticate with Github

tacit cliff
#

Ok thank you very much!

formal schooner
#

usually every user has their own keys

tacit cliff
#

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.

radiant kraken
tacit cliff
#

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

tacit cliff
#

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?

vestal turret
#

There's 3 versions to select

tacit cliff
#

Oh shit

#

My bad

#

Thank you! @vestal turret

fringe egret
#

can someone help me with this error

formal schooner
# fringe egret 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

tame venture
#

what do you guys rrecommend for destrubution for linux thinking about debian and linux mint rn

vagrant fern
#

debian stable

#

linux mint is also good and feels more user-friendly. my system is rather barebones

formal schooner
#

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

untold bolt
formal schooner
untold bolt
#

I guess so. Arch is Installed and configured so many more times by hand that it's bound to be cleaner at this point.

tame venture
#

but wanna get to learn linux better with my rpi 5

formal schooner
tacit wolf
#

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

dusk jewel
#

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

main olive
#

i see

formal schooner
tacit cliff
#

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

tacit cliff
tacit cliff
#

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

forest furnace
tacit cliff
#

Ohhh I see

forest furnace
# tacit cliff PS does this too so it might be a scripting language thing idk

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

tacit cliff
#

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

forest furnace
# tacit cliff Either way I'm not a fan of it

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

tacit cliff
#

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

forest furnace
forest furnace
tacit cliff
#

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 🥲

forest furnace
tacit cliff
#

Ohhhhh

#

Ah that makes perfect sense

tacit cliff
#

Cool, thanks. :)

#

I keep pressing CTRL + Z but forget that it does nothing in nano 🫠

tacit cliff
#

what's the difference between using printf and echo in shell?

#

should I use echo or printf? what is the convention? i

forest furnace
#

if you don't need formatting, echo is good enough

forest furnace
tacit cliff
#

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

forest furnace
#

you can use read -p "Enter some input: " for asking input

#

that is, for bash

tacit cliff
#

Oh that's so much better

#

thanks!

tacit cliff
#

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 :/

shrewd stratus
#

Do you have vim installed on the system?

#

Yanking to the unnamedplus register is equivalent to copying to system clipboard

tacit cliff
#

let me check

#

@shrewd stratus I do have vim how do i exit help

#

these fuckin cli editors man

shrewd stratus
#

:q

tacit cliff
#

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?

shrewd stratus
#

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

tacit cliff
#

but that defeats the purpose of an alias though as I could just do that in nano then

shrewd stratus
#

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

tacit cliff
#

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

shrewd stratus
tacit cliff
#

And what does vim -c do? runs a command? where can I find some documentation on -c?

shrewd stratus
#

Open vim
:h -c

tacit cliff
#

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

shrewd stratus
#

vim -c 'norm ggVG"+y' -cq -e <file>

tacit cliff
#

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?

shrewd stratus
tacit cliff
#

It doesn't actually seem to copy anything:

#

When I paste it outputs a space

shrewd stratus
#

Remove the -e

tacit cliff
#

No luck 🤷‍♂️

shrewd stratus
#

Wait. Are you ssh'd in to a server?

tacit cliff
#

yes

shrewd stratus
#

Yeah, it won't work then.

tacit cliff
#

How come?

shrewd stratus
#

The server's clipboard is not the same as your clipboard

tacit cliff
#

Damn

#

The server got its own clipboard? 💀

#

ffs

shrewd stratus
#

It's the OS clipboard

#

But anyway, cat, select and copy is the only choice

tacit cliff
#

Fair enough

shrewd stratus
#

Or just scp/rsync the file from the server

tacit cliff
#

i can try asking the admin to install xclip

shrewd stratus
#

Installing xclip won't work for the same reason

tacit cliff
#

oh well

#

cat it is then

shrewd stratus
#

Unless you forward your local X server to the server

tacit cliff
#

too much work

shrewd stratus
#

Yeah

tacit cliff
#

screw it i'll just use cat

shrewd stratus
#

cat 👍🏼

tacit cliff
#

🐱

#

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

shrewd stratus
#

BTW, you can also try setting up a reverse SSH tunnel to ease the copying

tacit cliff
#

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

shrewd stratus
#

python3 -m ensurepip

tacit cliff
#

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

shrewd stratus
#

Debian packages it separately for some reason

formal schooner
#

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.

tacit cliff
#

i don't get it

#

for the sake of "choosing yourself"?

spark mulch
#

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.

tacit cliff
#

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

meager spear
#

Ubuntu is Debian with colors

wise forge
#

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

tacit cliff
#

These venvs were created initially on Windows so they not exactly transferable through scp

#

Nor are venvs meant to be portable afaik anyway

wise forge
# tacit cliff 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

tacit cliff
#

I'm not new to Python you know

#

lmao

#

Appreciate you trying to help though 🙏

wise forge
#

Excuse me for skepticism, but it is how it usually is. Also it is in general bad strategy to presume anything.

tacit cliff
#

I'm fairly certain that's not true and something you have concluded due to anecdotal "evidence"

wise forge
#

it is not important to argue about.

solar palm
#

How does Python relate to unix?

paper ibex
#

It was first written for unix and its written in C, which is the main unix programming language

solar palm
#

Oh, so it pretty much always relates to unix. Since every OS is either unix or unix-like.

tacit cliff
#

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
tacit cliff
#

Also good news, pip and venv functionality has been installed

#

💪 yay

tacit cliff
#

YES they also installed gh so now I don't have to do these stupid aliases 😍

formal schooner
#

@tacit cliff SSH keys didn't work out?

ember quiver
paper ibex
#

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? 😇

tacit cliff
tacit cliff
finite moat
#

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.

finite moat
# tacit cliff 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.

tacit cliff
#

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.

finite moat
tacit cliff
#

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. 😄

finite moat
#

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.

tacit cliff
#

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

finite moat
#

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.

tacit cliff
#

If I were to install Linux now for daily use, which distribution would you recommend?

finite moat
#

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

tacit cliff
#

I'm not interested in gaming, but I want it to look somewhat nice and have good support.

tacit cliff
finite moat
tacit cliff
#

Drugs?

#

Nah just kidding

finite moat
# tacit cliff Drugs?

Building Gentoo from sources? You can say that, yeah. Felt like it, anyways. Especially when it (finally) worked.

finite moat
finite moat
#

Don't like it. Credits are where credits due though. ¯_(ツ)_/¯

tacit cliff
#

it looks like ass

#

Oh wait

#

they updated it

finite moat
#

Yep.

tacit cliff
#

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

finite moat
#

Good luck. :)

tacit cliff
#

wdym? good luck with what?

finite moat
#

With trying Ubuntu.

primal sierra
#

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

odd schooner
#

huuui

odd schooner
primal sierra
#

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 :)

wise forge
#

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

mossy marten
#

Who use Windows tiling

paper ibex
#

It probably just means that your router blocks the icmp packets needed for traceroute to work

silk herald
tacit cliff
topaz hazel
tacit cliff
wise forge
languid vortex
#

where should I find which library contains a certain head file so I can install it in Cygwin, for example, mpi.h?

ember quiver
languid vortex
languid vortex
languid vortex
#

but it seems CLion can automatically detect it

formal schooner
#

i switched to endeavour kde instead and have had basically no problems since

topaz hazel
#

I have debian for long time no issues

paper ibex
#

I think I am the only one allergic to debian.. perhaps that indicates that I should give it a forth change? 🤔😅

torn geyser
#

Driver issue? Broken apt dependencies? Those are the main Debian specific problems I had heard about.

quaint tulip
unkempt hamlet
#

Anyone know why ssh keys don't auto load after restart?

#

it was auto loading before

tacit cliff
#
  1. Come to work
  2. Get tasked with re-writing this shit
  3. Go to bathroom
  4. Cry
  5. Continue working
#

AAAAAAAAAAAAAAAAAAA

quaint tulip
formal schooner
#

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?!

tacit cliff
#

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

tacit cliff
fickle granite
#

welcome to The Real World 🙂

dusky oasis
formal schooner
#

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

tacit cliff
tacit cliff
tacit cliff
tacit cliff
tacit cliff
# tacit cliff Yes and improves readability by a lot

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.

tacit cliff
tacit cliff
#

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
forest furnace
#

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.

tacit cliff
#

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.

forest furnace
# tacit cliff Any idea why this isn't working? It says "No such file or directory".

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 ...

upper prairie
#

lol that syntax highlighting is doing you a little dirty

forest furnace
#

yeah, it's quite misleading there

formal schooner
#

I'm not confident that bash allows parameter expansion on the RHS of =~

forest furnace
formal schooner
#

maybe that was a zsh problem then? i can't remember, so many special cases

fickle granite
tacit cliff
tacit cliff
#

It annoys me greatly

faint lotus
#

i

#

i

fickle granite
forest furnace
tacit cliff
#

@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
#

Is there a command to load all ssk keys that I added

#

ssh*

tacit cliff
#

@unkempt hamlet ssh-add -l

unkempt hamlet
#

It just say "The agent has no identities."

tacit cliff
#

Did you not add through ssh-add?

#

how did you add your ssh keys

#

or are you asking how to add them

unkempt hamlet
#

I used ssh-add command to add them

unkempt hamlet
#

It was even auto loading them after I login

tacit cliff
#

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 ^

unkempt hamlet
tacit cliff
#

That's odd

unkempt hamlet
#

not list

tacit cliff
#

What do you mean by load though?

#

You usually use ssh keys to identify yourself at login and you said it already did that

unkempt hamlet
#

when it is loaded it doesnt ask for passphrase

tacit cliff
#

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?

unkempt hamlet
#

some for server some for github
I haven't used them in a while

unkempt hamlet
tacit cliff
#

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

unkempt hamlet
#

oh ok
I swear there was a way to load them so i don't have to tpye password

tacit cliff
#

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

unkempt hamlet
#

Maybe because i don't have this line in my config

tacit cliff
#

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

unkempt hamlet
#

tried it
didn't do anything

#

wait

#

i think i found it

#

it is ssh-add --apple-load-keychain

tacit cliff
#

should've mentioned you used MacOS

#

lmao

unkempt hamlet
#

i didn't know macos ssh is diff
anyways i added that to the zshrc file

#

now it auto load them

tacit cliff
#

Look at the tests

#

What is it about shell that makes my regex invalid?

spark mulch
#

My guess is it's the non-capturing group that's not supported

tacit cliff
#

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?

forest furnace
# tacit cliff I'll try without. I also found out that it expect you to include the **unquoted*...

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

tacit cliff
#

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:

  1. 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.

  2. 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.

#

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.

forest furnace
# tacit cliff <@544825455509897227> 2 questions, if you don't mind: 1. Do you have any sugges...

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:

  1. 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.)
  2. 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 using bash.

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.

tacit cliff
#

I see

#

Thank you for the thorough explanation. It was a little confusing to me.

forest furnace
#

it can be a little overwhelming at first, all those terms that might be used interchangeably when other people talk about them

tacit cliff
#

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 🤔

forest furnace
#

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")

tacit cliff
#

no way "barf" is an actual thing lol

#

really?

#

that's pretty funny

shrewd stratus
#

TIL there was barf?

#

I thought it was paste since the beginning

tacit cliff
#

only thing that comes up when I search "barf" is dog food

forest furnace
#

oopsie I misremembered

#

it's snarf

tacit cliff
#

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

forest furnace
shrewd stratus
#

You're just making up words now /s

tacit cliff
#

only time i've ever heard "yank" before is in 90s shows when you "yank" someone's chain

forest furnace
forest furnace
#

with the $(...) syntax you can run any command, as well as functions

tacit cliff
#

cool cool

tacit cliff
#

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

forest furnace
tacit cliff
#

i haven't tested it yet no

#

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

#

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

fickle granite
#

are you mixing up test_src with src_test?

formal schooner
#

i'm happy to review it for you later today though

tacit cliff
tacit cliff
formal schooner
#

Ah good then. I can look at that too if you want another set of eyes on it

tacit cliff
cobalt moat
#

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!!

charred juniper
#

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.

paper ibex
#

Seems like an LD_LIBRARY_PATH issue

cobalt moat
#

yeah, I resolved the issue

#

thanks for the help

steel prairie
#

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

frail blaze
#

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?

fickle granite
#

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?

frail blaze
#

I tried compliance options but no luck

#

Btw, I'm dealing with the secret key so that might be relevant.

fickle granite
#

🤷

#

tbh my experience with gpg is "I hate it and hope I never have to use it again"

frail blaze
#

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

fickle granite
#

meh. I guess I don't have whatever problem it was intended to solve.

frail blaze
#

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

frail blaze
#

NVM. I found the problem. It is because a certify signature used version 5 which earlier version of GPG doesn't recognize

fierce shadow
#

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?

lapis cloud
formal schooner
gilded cove
#

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?

formal schooner
formal schooner
gilded cove
#

aaah ok hen

formal schooner
#

is that the same tilda that you're using?

gilded cove
#

yeap

#

i was just there looking for it

formal schooner
#

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

gilded cove
#

TIL

#

ok lemme try

formal schooner
#

i don't know for sure, but it seems likely

gilded cove
#

thanks!

tacit cliff
gilded cove
#

guys how do i remove the newline from starship prompt default

upper prairie
near tree
#

LL_tile_hi Any advice for beginners?

gilded cove
upper prairie
#

I just use Powerlevel10k

gilded cove
#

that can't be right though

upper prairie
gilded cove
#

huh

upper prairie
#

and there's always a blank newline when I cleared with it on

#

I hated it both ways

gilded cove
#

i guess i just gotta look at these presets that don't have new lines

cobalt moat
#

can anyone recommend reference videos to learn xv6 kernel?

#

pl provide link

nimble notch
#

As a beginner which is better, Kali or Ubuntu Linux

upper prairie
hexed cave
#

I like Ubuntu

#

It's what I use

upper prairie
#

I don't mind Ubuntu

#

but I'm an openSUSE guy if I have the reasonable choice

wise forge
#

easy to use, same unbuntu stuff, a lot of guides and support

#

LTS versions should be installed for stability (20.04 / 22.04)

rotund girder
vapid eagle
unkempt hamlet
#

Is there way to see what is the default option like this:

#

for git config stuff

ember quiver
unkempt hamlet
paper ibex
ember quiver
rotund girder
#

Aren't most (all?) of the docs in the manpages?

formal schooner
inland perch
#

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

trail sapphire
unkempt hamlet
#

It doesnt show the default setting

haughty tartan
#

hi

formal schooner
# unkempt hamlet That just seems list all the options

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.

calm delta
#

Linux: Why might umount fail with “device is busy” even if lsof +f -- /path shows nothing?

calm delta
# calm delta Linux: Why might `umount` fail with “device is busy” even if `lsof +f -- /path` ...

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.

fickle granite
#

are you absolutely certain that /path is the right path? 'Cuz I'd have expected that to work, too

unique thunder
#

oh wow I didn't note the timestamp. I'm an idiot. My bad.

unkempt hamlet
#

I don't wanna accidentally use system python with python3 command
Is it possible to remove or disable that command without touching any file?

upper prairie
#

but luckily you can't break much without pip

#

You can have your editor or terminal auto source environments

unkempt hamlet
#

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

unkempt hamlet
#

Too much commands to remember
just gonna use python3.11 -m venv .vevn

upper prairie
torn geyser
#

Particularly useful when testing multiple Python versions in, say, tox.

formal schooner
#

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

upper prairie
formal schooner
#

@unkempt hamlet ☝️ in case you're interested (and i suggest being interested if you want to solve the problem you posted about)

calm delta
calm delta
calm delta
calm delta
unkempt hamlet
trail sapphire
formal schooner
#

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

pliant orchid
trail sapphire
pliant orchid
wise forge
wise forge
upper prairie
#

insert more pyenv upselling

wise forge
#

Venv is better

upper prairie
steel schooner
#

anyone have any experience in linking mariadb to an openvpn server to do its authentication?

ember quiver
trail sapphire
trail sapphire
naive oasis
#

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

fickle granite
#

I'd guess it's in a log that you can view with journalctl

upper prairie
#

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

naive oasis
#

the bot seems to run. sooooo. I did think that it is weird that I dont have /bin/python3.10 or somthing though

upper prairie
naive oasis
#

sorry, I am unfamiliar with that.

fickle granite
#

#!/usr/bin/env python as the first line of the script

#

e.g.

upper prairie
naive oasis
upper prairie
#

hm

#

well, absolutely no clue then

naive oasis
#

I guess, if it works it works 😅

upper prairie
#

Indeed \🤔

naive oasis
fickle granite
#

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.

upper prairie
#

I've always just used systemctl status

wise forge
# naive oasis and any suggestions on how to more easily see output

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

  1. having documented deployment procedure for bot
  2. optionally having saved frozen version for easier rollback back or redeployment later
  3. having uniform way to request its logs docker logs container_name/id (there is optiona to tail in a real time logs)
  4. 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)

wise forge
wise forge
# naive oasis and any suggestions on how to more easily see output

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

fickle granite
#

I'd like to port my little URL shortener to docker, but getting nginx and some sort of letsencrypt thing going seems daunting 😕

naive oasis
#

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

fickle granite
#

don't think it requires anything other than a Linux kernel -- the the "docker" command

wise forge
wise forge
# fickle granite I'd like to port my little URL shortener to docker, but getting nginx and some s...

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

Knowledge Base by phoenixNAP

Learn how to set up Let's Encrypt on a Nginx server running in Docker by following this easy tutorial. Secure your website with HTTPS today!

#

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

fickle granite
fickle granite
foggy quiver
#

are there compatibility issues for python on different operating systems?

#

stupid question prob

unkempt hamlet
upper prairie
#

if you're on anything *NIX with a system-installed version of Python, pyenv is almost a must at this point

unkempt hamlet
#

im on macos
prob pyenv won't be useful

upper prairie
unkempt hamlet
#

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

simple iris
#

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?

river apex
#

so have you installed libcupti?

simple iris
#

yes

river apex
#

it looks like you have corrupted cache

simple iris
#

it comes with cuda toolkit if i know correctly?

simple iris
river apex
river apex
simple iris
#

yeah im searching up the commands to do that sry

simple iris
river apex
#

do you know its directory?

#

just move it to /tmp

simple iris
#

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?
river apex
#

~ is you home directory, packages are stored in different folders

river apex
simple iris
#

i aint sure

#

how may i check?

river apex
#

i dont use wsl2 but google says wsl -l -v in powershell

simple iris
#

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

river apex
#

try dpkg-query -L libc-bin

simple iris
#

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

river apex
simple iris
#

so now i have to move libc-bin to tmp

river apex
#

ls -l /var/lib/dpkg/info/libc-bin.*

simple iris
#

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

#

does this seem fine?

river apex
#

not exactly your case

simple iris
#

i thought changing the versions would work but ok

river apex
#

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

simple iris
#

ok i will try the link after backing up

river apex
#

or you can just create a snapshot so you can rollback whatever bad happens

simple iris
#

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

river apex
#

cheers

simple iris
# river apex 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

open fractal
#

Mac is mid

unkempt hamlet
#

based