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
# From http://blogs.technet.com/b/heyscriptingguy/archive/2014/10/25/powertip-test-connectivity-to-remote-servers-without-ping.aspx | |
# Test a server for connectivity without PING | |
's1','s2' | % {Test-Wsman $_} |
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 | |
DEBUG="" | |
DATE=$(date +%Y-%m-%d) | |
HOSTNAME=`/bin/hostname` | |
AMINAME="$DATE-$HOSTNAME-AMI" | |
AMIDESC="$HOSTNAME backup to AMI on $DATE" | |
EC2_INSTANCE_ID="`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id || die \"wget instance-id has failed: $?\"`" | |
test -n "$EC2_INSTANCE_ID" || die 'cannot obtain instance-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
function Remove-MsgAttachment | |
{ | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(ParameterSetName="Path", Position=0, Mandatory=$True)] | |
[String]$Path, | |
[Parameter(ParameterSetName="LiteralPath", Mandatory=$True)] |
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_VERSION=`git --version | awk '{print $3}'` | |
URL="https://raw.github.com/git/git/v$GIT_VERSION/contrib/completion/git-completion.bash" | |
PROFILE="$HOME/.profile" | |
echo "Downloading git-completion for git version: $GIT_VERSION..." | |
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then | |
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1 | |
fi |
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 | |
# | |
# Clear out old, inactive versions of software | |
# installed by Homebrew. | |
# Created by Colin and listed on http://www.nonsenseby.me/blog/2014/01/12/remove-old-versions-in-homebrew/ | |
# | |
set -o noglob | |
# Some brew settings. | |
readonly BREW_CMD=$( which brew ) | |
readonly BREW_AWK="/tmp/brew.$$.awk" |
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
API_RECURSION_LIMIT = 5 | |
def get_stories(object_id): | |
token = facebook.get_app_access_token(APP_ID, APP_SECRET) | |
graph = facebook.GraphAPI(token) | |
def get_interesting_stories(until=None, since=None, recursion_level=0): | |
"""Recursive function that digs all the interesting stories till the recursion level is reached""" | |
api_parameters = { | |
'id': '{page_id}/feed'.format(page_id=object_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
SRV | |
_minecraft._tcp | |
Service:_minecraft | |
Protocol:_tcp | |
Name:@ | |
Priority:0 | |
Weight:0 | |
Port:25565 | |
Target:livecraft.us | |
Automatic |
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/python | |
import MySQLdb | |
conn = MySQLdb.connect (host = "host", | |
user = "us", | |
passwd = "pass", | |
db = "yourDB") | |
cursor = conn.cursor (MySQLdb.cursors.DictCursor ) | |
cursor.execute ("SELECT * from yourTable") |