Skip to content

Instantly share code, notes, and snippets.

@relkai
relkai / color.sh
Last active Sep 3, 2018
Terminalfarben
View color.sh
#!/bin/bash
n='normal'
b=' bold '
echo -e "\n 40m 41m 42m 43m 44m 45m 46m 47m";
for FGs in ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' ' 36m' '1;36m' ' 37m' '1;37m'; do
FG=${FGs// /}
echo -en " $FGs \033[$FG "
@relkai
relkai / fullbackup.sh
Last active Sep 3, 2018
Fullback inkl. Datenbank (dbbackup.sh erforderlich)
View fullbackup.sh
#!/bin/bash
# Variablen festlegen
backup_root="/mnt/backup"
backup_dir="${backup_root}/filesystem"
backup_db_dir="${backup_root}/db"
retention="2W"
script_path="/usr/local/sbin"
# Backup-Partition einmounten
@relkai
relkai / dbbackup.sh
Last active Sep 3, 2018
Backup aller MySQL Datenbanken
View dbbackup.sh
#!/bin/bash
db="db1 db2 db3 db4"
passwd="mysql-root-passwort"
backup_date=$(date +%Y%m%d)
backup_path="/mnt/backup/db"
# Loeschen der bin-logs
echo '* bin-logs werden geloescht'
View sleeptimer.sh
#!/bin/bash
# Sleep Timer v2.1 fuer MythTV oder andere HTPC Systeme
# 24.02.2013 // Erste Version
# 02.06.2014 // Um XBMC JSON-RPC Aufrufe erweitert
# Matthias Bodsch // bodsch.com
# -- Variablen definieren --------------------------------------------------
@relkai
relkai / reinemackefrau.sh
Last active Sep 3, 2018
Ubuntu aufräumen
View reinemackefrau.sh
#!/bin/bash
# Farben
gruen="\033[1;32m"
gelb="\033[1;33m"
blau="\033[1;34m"
violett="\033[1;35m"
weiss="\033[1;37m"
farbe_aus="\033[0m"