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
| #!/bin/sh | |
| exec docker inspect --format '{{ .State.Pid }}' "$@" |
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
| #!/bin/sh | |
| exec docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$@" |
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
| # Aliases | |
| alias ll="ls -alhp $1" | |
| alias v="vim $@" | |
| # Color definition | |
| txtblk='\e[0;30m' # Black - Regular | |
| txtred='\e[0;31m' # Red | |
| txtgrn='\e[0;32m' # Green | |
| txtylw='\e[0;33m' # Yellow | |
| txtblu='\e[0;34m' # Blue |
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
| " General Options {{{ | |
| " set nocompatible if no set yet | |
| if &compatible | |
| set nocompatible | |
| endif | |
| set viminfo='100,\"1000,:20,%,n~/.viminfo " Change viminfo file output destination | |
| syntax enable " Enable syntax highlighting | |
| set mouse=niv " Enable the use of mouse in all mode | |
| set backspace=indent,eol,start " Force the behavior of backspace |
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
| # Highlight the current autocomplete option | |
| zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" | |
| # Better SSH/Rsync/SCP Autocomplete | |
| zstyle ':completion:*:(scp|rsync):*' tag-order ' hosts:-ipaddr:ip\ address hosts:-host:host files' | |
| zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost | |
| zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*' | |
| zstyle ':completion:*:ssh:*' hosts off | |
| # Allow for autocomplete to be case insensitive |
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
| certbot certonly --webroot -w /var/www/letsencrypt --cert-name www.main_domain.com -d www.main_domain.com,main_domain.com,www.other_domain.fr,other_domain.fr,sub1.other_domain.fr,sub2.other_domain.fr |
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
| # Create table | |
| mysql> CREATE DATABASE mydatabase CHARACTER SET utf8 COLLATE utf8_general_ci; | |
| # Stats table size | |
| mysql> SELECT TABLE_NAME, table_rows, data_length, index_length, round(((data_length + index_length) / 1024 / 1024),2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "$DATABASE" ORDER BY (data_length + index_length) DESC; | |
| # Don't remember | |
| mysql> select table_rows from information_schema.tables where table_name = 'table_name'; | |
| # Create dump |
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
| var jq = document.createElement('script'); | |
| jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; | |
| document.getElementsByTagName('head')[0].appendChild(jq); | |
| jQuery(jQuery('ul')[3]).find('li > div').trigger('click'); |
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
| cat /etc/*release | |
| iptables -nvL | |
| du -a /dir/ | sort -n -r | head -n 20 | |
| watch -d | |
| grep -v |
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
| openssl req -x509 -sha256 -newkey rsa:2048 -keyout certificate.key -out certificate.crt -days 1024 -nodes -subj '/CN=my.domain.tld' | |
| # From https://letsencrypt.org/docs/certificates-for-localhost/ | |
| openssl req -x509 -out localhost.crt -keyout localhost.key \ | |
| -newkey rsa:2048 -nodes -sha256 \ | |
| -subj '/CN=localhost' -extensions EXT -config <( \ | |
| printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") |
OlderNewer