This file contains hidden or 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
# TODO throwing error: | |
# Cannot find a resource for to_ary on ubuntu version 12.04 | |
require 'set' | |
file "/root/chef_resources-#{node.name}.json" do | |
resource_clxn = Chef::ResourceCollection.new | |
run_context.resource_collection.each do |r| | |
next if r.class.to_s == 'Chef::Resource::NodeMetadata' | |
r = r.dup |
This file contains hidden or 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
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab: | |
# Author: Avishai Ish-Shalom <[email protected]> | |
SED=sed | |
# first argument set the command level | |
_get_knife_completions() { | |
n=$1 | |
shift | |
# first argument is knife, so shift it |
This file contains hidden or 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
#!/bin/sh | |
genpasswd() { | |
local l=$1 | |
[ "$l" == "" ] && l=16 | |
cat /dev/urandom | LC_CTYPE=C tr -dc A-Za-z0-9_ | head -c ${l} | |
echo | |
} | |
genpasswd "$@" |
This file contains hidden or 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
#!/bin/bash | |
# vagrant@vagrant-ubuntu-trusty-64:~$ sudo adduser swift | |
# Adding user `swift' ... | |
# Adding new group `swift' (1002) ... | |
# Adding new user `swift' (1002) with group `swift' ... | |
# Creating home directory `/home/swift' ... | |
# Copying files from `/etc/skel' ... | |
# Enter new UNIX password: | |
# Retype new UNIX password: | |
# passwd: password updated successfully |
This file contains hidden or 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
'''Implements a straight Jenkins lookup hash - http://burtleburtle.net/bob/hash/doobs.html | |
Usage: | |
from jhash import jhash | |
print jhash('My hovercraft is full of eels') | |
Returns: unsigned 32 bit integer value | |
Prereqs: None |
This file contains hidden or 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
git fetch origin && git fetch origin --tags && git reset --hard $(git ls-remote | grep -w 'refs/heads/master' | awk '{print $1}') |
This file contains hidden or 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
#!/usr/bin/env bash | |
declare -A vm_ip | |
declare -A vm_id | |
declare -A vm_status | |
while read -r _ id _ name _ ip _ ; do | |
ip=$(echo $ip|cut -d'=' -f2) | |
vm_ip[$name]=$ip | |
vm_id[$name]=$id |
This file contains hidden or 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
#!/bin/bash | |
sudo apt-get install -qqy ethtool libgraph-easy-perl graphviz > /dev/null | |
EXCEPT=/tmp/exceptlist | |
echo '' > $EXCEPT | |
result="" | |
function on_exit() { | |
rm -f $EXCEPT |
This file contains hidden or 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
#!/bin/bash | |
while true; do | |
disk=$(ls -al /dev/ | awk '/ disk[0-9]$/{print $10}' | grep -Ev "(disk0|disk1)" | head -n1) | |
if [ "x${disk}" = "x" ]; then | |
sleep 2 | |
continue | |
fi | |
diskpath=/dev/${disk} |
This file contains hidden or 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
#!/usr/bin/env bash | |
if mount | grep -q 'ntfs' ; then | |
if ! mount | grep -q 'read-only' ; then | |
echo -e "\033[01;36mExist already in /etc/fstab.\033[00m" | |
VOLUME=$(mount | grep "(ntfs, " | sed 's|/dev/disk[0-9]s[0-9] on \(.*\) (ntfs,.*$|\1|g') | |
open "$VOLUME" | |
exit | |
fi |
OlderNewer