Friday, December 16, 2011

Windows 7 states not genuine Win7 boot after moving partition


For some reasons after playing with disk partitions Windows 7 thinks System partition label was changed (for example from C: to V:).
As a consequence Windows now thinks that your installation is not licensed... 


And here's a very simple solution that saved my day.
Found here: http://social.technet.microsoft.com/Forums/en/w7itproinstall/thread/48c99917-9ee3-4fe5-9ea8-2ac44b365e93

  1. Hit control-shift-esc to get the task manager and ran regedit
  2. Navigated to HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices, backed up and removed the data inside
  3. Reboot

 upon reboot, the system will checked the key again and validate the license.

Monday, December 12, 2011

LCD bring-up tips

During Embedded Linux Conference Europe 2011 I attended one very interesting presentation regarding new LCD bring-up procedures.


Among other nice things we were presented with extremely useful utility that may save a bunch of time while guessing what is wrong with this brand new LCD.
And this is fb-test utility.


Feel free to check it out from here http://www.elinux.org/images/0/09/Fb-test.c and then simply build it with your cross-toolchain of choise.
Then on target run it.


More on this you may find here http://www.elinux.org/Board_Bringup_Utilities

These are slides from ELCE http://elinux.org/images/d/d5/Elce-2011-anders.pdf

Video of this presentation (39 minutes)
FullHD (242M): http://free-electrons.com/pub/video/2011/elce/elce-2011-anders-board-bringup-lcd-display.webm

450x800 (98M): http://free-electrons.com/pub/video/2011/elce/elce-2011-anders-board-bringup-lcd-display-450p.webm

Add trusted certificates from Firefox to Citrix ICA client in Ubuntu

For some connections Citrix ICA client may display message saying:
You have hot chosen to trust "XXX server", the issuer of the server's security certificate.

Basically if you have Mozilla Firefox installed on your PC you may easily use its certificates for Citrix client as well.

Do do it just copy them over to ICA Client certificate folder:
sudo cp /usr/share/ca-certificates/mozilla/* /opt/Citrix/ICAClient/keystore/cacerts

Friday, November 11, 2011

Enable menu icons in Ubuntu 11.10 Oneiric Ocelot

Back in the day menu icons were essential part of system interface, then it was possible to enable/disable those icons in Ubuntu-tweak etc.
With 11.10 release we are in position when only dconf-tools tool may help us.
So first of all we need to install dconf-tools (it is not installed by default).

sudo apt-get install dconf-tools

And then open dconf-editor (start typing "dconf" in Unity dash)
In dconf editor go to org->gnome->desktop->interface and enable menus-have-icons.


Wednesday, November 9, 2011

Enable ifplugd with DHCP

To get ifplugd properly working with network interface that should obtain its configuration from DHCP server one basically needs to properly modify /etc/network/interfaces file:

# Configure Loop
auto lo
iface lo inet loopback

iface eth0 inet dhcp

Note, there's no "auto eth0"  line, so eth0 will be managed by ifplugd

Syntax highlighter in blogger

Just to save my setup of "Syntax highlighter"

Here are pretty good instructions of how-to integrate "Syntax highlighter" in blogger http://www.shirmanov.com/2010/09/adding-syntaxhighlighter-30-to-blogger.html

And below are my settings.
They differ in

  1. "Eclipse" theme instead of "Midnight"
  2. Added 3 new brushes I'm interested in: "Plain", "Diff" and "Bash"

Note, as it is said here http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html
in case of "<pre /> method" Major issue with this method is that all right angle brackets must be HTML escaped, eg all < must be replaced with &lt; This will ensure correct rendering.

<!-- First we add CSS styles -->
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/> 
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCoreDefault.css' rel='stylesheet' type='text/css'/> 
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeEclipse.css' rel='stylesheet' type='text/css'/> 
 
<!-- Second we add JS scripts -->
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js' type='text/javascript'></script> 
 
<!-- Then we add Brushes -->
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDiff.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'></script> 
 
<!-- At last we call SyntaxHighlighter -->
<script language='javascript' type='text/javascript'> 
    SyntaxHighlighter.config.bloggerMode = true;
    SyntaxHighlighter.all();
</script>

Mount jffs2 image in your development system

Devices with embedded linux quite often have root file-system stored in flash-memory. And quite often it is whether jffs2 or yaffs2. For partitions of small size (say < 100-200 Mb) one may easily use jffs2, while for larger partitions it is recommended to use yaffs2 because of its better scalability (smaller RAM requirements and better performance).
Another big advantage of jffs2 over yaffs2 is its native support in mainline linux kernel. For sure yaffs2 patch could be easily applied to your kernel tree it is always very nice to have a feature in mainline.

So basically you prepare proper file-system image and put it on MTD-device of your embedded board.
And sometimes you need to get some data from prepared file-system image or even modify it on your host development machine.

I found a nice bash script on Maemo Wiki http://wiki.maemo.org/Modifying_the_root_image#Shell_script_to_mount.2Funmount_JFFS2_using_block_device_emulating_MTD
But since I have kernel of version 3.0 on my machine I decided to remove parts for 2.4 kernel (corresponding branches were used for 3.0 kernel as well because of improper tests that were not written for 3.0 obviously). And also I added automatic pick-up of an empty loop device.
So here's a very helpful script for mounting jffs2 image:

#!/bin/sh
JFFSIMG=$1 # jffs image
LOOP=$(losetup --find) # loop device
MP="/media/jffs2" # mount point
MTDBLOCK="/tmp/mtdblock0" # MTD device file
BLKMTD="block2mtd"
UMNT=""
 
echo "$0" | grep unmount_ >/dev/null 2>&1
[ $? -eq 0 ] && UMNT=1
if [ $# -gt 1 -a x"$2"x = x"unmount"x ]; then
  UMNT=1
fi
  
if [ x"${UMNT}"x = x""x ]; then
  if [ ! -b ${MTDBLOCK} ] ; then
    mknod ${MTDBLOCK} b 31 0 || exit 1
  fi
  lsmod | grep loop >/dev/null 2>&1
  if [ $? -ne 0 ]; then
    modprobe loop
    [ $? -ne 0 ] && echo "loopback loading failed" && exit 1
    sleep 1
  fi
  losetup ${LOOP} ${JFFSIMG} || exit 1
  sleep 1
  modprobe mtdblock
  modprobe ${BLKMTD} || exit 1
  echo "${LOOP}" > /sys/module/block2mtd/parameters/block2mtd
  sleep 1
  modprobe jffs2
  [ ! -d ${MP} ] && mkdir -p ${MP}
  mount -t jffs2 ${MTDBLOCK} ${MP} || exit 1
else
  umount ${MP}
  if [ $? -ne 0 ]; then
    echo "Cannot unmount JFFS2 at $MP" && exit 1
  fi
  modprobe -r jffs2
  modprobe -r ${BLKMTD}
  modprobe -r mtdblock
  sleep 1
  losetup -d ${LOOP}
fi