Skip to content

Instantly share code, notes, and snippets.

View ecelis's full-sized avatar
🏹
📷 🥊

Ernesto Celis ecelis

🏹
📷 🥊
View GitHub Profile
@ecelis
ecelis / keybase.md
Last active September 21, 2015 23:35

Keybase proof

I hereby claim:

  • I am ecelis on github.
  • I am ecelis (https://keybase.io/ecelis) on keybase.
  • I have a public key whose fingerprint is F29C 399A 7B19 FA67 4B9E BDF6 2D55 1002 2615 FA80

To claim this, I am signing this object:

@ecelis
ecelis / gpg-import-and-export-instructions.md
Created October 18, 2015 03:26 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@ecelis
ecelis / imaway
Created May 23, 2016 13:54 — forked from sdague/imaway
dbus xchat integration
#!/usr/bin/python
import dbus
import dbus.glib
import gobject
import subprocess
def lock():
print "Screen saver turned on"
@ecelis
ecelis / 51-android.rules
Created May 24, 2016 20:30
Android Linux udev rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
@ecelis
ecelis / default.conf
Created August 30, 2016 12:59 — forked from alanbriolat/default.conf
nginx userdir + PHP-FPM
server {
listen 80;
server_name localhost;
# ... other default site stuff, document root, etc. ...
location ~ ^/~(?<userdir_user>.+?)(?<userdir_uri>/.*)?$ {
alias /home/$userdir_user/public_html$userdir_uri;
index index.html index.htm index.php;
autoindex on;
@ecelis
ecelis / commands.txt
Created September 22, 2016 06:16
Docker cluster sample setup
########################################################################################################################################################
####### The following commands are for Module 4: Building your Swarm Infrastructure
#######
####### Remember to substitute hostnames and IPs etc etc for the appropriate values in your environment
########################################################################################################################################################
####### CONSUL BUILD COMMANDS
NODE1
docker run --restart=unless-stopped -d -h consul1 --name consul1 -v /mnt:/data \
@ecelis
ecelis / ora_bootstrap.sh
Created September 23, 2016 02:00
Oracle 12c RHEL/CentOS 7 bootstrap
yum -y install \
unzip \
binutils \
compat-libcap1 \
compat-libstdc++-33 \
compat-libstdc++-33.i686 \
gcc \
gcc-c++ \
glibc \
glibc.i686 \
@ecelis
ecelis / onliners.sh
Created October 2, 2016 22:05
Shell oneliners
## Copy files in YYYY/MM/DD/filename.txt directory hierarchy to YYYY-MM-DD-filename.txt
find . -name '*.txt' -exec bash -c 'name="{}"; cp "${name}" ./"${name:2:4}"-"${name:7:2}"-"${name:10:2}"-"${name:13}"' \;
## Delete empty line from file
sed -i '/^$/d' <file.ext>
## Delete empty espace at the begining of line
sed -i '/^\s//g' <file.ext>
## Delete email prefix (address@)
sed -i -e 's/[[:alnum:]].\.*[[:alnum:]]*@//g' <file.ext>
## Delete only numbers line
@ecelis
ecelis / nginx_ssl_proxy.conf
Created February 10, 2018 20:28
Nginx SSL Proxy
server {
listen 443 ssl;
server_name _;
ssl_certificate /path/to/cert.crt;
ssl_certificate_key /path/to/cert.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:TLS:2m;