So I have a TrueNAS server set up at home, and it would be cool to have access to it at all times. I currently have Syncthing set up to access and back up my most essential files on my phone and laptop, but it would be nice to be able to access all the … legally obtained files I have stored there wherever I go. I looked into...
I use SSH with port fowarding to securely access my services running on my server to anywhere I have internet. Its easy to setup, just expose any device running a ssh server like openssh to the internet, probably on a port that isnt 22, and with key only authentication.
Then on whatever device you want to get your services on you can do like
Where 8022 is the port of the ssh server exposed to the internet (default is 22), 8010 is the port its gonna bind to on the device you are using the client (it will bind to 127.0.0.1 by default), 192.168.75.111:80 is the address/hostname and the port of where your services are on your local network, and user@serverspublicip is your username and the ip address of where your ssh server is.
You can also use ssh to make a SOCKS proxy in your network like this
This will make a socks proxy into your network on your device at 127.0.0.1:1080. All of this can also be done on just about any mobile phone running android by using termux.
Mine is Strawberry since it has a ton of options and plays a ton of formats. It’s also (distant) fork of Amarok 1.4 and integrates well with KDE Plasma. I’m curious what other people are using these days. What’s your favorite player?
Dolphin + mpv for me so I can see the album covers and metadata and see whats available, if I have a specific song in mind, then ill just use the terminal and mpv.
Ive been tryna figure this out all day, Ive read the manual for systemctl and I didnt see anything about switch-root after the initrd target. I did see a –force option, however it didnt do anything. Before the upgrade to version 255, I would use a script or manually mount the partition, and then I would just do like systemctl...
I just gave it a try on my system and it worked just like it did before! Ill have to change my scripts to mount to /run/nextroot instead of /mnt, but i am very relieved that it is still possible. I was having trouble with it all morning. Thank you so much for your reply! It is much appreciated!
Recently I stumbled over an article, about how to customize your shell prompt. What really surprised me, is that it lacked one of the most basic tips I learned nearly 20 years back: Always display a timestamp in the prompt, to be able to check how long a process is running or when it ended. (Don’t need it daily, but every so...
A person in this thread already recommended having different colors for different conditions like ssh and running as root, I havent seen anyone mention this specifically but you can determine if the current working directory is writable with something like [ -w “$(pwd)” ] and set the color to red or print a symbol if it doesnt return true.
Also I recommend putting all the code and logic for your shell prompt in a shell function, and using a substitution shell to put it into the PS1 variable like this:
<span style="color:#323232;">__shellprompt ()
</span><span style="color:#323232;">{
</span><span style="color:#323232;"> if [ "$(id -u)" = 0 ]; then
</span><span style="color:#323232;"> local PROMPT_EMBLEM='#'
</span><span style="color:#323232;"> else
</span><span style="color:#323232;"> local PROMPT_EMBLEM='$'
</span><span style="color:#323232;"> fi
</span><span style="color:#323232;"> printf "%s" "$(whoami)@$(uname -n):$(pwd)"
</span><span style="color:#323232;"> printf "n%c " "$PROMPT_EMBLEM"
</span><span style="color:#323232;">}
</span><span style="color:#323232;">PS1='$(__shellprompt)'
</span>
Now this is just a really barebones example, there is a whole lot more you can do like passing in the last exit code through the argv of your shellprompt function like this PS1=‘$(__shellprompt $?)’ and like print it out if its non-zero so you wont have to like echo $? to see if the last command failed, but you should be able to still do this. In my testing, running the shell prompt function in the subsitiution shell didnt effect the $? variable.
In my first comment on another thread about shell prompts, I posted my full shellprompt, it is slightly outdated (I just changed hostname to uname -n), if you cant find it feel free to send a message or just ask, and I will send you the code.
Something that should be noted when adding colors to your shell prompt function is adding the non printable characters that keep the terminal from buggin out, this caused me a massive headache until I figured it out. When putting it in the PS1 variable directly you will put [ to begin a color sequence and ] to end one, but printf will print a literal [ and ] so instead you will have to use `
Accessing NAS when not on LAN
So I have a TrueNAS server set up at home, and it would be cool to have access to it at all times. I currently have Syncthing set up to access and back up my most essential files on my phone and laptop, but it would be nice to be able to access all the … legally obtained files I have stored there wherever I go. I looked into...
What's your favorite music player on Linux? (lemmy.ml)
Mine is Strawberry since it has a ton of options and plays a ton of formats. It’s also (distant) fork of Amarok 1.4 and integrates well with KDE Plasma. I’m curious what other people are using these days. What’s your favorite player?
SOLVED: Is there a way to enable the systemctl switch-root command after initrd.target in systemd version 255? (Arch Linux)
Ive been tryna figure this out all day, Ive read the manual for systemctl and I didnt see anything about switch-root after the initrd target. I did see a –force option, however it didnt do anything. Before the upgrade to version 255, I would use a script or manually mount the partition, and then I would just do like systemctl...
Custom shell prompt tips and tricks?
Recently I stumbled over an article, about how to customize your shell prompt. What really surprised me, is that it lacked one of the most basic tips I learned nearly 20 years back: Always display a timestamp in the prompt, to be able to check how long a process is running or when it ended. (Don’t need it daily, but every so...