User:Joerg rw/tools

All these hacks are tested on PR1.2(!!), but the cmdlines here are just off top of my head, so maybe typos or sth can be found. Lots of it will work on PR1.3 as well, but I haven't tested anything for PR1.3 yet. "Tested" on CSSU-Tmaemo5.1 Please report on http://wiki.maemo.org/index.php?title=User_talk:Joerg_rw/tools&action=edit. Thanks! Actually recent switching to PR1.3 + Community-SSU resulted in a quite similar set of system properties. So most of the things below are not needed anymore, except of course the gnu sanitizing of busybox crap.

So first install CSSU! http://wiki.maemo.org/Community_SSU

You did that? Fine, let's go on...

To make the plastic case melt and burn your fingers and your cat, click http://joerg.cloud-7.de/repositories.install (includes the catalogs aka repositories test, devel, and tools. Attention, will create dups, so check your catalog list in HAM anyway. You should keep all three catalogs usually disabled in HAM!)

If you feel like, patch eMMC aka *VANILLA* image file for larger /home partition (/opt is a bindmount to /home/opt, so this is also a way to have more free space to install apps) - much easier than repartitioning the N900 *after* flashing. So if that's not obvious, this part is meant to be done on your linux desktop PC, prior to fresh full flash of N900): NEW-HOME-SIZE=4096 sed -e "s/2048/$NEW-HOME-SIZE/" path/to/*VANILLA*.bin >patched-VANILLA.bin
 * 1) Size is in MB, tested up to 8192, changing number of chars known to
 * 2) break things, so for 5digit values you might need more sophisticated edits.
 * 3) Theoretical limit ~28GB

the section in this image file is close to the head of file and looks like: mmc { name = "internal"; partition { fs_type = "vfat"; prefix = "mydocs"; no_create = true; }       partition { size = 2048; fs_type = "ext3"; prefix = "home"; }       partition { size = 768; fs_type = "swap"; } } as this looks like a format free grammar, it's probably possible to "steal" whitespace from start of line to allow for 5 digit numbers 

Miniwrapper for apt-get logs. The text below is intended to c&p to N900 xterm, or ssh session to N900 on your PC (all in a root account where not mentioned otherwise - first snippet takes care of this by the first line "root"). You should highlight a whole white box or at least a whole § beginning with ####line and insert the whole text as one chunk to your N900 or ssh remote terminal. I took care about long lines by continuation\ marks\ so don't break up a block that consists of lines ending with \

root cat >/usr/local/bin/apt-get <<"wikiETX"
 * 1) ! /bin/sh
 * 2) file /usr/local/bin/apt-get
 * 3) due to $PATH will override original apt-get cmd and create
 * 4) a file installed-aps.sh in ~root/ which can be sourced to redo
 * 5) all the apps installed via `apt-get install `

ag=/usr/bin/apt-get case "$1" in "install")   echo '############ logged install ###########'    $ag "$@" && echo "$ag $@ ;#`date`" >>$HOME/installed-aps.sh    ;; "dist-upgrade"|"autoremove") # autoremove kills rtcom-accounts-voip-support # see http://talk.maemo.org/showthread.php?t=70875 echo "NONONO!! Don't do that!" exit 5 ;; *)   $ag "$@" esac wikiETX chmod a+x /usr/local/bin/apt-get

proper bash and tools apt-get install bash3

cat <<"wikietx" >/home/user/.bashrc
 * 1) ~/.bashrc: executed by bash(1) for non-login shells.

PATH=/usr/bin/gnu:$PATH export PS1='\h:\w\$ ' umask 022

export LS_OPTIONS='--color=auto' eval "`dircolors`" alias ls='ls $LS_OPTIONS' alias ll='ls $LS_OPTIONS -l' alias l='ls $LS_OPTIONS -lA' wikietx
 * 1) You may uncomment the following lines if you want `ls' to be colorized:
 * 1) for unclear reasons messybox feels obliged to source .bashrc >:-(
 * 2) so this will break the messy ls, and you'll need to use bash
 * 1) Some more alias to avoid making mistakes:
 * 2) alias rm='rm -i'
 * 3) alias cp='cp -i'
 * 4) alias mv='mv -i'
 * 1) alias mv='mv -i'

cp /home/user/.bashrc /root/

chown user /home/user/.bashrc

apt-get install coreutils-gnu


 * 1) breaks cssu-t5.1 MP, so it's commented out. Use on own peril:
 * 2) apt-get install procps

apt-get install less apt-get install findutils apt-get install locate


 * 1) obsolete since repo pkg fixed:
 * 2) patch updatedb to avoid borked messybox find:
 * 3) sed -i 's@{BINDIR}/find@{BINDIR}/gfind@' /usr/bin/gnu/updatedb

apt-get install man-db-n900

random stuff to config / fix 'things' (c&p to shell)

mv /usr/lib/xchat/plugins /usr/lib/xchat/plugins_disabled
 * 1) disable annoying xchat notifications introduced with some more recent update
 * 2) goes along with 'undocumented' command /notify_mode -vl - thanks cehteh :-/
 * 1) goes along with 'undocumented' command /notify_mode -vl - thanks cehteh :-/

echo IroN900 >/etc/hostname
 * 1) master device name, replace with iroN900 *your* fav name
 * 1) master device name, replace with iroN900 *your* fav name

touch /home/user/.cherry_state
 * 1) kill that cherry PITA, before it sends SMS  --  STILL ACTUAL!
 * 2) see http://wiki.maemo.org/PR1.2_compulsory_My_Nokia_subscription
 * 1) see http://wiki.maemo.org/PR1.2_compulsory_My_Nokia_subscription


 * 1)   OBSOLETE with CSSU, so now commented out #o#   #####
 * 2) fix annoying hildon-desktop cpu hog bug
 * 3) new: with ctrl-BS for nice taskswitching, see
 * 4) http://my.arava.co.il/~matan/repo/Modified_Hildon_Desktop.html
 * 5) and http://share.ovi.com/media/joerg900.screenshots/joerg900.10092 video
 * 1) and http://share.ovi.com/media/joerg900.screenshots/joerg900.10092 video


 * 1) o#cd ~user/MyDocs/tmp/


 * 1) wget http://mohammadag.xceleo.org/repo/pool/\
 * 2) free/h/hildon-desktop/hildon-desktop_2.2.142-1_armel.deb
 * 3) o#wget http://my.svgalib.org/770/n900/hd-2.2.141/\
 * 4) o#modified-hildon-desktop_3.1_armel.deb


 * 1) dpkg -i hildon-desktop_2.2.142-1_armel.deb
 * 2) o#dpkg -i modified-hildon-desktop_3.1_armel.deb


 * 1) o#killall hildon-desktop


 * 1) set ctl-BS to my preferred operation mode, '
 * 2)     also for CSSU!!'   ##
 * 3) As it seems I haven't documented it elsewhere, here are the nifty
 * 4) keypress-sequences.
 * 5)      (C=control, B=backspace, Cd=control-press-and-hold, Cu=control-release)
 * Cd,Bd = open taskswitcher; Bu,Bd = roll forward; Cu,Cd = roll-backward
 * Bu,Cu = select upper leftmost / Cu,Bu = keep taskswitcher open
 * 1) with taskswitcher open:
 * 2)  "q"|"w"|"e"\"a"|"s"|"f"... select app at that pos
 * 3)  Shift+"q"|"w"... close that app
 * 1)  Shift+"q"|"w"... close that app

gconftool-2 -s \ /apps/osso/hildon-desktop/key-actions/ctrl_backspace_in_tasknav -t int 5


 * 1)   OBSOLETE with CSSU   #o# #####
 * 2) ... and restore apt-get install (it's a metapkg,
 * 3) so nothing bad seems to happen)
 * 4) might want to apt-get install it prior to next SSU to PR1.3
 * 5) o#apt-get remove mp-fremantle-generic-pr

sed -e "s/Defaults env_reset/Defaults env_reset\nDefaults targetpw/;\ s+user ALL = NOPASSWD: /usr/sbin/gainroot+user ALL =\ PASSWD: /usr/sbin/gainroot+" \ -i /etc/sudoers.d/01sudo update-sudoers
 * 1) fix NOPASSWD for root / sudo gainroot
 * 2) this will allow your N900 to ask for ROOT password on "root"
 * 3) and "sudo gainroot" as it's supposed to be
 * 4) MAKE SURE YOU'VE SET PROPER ROOT PASSWORD PRIOR TO THIS! In expression
 * 5) type
 * 6)    root
 * 7)    passwd
 * 8) and enter your root password two times, then (as root) do
 * 1) and enter your root password two times, then (as root) do
 * 1) this is how my 01sudo looks after the edit (excerpt):
 * 2) Defaults env_reset
 * 3) Defaults targetpw
 * 4) user ALL = PASSWD: /usr/sbin/gainroot
 * 5) user ALL = NOPASSWD: /usr/sbin/mmc-mount /dev/mmcblk0 /media/mmc1

sed -i -e "s/Throttle=0/Throttle=10/" /home/user/.config/tracker/tracker.cfg
 * 1) nice trackerd, doesn't exactly make it bearable, but somewhat less sucking
 * 1) nice trackerd, doesn't exactly make it bearable, but somewhat less sucking

gconftool-2 -s /apps/osso/inputmethod/ext_kb_repeat_enabled --type boolean true
 * 1) "fix" the hold-key=sym nonsense
 * 2) http://wiki.maemo.org/Customizing_Maemo#Keyboard_Sym_on_auto_hold
 * 1) http://wiki.maemo.org/Customizing_Maemo#Keyboard_Sym_on_auto_hold


 * 1)   OBSOLETE with CSSU   #o######
 * 2) NK-Enter bug, putting less +/, htop "search", and many other back to proper
 * 3) https://bugs.maemo.org/show_bug.cgi?id=6009
 * 4) PR1.3: [2010-10-25 19:05:34] chem|st: seems to work just fine (re: libvte4)
 * 5) o#cd ~user/MyDocs/tmp/
 * 6) o#wget --no-check-certificate \
 * 7) o# https://bugs.maemo.org/attachment.cgi?id=2705 \
 * 8) o# -O libvte4_0.16.14-0mh9.m5_armel.deb
 * 9) o#dpkg -i libvte4_0.16.14-0mh9.m5_armel.deb
 * 1) o#dpkg -i libvte4_0.16.14-0mh9.m5_armel.deb

sqlite3 -batch /home/user/.rtcom-eventlogger/el-v1.db < 0 BEGIN update events set end_time = (case when end_time=0 then start_time else end_time end) + ((select new.inbound_gsm) - (select old.inbound_gsm)) where id = (select id from events where event_type_id = 1 and outgoing = 0 and service_id = 1 and local_uid='ring/tel/ring' order by start_time desc limit 1); END;
 * 1) !/bin/sh
 * 2) execute or source this to fix the missing end-times in eventslogger db
 * 3) thanks hcm @ http://talk.maemo.org/showpost.php?p=690253&postcount=20
 * 4) find original at http://maemo.cloud-7.de/maemo5/patches_n_tools/eventsdb_calllog_triggers.sh

DROP TRIGGER IF EXISTS call_duration_outbound; CREATE TRIGGER call_duration_outbound AFTER UPDATE OF outbound_gsm ON call_duration FOR EACH ROW WHEN new.outbound_gsm > 0 BEGIN update events set end_time = (case when end_time=0 then start_time else end_time end) + ((select new.outbound_gsm) - (select old.outbound_gsm)) where id = (select id from events where event_type_id = 1 and outgoing = 1 and service_id = 1 and local_uid='ring/tel/ring' order by start_time desc limit 1); END;

DROP TRIGGER IF EXISTS call_duration_voip_in; CREATE TRIGGER call_duration_voip_in AFTER UPDATE OF inbound_voip ON call_duration FOR EACH ROW WHEN new.inbound_voip > 0 BEGIN update events set end_time = (case when end_time=0 then start_time else end_time end) + ((select new.inbound_voip) - (select old.inbound_voip)) where id = (select id from events where event_type_id = 1 and outgoing = 0 and service_id = 1 and local_uid!='ring/tel/ring' order by start_time desc limit 1); END;

DROP TRIGGER IF EXISTS call_duration_voip_out; CREATE TRIGGER call_duration_voip_out AFTER UPDATE OF outbound_voip ON call_duration FOR EACH ROW WHEN new.outbound_voip > 0 BEGIN update events set end_time = (case when end_time=0 then start_time else end_time end) + ((select new.outbound_voip) - (select old.outbound_voip)) where id = (select id from events where event_type_id = 1 and outgoing = 1 and service_id = 1 and local_uid!='ring/tel/ring' order by start_time desc limit 1); END; ETX

/etc/X11/Xsession.d/10hildon_welcome = starter for video /opt/usr/share/hildon-welcome/media/Hands-v32-h264.avi = shaking-hands-video

http://maemo.cloud-7.de/maemo5/bootvideo-DONTPANIC/ (the original author please holler - I forgot your name :-/ )

tracker fixing index for .ogg: sudo /var/lib/dpkg/info/decoders-support.postinst

things (not only) for CSSU
I currently updated to 16.5 CSSU-Tmaemo5.1.

fix a bug that re-appears with each new CSSU upgrade: apt-get install rtcom-accounts-voip-support

To get rid of the ubiquitous autorotating while still allowing dialer to switch to portrait mode (doesn't lock microB, for now I will live with it): gconftool-2 --set /apps/osso/hildon-desktop/ui_can_rotate -t bool false reboot

cd /opt/usr/share/hildon-welcome/media wget http://maemo.cloud-7.de/maemo5/bootvideo-DONTPANIC/dontpanic.avi echo -e "[hildon-welcome]\nfilename=dontpanic.avi" >/etc/hildon-welcome.d/default.conf
 * 1) replace Hands by DONT_PANIC! bootmovie
 * 1) cp /etc/hildon-welcome.d/default.conf \
 * 2) /etc/hildon-welcome.d/default.conf_backup #makes BOTH videos play at boot :)
 * 3) to "uninstall" simply edit the file below
 * 4) to read  "filename=Hands-v32-h264.avi"

A job I start on my PC every day, via cron, like 'N900-rsync IroN900' (IroN900 is resolving to my N900's local IP in WLAN, via /etc/hosts. You as well can use a numerical IP):
 * 1) !/bin/sh
 * 2) call with parameter 
 * 3) NB this has a path relative to $HOME of user calling the job

while ! rsync -vaRzx --fake-super root@$1:/ ~/Documents/N900/backup/$1; do  echo "$1 not available via ssh, retrying in 30 minutes"; sleep 1800; done echo "########## rootfs synced, now syncing /home"

while ! rsync -vaRzx --fake-super root@$1:/home ~/Documents/N900/backup/$1/home; do  echo "$1 not available via ssh, retrying in 30 minutes"; sleep 1800; done