Posts

Showing posts from August, 2010

SQLite on iPhone

It seems that many of the internal stores on the iPhone are actually SQLite databases. The database that stores your text messages are located in /private/var/mobile/Library/SMS/sms.db and can be manipulated with any SQLite client. Similarly, Voicemail database is located at /private/var/mobile/Library/Voicemail/voicemail.db. That same folder also contains all your voicemail audio files, so you can back them up too, if you want.

Using powershell to batch rename some files

Now that powershell comes pre-installed on all copies of Win7, we can use it to perform day-to-day tasks. Here is the first tip: to batch rename a bunch of files, such that the first 3 characters are deleted from the filename, issue the command: dir | foreach -process {mv $_.Name $_.Name.Substring(3)} Update: I will be updating this post with more snippets as I come across them 1. Here is how to create a graphics object in powershell, and draw a bunch of lines on it. $bmp = new-object System.Drawing.Bitmap(264, 264) $graphics = [System.Drawing.Graphics]::FromImage($bmp) for($i=1; $i -lt 9; $i+=1) { $graphics.DrawLine($pen, 33*$i, 0, 33*$i, 264); } 2. Here is how to set the current directory so that .NET objects know it [Environment]::CurrentDirectory = $pwd 3. Here is how to download a file $c = new-object System.Net.WebClient $c.DownloadFile( url, filename ) 4. Concatenate a bunch of files together cat misc*.txt | Out-File allmisc.txt -Encoding ASCII or cat misc1