/r/unix
/r/unix is a subreddit for Unix and everything related to Unix.
/r/unix is a pretty chill place:
First and foremost, follow the rules of reddit
Don't be an asshole
Related subreddits:
/r/unix
Basically, for the past week I have been trying to get java 21 running on an aarch64 machine, which wouldn't normally be a problem, BUT the machine just happens to be a NanoPi R4S, which has no output so the only OS you can use on it is open/friendlywrt. That kinda sucks tho, since no official java binaries exist for it, you can't compile java for it since you don't have java installed, and if you just get a generic aarch64 package off the official java servers (This), i get the following error: "..../bin/java: cannot execute: file not found"
This happens with any command that is java
So what i need help with is basically getting java 21 to run on the machine, so as extra info here's the wiki and specs of the R4S for those who aren't familiar with it: NanoPi R4S Wiki ; NanoPi R4S Specs
UPDATE: Thanks for the help, i don't know how i forgot that other OSes exist i can use for this so i'll look into that later, for now i managed to get Azul Zulu running on it. (By managed i mean it worked instantly)
Hi!
I’m trying to do an automated job in shell, basically I have a directory with 1000+ files and each day some other files are added.
I’m trying to create a script that runs periodically and clean up the directory and backup the files.
The script will take some arguments, like: SourceDirectory DestinationDirectory FilenameMatcher SkipCriteria RetentionCriteria
And basically, what I want to achieve is:
Any suggestions in how to achieve this?
I'm currently exploring reasons why or why not to mount the /var/run/docker.sock
UNIX socket into a Docker container.
This made me curious, what are some cool tricks or projects any of you all have done using either the Docker socket or any other UNIX sockets.
hi guys i wanna know how to customize my terminal and make it beautiful like unixporn guys, i see a lot of amazing terminal and i see links they provide to make your like them but i can not cuz im beginner in these stuffs. they provide dofitles and some stuffs like that but dont know how to use .
Some config files have between 1 and 5 blank lines at the top before any comments or settings are shown. How can I use 'sed' to delete blank lines until text appears?
I do not want to delete any blank lines once the text starts though.
Hyra is a work in progress Unix-like operating system in development with the eventual goal of being used frequently and potentially daily driven by myself. Hyra is apart of the OSMORA (osmora.org) project which has also been created by me.
I've used vi and emacs forever but recently needed to use ed to script up some file changes. While I wouldn't want to use it full time, I have found three usecases where it's worth considering:
Two other comments:
If I enter a correct password in the sudo password query, it does not take a tenth of a second until I can continue my activity as super user. But if I cancel the sudo password query on my Arch Linux system, it takes longer.
Why is that?
I can understand if the password prompt takes a long time to reject an incorrect password. This may be due to the algorithm, or to prevent brute force from being possible so quickly, idk.
I've been trying to get a file like the following:
hello
world
README
boo
hoo
README
psg
dortmund
README
to look like the following:
README
hello
world
README
boo
hoo
README
psg
dortmund
The closest I've gotten so far is the following command:
sed -n '/README/!H;/README/G;/README/p'
which leads to the following:
README
hello
world
README
hello
world
boo
hoo
README
hello
world
boo
hoo
psg
dortmund
After screwing around too much, I ended up using awk but it feels like I'm "this close" to having it work.
Hi,
Hoping someone with true unix knowledge can help with what will inevitably be something straightforward, but I can't seem to fumble my way through.
I'm just wanting to remove the $ORIG_DIR once the loop has run through a single and remove the $ALAC_DIR if the original files are .mp3 and it's finished the loop?
SOURCE_DIR="$(cd "$(dirname "${dirs[0]}")"; pwd)/$(basename "${dirs[0]}")"
SOURCE_DIR=$(dirname "$SOURCE_DIR/temp") # this fixes . and ./
HIRES_DIR="$(cd "$(dirname "${dirs[1]}")"; pwd)/$(basename "${dirs[1]}")"
HIRES_DIR=$(dirname "$HIRES_DIR/temp") # this fixes . and ./
LORES_DIR="$(cd "$(dirname "${dirs[2]}")"; pwd)/$(basename "${dirs[2]}")"
LORES_DIR=$(dirname "$LORES_DIR/temp") # this fixes . and ./
find "$SOURCE_DIR" \( -iname '*.flac' -or -iname '*.mp3' \) -type f -print | while read -r FILE
do
ORIG_DIR=$(dirname "$FILE")
BASE=$(basename "$FILE")
BASE=${BASE%.*}
AAC_DIR=${ORIG_DIR/$SOURCE_DIR/$LORES_DIR}
ALAC_DIR=${ORIG_DIR/$SOURCE_DIR/$HIRES_DIR}
mkdir -p "$AAC_DIR" "$ALAC_DIR"
AAC_FILE="$AAC_DIR/$BASE.m4a"
ALAC_FILE="$ALAC_DIR/$BASE.m4a"
if [[ (! -f "$AAC_FILE" && $FILE == *.flac) ]]; then
ffmpeg -hide_banner -i "$FILE" -c:v copy -b:a 256k -c:a aac "$AAC_FILE" </dev/null &&
ffmpeg -hide_banner -i "$FILE" -c:v copy -c:a alac "$ALAC_FILE" </dev/null
elif [[ (! -f "$AAC_FILE" && $FILE == *.mp3) ]]; then
ffmpeg -hide_banner -i "$FILE" -c:v copy -b:a 256k -c:a aac "$AAC_FILE" </dev/null
fi
done
rmdir "$ALAC_DIR"
rm -Rf "$ORIG_DIR"
Hello,
I am working on compiling a notebook of practical mini essays, notes, and code examples elucidating how Unix and the POSIX API works.
There is a learning curve for understanding how to use and code within Unix. These notes are used to make the individual topics more accessible. I have notes on a handful of networking concepts, including some small C programs demonstrating the POSIX. I'll eventually add more Unix topics, as well as more code samples for Awk, C, sh, etc.
If anyone is interested in contributing or learning more about Unix, please visit unix-notes.
So I'm a 13yo looking to learn the very basics of kernel development, withought any jargon whatsoever. I know some C and python but forgot quite a lot. What's the best online resource to learn kernel development. I won't be able to read physical books. Online resource, please.
smenu started as a lightweight and flexible terminal menu generator, but quickly evolved into a powerful and versatile CLI selection tool for interactive or scripting use.
smenu makes it easy to navigate and select words from stdin or a file using a friendly text-based user interface. The selection is printed to stdout for further processing.
Tested on Linux and FreeBSD but should work on other Unix as well.
It is available here: https://github.com/p-gen/smenu
Anyone know what happened? It seems like it's gone.
This apparently upsets a lot of people here.
Using windows with 4 shells (cmd, powershell, TCC, and bash), sed absolutely works with both ' and "
People need to grow up about this and stop insisting otherwise.
Hi folks, why does the first command work but the second does not? Permissions on the server are 700 for /home/me/.ssh and 600 for /home/me/.ssh/authorized_keys . /home/me/.ssh/authorized_keys is a copy of /root/.ssh/authorized_keys, and I've restarted sshd. Am I losing my mind?
me@home ~ % ssh me@my.server
me@my.server: Permission denied (publickey).
me@home ~ % ssh root@my.server
Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-101-generic x86_64)
I’m in a strange spot from playing around so much where I believe I’m a little past the basic stage but not quite at advanced from Google and what not. -I’m looking for a good handprint , preferably with labs, to build a solid foundation- I don’t don’t work in tech I’m just a nerd, not even a gamer.
I can SSH to all of them now, I can move around in directories, I’m a little familiar with VIM, and I’m all over the place. I have FreeBSD, Debian, ghost, all running.
I just need a solid starting point and a road map to go from the left to right, and I believe FreeBSD looks like a great place to start.
Please advise on a book for a working man and nerd. I’m tired of PDF’s and switching between windows.
Some practicals would be nice as I have no real reason, at this juncture, to run or use any of it.
Thank you all in advance!
UPDATE: SEMI-SOLVED: Problem is specific to a recently-upgraded cygwin installation. Even though the versoin of sed.exe is the same on 3 machines, it is broken on the 1 machine that upgraded cygwin. But that same machine can get it working by running out of the cygwin\bin folders on the other 2 machines. I probably have to revert my cygwin upgrade, even though the sed version is the same. Suspect DLLS or some other b.s.
UPDATE 2: Reverting the cygwin\bin folder fixed the problems. AND YES, SED WORKS WITH ' AND " FOR ME, EVEN THOUGH I RUN WINDOWS. I'm not sorry that makes you uncomfortable.
ORIGINAL MESSAGE:
Any idea why I woke up this morning to my sed no longer working with emoji?
It's cygwin sed, but it's the same cygwin sed as my other 2 machines.
All 3 worked with emoji just fine. For months!
Woke up today, 1 machine is not working.
TCC v31 on 2 of the machines — one working, one not (lol)
TCC v28 on 1 of the machines — working
This is driving me crazy. I'm trying to add emoji around certain words. It works for months on 3 machines, then ... stopped this morning on one machine.
< 7:37a> <15%> C:\>echo gOlIaTh |:u8 sed -e 's/goliath/GOLIATH/gi'GOLIATH
< 7:36a> <10%> C:\>echo gOlIaTh |:u8 sed -e 's/goliath/🦇GOLIATH🦇/gi'/cygdrive/c/cygwin/bin/sed: -e expression #1, char 1: unknown command: `''
EDIT: I should mention sed works fine with ' or " in my situation. The problem is NOT that i simply used the wrong quote. I wish it were that simple. This is a situation that is was working on 3 computers for 3 months then borked on 1 of the machines overnight.
Hello I am mostly a Mac OS user and I know that Mac OS is basically a fork of BSD. My secondary computer runs Linux although I am wondering if it's worth installing FreeBSD on it instead. I know that there is more software support on Linux, and I will miss tools like lsblk. Another thing that is keeping me on the fence is if FreeBSD is really that different compared to Mac OS. I know there will be differences due to the open source and software packaging. Although can I get most of the experience on my Mac?
I just want to make sure I have my thinking on this correct. We're configuring a mail server for our network with some specific requirements.
My thinking on this was the following:
PAZ
Postfix Satellite here that will be used to relay email received from the internet into the OZ
Configure satellite to whitelist specific domains/addresses and drop everything else
Configure satellite for SMTPS
OZ
Postfix Internet Server Configure Mailboxes for virtual users here, Configure for SMTPS
Dovecot Configure for IMAPS
This is the basic EARLY outline I have right now for how I'm going to do this. It's been a while since I configured a mail server that wasn't "Out of a Box". We may need an additional hop if they decide they want the data stored in our RZ instead (I would just setup another satellite in our OZ for this, we don't want any RZ DNS info on the public side so it would have to go to OZ first).
Thank you for the sanity check!