Skip to content

Instantly share code, notes, and snippets.

@qittu
qittu / create-playbooks-structure.sh
Last active July 3, 2024 20:00
Create a ansible playbook's basic directory structure. https://docs.ansible.com/playbooks_best_practices.html
#!/bin/sh
print_usage() {
echo "Usage:"
echo " Create a top level structure: 'create_ansible_structure.sh [TOP_DIRECTORY_PATH]'"
echo " Create a role structure: 'create_ansible_structure.sh role [TOP_DIRECTORY_PATH] [ROLE_NAME]'"
}
error() {
echo "Error: ${1}"
# Python 2.7.5
#
# Usage:
# $ python puzzle_of_vine.py STEP_NUMBER
import sys
import math
argv = sys.argv
if len(argv) < 2: exit("Error")
@qittu
qittu / AutoChangeWirelessNetworkLocation.sh
Created December 20, 2013 19:10
Change OS X network location automatically. This script will run when wireless network connection changes.
#/bin/sh
#
# This script is woring on Mac OS X Mavericks 10.9.1.
#
# Usage:
#
# 1.Save this script in your binary directory.
#
# 2.Replace SSIDs and Labels in this script with your own environment.
#
@qittu
qittu / camelize.cs
Last active January 14, 2016 01:33
Camelize in C#
/*
* Ex.
* Convert "foo_bar" to "FooBar".
*/
public static string camelize(string str) {
string result = "";
string[] strArray = str.Split('_');
foreach(string word in strArray) {
result += word.Substring(0, 1).ToUpper() + word.Substring(1);