Description | Command |
---|---|
Start a new session with session name | screen -S <session_name> |
List running sessions / screens | screen -ls |
Attach to a running session | screen -x |
Attach to a running session with name | screen -r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is just a cheat sheet: | |
# On production | |
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
# On local | |
scp -C production:~/database.sql.gz | |
dropdb database && createdb database | |
gunzip < database.sql.gz | psql database |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT post_content, | |
REGEXP_REPLACE(post_content, 'https://static\\.webshopapp\\.com/shops/1234/files/[0-9]+/', 'https://new-url.com/fixed/path/') | |
FROM `db606006_1`.`eucph_posts` | |
WHERE | |
post_content REGEXP 'https://static\\.webshopapp\\.com/shops/1234/[^\"\\s]*'; | |
EXPLAIN UPDATE eucph_posts | |
SET post_content = REGEXP_REPLACE(post_content, 'https://static\\.webshopapp\\.com/shops/1234/files/[0-9]+/', 'https://rechtwp.de/wp-content/uploads/2024/11/') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"C:\Program Files\LibreOffice\program\soffice.exe" --headless --convert-to pdf *.ods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zfs list -t snapshot -H -o name | grep "201509[0-9].*" | xargs -n1 echo | |
# zfs list -t snapshot -H -o name | grep "201509[0-9].*" | xargs -n1 zfs destroy | |
zfs list -r -t snapshot -o name BusinessData/Strato-varwww | grep "2024-07" | xargs -n1 echo | |
zfs list -r -t snapshot -o name BusinessData/Strato-varwww | grep "2024-07" | xargs -n1 zfs destroy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
import calendar | |
# Start- und Enddatum festlegen | |
start_datum = datetime(2019, 12, 1) # 1. Januar 2023 | |
end_datum = datetime(2024, 12, 1) # 1. Juli 2024 | |
# Basis-URL festlegen | |
base_url = '<a href="https://irgendwo.com/admin/index.php/sell/orders/?order%5Bfilters%5D%5Bdate_add%5D%5Bfrom%5D={start_datum}&order%5Bfilters%5D%5Bdate_add%5D%5Bto%5D={end_datum}">{start_datum} - {end_datum}</a><br />' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zfs list -t snapshot -o name -S creation Pool/FSName | tail -n +16 | xargs -n 1 zfs destroy -vr | |
via | |
https://serverfault.com/questions/340837/how-to-delete-all-but-last-n-zfs-snapshots |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo apt install build-essential zlib1g-dev libssl-dev | |
sudo mkdir /var/lib/sshd | |
sudo chmod -R 700 /var/lib/sshd/ | |
sudo chown -R root:sys /var/lib/sshd/ | |
wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.7p1.tar.gz | |
tar -xzf openssh-9.7p1.tar.gz | |
cd openssh-9.7p1/ | |
sudo apt install libpam0g-dev libselinux1-dev libkrb5-dev | |
./configure --with-kerberos5 --with-md5-passwords --with-pam --with-selinux --with-privsep-path=/var/lib/sshd/ --sysconfdir=/etc/ssh |
Nice commands to know:
su -c "/opt/otrs/bin/otrs.Console.pl" -s /bin/bash otrs = show all options su -c "/opt/otrs/bin/otrs.Console.pl Maint::Ticket::Dump #Ticket_id " -s /bin/bash otrs = Show ticket
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Ticket::Delete --ticket-id #Ticket_id " -s /bin/bash www-data
NewerOlder