start new:
tmux
start new with session name:
tmux new -s myname
ip -o a|grep -v mtu|cut -d' ' -f2,7 |
alias ssh="cat ~/.ssh/config.d/* > ~/.ssh/config; ssh" |
KEEP=2 OLDERTHEN=4;find /backups/ -type f -mtime +${OLDER} -printf '%T@ %p\n'|sort -nr | tail -n +${KEEP}|awk '{print $2}'|xargs -r rm -f | |
# For Crontab: escape the % in printf option => -printf '\%T@ \%p\n' |
#! /bin/env bash | |
filename=$1 | |
firstline=$2 | |
lastline=$3 | |
# Usage: ./get_file_body.sh 10 15 access.log | |
awk -vs="$firstline" -ve="$lastline" 'NR>=s&&NR<=e' "$filename" |
# Script Record | |
TIMESTAMP=$(date "+%Y%m%d-%H%M%S") | |
script -q -f -t /home/test/.script/script-${TIMESTAMP}.log 2> /home/test/.script/script-${TIMESTAMP}.time.log && exit |
# Transfer this over a secure connection, e.g. https | |
wget -q -O bash_installer.sh https://example.com/bash_installer.sh && \ | |
echo "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 bash_installer.sh" | sha256sum -c && \ | |
chmod +x ./bash_installer.sh && \ | |
./bash_installer.sh |
map $http_x_request_id $uuid { | |
default "${request_id}"; | |
~* "${http_x_request_id}"; | |
} | |
server { | |
listen 80; | |
server_name _; | |
proxy_set_header X-Request-ID $uuid; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
body, | |
html { | |
margin: 0; | |
padding: 0; |
For symmetic encryption, you can use the following: | |
To encrypt: | |
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt | |
To decrypt: | |
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt | |
For Asymmetric encryption you must first generate your private key and extract the public key. |