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
#!/usr/bin/env python3 | |
pts = 15 # set the pts your vim instance is running | |
""" Run this as super user """ | |
import os, fcntl, termios | |
fd = os.open(f'/dev/pts/{pts}', os.O_RDWR) | |
vim_cmd = '\033:wqa!\n' | |
for i in vim_cmd: | |
fcntl.ioctl(fd, termios.TIOCSTI, i) |
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 https://cipherli.st/ | |
# and https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; | |
ssl_ecdh_curve secp384r1; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_tickets off; | |
ssl_stapling on; |
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 | |
sudo apt-get install curl software-properties-common | |
curl -sL https://deb.nodesource.com/setup_11.x | sudo bash - |
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 magicalObj = (function magicalMethod() { | |
return new Proxy(new Object(), { | |
get(target, propertyName, receiver) { | |
const theMethod = (target.propertyName) ? target.propertyName : function () { return true } | |
return function (...args) { return theMethod.apply(this, args) } | |
} | |
}) | |
})() |
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
" run pathogen | |
execute pathogen#infect() | |
" show line numbers | |
set nu | |
" set auto indent | |
set ai | |
" enable syntax | |
syntax on | |
" open a new tab (control + t) | |
nmap <C-t> :tabnew<CR> |
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 | |
if [ "$1" == "" ] || [ "$2" == ""] ; | |
then | |
echo "\nUse: $0 <es_host> <node_name> [optional] <index_name>\n" | |
exit; | |
fi | |
for index_shards in $(curl -s -XGET http://$1:9200/_cat/shards | grep UNASSIGNED | awk '{print $1"|"$2;}'); | |
do |