fsck -y on reboot

Normally if the system reboots after a power failure the checkfs or checkrootfs scripts do a fsck -a to check the filesystem. In some cases the following happens: <br></br>/dev/sda1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY<br></br><br></br> (i.e., without -a or -p options)<br></br><br></br><br></br><br></br>A maintenance shell will now be started.<br></br><br></br>After preforming system maintenance, press Control-D<br></br><br></br>to terminate the maintenance shell and restart the system.<br></br><br></br>Give root password for maitenance<br></br><br></br>(or type Control-D to continue)<br></br> In normal cases you enter the root password and do a fsck of the disc to fix the errors....

June 20, 2008 · len

Working with namespaces

First when you start working with XML in flex you are completely wondered about how easy the xpath like syntax is used. However some botlenecks might occur. One of them is using namespaces. Consider the following example: <?xml version="1.0" encoding="UTF-8"?><report version="3.2.15" xmlns="http://www.len.ro/report"> <item name="user">len</item></report> First approach is to do something like: var myXML:XML = XML(event.result);trace("XML: " + myXML.item.@name); you will see nothing and start wondering what you are doing wrong. Some time later you realize it’s namespace related and you try (according to flex doc) to do this:...

June 16, 2008 · len

Loading an unloading modules

The following error appears when you load then unload and then re-load a module which contains a viewStack or tabNavigator components: TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::HistoryManagerImpl@-77d0a45f to mx.managers.IHistoryManager.<br></br> at mx.managers::HistoryManager$/get impl()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\HistoryManager.as:96]<br></br> at mx.managers::HistoryManager$/register()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\HistoryManager.as:134]<br></br> at mx.containers::ViewStack/commitProperties()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\containers\ViewStack.as:649]<br></br> at mx.containers::TabNavigator/commitProperties()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\containers\TabNavigator.as:504]<br></br> at mx.core::UIComponent/validateProperties()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:5670]<br></br> at mx.managers::LayoutManager/validateProperties()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:519]<br></br> at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:639]<br></br> at Function/http://adobe.com/AS3/2006/builtin::apply()<br></br> at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460]<br></br> at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403]<br></br><br></br> Check here the solution: <mx:Application ...><br></br>...<br></br><mx:Script><br></br><![CDATA[<br></br> //because of http://bugs.adobe.com/jira/browse/SDK-15249<br></br> import mx.managers.HistoryManager;<br></br> private var hist:HistoryManager; <br></br>]]><br></br></mx:Script><br></br> It seems this problem is much more general and as far as I understand it it’s related to singletone problems while loading/unloading modules:...

June 16, 2008 · len

About module loading events

Choice 1 – Bad The application: <?xml version="1.0" encoding="utf-8"?><br></br><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" ><br></br><mx:Script><br></br><![CDATA[ <br></br> private function initModule(e:Event):void {<br></br> var ichild:* = myModule.child as IMyModule; <br></br> if (ichild != null) { <br></br> ichild.initModule();<br></br> }<br></br> }<br></br>]]><br></br></mx:Script><br></br>...<br></br><mx:ModuleLoader id="myModule" url="myModule.swf" <b>ready="initModule(event);"</b>/> <br></br>...<br></br></mx:Application><br></br> The module: <?xml version="1.0" encoding="utf-8"?><br></br><mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" implements="IMyModule" ><br></br><mx:Script><br></br><![CDATA[ <br></br>[Bindable]<br></br>public serviceName:String = new String("http://localhost:8080/myService");<br></br> <br></br>public function initModule():void{<br></br> <b>myHService.send();<br></br> //it will fail here!!! because myHService.url = null <br></br> //the module is loaded, not initialized<br></br></b>}<br></br>]]><br></br></mx:Script><br></br>...<br></br><mx:HTTPService id="myHService" url="{serviceName}" method="GET" <br></br> useProxy="false" resultFormat="e4x" showBusyCursor="true" /><br></br>....

May 27, 2008 · len

Remap bad keys

For a few days some my keyboard has start to make me a lot of trouble: the backspace key works 50% of the time the tab and y keys inserts a “t”. The tab might not seem so important unless you are a terminal user. Cleaning the keyboard did not do anything so in order to be able to use the keyboard I decided to remap some of the keys:...

May 16, 2008 · len

Locale files

When using flex and java in parallel the localization mechanism might be clear. One aspect which is not clear is the encoding of the properties files: Flex locale files encoding: UTF-8 Java locale files encoding: ISO-8859-1 Convertor script: ..$ cat fixUTF.sh #!/bin/bash TMP=iconv.tmp if [ "!$2" == "!rev" ]; then iconv -t ISO_8859-1 -f UTF-8 -o $TMP $1else iconv -f ISO_8859-1 -t UTF-8 -o $TMP $1fimv $TMP $1

May 13, 2008 · len

Replace F-Spot

I can only say good things about the ease to fetch photos from a digital camera in ubuntu now but the F-Spot interface is completely dummy. I can’t understand any good reason to use it. In order to revert to the old gutsy photo import option here are the steps: apt-get install gthumb go to System -> Preferences -> Removable drives and media -> Cameras and remove the f-spot-import with...

May 10, 2008 · len

Creating typed objects with HttpService

When you start using the HttpService with the e4x outputFormat everything seems extremely simple. There is no complex XML parsing code and you can feed the results into a DataGrid for instance with almost no effort at all. Simplicity has a price however and you realize you might need some more advanced features. In my case I wanted to have strong typed objects in the datagrid. This means a Date to be a date or a Number to be a Number....

May 9, 2008 · len

Logging

In the code just add trace(…) calls as you would add printf of System.out.println calls The plugin first you will need the debugger version of the plugin. In ubuntu the plugin can be found in /usr/lib/firefox/plugins which is usualy a link in /etc/alternatives which links to the actual plugin. root@black:/home/len# ls -l /usr/lib/firefox/plugins/total 8628lrwxrwxrwx 1 root root 37 2008-04-27 22:43 flashplugin-alternative.so -> /etc/alternatives/firefox-flashpluginroot@black:/home/len# ls -l /etc/alternatives/firefox-flashplugin lrwxrwxrwx 1 root root 99 2008-05-01 17:33 /etc/alternatives/firefox-flashplugin -> /phantom/linux/Adobe_Flex_Builder_Linux/Player/linux/install_flash_player_9_linux/libflashplayer....

May 8, 2008 · len

Ubuntu Hardy Heron on a Dell D820

Taking advantage of the free easter days I decided that between sleeping and cooking to also try the new Hardy Heron: not wanting to take any risks as in the painful Gutsy update I did a clean install on a different partition I tried the data migration option (gaim, evolution, firefox) but it only imported partial configuration and no data. I reverted to the old method...

April 27, 2008 · len