although this is HIGHLY DISCOURAGED on productive systems it can help speed up development on development systems echo “user ALL=(ALL) NOPASSWD: ALL” >> /etc/sudoers then log off (close terminal) and re-open, re-connect now typing sudo bash will immediately grant root […]
sometimes it is usefull to meassure how long what took in the shell vim /scripts/stopwatch.sh #!/bin/bash # function to get current time in seconds and milliseconds get_time() { date +%s%N | cut -b1-13 } # initial time start_time=$(get_time) echo “press […]
neofetch; # tested on (fancy version of uname -a or hostnamectl su – root apt update apt install stress-ng # Ctrl+D log off root # what cpu cat /proc/cpuinfo |head processor : 0 vendor_id : AuthenticAMD cpu family : 25 […]
with the bash history it’s a very useful but also a bit confusing thing X-D whenever a bash terminal is exited, it saves the histoy to cat ~/.bash_history did the user know that with the super cool hotkey-shortcut: Ctrl+R then […]
htop has a column called “S” (State) if the state of a process is “Z” (Zombie) that ain’t good htop states: S for sleeping process is waiting for an event to complete, could be I/O completion, a signal, or some […]
sometimes the most simple things are the trickiest X-D the question was, why if shutdown -r now is specified in a script or crontab directly: why won’t the server reboot (to activate newly via updates installed kernel?) the answer: crontab […]
how to get started: have a hetzner account login to https://console.hetzner.cloud/ create a new project click on project in the left menu there is a new entry: Object Storage tested and works: upload download delete untested: https://docs.hetzner.com/de/storage/object-storage/howto-protect-objects/protect-versioning/ pricing: https://docs.hetzner.com/de/storage/object-storage/overview/#preise max. […]
hostnamectl; # tested on Operating System: Debian GNU/Linux 12 (bookworm) Kernel: Linux 6.1.0-25-amd64 Architecture: x86-64 Hardware Vendor: Gigabyte Technology Co., Ltd. Hardware Model: B550 AORUS ELITE AX V2 Firmware Version: F16d ls -lah; # show content of this dir lsblk; […]
hostnamectl; # tested on Operating System: Debian GNU/Linux 12 (bookworm) Kernel: Linux 6.1.0-20-amd64 Architecture: x86-64 # become root su – root apt update # if it’s graphical application echo $DISPLAY # and the user “user” is the user that started […]
GNU Linux bash – how old are the projects files? find the last 10 most recently changed files in all subdris the current dir and display their change time like: (YYYY-MM-DD HH:MM) find . -type f -exec stat –format=”%Y %n” […]
whenever the inet goes down, do something, wait until inet recovers, then restart program x. hostnamectl; # tested on Operating System: Debian GNU/Linux 12 (bookworm) Kernel: Linux 6.1.0-20-amd64 Architecture: x86-64 ping -V ping from iputils 20221126 libcap: yes, IDN: yes, […]
try but without gurantees screen -xr # -x Attach to a not detached screen session (Multi display mode) # Screen refuses to attach from within itself # But when cascading multiple screens, loops are not detected # take care -r […]
once upon a time, compressing massive amounts of binary was required. hostnamectl; # tested on Operating System: Debian GNU/Linux 12 (bookworm) Kernel: Linux 6.1.0-12-amd64 Architecture: x86-64 lscpu | grep -E ‘Architecture|Model name|Thread|Core’; # tested on CPU Architecture: x86_64 Model name: […]
This is actually VERY usefull to find files that waste disk space. lsb_release -a; # tested on Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) the solution: czkawka_cli install rust like this (no need to install rust as root) install […]
Debian runs well even on systems with as little as 512 MBytes of RAM. so imho even on a QNAP NAS there should be no more “argument list too long” for whatever reason. lsb_release -d; # official way: tested on […]
hint! this script works! BUT: it can not deal with complex filenames, it needs “easy filenames” (yes no kidding). so something like: 2.mp4 and 3.mp4 in the same directory will work. or it will output: concat Unsafe file name: Operation […]
what to expect? (click here for two html embedded test video files, if the user’s browser can playback 264x and 265x) while x264 and x265 are surely great codecs, the re-encoding of x264 to x265 is very CPU and thus […]
WARNING! MAKE BACKUP of ALL FILES ON THE HARDDISK! that being said, this search replace script works with the tool sed which required to escape all special characters. This tool will help with that: https://dwaves.de/tools/escape/ per default it will search […]
# this will create a new compressed version of ‘folder-to-pack’ # but will not include any pdf fiels tar fcvz /path/to/package.tar.gz –exclude=’*.pdf’ /path/to/folder-to-pack # automatically include the current date in filename of backup file: tar fcvz /backups/$(date ‘+%Y-%m-%d’).filename.tar.gz –exclude=’*.pdf’ /path/to/backup
ok an alias is simply an appreviation (ll) of a longer command (ls -lah –color) defined in one of those files: user@Debian8:~$ bash -l; # simulates a login 1. hello from /etc/bash.bashrc 2. hello from /etc/profile 7. hello from ~/.bash_profile […]
v2 mkdir /root/backups; vim /scripts/backup_db.sh #!/bin/bash # Prompt user for root password read -sp “Enter MySQL root password: ” root_password echo # Get list of databases databases=$(mysql -uroot -p”$root_password” -e “SHOW DATABASES;” | grep -Ev “(Database|information_schema|performance_schema|mysql)”) for db in $databases; […]
how long (many hours) will this notebook-laptop battery last? some sensors/softwares report/calculate things like this… 5days on one charge is a very very optimistic estimate for most intel or amd based notebooks (even for RISC/ARM based notebooks-laptops that would be […]
just one of those programs, that makes users smile 🙂 written in C 🙂 compile it from src or go lsb_release -d; # tested on Description: Debian GNU/Linux 11 (bullseye) su – root apt update apt install sl
su – root apt update apt install tmux # split vertically CTRL+B % # split horizontally CTRL+B ” # switch to next “pane” window CTRL+B O # no scroll? # activate scroll mode to use PageUp and PageDown to scroll […]
this might sound trivial, but there are multiple approaches: # for (theoretically every) Debian, but not every Debian based system: cat /etc/debian_version 11.3 # for Debian 10 and prior hostnamectl|grep Op Operating System: Debian GNU/Linux 10 (buster) # for Debian […]
hostnamectl|grep Op Operating System: Debian GNU/Linux 10 (buster) # and also on lsb_release -d Description: Debian GNU/Linux 11 (bullseye) su – root df -m | grep ” \+/$” | awk ‘{print $1;}’ # because of a bug, runnig it as […]
straight after (Debian based) GNU Linux OS setup, usually doing those modifications to: speed up boot & start of programs grub timetout 1sec shotcuts for faster start of programs in MATE Desktop Alt+F2 -> fox, will start firefox (no need […]
get the mac address of the interface of the target PC(T) enable wake on lan in bios of the target PC(T) pace shure PC(T) has done a clean shutdown (it might be in an unkown state, so boot it up […]
equals to: one neat function of the find command, it that what it found can be passed to another program for further processing. or: it can delete the file by adding the option -delete BUT (!!!) THIS IS DANGEROUS! as […]
inxi – Command line system information script for console and IRC DESCRIPTION It is also used a debugging tool for forum technical support to quickly ascertain users’ system configurations and hardware. inxi shows system hardware, CPU, drivers, Xorg, Desktop, Kernel, […]