Skip to content

Instantly share code, notes, and snippets.

@lithid
lithid / gist:5364182
Created April 11, 2013 15:12
objdump adb
[lithid@GnomeArch platform-tools]$ objdump -p adb
adb: file format elf32-i386
Program Header:
PHDR off 0x00000034 vaddr 0x08048034 paddr 0x08048034 align 2**2
filesz 0x00000100 memsz 0x00000100 flags r-x
INTERP off 0x00000134 vaddr 0x08048134 paddr 0x08048134 align 2**0
filesz 0x00000013 memsz 0x00000013 flags r--
LOAD off 0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12
@lithid
lithid / Grid
Created February 20, 2013 02:05
Here is a grid using python and GTK3, loading dynamically based on window size/re-size. I came up with this example while trying to mimic a gridview of images for a wallpaper application. The example is below.
#!/usr/bin/env python2
from gi.repository import Gtk
class Grid(Gtk.Window):
widget_list = []
WIDGET_SIZE = 140
COLS = 1
NUM = 100
def calcule_columns(self, scroll, grid):
E/AndroidRuntime(13411): java.lang.RuntimeException: Unable to start receiver com.owentech.DevDrawer.receivers.AppInstalledReceiver: java.lang.IllegalStateException: Couldn't read row 0, col 2 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
E/AndroidRuntime(13411): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2507)
E/AndroidRuntime(13411): at android.app.ActivityThread.access$1500(ActivityThread.java:150)
E/AndroidRuntime(13411): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1320)
E/AndroidRuntime(13411): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(13411): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(13411): at android.app.ActivityThread.main(ActivityThread.java:5191)
E/AndroidRuntime(13411): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(13411): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(13411): at com.android.internal
@lithid
lithid / meh
Created February 1, 2013 16:37
<?php
$response = array();
require_once('db_connect.php');
$db = new DB_CONNECT();
# There are 6 variables tha can be used with this api
# id page count all order search
@lithid
lithid / gist:4251170
Created December 10, 2012 15:15
OnTouchListener
public class MainActivity extends Activity implements OnTouchListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
GridView gv = (GridView) findViewById(R.id.grid);
gv.setOnTouchListener(this); // Uses onTouch override
}
[lithid@ArchLinux ~]$ cat ~/.xinitrc
#!/bin/sh
# Start shit with this
exec ck-launch-session dbus-launch openbox-session
[lithid@ArchLinux ~]$ cat ~/.config/openbox/autostart
#
# These things are run when an Openbox X Session is started.
# You may place a similar script in $HOME/.config/openbox/autostart
# to run user-specific things.
#xinitrc
#!/bin/sh
# Start shit with this
exec ck-launch-session dbus-launch openbox-session
#autostart
#
# These things are run when an Openbox X Session is started.
# You may place a similar script in $HOME/.config/openbox/autostart
# to run user-specific things.
#!/usr/bin/env python
import sys
import platform
p = platform.dist()
distro = p[0]
version = p[1]
name = p[2]
check = (sys.maxsize > 2**32)
@lithid
lithid / lwjgl-update.sh
Created May 19, 2012 20:53
Download updated lwjgl library for minecraft
#!/bin/bash
# Written by Lithid
URL="http://downloads.sourceforge.net/project/java-game-lib/Official%20Releases/LWJGL%202.6/lwjgl-2.6.zip"
FILE="lwjgl-2.6.zip"
FOLDER="lwjgl-2.6"
DIR="$HOME/.minecraft"
if [ -d $DIR ]; then
cd $DIR
String[] checkRom = {"gapps-geek.sh check-rom"};
String[] checkGapps = {"gapps-geek.sh check-gapps"};
// On check rom Preference
RunAsRoot(checkRom);
// On check gapps Preference
RunAsRoot(checkGapps);
public void RunAsRoot(String[] cmds){