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 | |
| echo '#!/bin/bash' | |
| echo '' | |
| echo 'failed_items=""' | |
| echo 'function install_package() {' | |
| echo 'echo EXECUTING: brew install $1 $2' | |
| echo 'brew install $1 $2' | |
| echo '[ $? -ne 0 ] && $failed_items="$failed_items $1" # package failed to install.' | |
| echo '}' |
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 | |
| MACHINE=$1 | |
| # Assume executing in the directory of the Vagrant file | |
| # This command will prompt for the Vagrant user's password, it's usually "vagrant" | |
| ssh-keygen -y -f .vagrant/machines/$MACHINE/virtualbox/private_key | \ | |
| vagrant ssh $MACHIME -c "mkdir .ssh; tee -a .ssh/authorized_keys; chmod 0600 .ssh/authorized_keys" | |
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
| // If "i" is already power of 2 then return it. Skip this step if want | |
| // the next power of 2 for this case | |
| if (! (i & i-1))) | |
| return i; /* i is already a power of 2 */ | |
| // this "do" assumes that the previous "if" exists, otherwise replace the | |
| // "do..while" with a simple "while" | |
| do | |
| i &= i-1; | |
| while (i & (i-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/ruby | |
| require 'rubygems' | |
| require 'packetfu' | |
| dev = ARGV[0] | |
| mac=`ip link show #{dev} | awk '/ether/ {print $2}'` | |
| ARGV.shift | |
| dests = ARGV | |
| cap = PacketFu::Capture.new( |
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 | |
| [[ -n "$1" && -n "$2" ]] || { echo "Usage: $0 <interface to grab multicast packets from> <interface to send modified packets to> [target MAC address 1] [target MAC address 2] ..."; exit 0 ; } | |
| IIF=$1 | |
| OIF=$2 | |
| shift | |
| shift | |
| SRC_MACADDR=`ip link show $OIF | awk '/ether/ {print $2}' | tr -d :` |
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 | |
| gpg --list-keys --fingerprint | \ | |
| gsed -r -n -e 's/Key fingerprint = (.*)/\1/p' | \ | |
| tr -d ' ' | \ | |
| sed -e 's/$/:6:/' | \ | |
| gpg --import-ownertrust |
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
| cherrypy.server.socket_timeout = 0 |
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
| /* | |
| * This program is free software: you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License as published by | |
| * the Free Software Foundation, either version 3 of the License, or | |
| * (at your option) any later version. | |
| */ | |
| #include <arpa/inet.h> | |
| #include <linux/if_packet.h> | |
| #include <stdio.h> |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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 | |
| TTY=$(tty) | |
| curl -s http://status.int.covata.com:4567/results | | |
| jq -r '.[] | select(.check.output | startswith("PuppetLastRun WARNING:")) | .client' | | |
| while read HOST | |
| do | |
| echo ====== "$HOST" ====== | |
| IP=$(curl -s http://status.int.covata.com:4567/clients/"$HOST" | jq -r '.address') |