An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
object WordCount { | |
def main(args: Array[String]) { | |
import mapreduce._ | |
import _root_.scala.io.Source | |
def textInputFormat(lines: Iterator[String], offset: Long = 0): Stream[(Long, String)] = { | |
if(lines.hasNext) { | |
val line = lines.next |
#!/bin/bash | |
# Script to backup git repo to S3 | |
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars | |
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc | |
bucket=$GITHUB_BACKUP_BUCKET | |
dir=$GITHUB_BACKUP_DIR | |
password=$GITHUB_BACKUP_PASSWORD | |
account=$GITHUB_ACCOUNT |
#!/bin/bash | |
# Script to backup git repo to S3 | |
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars | |
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc | |
bucket=$GITHUB_BACKUP_BUCKET | |
dir=$GITHUB_BACKUP_DIR | |
password=$GITHUB_BACKUP_PASSWORD | |
account=$GITHUB_ACCOUNT |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
This tutorial guides you through creating your first Vagrant project.
We start with a generic Ubuntu VM, and use the Chef provisioning tool to:
Afterwards, we'll see how easy it is to package our newly provisioned VM
>>> from jinja2 import Template | |
>>> tmpl = """{% if name != "Jeff" %}Nothing to see here move along{% else %} | |
... hello {{name}}, how are you?{% endif %}""" | |
>>> template = Template(tmpl) | |
>>> print template.render({"name": "Jeff"}) | |
hello Jeff, how are you? | |
>>> print template.render({"name": "John"}) | |
Nothing to see here move along | |
>>> |
# update gems | |
sudo gem update --no-rdoc --no-ri | |
# edit client.rb with correct validation key and chef server | |
# also set the environment | |
log_level :info | |
log_location STDOUT | |
chef_server_url "https://api.opscode.com/organizations/modcloth-comments" | |
validation_client_name "modcloth-comments-validator" | |
node_name "comments-standalone-01.demo.modcloth.com" |
Press minus + shift + s
and return
to chop/fold long lines!
#!/bin/sh | |
# check for where the latest version of IDEA is installed | |
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1` | |
wd=`pwd` | |
# were we given a directory? | |
if [ -d "$1" ]; then | |
# echo "checking for things in the working dir given" | |
wd=`ls -1d "$1" | head -n1` |