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
import java.io.File; | |
import java.io.FileDescriptor; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.io.RandomAccessFile; | |
import java.lang.reflect.Field; | |
import java.nio.channels.Channels; | |
import java.nio.channels.FileChannel; | |
import java.nio.file.FileSystems; |
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 | |
IMAGE_A=$1 | |
IMAGE_B=$2 | |
TMP_DIR=$(mktemp -d) | |
cleanup() { | |
rm -rf "$TMP_DIR" | |
} | |
# Trap signals |
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
package com.importio.webcache.web.api; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Parameter; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.TreeMap; |
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 -ex | |
# 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=$S3_BACKUP_BUCKET | |
dir="tmp-backups" | |
account=$GITHUB_ACCOUNT | |
date=`date '+%Y%m%d%H%M%S'` |
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
region=us-east-1 | |
s3_bucket_name=$1 | |
sns_topic_name=$2 | |
sqs_queue_name=$sns_topic_name | |
# create the SNS topic | |
sns_topic_arn=$(aws sns create-topic \ | |
--region "$region" \ | |
--name "$sns_topic_name" \ | |
--output text \ |
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
# (1) set up the client | |
# where to get the access/secret key | |
# see http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html | |
AWSCredentialsProvider credentialsProvider = new DefaultAWSCredentialsProviderChain(); | |
ClientConfiguration clientConfig = new ClientConfiguration(); | |
AmazonKinesis kinesis = new AmazonKinesisClient(credentialsProvider, clientConfig); | |
# what region you are in |
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
# If ccache was installed via Homebrew: | |
export PATH="`brew --prefix ccache`/libexec:$PATH" | |
# Import the stock config for building the browser (Firefox) | |
. $topsrcdir/browser/config/mozconfig | |
. $topsrcdir/build/macosx/mozconfig.common | |
# Define where build files should go. This places them in the directory | |
# "obj-ff-dbg" under the current source directory |
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
/******************************************************************************* | |
* Copyright (c) 2007 IBM Corporation and others. All rights reserved. This program and the | |
* accompanying materials are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* | |
* Contributors: IBM Corporation - initial API and implementation | |
*******************************************************************************/ | |
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
''' | |
Created on 19 Sep 2013 | |
@author: dev | |
''' | |
import requests, threading, logging, uuid, json | |
logging.basicConfig(level=logging.INFO) | |
logger = logging.getLogger(__name__) |
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
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import com.google.common.io.ByteStreams; | |
public class Test { |
NewerOlder