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 | |
group_name='<log-group-name>' | |
start_seconds_ago=3600 | |
aws_cmd_opts= # e.g. "--profile <profile-name>" | |
# Usage: get_loglines "<log-group-name>" <start-time> | |
get_loglines() { | |
aws $aws_cmd_opts --output text logs filter-log-events \ | |
--log-group-name "$1" \ |
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
# usage : sh meteorDump.sh <YOUR DOMAIN> | |
mongourl=`meteor mongo -U $1` | |
ID=`echo $mongourl | sed "s/.*\/\/\([a-z0-9-]*\).*/\1/"` | |
PASSWORD=`echo $mongourl | sed "s/.*:\([a-z0-9-]*\)@.*/\1/"` | |
NAME=`echo $mongourl | sed "s/.*\/\([a-z_]*\)$/\1/"` | |
URL=`echo $mongourl | sed "s/.*@\([a-z0-9.-]*:[0-9]*\).*/\1/"` | |
mongodump -u $ID -h $URL -d $NAME -p $PASSWORD | |
echo | |
echo "mongodump 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
wait4eth1() { | |
CNT=0 | |
until ip a show eth1 | grep -q UP | |
do | |
[ $((CNT++)) -gt 60 ] && break || sleep 1 | |
done | |
sleep 1 | |
} | |
wait4eth1 |
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
var request = require("request"); | |
// The Cities IDs can be found on openweathermap.org (make a search, and look the URI) | |
var cities = [2988507, 5391959]; | |
var slackBotUri = ""; // TODO: Complete | |
request("http://api.openweathermap.org/data/2.5/group?id="+cities.join(',')+"&units=metric ", function(error, response, body) { | |
// Maybe we can handle this differently/better ? | |
if(error != null) | |
return; |
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
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin <branch-name> |
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
find-up() { | |
local path=$(pwd) | |
while [[ "$path" != "" && ! -e "$path/$1" ]]; do | |
path=${path%/*} | |
done | |
if [ "$path" != "" ] | |
then | |
echo "$path" | |
fi | |
} |