Skip to content

Instantly share code, notes, and snippets.

View c0ze's full-sized avatar
🏠
Working from home

Arda Karaduman c0ze

🏠
Working from home
View GitHub Profile
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
)
export DOCKER_HOST=127.0.0.1:2375
export DISPLAY=:0 #FOR WLS Xming
export CLICOLOR=1
alias ls='ls --color=auto'
eval `dircolors /home/arda/dircolors-solarized/dircolors.256dark`
source ~/Dropbox/linux-common/.git-prompt.sh
source ~/Dropbox/linux-common/git-completion.sh
PS1="\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \$(__git_ps1) \[\e[1;37m\]"
export PATH="$HOME/.rbenv/bin:$PATH"
@c0ze
c0ze / .emacs
Created December 20, 2018 04:54
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
DOCKER=`which docker`
$DOCKER rm -v $($DOCKER ps -a -q -f status=exited)
$DOCKER rmi $($DOCKER images -f "dangling=true" -q)
$DOCKER volume rm $($DOCKER volume ls -qf dangling=true)
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDj91qUnVGoIikbkS03nX87nHk59+Iuw23tSabigZIaybc3qwft9ZYSrVmuOKuR/VeBPPQDE+rgiZ26RUI37JxZNZFK0WF2hasW4f+VpksoxOHmNJ8XCrJAZGnneJAVdN7x0z4dVY5RU7+hIlO7QHaSc1eAZ1TKZAIeyDWGZt6bnbRiOEzZWVDRYFXZycmbDFwHt4y+Dp/VjyAMsur5v+L+GKLoftk/HiWAHSF5o1o6saIiwfs0GBqr6n9sBCRsBSFBgqtl833mekMfW4O1627AkpBoRzOjxAkO/7j7qLaGIiEw7EhqmDQIVgj0cqureljRMQKDoez0Rgx00yiUGlGV akaraduman@gmail.com
cat ./* | grep ALLIANZ | awk '{print $9}' | sed 's/,//g' | awk '{s+=$1}END{print s}'
@c0ze
c0ze / phash_deps.sh
Created April 22, 2016 02:28
phash dependencies for rasbian
sudo apt-get install libsndfile1 libsndfile1-dev libsamplerate0 libsamplerate0-dev libmpg123-0 libmpg123-dev cimg-dev
@c0ze
c0ze / build.sh
Created April 10, 2016 11:39
shell script to compile a web/chrome app made with coffee-script / slim
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"
@c0ze
c0ze / replace.sh
Created March 18, 2016 08:57
Recursive replace string in directory
find `pwd` -iname "*.go" -type f -exec sed -i '' 's:github.com/alecthomas/log4go:github.com/sujrd/log4go:g' {} +
@c0ze
c0ze / ibeacon_scan.sh
Created December 25, 2015 10:24
A bash script to parse ibeacon packets
#!/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/'`