Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher Piekarski chris-piekarski

View GitHub Profile
@chris-piekarski
chris-piekarski / rvm_dump
Last active Oct 11, 2015
Ruby RVM Info Dump: ( set -x ; cd dir ) Output
View rvm_dump
+ cd current
+ builtin cd current
+ [[ -n '' ]]
+ true
+ __rvm_do_with_env_before
+ [[ -n '' ]]
+ [[ -n /usr/local/rvm ]]
+ source /usr/local/rvm/scripts/initialize
++ : rvm_trace_flag:0
++ (( rvm_trace_flag > 0 ))
@chris-piekarski
chris-piekarski / repo_forall_path_example
Last active May 28, 2019
List remote project and local paths using Android repo script.
View repo_forall_path_example
repo forall -c 'echo $REPO_PROJECT $REPO_PATH'
platform/abi/cpp abi/cpp
platform/bionic bionic
device/fsl/bootloader/uboot bootable/bootloader/uboot-imx
platform/bootable/recovery bootable/recovery
platform/build build
platform/cts cts
platform/dalvik dalvik
View LS_COLORS
#set lots of bash shell ls colors
wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O $HOME/.dircolors
echo 'eval $(dircolors -b $HOME/.dircolors)' >> $HOME/.bashrc
. $HOME/.bashrc
#To set if it was setup correctly
dircolors -p
@chris-piekarski
chris-piekarski / dropbox monitor
Created Feb 3, 2013
Fix dropbox Ubuntu monitor error.
View dropbox monitor
echo 100000 | sudo tee /proc/sys/fs/inotify/max_user_watches
@chris-piekarski
chris-piekarski / create_gerrit_branch
Last active Dec 12, 2015
Create Gerrit branch from AOSP mirror
View create_gerrit_branch
repo init -u git://server/manifest -b <tag> android-4.1.2_r1
repo sync
repo forall -c 'git branch company/branchname"
repo forall -c 'git checkout company/branchname"
repo forall -c 'git push ssh://cpiekarski@server:29418/$REPO_PROJECT company/branchname:company/branchname'
@chris-piekarski
chris-piekarski / android_apk_location
Last active Dec 13, 2015
Get Android package (app) apk location
View android_apk_location
$ adb shell pm list packages -f | grep com.occipital.panorama
package:/data/app-private/com.occipital.panorama-2.apk=com.occipital.panorama
$ adb pull /data/app-private/com.occipital.panorama-2.apk ~/tmp
@chris-piekarski
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
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
chris-piekarski / git log alias
Last active Dec 14, 2015
Git log alias & GitStats HTML Output
View git log alias
#http://www.jukie.net/bart/blog/pimping-out-git-log
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
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:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
android:protectionLevel="signature|system|development"
android:label="@string/permlab_writeCompanySettings"
android:description="@string/permdesc_writeCompanySettings" />
<!-- Allows an application to read the company system settings. -->