- http://donigian.blogspot.com, http://donigian.github.com
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
To set up a new Chef workstation: | |
+ download vagrant | |
+ download virtualbox | |
+ vagrant box add precise64 | |
+ vagrant plugin install vagrant-berkshelf | |
+ vagrant plugin install vagrant-omnibus | |
+ git clone [email protected]:gpn-dev/chef-repo.git | |
+ vagrant up | |
vagrant up |
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
For example, if your commit history is A-B-C-D-E-F with F as HEAD, and you want to change the author of C and D, then you would... | |
Specify git rebase -i B | |
change the lines for both C and D to edit | |
Once the rebase started, it would first pause at C | |
You would git commit --amend --author="Author Name <[email protected]>" | |
Then git rebase --continue | |
It would pause again at D | |
Then you would git commit --amend --author="Author Name <[email protected]>" again | |
git rebase --continue |
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
✗ knife bootstrap localhost \ | |
--ssh-user vagrant \ | |
--ssh-password vagrant \ | |
--ssh-port 2222 \ | |
--run-list "recipe[apt]" \ | |
--sudo | |
Bootstrapping Chef on localhost | |
localhost --2013-12-19 21:47:47-- https://www.opscode.com/chef/install.sh | |
localhost Resolving www.opscode.com (www.opscode.com)... 184.106.28.91 | |
localhost Connecting to www.opscode.com (www.opscode.com)|184.106.28.91|:443... connected. |
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 | |
set -o errexit | |
set -o nounset | |
if [[ ${#} -ne 1 ]] | |
then | |
echo "Usage: ${0} upstart-conf-file" >&2 | |
exit 1 | |
fi |
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
scala> callByValue(printFoo()) | |
Func Foo invoked | |
a1="a1" | |
a2="a2" | |
scala> callByName(printFoo()) | |
Func Foo invoked | |
b1="b1" | |
Func Foo invoked | |
b2="b2" |
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
def printFoo() = { | |
println("Func Foo invoked") | |
} | |
def callByValue(a: String) = { | |
println("a1=" + a) | |
println("a2=" + a) | |
} | |
def callByName(b: => String) = { |
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
function mk-scala-dir() { | |
mkdir -p src/main/{resources,scala} | |
mkdir -p test/{resources,scala} | |
mkdir -p project/ | |
touch build.sbt | |
printf 'name := "sample"\n\n' >> build.sbt | |
printf 'version := "0.0.1"\n\n' >>build.sbt | |
printf 'scalaVersion := "2.10.0"\n' >> build.sbt | |
touch project/build.properties |
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
rmongodb Example | |
library(rmongodb) | |
mg2 <- mongo.create() | |
print(mongo.get.databases(mg2)) | |
print(mongo.get.database.collections(mg2, 'db')) | |
buf <- mongo.bson.buffer.create() | |
mongo.bson.buffer.start.object(buf, 'AGE') | |
mongo.bson.buffer.append(buf, '$lt', 10) | |
mongo.bson.buffer.finish.object(buf) |
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
$ git checkout master && git pull | |
$ git checkout -b topic | |
-> Work a bit and commit changes | |
-> Preview changes from master | |
$ git checkout master # Think about checking out branch performing action to | |
$ git pull | |
$ git checkout topic | |
$ git rebase master | |
-> When unit & integration tests pass | |
$ git checkout master |
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
sudo service postgresql restart | |
sudo service postgresql status | |
sudo service postgresql stop | |
sudo service postgresql status | |
sudo crontab -l | |
tail -f /var/log/postgresql/postgresql-9.1-main.log | |
/etc/services |