{"id":298,"date":"2011-05-26T17:45:20","date_gmt":"2011-05-26T09:45:20","guid":{"rendered":"https:\/\/patrick-nagel.net\/blog\/?p=298"},"modified":"2011-05-27T11:49:54","modified_gmt":"2011-05-27T03:49:54","slug":"my-phones-bash-profile","status":"publish","type":"post","link":"https:\/\/patrick-nagel.net\/blog\/archives\/298","title":{"rendered":"My phone&#8217;s bash.profile"},"content":{"rendered":"<p>Here is some automation that I put into my bash.profile. It&#8217;s all done with aliases, since with regular shell scripts, I would first have to remount \/mnt\/sdcard without &#8216;noexec&#8217;. Like this, I just need to open a ConnectBot &#8220;Local&#8221; connection, type the alias, and press enter(*). <\/p>\n<p>(*) For this to work, the &#8216;post login automation&#8217; entry of the ConnectBot &#8220;Local&#8221; profile needs to have<br \/>\n<code>bash --rcfile \/sdcard\/bash.profile<\/code><br \/>\nin it.<\/p>\n<p>Here is what I have in there:<\/p>\n<p><code>alias bb=\"busybox\"<br \/>\nalias top=\"bb top\"<br \/>\nalias df=\"bb df\"<\/p>\n<p>alias ll=\"ls -l\"<br \/>\nalias n=\"su -c \\\"netstat -ntupl\\\"\"<\/p>\n<p>alias backupdata=\"su -c \\\"rsync -rP --delete --numeric-ids --chmod=u+rwX --exclude Music \/sdcard\/ pat@192.168.0.2:\/data\/pat\/g2sd\/\\\"\"<\/p>\n<p>alias postflash=\"echo \\\"Mounting \/system read-write\\\" && su -c \\\"mount -o rw,remount \/system\\\" && echo \\\"Copying modified keyboard layout files...\\\" && su -c \\\"cp \/sdcard\/vision-keypad-wwe.kcm.bin \/system\/usr\/keychars\/\\\" && su -c \\\"cp \/sdcard\/vision-keypad-wwe.kl \/system\/usr\/keylayout\/\\\" && echo \\\"Deleting awful camera click sound...\\\" && su -c \\\"rm \/system\/media\/audio\/ui\/camera_click.ogg\\\" && sync && echo \\\"All done. Please reboot now.\\\"\"<\/p>\n<p>clear<br \/>\nuptime<br \/>\necho<\/code><\/p>\n<p>The first couple of aliases should be self-explanatory.<br \/>\n<tt><strong>backupdata<\/strong><\/tt> is, as the name suggests, to get my SD card&#8217;s content to my home server.<br \/>\n<tt><strong>postflash<\/strong><\/tt> is for after flashing a new ROM (usually a <a href=\"http:\/\/www.cyanogenmod.com\/\">CyanogenMod<\/a> nightly build). It gets my modified keyboard layout into place, and deletes the <em>terrible<\/em> sound file that gets played when I take a photo with the phone&#8217;s camera.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is some automation that I put into my bash.profile. It&#8217;s all done with aliases, since with regular shell scripts, I would first have to remount \/mnt\/sdcard without &#8216;noexec&#8217;. Like this, I just need to open a ConnectBot &#8220;Local&#8221; connection, type the alias, and press enter(*). (*) For this to work, the &#8216;post login automation&#8217; &hellip; <a href=\"https:\/\/patrick-nagel.net\/blog\/archives\/298\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;My phone&#8217;s bash.profile&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,13],"tags":[],"class_list":["post-298","post","type-post","status-publish","format-standard","hentry","category-android","category-linux-general"],"_links":{"self":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts\/298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/comments?post=298"}],"version-history":[{"count":13,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts\/298\/revisions"}],"predecessor-version":[{"id":312,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts\/298\/revisions\/312"}],"wp:attachment":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/media?parent=298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/categories?post=298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/tags?post=298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}