Skip to content

Instantly share code, notes, and snippets.

@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 / 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]
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 "$@"

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:

#!/usr/bin/env bash
commit="$1"
date="$2"
git filter-branch --env-filter \
"if test \$GIT_COMMIT = '$commit'
then
export GIT_AUTHOR_DATE='$date'
export GIT_COMMITTER_DATE='$date'