This file contains 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
# install build dependencies | |
sudo yum install -y git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel | |
# clone and install rbenv environment | |
cd ~ | |
git clone git://github.com/sstephenson/rbenv.git .rbenv | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile |
This file contains 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
# here is the code to convert img to vdi format | |
# it is useful especially for uefi based image | |
VBoxManage convertfromraw --format VDI [filename].img [filename].vdi |
This file contains 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
To get it to work please follow the steps: | |
1) Create test user by toggling the Authorize test users for this app and grant permissions "manage_pages" and "page_messaging". | |
2) Use the Edit Button and get an access token for this user (using v2.6). Please save this for later. | |
3) Use edit button to login as the test user | |
4) After login, create page as the test user | |
5) Use the user access token for the test user to get the page access token for this user. You can do this with the following call: | |
~~~ | |
https://graph.facebook.com/v2.6/me/accounts?access_token=<TEST_USER_ACCESS_TOKEN> | |
~~~ |
This file contains 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
# 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 |
This file contains 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
1. Connect to mongodb instance. | |
~~~ | |
mongod --port 27017 --dbpath /data/db | |
~~~ | |
2. Create user: | |
~~~ | |
use admin | |
db.createUser( | |
{ |
This file contains 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://gist.github.com/scturtle/5972996 | |
import re | |
import os | |
import sys | |
import md5 | |
import json | |
import random | |
import requests |
This file contains 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
# 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" |
This file contains 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
Deprecated command Replacement command(s) | |
arp ip n (ip neighbor) | |
ifconfig ip a (ip addr), ip link, ip -s (ip -stats) | |
iptunnel ip tunnel | |
iwconfig iw | |
nameif ip link, ifrename | |
netstat ss, ip route (for netstat-r), ip -s link (for netstat -i), ip maddr (for netstat-g) | |
route ip r (ip route) |
This file contains 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
# 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 |
This file contains 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
# 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 |
NewerOlder