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
#!/bin/bash | |
# This script generates a static version of your rails site | |
# and uploads it into specified S3 bucket | |
# in this case the site had only two static pages, index.html and dashboard.html | |
# you need to configure these in routes.rb | |
# PS: if you know any other cleaner way to do this, pls let me know. | |
# this is necessary for setting up rbenv/rvm | |
source /Users/coze/.bash_profile |
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
### Keybase proof | |
I hereby claim: | |
* I am c0ze on github. | |
* I am coze (https://keybase.io/coze) on keybase. | |
* I have a public key whose fingerprint is 1E59 A9C5 7D0A A2FF E48F DF72 13BC 8AE4 E958 D3CC | |
To claim this, I am signing this object: |
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
require 'zip' | |
file_path = ARGV[0] | |
Zip::ZipFile.open(file_path) { |zip_file| | |
zip_file.each { |f| | |
date = f.name.split("/")[2].split(" ")[0] | |
name = f.name.split("/")[3] | |
p "date #{date} name #{name}" | |
f_path=File.join("GooglePhotos", date.split("-"), name) |
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
require "aws-sdk" | |
require "dotenv" | |
require "reduce" | |
Dotenv.load | |
def local_dir; './_site'; end | |
def access_key; ENV['AWS_ACCESS_KEY']; end | |
def secret_key; ENV['AWS_SECRET_KEY']; end |
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
#!/bin/bash | |
# Eddystone Scan by Arda Karaduman | |
# Based on ibeacon_scan by radius networks | |
# http://stackoverflow.com/questions/21733228/can-raspberrypi-with-ble-dongle-detect-ibeacons | |
if [[ $1 == "parse" ]]; then | |
packet="" | |
capturing="" | |
count=0 | |
while read line |
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
#!/bin/bash | |
# iBeacon Scan by Arda Karaduman | |
function parse_ib_uuid { | |
UUID=`echo $1 | sed 's/^.\{69\}\(.\{47\}\).*$/\1/'` | |
UUID=`echo $UUID | sed -e 's/\ //g' -e 's/^\(.\{8\}\)\(.\{4\}\)\(.\{4\}\)\(.\{4\}\)\(.\{12\}\)$/\1-\2-\3-\4-\5/'` | |
} | |
function parse_ib_major { | |
MAJOR=`echo $1 | sed 's/^.\{117\}\(.\{5\}\).*$/\1/'` |
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 `pwd` -iname "*.go" -type f -exec sed -i '' 's:github.com/alecthomas/log4go:github.com/sujrd/log4go:g' {} + |
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
TARGETDIR="./out" | |
rm -rf $TARGETDIR | |
# copy html | |
for file in $(find . -type f -name \*.html); do | |
dir="./$TARGETDIR/$(dirname ${file})" | |
mkdir -p "$dir" | |
cp $file "$dir/$(basename ${file%.*}).html" |
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
sudo apt-get install libsndfile1 libsndfile1-dev libsamplerate0 libsamplerate0-dev libmpg123-0 libmpg123-dev cimg-dev |
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
cat ./* | grep ALLIANZ | awk '{print $9}' | sed 's/,//g' | awk '{s+=$1}END{print s}' |
OlderNewer