Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am debo on github.
  • I am debo (https://keybase.io/debo) on keybase.
  • I have a public key whose fingerprint is 1B0C ED9A 5805 213C A9E5 175A 2054 7CDF F530 5EC6

To claim this, I am signing this object:

@debo
debo / AWS EC2 Utils
Last active December 1, 2016 03:57
Useful CLI comands to ssh into or terminate your AWS EC2 instances without AWS Console
aws ec2 describe-instances --filter Name=tag:Name,Values='[query]' --profile=[profile] --region=[region] | jq '.Reservations[].Instances[].PrivateIpAddress'| sed 's/"//g' | sed 's/null//g' | sed '/^\s*$/d' | sort
aws ec2 describe-instances --filter Name=tag:Name,Values='[query]' --profile=[profile] --region=[region] | jq '.Reservations[].Instances[].InstanceId'| sed 's/"//g' | sort
aws ec2 terminate-instances --instance-ids [instanceId] --profile=[profile] --region=[region]
@debo
debo / ec2-expand
Last active March 1, 2017 02:19
Commands to extend disk on an AWS EC2
# add a new volume to the instance, ssh into the machine and execute the following commands
lsblk
pvcreate /dev/xvdf
pvdisplay # for sanity check
vgextend vg0 /dev/xvdf
lvextend -l+100%FREE /dev/mapper/vg0-storage
xfs_growfs /storage
df -h # profit
@debo
debo / .vimrc
Created February 1, 2018 21:25
""""""""""""""""""""""""""""""""""""""""
" Init
set nocompatible
execute pathogen#infect()
execute pathogen#helptags()
""""""""""""""""""""""""""""""""""""""""
" Mappings
" quickly edit the .vimrc file
@debo
debo / updatedb
Last active January 30, 2019 16:25
#!/usr/bin/env bash
sudo /usr/libexec/locate.updatedb
@debo
debo / no-sleep
Last active January 30, 2019 16:25
#!/usr/bin/env bash
sudo pmset -c sleep 1440 displaysleep 10 disksleep 1440
sudo pmset -b sleep 1440 displaysleep 2 disksleep 1440
#!/usr/bin/env bash
sudo pmset -c sleep 10 displaysleep 10 disksleep 10
sudo pmset -b sleep 10 displaysleep 2 disksleep 10
#!/usr/bin/env bash
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
git clone https://github.com/phansible/role-php.git src/Phansible/Resources/ansible/roles/php
git clone https://github.com/phansible/role-apache.git src/Phansible/Resources/ansible/roles/apache
git clone https://github.com/phansible/role-beanstalkd.git src/Phansible/Resources/ansible/roles/beanstalkd
git clone https://github.com/phansible/role-blackfire.git src/Phansible/Resources/ansible/roles/blackfire
git clone https://github.com/phansible/role-composer.git src/Phansible/Resources/ansible/roles/composer
git clone https://github.com/phansible/role-elasticsearch.git src/Phansible/Resources/ansible/roles/elasticsearch
git clone https://github.com/phansible/role-hhvm.git src/Phansible/Resources/ansible/roles/hhvm
git clone https://github.com/phansible/role-mariadb.git src/Phansible/Resources/ansible/roles/mariadb
git clone https://github.com/phansible/role-mongodb.git src/Phansible/Resources/ansible/roles/mongodb
git clone https://github.com/phansible/role-mysql.git src/Phansible/Resources/ansible/roles/mysql
#!/usr/bin/env zsh
#
# Wikify by Mario "Kuroir" Ricalde
#
function wikify() {
# gnu ls has natural number sorting, useful for sorting 1, 10, 2 into 1, 2, 10
function gls_or_ls() {
if hash gls 2>/dev/null; then
gls -v "$@"