Skip to content

Instantly share code, notes, and snippets.

View sgnn7's full-sized avatar
🤔
ǝʌᴉʇɔǝdsɹǝd ɹnoʎ ǝƃuɐɥƆ

Srdjan Grubor sgnn7

🤔
ǝʌᴉʇɔǝdsɹǝd ɹnoʎ ǝƃuɐɥƆ
View GitHub Profile
@sgnn7
sgnn7 / upload_to_aws.sh
Last active August 29, 2015 14:01
Upload file to S3
#!/bin/bash -e
if [ $# -ne 2 ]; then
echo "Usage: $0 <file> <s3keysecret>"
exit 1
fi
if [ ! -f $1 ]; then
echo "File $1 not found. Exiting"
exit 1
#!/usr/bin/env python
import gevent.monkey
gevent.monkey.patch_all()
import boto
import config
import gevent
import gevent.pool
import os
@sgnn7
sgnn7 / download_railscasts.sh
Created September 2, 2014 18:07
RailsCasts download
#!/usr/bin/env ruby
# A script to download the latest episodes from railscasts.com
#
# modifications: sgnn7 <sgnn7@sgnn7.org>
# original author: modsaid <mahmoud@modsaid.com>
require 'rubygems'
require 'json'
require 'open-uri'
@sgnn7
sgnn7 / update_bash.sh
Last active August 29, 2015 14:06
Update bash to non-buggy version
#!/bin/bash -e
VERSION=4.3-7ubuntu1.3
BUILD=6410174
PPA="ubuntu-security-proposed"
ARCH=amd64
PREFIX=/tmp/dl
sudo rm -rf $PREFIX
mkdir -p $PREFIX
@sgnn7
sgnn7 / nginx.conf
Last active August 29, 2015 14:08
NGINX SSL ciphers
{
# Less secure though more compatible and possibly vulnerable to BEAST attack
# ssl_ciphers 'EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:DHE+aRSA+AES:EECDH+aRSA+SHA384:EECDH+aRSA+GCM+SHA256:!aNULL:!eNULL:!EXPORT:!MEDIUM:!LOW:!CAMELLIA:!3DES:!DES:!MD5:!PSK:!RC4:!DSS:!SRP:!DSS:!SEED:!SSLv3:!SSLv2:!IDEA:!aGOST';
# More secure but might not be compatible with all browsers
ssl_ciphers 'EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EDH+aRSA+AESGCM:!SHA:!aNULL:!eNULL:!EXPORT:!MEDIUM:!LOW:!CAMELLIA:!3DES:!DES:!MD5:!PSK:!RC4:!DSS:!SRP:!DSS:!SEED:!SSLv3:!SSLv2:!IDEA:!aGOST';
ssl_ecdh_curve secp384r1;
}
@sgnn7
sgnn7 / listactivities.sh
Created October 27, 2011 16:02
Listing activity stack of an android app
#!/bin/bash
adb shell dumpsys activity | grep Intent | grep -v 'Intent:' | grep -v Sticky | sed -e 's/.* cmp=.*\///g' | sed -e 's/}//g'
@sgnn7
sgnn7 / show_mem_usage
Created December 15, 2011 21:09
Showing the memory usage of android app
#!/bin/bash
adb shell dumpsys meminfo | awk '/^\*\*.*com.asolutions.endless.mobility/ { c=20;{print}next}c-->0'
@sgnn7
sgnn7 / sketch_vu.ino
Last active October 23, 2015 03:25
Arduino VU meter
#define RED 0
#define GREEN 1
#define BLUE 2
#define VOLUME_DEAD_ZONE 34
#define MIN_VOLUME 40
#define MAX_VOLUME 460
#define CENTER_VOLUME ((MAX_VOLUME + MIN_VOLUME) / 2)
@sgnn7
sgnn7 / .gitignore
Last active January 25, 2016 23:00
Build mesos.deb with Docker
*.deb
build/
APP_NAME=foobar
TASK_INDEX=0
LOG_TYPE=stderr # or stdout
MARATHON_HOST="marathon.host.local"
SCHEME=https
MARATHON_TASK_URI="$SCHEME://$MARATHON_HOST/v2/apps/$APP_NAME?embed=app.tasks"
app_info=$(curl "$MARATHON_TASK_URI")
app_task=$(echo ${app_info} | jq -r ".app.tasks[$TASK_INDEX]")