sudo apt-get install python-setuptools
wget http://sourceforge.net/projects/s3tools/files/s3cmd/1.5.2/s3cmd-1.5.2.tar.gz
tar xvfz s3cmd-1.5.2.tar.gz
cd s3cmd-1.5.2
sudo python setup.py install
s3cmd --configure
This file contains hidden or 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 main | |
import( | |
"log" | |
"net/url" | |
"net/http" | |
"net/http/httputil" | |
) | |
func main() { |
This file contains hidden or 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
find . -type d -printf "%f\n" | sort -f | uniq -i |
This file contains hidden or 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
// in Go Play: http://play.golang.org/p/G5e-E8fe7h | |
package main | |
import "fmt" | |
func UniqStrs(slice []string) []string { | |
m := map[string]bool{} | |
for _, v := range slice { | |
m[v] = true | |
} |
This file contains hidden or 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
# port from https://portal.redbridge.se/faq/api/guide/ | |
require 'openssl' | |
require 'digest/hmac' | |
require 'base64' | |
require 'cgi' | |
BASE_URL = "https://api.rbcloud.net/client/api" | |
API_KEY = "your api key" | |
SECRET_KEY = "your secret key" |
This file contains hidden or 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
# Apples build env's https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html | |
# | |
ROOT_PRODUCT_IDENTIFIER_PLIST=`/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" $INFOPLIST_FILE` | |
export ROOT_PRODUCT_IDENTIFIER=`eval echo $ROOT_PRODUCT_IDENTIFIER_PLIST` |
Enable
defaults write com.apple.Safari NSUserKeyEquivalents -dict-add Back "\U232b"
Disable
defaults delete com.apple.Safari NSUserKeyEquivalents
This file contains hidden or 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
Use an 8GB+ USB stick and format it with Mac OS Extended (Journaled) and name Untitled | |
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction |
This file contains hidden or 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
# taken from http://stackoverflow.com/questions/1960799/using-git-and-dropbox-together-effectively | |
~/project $ git init | |
~/project $ git add . | |
~/project $ git commit -m "first commit" | |
~/project $ cd ~/Dropbox/git | |
~/Dropbox/git $ git init --bare project.git | |
~/Dropbox/git $ cd ~/project |
This file contains hidden or 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
private static async Task<bool> UploadFile(string filePath, string actionUrl) | |
{ | |
FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read); | |
HttpContent filePathContent = new StringContent(filePath); | |
HttpContent fileStreamContent = new StreamContent(file); | |
using (var client = new HttpClient()) | |
using (var formData = new MultipartFormDataContent()) | |
{ | |
formData.Add(filePathContent, "filepath"); | |
formData.Add(fileStreamContent, "file", Path.GetFileName(filePath)); |