Skip to content

Instantly share code, notes, and snippets.

View soardex's full-sized avatar

Edward Fitz Bucud Abucay soardex

View GitHub Profile
@soardex
soardex / gist:062885a9aaa650dfc8d4
Created January 3, 2016 11:39
Repackage a CentOS 7 vagrant box
# update the box
sudo yum update -y
sudo yum clean all
# fill the empty spaces with zeroes
sudo dd if=/dev/zero of=/boot/EMPTY bs=1M
sudo rm -f /boot/EMPTY
sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
@soardex
soardex / gist:5474b5cf3f263d6acd77
Created July 11, 2015 15:31
Perlbrew on CentOS 7
# install perlbrew
sudo yum install -y perl perl-CPAN perl-CPAN-Meta
sudo cpan App::cpanminus
sudo cpanm install App::perlbrew
# install cpanm and perl latest
perlbrew install-cpanm
perlbrew install-patchperl
perlbrew install 5.22.0
@soardex
soardex / gist:3b088e71dde0e7361a1a
Created July 11, 2015 13:06
Dockerfile for vert.x with JVM
FROM centos:latest
MAINTAINER Fitz Abucay <[email protected]>
RUN yum update -y
RUN yum install -y deltarpm
RUN yum install -y java-1.7.0-openjdk-headless
ENV VERTX_HOME /opt/vertx
RUN mkdir -p $VERTX_HOME && \
@soardex
soardex / gist:84c67472dee43a65e344
Created July 3, 2015 08:49
NetEase music.163.com
## from https://gist.github.com/scturtle/5972996
import re
import os
import sys
import md5
import json
import random
import requests
@soardex
soardex / gist:8c3ac67914e5d4a13807
Last active August 29, 2015 14:24
NetEase music.163.com
#! /usr/bin/env python
# -*- coding: utf-8 -*-
## from https://github.com/yanunon/NeteaseCloudMusic
'''
Created on 2013-06-07 19:28
@author: Yang Junyong <[email protected]>
'''
@soardex
soardex / gist:95afe3f168b4db461403
Created June 24, 2015 06:50
Encrypt msmtp Secrets
# create and encrypt ~/.msmtp/secrets.gpg
mkdir -p ~/.msmtp
echo -e "password\n" | gpg -e -r [your_gpg_id] -o ~/.msmtp/secrets.gpg
# in `.msmtprc` change the password to passwordeval to launch an external program.
passwordeval "gpg -q --for-your-eyes-only --no-tty -d ~/.msmtp/secrets.gpg"
@soardex
soardex / gist:6883715ecdc6a8bad4eb
Created June 24, 2015 06:36
Encrypted .muttrc for Mutt
# create ~/.mutt/secrets
cat > ~/.mutt/secrets << EOF
set imap_pass="secret_password"
set smtp_pass="secret_password"
EOF
# encrypt ~/.mutt/secrets
gpg -e -r [your_gpg_id] ~/.mutt/secrets
# clean removed ~/.mutt/secrets file
@soardex
soardex / gist:bd588f633d03d8bd0f84
Created June 24, 2015 06:34
Encrypted .netrc for Git
# encrypt ~/.netrc with gpg agent
gpg -e -r [your_gpg_id] ~/.netrc
# clean removed .netrc file
shred ~/.netrc
rm -f ~/.netrc
# enable credential helper
# this would search files in your home directory
# .authinfo.gpg
@soardex
soardex / gist:4f05bac49506e7144f46
Created June 21, 2015 13:39
Remove Unfinished Docker Images Pull
# removes unfinished pulled images in docker
docker rmi -f $(docker images | grep "<none>" | awk "{print \$3}")
@soardex
soardex / gist:5e8c055083edcffdf345
Created June 19, 2015 16:58
Distributing Keys to PGP Keyservers
# keyservers:
# pgp.mit.edu
# keyserver.ubuntu.com
# keys.gnupg.net
#
# the keyserver parameter is optional and would default to the
# distributed keyserver of keys.gnupg.net
# search keys
gpg2 [--keyserver [keyserver]] --search-keys [pubkey_id]