Skip to content

Instantly share code, notes, and snippets.


Christopher Piekarski chris-piekarski

View GitHub Profile
chris-piekarski / ruby_twitter_crunch
Last active Dec 14, 2015
Ruby Twitter Crunch It Steps
View ruby_twitter_crunch
> redis-server
> vi ./examples/Rakefile
@app_token = ''
@app_secret = ''
@user_accounts = {:name_one => { :token => '',
:secret => '',
:filter => ['cubs', '#baseball']},
chris-piekarski / compile_off_proc_cpuinfo
Created Feb 26, 2013
Record build time and multiprocess build for machine type
View compile_off_proc_cpuinfo
# record build time and multiprocess build for machine
time make -j$(egrep '^processor' /proc/cpuinfo | wc -l) 2>&1 | tee my_make.out
chris-piekarski / git log alias
Last active Dec 14, 2015
Git log alias & GitStats HTML Output
View git log alias
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
#other git log commands
git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
#see short changes for a commit id
git diff --stat b78c27ee675356a309cb5d0e3edf1462e1764a44
chris-piekarski / add_new_android_permission
Created Mar 19, 2013
Add new permissions to Android platform.
View add_new_android_permission
To add a new permission to Android modify the frameworks/base/core/res/AndroidManifest.xml file. Make sure you add the strings too. After rebuilding check that the api/current.txt file was updated to include the new permissions.
<!-- Allows an application to write the company system settings. -->
<permission android:name="android.permission.WRITE_COMPANY_SETTINGS"
android:description="@string/permdesc_writeCompanySettings" />
<!-- Allows an application to read the company system settings. -->
chris-piekarski / android.uid.system
Created Mar 26, 2013
Run Android APK as system user
View android.uid.system
<manifest package="com.package"
View android_win32_emulator_avd_ram_issue
Also, if you're seeing apps killed because of low memory increase VM Heap size to 64
chris-piekarski / pypi_package_upload
Last active Dec 15, 2015
process for uploading new pypi package
View pypi_package_upload
python sdist --formats=gztar,zip
python sdist upload
Check/Add .pypirc file under user home dir ~/.pypirc
index-servers =
chris-piekarski / gist:5339025
Created Apr 8, 2013
Override AOSP device network attributes for ConnectivityManager
View gist:5339025
<!-- This string array should be overridden by the device to present a list of network
attributes. This is used by the connectivity manager to decide which networks can coexist
based on the hardware -->
<!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx],
[associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
<!-- the 5th element "resore-time" indicates the number of milliseconds to delay
before automatically restore the default connection. Set -1 if the connection
chris-piekarski / resolve_gerrit_conficts
Last active Dec 16, 2015
Dealing w/Gerrit Conflicts
View resolve_gerrit_conficts
Need to flush out:
git checkout chrischanges
git pull refs/changes/12/112/1
git add src/com/blah/blah/
git commit -a
git rebase --continue
git add src/com/blah/blah/
git push ssh:// chrischanges:refs/for/balh/android-4.1.2_r1
chris-piekarski / nc_port_forward
Last active Dec 16, 2015
nc port forward examples
View nc_port_forward
Will work once:
nc -l 6127
nc -l 6126 | nc 6127
First 'nc -l' should hit.