Skip to content

Instantly share code, notes, and snippets.

View DevelopKim's full-sized avatar

Develop.Kim DevelopKim

View GitHub Profile
#!/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" \
@acidsound
acidsound / meteorDump.sh
Last active August 29, 2015 14:27
usage: sh meteorDump.sh <YOUR DOMAIN>
# 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"
@garthk
garthk / profile
Created June 21, 2015 23:51
boot2docker 1.7.0 cert fix
wait4eth1() {
CNT=0
until ip a show eth1 | grep -q UP
do
[ $((CNT++)) -gt 60 ] && break || sleep 1
done
sleep 1
}
wait4eth1
@cmaneu
cmaneu / slackWeather.js
Last active January 19, 2024 19:59
Slack slackbot send weather forecast
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;
@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active November 12, 2023 23:00
Remove node_modules from git repo
#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>
find-up() {
local path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
if [ "$path" != "" ]
then
echo "$path"
fi
}