Skip to content

Instantly share code, notes, and snippets.

View ldx's full-sized avatar
🌪️
Wreaking havoc

Vilmos Nebehaj ldx

🌪️
Wreaking havoc
View GitHub Profile
@ldx
ldx / flickr.py
Created September 26, 2011 14:11
Fetch all photos from a flickr account
#!/usr/bin/env python
#
# Only parameter is the user ID e.g. 12345678@N06, which comes
# from the last part of the URL pointing to your photostream.
#
import sys
import urllib2
import flickrapi
@ldx
ldx / dropbox_api_key_decode.py
Created February 21, 2013 15:36
This one decodes a Dropbox encoded API key obtained here: https://dl-web.dropbox.com/spa/pjlfdak1tmznswp/api_keys.js/public/index.html It was written after studying dropbox-js/src/prod.coffee.
from base64 import b64encode, b64decode
def decode_key(key):
key, secret = key.split('|')
key = b64decode(key)
key = [ord(x) for x in key]
secret = b64decode(secret)
s = range(256)
@ldx
ldx / install.sh
Last active December 16, 2015 16:49
#!/bin/sh
#
# curl -k -L https://gist.github.com/ldx/5466020/raw/|sh
# - or -
# wget -O - https://gist.github.com/ldx/5466020/raw/|sh
#
ssh-keyscan github.com
TMPDIR=`mktemp -d /tmp/temp.XXXX`
@ldx
ldx / gist:8862808
Created February 7, 2014 13:41
Find library via checking gcc/ld search directories
find_lib() {
_lib="$1"
_sysroot="$(gcc -print-sysroot)"
_gcc_searchdirs=$(gcc -print-search-dirs|grep '^libraries'|sed -e 's/^libraries: //g' -e 's/:/ /g' -e "s/=/\$sysroot/g")
_ld_searchdirs=$(ld --verbose|grep SEARCH_DIR|sed -e 's/SEARCH_DIR("//g' -e 's/");//g' -e "s/=/\$sysroot/g")
for d in $_gcc_searchdirs $_ld_searchdirs; do
if [ -f "$d/$_lib" ]; then
echo -n "$d/$_lib"
return
fi
@ldx
ldx / gist:9116170
Created February 20, 2014 15:23
Build a chroot with a CentOS 6.5 base install.
#!/bin/sh
#
# Build a chroot with a CentOS 6.5 base install.
#
CHROOT=/tmp/chroot
mkdir -p $CHROOT
mkdir -p $CHROOT/var/lib/rpm
#!/bin/bash
if [ -z "${SAUCE_USERNAME}" ] || [ -z "${SAUCE_ACCESS_KEY}" ]; then
echo "This script can't run without your Sauce credentials"
echo "Please set SAUCE_USERNAME and SAUCE_ACCESS_KEY env variables"
echo "export SAUCE_USERNAME=ur-username"
echo "export SAUCE_ACCESS_KEY=ur-access-key"
exit 1
fi
SAUCE_TMP_DIR="$(mktemp -d -t sc.XXXX)"
@ldx
ldx / test.sh
Created October 8, 2014 10:07
Just a test.
#!/bin/sh
echo "All good."
exit 0
@ldx
ldx / create_wallpaper_db
Created November 28, 2014 16:03
Create wallpaper sqlite DB on Mac OS X
import sqlite3
conn = sqlite3.connect('sqlite.db')
cur = conn.cursor()
cur.execute("PRAGMA foreign_keys=OFF;")
cur.execute("BEGIN TRANSACTION;")
cur.execute("CREATE TABLE pictures (space_id INTEGER, display_id INTEGER);")
cur.execute("INSERT INTO pictures VALUES(NULL,NULL);")
cur.execute("INSERT INTO pictures VALUES(NULL,1);")
@ldx
ldx / appium.log
Created January 6, 2015 13:34
Appium log 1
2015-01-06 12:45:15:507 - info: Welcome to Appium v1.3.4 (REV c8c79a85fbd6870cd6fc3d66d038a115ebe22efe)
2015-01-06 12:45:15:512 - info: Appium REST http interface listener started on 0.0.0.0:4443
2015-01-06 12:45:15:518 - info: [debug] Non-default server args: {"port":4443,"callbackAddress":"127.0.0.1","backendRetries":4,"launchTimeout":"40000","logTimestamp":true,"logNoColors":true,"browserName":"safari","orientation":"portrait","showSimulatorLog":true,"keepKeyChains":true,"isolateSimDevice":true}
2015-01-06 12:45:15:519 - warn: Deprecated server args: {"--show-sim-log":"use instead: --show-ios-log"}
2015-01-06 12:45:15:520 - info: Console LogLevel: debug
2015-01-06 12:45:16:092 - info: --> POST /wd/hub/session {"desiredCapabilities":{"deviceName":"iPhone Simulator","javascriptEnabled":true,"webdriver.remote.quietExceptions":true,"browserName":"safari","platformVersion":"8.1","platformName":"iOS"}}
2015-01-06 12:45:16:095 - info: Client User-Agent string: undefined
2015-01-06 12:45:16:096 - info: [debug] The
@ldx
ldx / appium.log
Created January 7, 2015 10:50
Appium log
2015-01-07 10:41:45:207 - info: Welcome to Appium v1.3.4 (REV 1c446f71b2759202b9677326c2a972b0b1377af9)
2015-01-07 10:41:45:211 - info: Appium REST http interface listener started on 0.0.0.0:4443
2015-01-07 10:41:45:217 - info: [debug] Non-default server args: {"port":4443,"callbackAddress":"127.0.0.1","backendRetries":4,"launchTimeout":"40000","logTimestamp":true,"logNoColors":true,"browserName":"safari","orientation":"portrait","showSimulatorLog":true,"keepKeyChains":true,"isolateSimDevice":true}
2015-01-07 10:41:45:218 - warn: Deprecated server args: {"--show-sim-log":"use instead: --show-ios-log"}
2015-01-07 10:41:45:218 - info: Console LogLevel: debug
2015-01-07 10:41:45:671 - info: --> POST /wd/hub/session {"desiredCapabilities":{"deviceName":"iPhone Simulator","javascriptEnabled":true,"webdriver.remote.quietExceptions":true,"browserName":"safari","platformVersion":"8.1","platformName":"iOS"}}
2015-01-07 10:41:45:674 - info: Client User-Agent string: undefined
2015-01-07 10:41:45:675 - info: [debug] The