Show process list:
SELECT * FROM pg_stat_activity;
Show running processes:
SELECT pid,datname,query_start,state,query FROM pg_stat_activity WHERE state <> 'idle';
Reload config:
| # show commit tree (possibly append --all for all branches) | |
| git log --graph --oneline --decorate | |
| # save previous as an alias and then just use 'git tree' | |
| git config --global alias.tree "log --graph --oneline --decorate" | |
| # restoring lost commit (e.g. after git reset --hard HEAD~1) | |
| git fsck --lost-found | |
| # or | |
| git reflog | |
| git merge <hash> |
| SSLCipherSuite ECDHE:DHE:HIGH:+SHA1:!MEDIUM:!LOW:!EXP:!aNULL:!eNULL:!PSK:!RC4 | |
| SSLHonorCipherOrder on | |
| SSLProtocol all -SSLv3 | |
| <VirtualHost ...> | |
| SSLEngine on | |
| Header always set Strict-Transport-Security "max-age=15552000" | |
| Header set Public-Key-Pins "pin-sha256=\"yiUxVRHwMNoXtZZS/RtgPr2bCNyc6L8IJrmTU80HSlA=\"; pin-sha256=\"XQIfp7PhqFyw93tHv86EhngOxSVVdZy0Dj1mFmI81PM=\"; max-age=15552000" | |
| SSLUseStapling on | |
| ... |
| # Number of open file descriptors per process (replace 'httpd' with process name) | |
| lsof -p $( echo `ps -o pid= -C httpd` | tr ' ' ',' ) | awk '{ print $2 }' | uniq -c | |
| # Show swap usage per process, >=1000 kB | |
| cat /proc/*/status | egrep -B30 '^VmSwap:[[:space:]]+[[:digit:]]{4,}' | egrep '^Name|^Pid|^VmSwap' | |
| # generate password | |
| head -c12 /dev/urandom | base64 | tr '+/' '_-' | tr -d '=' | |
| # days to web server certificate expiry |
| # https://www.zabbix.com/forum/showthread.php?t=43550 | |
| policy_module(zabbix-fix, 1.3) | |
| require { | |
| type zabbix_agent_t; | |
| type zabbix_t; | |
| type ping_t; | |
| type zabbix_tmp_t; | |
| class tcp_socket name_connect; | |
| } |
Show process list:
SELECT * FROM pg_stat_activity;
Show running processes:
SELECT pid,datname,query_start,state,query FROM pg_stat_activity WHERE state <> 'idle';
Reload config:
| #!/usr/bin/gnuplot | |
| U = 3.3 | |
| I = 2.2e-3 | |
| R = U/I | |
| C = 10e-6 | |
| t = 0.01 | |
| set yrange [0:U] | |
| set xrange [0:t] | |
| plot U * exp(-x/(R*C)) | |
| pause -1 |
for beli (https://keybase.io/beli) @keybase
with PGP fingerprint 05ED 7B6D 4DDA E43D DB92 1AEC A537 2D08 32D8 419D
{
"body": {
"key": {| colorscheme evening | |
| set columns=120 lines=35 | |
| "set guifont=Inconsolata\ 13 |
| # for building packages | |
| apt-get install build-essential devscripts debhelper | |
| # for creating/editing packages | |
| apt-get install dh-make quilt | |
| cat >>~/.bashrc <<"_EOF" | |
| DEBEMAIL="your.email.address@example.org" | |
| DEBFULLNAME="Firstname Lastname" | |
| export DEBEMAIL DEBFULLNAME | |
| alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg" |
| #set -g status off | |
| #set -g status-right "\"#{=32:pane_title}\"" | |
| setw -g mode-keys vi | |
| unbind [ | |
| bind Escape copy-mode | |
| unbind p | |
| bind p paste-buffer | |
| bind-key -T copy-mode-vi 'v' send-keys -X begin-selection | |
| bind-key -T copy-mode-vi 'y' send-keys -X copy-selection-and-cancel | |
| bind-key S setw synchronize-panes |