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 i in `seq 1 8` | |
do | |
echo "cat ~/.ssh/id_rsa.pub | ssh account@iaas-hh$i 'cat >> .ssh/authorized_keys'" | |
cat ~/.ssh/id_rsa.pub | ssh account@iaas-hh$i 'cat >> .ssh/authorized_keys' | |
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
#!/bin/bash | |
DAUMID=***** | |
DAUMPW=***** | |
# IMAP SSL/TLS | |
response=`{ echo "a001 login $DAUMID $DAUMPW"; sleep 1; echo "a002 select inbox"; sleep 1; echo "a003 logout"; } | /usr/local/bin/gnutls-cli imap.daum.net --port=993` | |
# fetch `UNSEEN` mail count | |
unseen=$(echo $response | grep -oEi 'OK\ \[UNSEEN\ (\d+)' | awk '{print $3}') |
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
PLATFORM=`uname` | |
if [[ "$PLATFORM" == 'Darwin' ]]; then # Mac | |
IP=`/sbin/ifconfig en0 | grep inet | grep -v inet6 | awk '{print $2}'` | |
elif [[ "$PLATFORM" == 'Linux' ]]; then # Linux | |
IP=`/sbin/ifconfig eth0 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*'` | |
fi | |
print $IP |
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
// cc MaxTemperature Application to find the maximum temperature in the weather dataset | |
// vv MaxTemperature | |
import java.io.IOException; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.IntWritable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.mapreduce.Job; | |
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; | |
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; |
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
.vim |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sqlite3.h> | |
static int callback(void *NotUsed, int argc, char **argv, char **azColName) { | |
NotUsed = 0; | |
int i; | |
for (i = 0; i < argc; i++) { | |
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL"); | |
} |
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 -e | |
GIT_OPTS="--max-count=10" | |
commit_id_format=$(tput setaf 3) | |
date_format=$(tput setaf 4) | |
author_format=$(tput setaf 2) | |
ref_name_format=$(tput setaf 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
#!/bin/sh | |
# See http://www.wtfpl.net/txt/copying for license details | |
# Creates a minimal manifest and manifest.uuid file so sqlite (and fossil) can build | |
git rev-parse --git-dir >/dev/null || exit 1 | |
git log -1 --format=format:%ci%n | sed -e 's/ [-+].*$//;s/ /T/;s/^/D /' > manifest | |
echo $(git log -1 --format=format:%H) > manifest.uuid |
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 | |
url=`pbpaste` | |
url=$(echo $url | sed 's/www.dropbox.com/dl.dropboxusercontent.com/g' | tr -d '\n') | |
echo "$url" | |
echo "$url" | pbcopy |
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
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <time.h> | |
#include <pthread.h> |