This file contains 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
Show hidden characters
{ | |
"cmd" : ["$file"], | |
"selector" : "source.shell", | |
"shell" : "bash" | |
} |
This file contains 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
echo "AMI's from snapshots which no longer exist"; | |
echo "----------------------------------"; | |
for i in `aws describe-snapshots | grep -o "ami-\([0-9]\|[a-z]\)\+" | sort -u`; do | |
if [[ -n `aws dim $i | grep requestId` ]]; then | |
echo "$i"; else echo ""; | |
fi; | |
done; |
This file contains 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
It's not "plumbing", but it'll do exactly what you want: | |
$ git log --format=%B -n 1 <commit> | |
If you absolutely need a "plumbing" command (not sure why that's a requirement), you can use rev-list: | |
$ git rev-list --format=%B --max-count=1 <commit> | |
Although rev-list will also print out the commit sha (on the first line) in addition to the commit message. |
This file contains 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 | |
BASEDIR=$(dirname $0) | |
echo $BASEDIR |
This file contains 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
See the EC2 documentation on the subject. | |
Run: | |
wget -q -O - http://169.254.169.254/latest/meta-data/instance-id | |
If you need programatic access to the instance ID from within a script, | |
die() { status=$1; shift; echo "FATAL: $*"; exit $status; } | |
EC2_INSTANCE_ID="`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id || die "wget instance-id has failed: $?"`" |
This file contains 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
alias rmdbc="find . -name *\ \(*conflicted* -exec rm {} \;" # recursively delete Dropbox conflicted files | |
# and/or (smart idea from Gordon Fontenot) | |
alias rmdbcsafe="find . -name *\ \(*conflicted* -exec mv {} ~/DropboxConflicts/ \;" # recursively move Dropbox conflicted files to temp folder | |
# or... via TJ Luoma | |
alias rmdbctrash="find . -name *\ \(*conflicted* -exec mv -v {} ~/.Trash/ \;" # recursively move Dropbox conflicted files to Trash | |
# More advanced idea combining ideas from @modernscientist and @GFontenot would be | |
# Hazel or launchd script to move conflicted files to temp folder once a day, and Hazel or launchd script to delete files older than [x] | |
# Or schedule TJ's idea of moving to Trash and skipping intermediate folder while still maintaining the ability to review | |
# hmmmm... |
This file contains 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 will do it: | |
Code: | |
#!/bin/bash | |
IFS=' | |
' | |
xbox_name=($(curl -s http://marketplace.xbox.com/en-US/Promotion/dealoftheweek|grep -i "a class"|grep -i "title="|cut -d""" -f6)) | |
xbox_price=($(curl -s http://marketplace.xbox.com/en-US/Promotion/dealoftheweek|grep -i "mspoints goldprice"|cut -d">" -f3|cut -d"<" -f1)) |
This file contains 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
area[11]=23 | |
area[13]=37 | |
area[51]=UFOs | |
# Array members need not be consecutive or contiguous. | |
# Some members of the array can be left uninitialized. | |
# Gaps in the array are okay. | |
# In fact, arrays with sparse data ("sparse arrays") |
This file contains 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
Automating CPAN across a network | |
CPAN is an excellent tool, but the system has its limitations. One major drawback is that it's a single-system solution, which is fine if you want to manage your Perl installations on a single-computer basis. But if you have a set of Perl modules spread across your Web server farm or even across your lab on a range of platforms, trying to keep up to date across all the computers can be a time-consuming process -- even if you use the automation techniques I discussed above. | |
CPAN also consumes a lot of Internet bandwidth in that for each computer on which you use CPAN, CPAN expects to download a copy of the files from one of the central CPAN repositories. CPAN also relies on a configuration that has to be tailored to each computer: You can copy a configuration file, which resides in /perlinstalldirectory/CPAN/Config.pm, only if you can configure your platforms identically. | |
An obvious route to take when using CPAN is to use the autobundle function. This function generates a list |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE syntax SYSTEM "syntax.dtd"> | |
<syntax> | |
<head> | |
<name>bash</name> <!-- The definitions title --> | |
<charsintokens><![CDATA[_0987654321abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@/.]]></charsintokens> <!-- Valid Characters for Variables --> | |
<!-- <charsdelimitingtokens></charsdelimitingtokens> --> | |
</head> |
OlderNewer