dimanche 21 décembre 2008

HTC S710 with Windows Mobile sucks

Ok, I made a mistake, my cell provider only had one wifi smart phone, the HTC S710, I had read here and there that Windows mobile was not the best OS for mobile phones, but I needed a phone to receive email, and at work, most of our servers a linux or unix ... except email server (by special request of the owner/boss), which is windows 2003 with Exchange 2003.

So i thought I would try a windows mobile phone, I was using a pre-production model of another brand I cannot name, and it was very buggy (the original phone I got with my contract had failed shortly after warranty had expired).

So, I went for this phone and I was not very impressed. The s710 was just as buggy as my pre-production phone, which used another proprietary OS ... On the S710, the browser, ie, is terrible in windows mobile phones, and I know that I can get opera and I do not mind paying. The problem was, that it was just too buggy, I removed the bar at the top of the screen with the shortcut stuff, because I wanted more screen estate ... well, sometimes it re-appears after I reboot the phone, sometimes it appears twice ... both times empty, with no shortcuts ... that sucks ... I just wanted it to go away! I understand why HTC are pushing androoid.

Palm have the best OS out there, I think, it is very stable and multi-platform (it syncs with any serious OS out there ....). Why Palm went with WM is a mystery to me, they have tried to go bust for years, now, maybe next year (2009) they will succeed! They had it all, really, they had it all and lost ... you cannot even get a Palm phone from a French provider ... I just hope no company will ever hire any of these [I needed to change the URL, they are hiding], it will mean your company is doomed, sell your shares, be quick or you're lose it all.

When I used ie to go on the Internet via wifi it was terribly slow, unusably slow ... although I was less than 3 feet away from my airport ... slow even displaying www.google.com, so not rendering-related. The pages of the provider were completely broken in the browser of the phone, that was the provider's fault, I know, but it really felt bad.

I sent the phone back to the provider, we have 7 days to send it back in France ... and the provider put me on a blacklist for cell providers in France ... I am getting very upset with this provider, n9uf telecom, recently bought up by SFR (vodaphone-like). I chose SFR as my first phone provider in France two years ago, but quickly moved to n9uf because I had my internet there and because I kept getting spam text messages, although only 5 people had my phone number and I had never entered it into any online form!!!! In short, SFR sucks biiiiig time!

I do not regret sending it back though, the usability of wm6 is terrible, there is no way to quit an application other than by using task manager, I guess this is good for media player, for all others it sucks and you should always have the option to close the app from within the app itself, wtf, guyz??? On the performance side, the phone is totally underpowered, the processor is far too slow, this combined with the fact that apps don't close when you leave them makes this phone too slow for me ... I am not even the impatient kind of guy ...

So I guess I will be getting the iphone soon, because I need a phone now, my charger is dead, and since it is a pre-production phone, it uses a special, incompatible charger ... or a blackberry Bold, I would love to get the Storm, but the only provider here that has that on offer is .... S F R.

lundi 10 novembre 2008

Windows PowerShell and regex?

Yesterday, I was researching PowerShell for work and I was quite impressed, it is pretty powerful! I obviously cannot stand the hype and self-satisfied twits making over-enthusiastic remarks in the Windows PowerShell Owner’s Manual like:

To impress your colleagues, show them "dot source", if they are not impressed, nothing will impress them ...

"dot source", lol, that has been around for decades ;-), even on Windows with Microsoft's own ksh (i.e. in the Unix Services 4 Windows) ...

What does impress me in PowerShell, is the wmi integration, that is really cool! Also, the PowerShell is very good in interacting with .Net objects, as it can pass objects between different 'cmdlets' instead of strings, unlike most shells.

Regex is there as well, well, actually, sort of ....

Because, when the twits over at Redmond implement a standard, why, YES, WHY can't they stick to the standard? Look at regex for powershell, it is not case sensitive by default, not greedy and worse of all, '?' and '*' have all of a sudden become '.?' and '.*', respectively! How can they call that regex? There are certainly other things I have overlooked .... I would call the implementation Glogex or RegGlobex - they merged GLOB with regular expressions ...

The regex implementation in vbs is much better, as it has not been merged with GLOB!

I often use this regex cheat sheet, compare that to what is said here.

vendredi 10 octobre 2008

Solaris zones

A less technical note today ....

I was playing with Solaris zones and I tried to kill a zone, by doing

rm -rf / as root

and I got:

rm of / is not allowed


so, yeah, I removed /etc and /usr, that worked ;-)

I was wondering why rm -rf / would not work on Solaris 10 and came across this on Sun's blog!

A good laugh, made me think of the idiots that validated Microsoft's Standard for Office documents ... why do we need more than one? And why do we have Microsoft, that has a monopoly of Office software, determine the format - seeing their track record of compatibility between their Office versions, it's insane??
I do not get it, I guess some guyz on the board have a Cayman Islands bank account or, after reading Sun's blog, are just not intellectually savvy enough to understand the issues at stake. It makes me sick!

dimanche 28 septembre 2008

PowerPoint 2003 and Notes

I almost went nuts last Friday, I convert powerpoint to word with a nice vbs script (so I can use it from the command line). It is basically just taking every slide, pasting it into a word file, adding lines for notes. I create a handout with that, it will be printed and handed out to the people attending the presentation.

The command line is so cool, because I can recursively convert all ppt's with a simple for loop:

for /r %i (*.ppt) do convert.vbs %i

Anyway, in the Notes section in powerpoint, we also have text, when we want to include a word/html file into the handout. We must have some 30+ ppts and it failed on just 2. According to google, these two powerpoint slides are the only two on the planet where the notes text is not in NotesPage.Shapes.Placeholders(2) but NotesPage.Shapes.Placeholders(1). The worst is that it is not even consistent, on some slides it is in the correct placeholder and on others it is not ...

I spent quite some time finding out how to determine if a placeholder is a body; the type is returned with PlaceholderFormat.Type and ppPlaceholderBody is the type we are looking for, it is a constant set to 2.


[...]
objSlide = ObjPptApp.ActivePresentation.Slides(slidenbr)
objShapes = objSlide.NotesPage.Shapes

if objShapes.Placeholders(1).PlaceholderFormat.Type= 2 then
NotesText = objShapes.Placeholders(1).TextFrame.TextRange.Text
else
NotesText = objShapes.Placeholders(2).TextFrame.TextRange.Text
end if
[...]

We had been using the script for years, and all presentations are based on a master presentation. I think this must be Office 2007, MS Office for Mac, OpenOffice, or NeoOffice playing silly billy.

I will be happy when we migrate to OpenDocument Format, then we will have all the training sources in a wiki and no need to go through all this hassle with ppt's. Often we get slight modifications in ppt's back ... just imagine if all text and graphics were stored in a wiki. I cannot wait.

samedi 13 septembre 2008

"The file 'Asms' on Windows XP Professional CD-ROM is needed" Installing Windows XP SP2

I was reinstalling Windows XP on a laptop, and the nightmare began ....

The first message I got was that Windows could not find any hard drive. The computer has a SATA drive, so I disabled NATIVE SATA CONTROL in the bios, restarted and it worked.

Next, after the reboot, I got the apparently famous:

"The file 'Asms' on Windows XP Professional CD-ROM is needed" error message when you install Windows XP

Basically, in the first steps of the installation, when windows setup copies the files, it does not do it recursively (before the first reboot). Bug #1. I understand that since nobody has changed this part of the windows installation in ages, I mean it's the same primitive shit you had in NT3.5. I doubt anybody at microsoft would have the balls to change this.

On microsoft.com and many other places on the web, smart guyz tell you to edit the registry ... scary for many, not for me, however, regedit.exe was not there, regedt32.exe was, but never came up. Expanding either from the cdrom drive did not work either (expanding did, but neither came up, I got a weird error for regedit.exe)... Besides, why? yes WHY??!? would you want to stop setup from accessing files it would normally need for the installation? If they are really "optional" why does setup abort with this error in the first place??? Bug #2.

I looked at the other options ...

Why the cdrom was not available to "setup" but to cmd.exe I do not know, looks like bug #3 to me ;-).

To get to the command prompt anywhere in setup after the reboot is easy, Shift + F10.

So, the easiest solution is to do the following on the command line:
xcopy /s :\i386 :\i386

Regarding microsoft.com knowledge base, the instructions are really weird:
check em out here.

1. Regedit was not there for me, see above, and did not want to run. It did for others, really weird, I am using a standard SP2 disc.
2. xcopy IS there, and works on NTFS formatted drives as well!!!!! So FAT / NTFS distinction is useless!!!
So, the correct answer would have been, for all:
2.1 xcopy /s :\i386 :\i386
/e ??? ... why copy empty folders?
3. Have they ever thought that, maybe, "Method 2" will give exactly the same error? Those guys are brilliant, no really!

mercredi 12 mars 2008

Speed up mail.app despite big mailboxes


My Mail.app inbox got too bulky again and was feeling sluggish, there are several ways to fix this issue. For reference, I have three mailboxes with over 3.5Gb of email ... Heck, I have emails from 1997! My first I do not want to loose ... ;-)

I found two ways to fix the issue, remove the "Envelope Index" file, which will mean that the index will be generated again ... and messages will have to be imported again - that sucks.

My second solution is the following, close mail.app and run my shell script!

My shell script:

8<----------------8<----------------8<----------------

#!/bin/sh

#Tell mail to quit (Applescript code taken from another blog)
osascript -e ‘tell application “Mail” to quit’

#Backup the index:
cp ~/Library/Mail/Envelope\ Index /tmp/

#Optimize, cleanup indices
sqlite3 ~/Library/Mail/Envelope\ Index 'vacuum addresses; vacuum messages; vacuum sqlite_sequence; vacuum attachments; vacuum properties; vacuum subjects; vacuum mailboxes; vacuum recipients; vacuum threads;'

8<----------------8<----------------8<----------------


Note: Everything between the two ' has to be on one line. This will cleanup the sqlite db and speed things up.



Worked for me. Might plan that on a monthly basis.

For the interested, what does vacuum do?
http://www.sqlite.org/lang_vacuum.html

samedi 9 février 2008

Installing a daemon on Solaris 10

Solaris 10 implements SMF, I wanted to have my shell script run at system boot and make sure it runs reliably in the background. SMF is your friend on Solaris 10.


1. Create a file <file>.xml with the following contents
8<------------------8<------------------8<------------------8<------------------
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<!--
Service manifest for my daemon.
-->

<service_bundle type='manifest' name='inetconv:mydaemon'>

<service
name='network/mydaemon'
type='service'
version='1'>

<create_default_instance enabled='true'/>

<restarter>
<service_fmri value='svc:/network/inetd:default' />
</restarter>

<!--
Set a timeout of 0 to signify to inetd that we don't want to
timeout this service, since the forked process is the one that
does the service's work. This is the case for most/all legacy
inetd services; for services written to take advantage of SMF
capabilities, the start method should fork off a process to
handle the request and return a success code.
-->
<exec_method
type='method'
name='inetd_start'
exec='/opt/hans/daemon.sh'
timeout_seconds='0'>
<method_context>
<method_credential user='hans' group='other' />
</method_context>
<propval name='arg0' type='astring'
value='hans' />
</exec_method>

<!--
Use inetd's built-in kill support to disable services.
-->
<exec_method
type='method'
name='inetd_disable'
exec=':kill'
timeout_seconds='0'>
</exec_method>

<!--
This property group is used to record information about
how this manifest was created. It is an implementation
detail which should not be modified or deleted.
-->
<property_group name='inetconv' type='framework'>
<propval name='converted' type='boolean' value='true' />
<propval name='version' type='integer' value='1' />
<propval name='source_line' type='astring' value=
'mydaemon stream tcp nowait hans /opt/hans/daemon.sh mydaemon'
/>
</property_group>

<property_group name='inetd' type='framework'>
<propval name='name' type='astring' value='hans' />
<propval name='endpoint_type' type='astring' value='stream' />
<propval name='proto' type='astring' value='tcp' />
<propval name='wait' type='boolean' value='false' />
<propval name='isrpc' type='boolean' value='false' />
</property_group>

<stability value='External' />

<template>
<common_name>
<loctext xml:lang='C'>
Redwood Network Agent
</loctext>
</common_name>
</template>
</service>

</service_bundle>
8<------------------8<------------------8<------------------8<------------------

Note: Please change the UID to the UID of your user and change the path as well as mydaemon, unless you want to keep that name ... ;-).

2. Import the xml file with

svccfg -v import <file>.xml

3. Check the service with

svcs -v mydaemon

vendredi 8 février 2008

easy backport

I am a tech writer, and sometimes, just after a branch, I frequently have two checkouts living side by side, one for each version. Since the branch was made very recently, the files are still the same, so contain the same bug.

Since I keep version numbers in the path, head is 200, and will remain so until v3 is out.

Ex:

~/cvs_200/doc/xml/somedir
~/cvs_203/doc/xml/somedir

Often I am far down in the fs and

Once I have fixed the bug on head, I run:

cd `echo \`pwd\` | sed -e 's/200/203/'`
cvs up -j HEAD file.xml
cvs commit

ldd, otool and flushing dns

The other day I needed to check which libs an executable was linked against, on linux I would use ldd, but on my Mac OS X there is no tool called ldd. I found otool with the -L option did the trick.

otool -L `which awk`

Btw, LD_LIBRARY_PATH on Darwin (Mac OS X) is DYLD_LIBRARY_PATH, more information available in the man page, man dyld.


Another issue I get is when I want to flush the dns cache of my mac, I have recently purchased a white MacBook with Leopard on it and the

lookupd -flushcache

does not work anymore, in Leopard (10.5) it has become

dscacheutil -flushcache