Categories
Linux Mastering Development

Cannot reach ssh / autossh from outside the remote server

I have a problem with my autossh setup: An OpenWRT router has autossh configured to connect to an OVH server I have and setup a remote port on 5922: openWrt$ ssh -R 5922:localhost:22 user@my_ovh_server I can see the port opened on the OVH server and can connect on it from within the OVH server: ovh$ […]

Categories
Linux Mastering Development

How to pgrep to find a bash script on macOS (or how to programatically kill a script running in the background)?

I’m trying to programatically kill a bash script running as a background process (on macOS). The way I’ve settled on for now is to pgrep the name of the script and then pass the PID value to a kill function. Note: If anyone has a better suggestion on how to do this please feel free […]

Categories
Linux Mastering Development

Kill all processes that are using qt5

I would like to run a pyhton script with conflicts with the use of a certain graphical framework: ImportError: Cannot load backend ‘TkAgg’ which requires the ‘tk’ interactive framework, as ‘qt5′ is currently running Therefore I would like to ask if there is a way to determine all processes that currently ‘qt5’ and depending on […]

Categories
Linux Mastering Development

Switch off internal notebook screen permanently

Is there a possibility to switch off the notebook screen permanently? The notebook is constantly connected to the TV via HDMI. However, if the notebook is left on and the TV is switched off in the meantime or the notebook boots up before the TV is switched on, the display resolution and so on changes […]

Categories
Linux Mastering Development

Scrolling TTY without dedicated PgUp and PgDown

My keyboard does not have separate PgUp and PgDown keys. They are in the numpad, sharing their position with KP_9 and KP_3. Scrolling terminals with Shift+Pg{Up,Down} was not possible either with Numlock on or off. Since I don’t care for the keypad numbers but do care a lot for scrolling, I have successfully remapped them […]

Categories
Linux Mastering Development

Rsync does not properli link incremental backups

I am using Rsync to do the incremental backups of the data, but for some reason after 3-4 proper incremental backups , rsync performs Full backup, occupying twice the space, then I quickly run out of space on the backup machine. The scenario is that cron performs the incremental rsync everyday, and then additional script […]

Categories
Linux Mastering Development

How to count and displaying result in two different lines (bash)

I have a script that counts the number of the line in the file and displaying this number in online mode. echo "Checking in progress:" while true ; do outcount=$(cat /tmp/curl-check-result.txt | wc -l) echo -ne "Total checked IPs:" ‘\t’`cat /tmp/curl-check-result.txt | wc -l`’\r’ if [[ $outcount -eq $numips ]]; then break fi done But […]

Categories
Linux Mastering Development

If I run tmux and then `kill` the tmux process, I see two bash processes. How does this second bash relate to the first and how do I kill it?

As stated in the question, I’m trying to better understand sessions, processes, process groups, etc. A few questions that I came across while playing around with tmux. If I open tmux and run ps, I see two bash processes. If I understand correctly, one bash process corresponds to the parent shell and the second bash […]

Categories
Linux Mastering Development

wrong grub prefix (efi) `grub-install` and `update-grub` doesn’t fix it

problem: When booting, grub goes to the prompt (grub>, not grub rescue>). I need to type in: set prefix=(hd0,gpt8)/boot/grub insmod normal normal To get the normal grub menu. Every post I found so far was solved by doing grub-install and/or update-grub once you manage to boot your system. I tried these but the problem persists. […]

Categories
Linux Mastering Development

wrong grub prefix (efi) `grub-install` and `update-grub` doesn’t fix it

problem: When booting, grub goes to the prompt (grub>, not grub rescue>). I need to type in: set prefix=(hd0,gpt8)/boot/grub insmod normal normal To get the normal grub menu. Every post I found so far was solved by doing grub-install and/or update-grub once you manage to boot your system. I tried these but the problem persists. […]