Skip to content

Instantly share code, notes, and snippets.

View carlosonunez's full-sized avatar

Carlos Nunez carlosonunez

View GitHub Profile
(* 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
(* 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)
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. No way of reusing task output in main play.
2. Cannot specify multiple fail_when statements.
3. [*] A play is atomic, i.e. I can't take the output from a command, parse its json then act on it. I need to create an intermediary fact containing the json dict then use that in another play. It's tedious.
4. If you're missing a variable in a variable file, Ansible won't fail to parse it. It will just tell you "VARIABLE IS NOT DEFINED!," which is ambiguous
5. Doing anything "complicated" (like looping within a loop for deeply nested Ansible variables) is right out.
6. selectattr doesn't actually do what you think it does!
7. Missing vars within tasks or roles can lead to very very VERY cryptic errors
8. So you can't set booleans with set_facts without casting......... https://github.com/ansible/ansible/issues/5463
9. It would be great if I could say something like:
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
# ===============