Skip to content

Instantly share code, notes, and snippets.

View mariusbutuc's full-sized avatar
🌏

Marius Butuc mariusbutuc

🌏
  • Toronto, ON
  • 22:52 (UTC -04:00)
View GitHub Profile
@mariusbutuc
mariusbutuc / db2.sh
Created September 10, 2012 19:47
Start DB2 v10.1 and enable Text Search, for each DB2 instance
#! /bin/sh
# vim /etc/init.d/db2.sh
# chmod 744 /etc/init.d/db2.sh
# ln /etc/init.d/db2.sh /etc/rc3.d/db2.sh
for i in `/opt/ibm/db2/V10.1/bin/db2ilist`;
do
su - $i -c "db2start"
su - $i -c 'db2ts "START FOR TEXT"'
@mariusbutuc
mariusbutuc / branch-merge.git
Created September 13, 2012 15:05
Git (hotfix) branch merging workflow
[IMCloud (hotfix_<id>)]$ git checkout develop
[IMCloud (develop)]$ git pull origin develop
[IMCloud (develop)]$ git pull origin hotfix_<id>
< If there are any conflicts, solve them and: >
[IMCloud (develop|MERGING)]$ git add <files to be committed>
< Commit changes introduced by solving conflicts >
[IMCloud (develop|MERGING)]$ git commit -m "Pulling from branch hotfix_<id>"
[IMCloud (develop)]$ git push origin develop
[IMCloud (develop)]$ git checkout test
@mariusbutuc
mariusbutuc / branch-rename-remote.git
Created September 21, 2012 23:12
Rename remote Git branch
git push origin previous_name:new_name
git branch new_name origin/new_name
# http://stackoverflow.com/a/3790682/341929
@mariusbutuc
mariusbutuc / branch-delete.git
Created September 21, 2012 23:16
Delete Git branch: local and remote
git branch -d obsolete_branch
git push origin --delete obsolete_branch
@mariusbutuc
mariusbutuc / devtest.sh
Created October 31, 2012 02:25
My first "real" bash script
#! /bin/bash
clear
case "$2" in
master) branches=(test develop master);;
dev) branches=(test develop);;
*) branches=(test);;
esac
for branch in ${branches[*]}
#!/bin/bash
# Argument = -e email -u username -i initials -v
usage()
{
cat << EOF
usage: $0 options
This script creates a new dev/test user on imcloud-devtest.torolab.ibm.com.
@mariusbutuc
mariusbutuc / moodle2_backup.sh
Created November 22, 2012 17:55
BDU: Take online backup of MOODLE2 and store it in S3 script.
#!/bin/sh
###########################################################
#
# Take online backup of MOODLE2 and store it in S3 script.
#
###########################################################
echo '\n\n################# New MOODLE2 backup ################################################################' >> moodle2_backup.log
export DATABASE=MOODLE2
@mariusbutuc
mariusbutuc / gist:4138546
Created November 24, 2012 05:21 — forked from davatron5000/gist:2254924
Static Site Generators

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby

@mariusbutuc
mariusbutuc / .bashrc
Created December 1, 2012 17:27
Make git nicer
# Git tab completion
source ~/git-completion.bash
# Show branch in status line
PS1='[\W$(__git_ps1 " (%s)")]\$ '
export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"'
[express (master)]$ node app.js
/Users/marius/Projects/spa/explore-node/express/app.js:2
var app = express();
^
TypeError: object is not a function
at Object.<anonymous> (/Users/marius/Projects/spa/explore-node/express/app.js:2:11)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)