Skip to content

Instantly share code, notes, and snippets.

@ifnull
ifnull / gist:8814390
Created February 4, 2014 23:14
Download your Facebook "A look back" Video
window.location = JSON.parse(decodeURIComponent(document.getElementsByTagName("embed")[0].getAttribute('flashvars').split('&')[0].split('=')[1])).video_data[0].hd_src;
@ifnull
ifnull / check-divisibility.py
Created February 24, 2014 07:20
Math: Check divisibility
#!/usr/bin/env python
import math, time
# 01. All whole numbers are multiples of 1
# 02. The last digit is 2, 4, 6, 8, 0
# 03. The digits add up to a multiple of 3
# 04. The last 2 digits are a multiple of 4
# 05. Last digit is either 5 or 0
# 06. Divisible by 2 and 3
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:*"
],
"Resource": [
"arn:aws:iam::*",
@ifnull
ifnull / gist:9614867
Created March 18, 2014 06:57
PIN numbers sorted by probability.
1234
0000
1111
2580
1212
5555
2222
6969
7777
5683
@ifnull
ifnull / packages.md
Created March 18, 2014 23:34
Sublime Packages
  • Doc​Blockr: Simplifies writing DocBlock comments in Javascript, PHP, CoffeeScript, Actionscript, C & C++
  • Spacegray: Theme
  • SublimeLinter: Interactive code linting framework for Sublime Text 3
  • BracketHighlighter: Bracket and tag highlighter for Sublime Text
  • Python Flake​8 Lint: heck Python files with flake8 (PEP8, pyflake and mccabe)
@ifnull
ifnull / Vagrantfile
Created March 28, 2014 03:16
Salt Master Debug
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@ifnull
ifnull / speed-up-vagrant-virtualbox.md
Created May 12, 2014 20:51
Speed up Vagrant / VirtualBox

Speed up Vagrant / VirtualBox

Requirements

  • Windows users will need to install the vagrant-winnfsd plugin.

Notes

  • Trailing shash needed for all NFS mounts
  • Remove old Salt provisioner. vagrant plugin uninstall vagrant-salt
[root@vagrant-centos65 ~]# /tmp/bootstrap_salt.sh -v
/tmp/bootstrap_salt.sh -- Version 1.5.5
[root@vagrant-centos65 ~]# /tmp/bootstrap_salt.sh -D -F -c /tmp -k /tmp/minion-seed-keys -C
* ERROR: Option does not exist : F
Usage : bootstrap-salt.sh [options] <install-type> <install-type-args>
Installation types:
- stable (default)

How-to: Upgrade VBoxGuestAdditions

This process will upgrade VBoxGuestAdditions from CLI in Vagrant (or just straight VirtualBox).

This is easier if we are root so ...

sudo su -

Next we make sure the packages that are usually removed to slim the box are re-added so that we can recompile VBoxGuestAdditions. After that we download and compile VBoxGuestAdditions followed by a little clean up.

@ifnull
ifnull / Vagrantfile.rb
Created May 14, 2014 18:07
mitchellh/vagrant VBoxManage not returning guest IP
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "madjango-base"
config.vm.box_url = "http://**************/madjango-base.box"
config.vm.post_up_message = "This is a Test"