This file contains 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
adb shell content delete --uri content://settings/settings/pointer_speed | |
adb shell content query --uri content://settings/settings | |
adb shell content insert --uri content://settings/secure --bind name:s:my_number --bind value:i:24 | |
See "package com.android.commands.content;" in /frameworks/base/cmds/content/ | |
Usese "final class ContentProviderProxy implements IContentProvider" in ContentProviderProxy.java |
This file contains 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
android.os.Process.myPid() | |
android.os.Process.killProcess(android.os.Process.myPid()) |
This file contains 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
On SSH server make sure the sshd config file contains "X11Forwarding yes" (/etc/ssh/sshd_config). | |
On the client add -X flag to ssh command ( ssh -X myusername@myhost.com ). Then simply run X11 programs. |
This file contains 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
import sys, os | |
from OpenSSL import crypto, SSL | |
from socket import gethostname | |
from pprint import pprint | |
from time import gmtime, mktime | |
from os.path import exists, join | |
CERT_FILE = "apache.crt" | |
KEY_FILE = "apache.key" |
This file contains 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 vi /etc/init.d/cjp | |
sudo chmod +x /etc/init.d/cjp | |
#if you want it to run at startup | |
sudo update-rc.d cjp defaults | |
#to remove | |
sudo update-rc.d -f cjp remove | |
#start and stop at will |
This file contains 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
#get version | |
python -c "import django; print(django.get_version())" | |
#create a project | |
django-admin.py startproject mysite | |
#run development server | |
python manage.py runserver OR python manage.py runserver 8080 OR python manage.py runserver 0.0.0.0:8000 | |
#create databse tables from INSTALLED_APPS models |
This file contains 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 python-software-properties | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
Oracle JDK 6 | |
sudo apt-get install oracle-java6-installer | |
Oracle JDK 7 | |
sudo apt-get install oracle-java7-installer |
This file contains 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
tail -f /var/log/syslog | stdbuf -oL cut -d'|' -f2 | tee times.txt |
This file contains 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
See device/sample/frameworks/PlatformLibrary/README.txt | |
Platform Library Example | |
~~~~~~~~~~~~~~~~~~~~~~~~ | |
This directory contains a full example of writing your own Android platform | |
shared library, without changing the Android framework. It also shows how to | |
write JNI code for incorporating native code into the library, and a client | |
application that uses the library. |
This file contains 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
public void handle(HttpRequest request, ... ) { | |
Header[] hdrs = request.getAllHeaders(); | |
for( Header h: hdrs) { | |
Log.w(TAG, h.getName()+":"+h.getValue()); | |
} | |
} |