Skip to content

Instantly share code, notes, and snippets.

View carlosonunez's full-sized avatar

Carlos Nunez carlosonunez

View GitHub Profile
(* Profile launcher for Opera *)
(* Set this to whatever you want. *)
property profileName : "google.com"
property profileFolder : "/Users/$USER/.OperaProfiles/" & profileName
property operaFilePath : "/Applications/Opera.app/Contents/MacOS/Opera"
property commandCreateProfileFolder : "mkdir -p " & profileFolder
try
set commandOpenOpera to operaFilePath & ¬
" --args" & ¬
# URI: https://www.reddit.com/r/dailyprogrammer/comments/3nkanm/20151005_challenge_235_easy_ruthaaron_pairs/
# Ruth-Aaron Pairs.
function GetRuthAaronPairs {
# GetSumOfPrimeFactors: Calculates and sums the prime factors for a given number.
function GetSumOfPrimeFactors {
param ([int]$Number)
$sum = 0
$current = $Number
import re
def SumPrimeFactors(num):
def ValidateRuthAaronPairs():
number_of_pairs = int(raw_input("Number of pairs:"))
pairs = []
while (number_of_pairs > 0):
this_pair = raw_input("Pair: ")
if re.match("^\(\d+,\d+\)$",this_pair is not None:
numbers = re.findall("\d+",this_pair)
(* Use this AppleScript to launch instances of Chromium under different profiles. *)
(* Download the latest Chromium build here: http://chromium.woolyss.com *)
(* Gets the latest Flash version from your PepperFlash manifest. *)
on getPepperFlashManifest()
set pepperFlashPathPosix to "/Library/Internet Plug-Ins/PepperFlashPlayer"
set pepperFlashPathPosixEscaped to "/Library/Internet\\ Plug-Ins/PepperFlashPlayer"
set pepperFlashManifestFilePathPosix to pepperFlashPathPosix & "/manifest.json"
set pepperFlashPluginFilePathPosix to "/Library/Internet\\ Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin"
set pepperFlashPluginFile to POSIX file pepperFlashPluginFilePathPosix
bind r source-file ~/.tmux.conf
# Enable VI mode.
set-window-option -g mode-keys vi
# Configure the status pane on the bottom
set -g status-left-length 60
set -g status-right-length 60
set -g status-left "#[fg=Green]#(whoami)#[fg=white]::#[fg=blue]"
export TERM="xterm-color"
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# ==================================================================
# Most of this was taken from the example .bash_profile on tldp.org.
# ==================================================================
# =================
# COLORS
# =================
1. Are you having trouble getting instances to connect to each other despite their inbound security grounds being configured properly?
a. Have you tried disabling `iptables` or the Windows firewall?
b. If they are in a VPC, are their egress rules configured correctly?
1. sudo apt-get install software-properties-common
2. sudo add-apt-repository ppa:gluster/glusterfs-3.5
3. sudo apt-get update
4. sudo apt-get install glusterfs-server
5. Create an EBS volume and mount it to each server
6. Probe for other glusterfs servers in the subnet that aren't itself using `gluster peer probe <ip>`
7. Create a new volume in the pool (from the example): ` gluster volume create testvol rep 2 transport tcp node01:/export/sdb1/brick node02:/export/sdb1/brick`
#!/bin/bash
# NOTE: This assumes a few things:
# * that you are running Ubuntu 14.10,
# * that you are using EC2 for master and slaves,
# * that you are using Github for source control, and
# * that you want to use Google Apps for logging in.
# 1. Set up S3FS
# ===============
1. Adding a `file` provisioner to a resource doesn't trigger a rebuild. The only issue I found related to this is here: https://github.com/hashicorp/terraform/issues/6065
2. For the `connection` block, it's `private_key`, not `key_name`. Terraform didn't fight me on this...
3. `private_key` only takes the `file()` method and the path has to be absolute. Nothing else works...