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
1 5 * * * /bin/bash -l -c -i "source $HOME/.keychain/chis-devpc-sh && /usr/bin/scp -vvv -F /home/chris/.ssh/config -i /home/chris/.ssh/id_rsa db:/var/apps/perch/shared/backups/\* /home/chris/ServerBackups/" > /home/chris/tmp/db_backup_copy_log.cron 2>&1 |
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
private String getLogData(String level) { | |
Log.d(TAG, "Getting log data for level: "+level); | |
StringBuilder log = new StringBuilder(); | |
try { | |
Process process = Runtime.getRuntime().exec("logcat -d"); | |
BufferedReader bufferedReader = new BufferedReader( | |
new InputStreamReader(process.getInputStream())); | |
String line = ""; |
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
repo forall -c 'git tag spectralink_sprint_8' | |
repo forall -c 'git push ssh://cpiekarski@tinfoil:29418/$REPO_PROJECT --tags' |
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
$ cat .git/config | |
... | |
[remote "for-a-exp"] | |
url = tr:kernel/common | |
receivepack = git receive-pack --reviewer=a@a.com --cc=b@o.com | |
push = HEAD:refs/for/experimental | |
$ git push for-a-exp |
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
func goHandler(w http.ResponseWriter, r *http.Request) { | |
if r.Method == "POST" { | |
fmt.Print("Got a POST") | |
} | |
body, _ := ioutil.ReadFile("mag.html") | |
w.Write(body) | |
} |
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
kill `ps ax | grep chrome | grep -v 'grep' | cut -f1 -d' ' -s` | |
#test -> check if -f 1 or -f 2 | |
ps ax | grep rake | grep -v 'grep' | cut -d ' ' -f 2 |
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
Add res/values/config.xml | |
<resources> | |
<bool name="config_hardwareAccelerated">true</bool> | |
<bool name="config_largeHeap">false</bool> | |
<bool name="is_large_screen">false</bool> | |
<bool name="allow_rotation">false</bool> | |
</resources> | |
Get values with: |
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
//From AOSP Doc | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
/* Checks if external storage is available for read and write */ | |
public boolean isExternalStorageWritable() { | |
String state = Environment.getExternalStorageState(); | |
if (Environment.MEDIA_MOUNTED.equals(state)) { | |
return true; | |
} |
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
"The point here is that a lot of terms are thrown around in this industry, and not everyone | |
uses them properly. Additionally, as in this case, the definitions may be nebulous; this, | |
of course, leads to confusion." - Network Warrior page 2 |
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
The exec command is not implemend by default for init.rc despite what the readme.txt says. Add the following to get it working. | |
file: android/system/core/init/builtins.c | |
int do_exec(int nargs, char **args) | |
{ | |
const int cmd_line_max = 256; | |
char cmd_line[cmd_line_max]; | |
int cmd_length, i; | |