Wednesday, February 06, 2013

git clone --mirror and update

To create a git repository mirror is fairly easy:
$ git clone --mirror ssh://user@example.com/path/to/repo
To update the mirror from the original source:
$ git remote update



ssh-add "Could not open a connection to your authentication agent"


I came accross some occurence when I use ssh-add to add a ssh key it gives me the following error:

Could not open a connection to your authentication agent.



and the following command did the trick sometimes...
$ exec ssh-agent bash
but I still have the problem when I use ssh-add under Cygwin in Windows system.... couldn't find a solution :(

Saturday, February 02, 2013

Linux serial baud 14400 and DS89C450 development

For some freaking reason Linux couldn't support 14400 baud rate on it's serial connection.  I was doing some development based on Maxim's DS89C450 , as it is one of the highest performance 8051 compatible microcontrollers in the market. The nice thing of this DS89C450 is that it has a boot ROM which allows me to program the chip using serial port (instead of an expensive programmer).  However, the boot ROM only allows COM port connections at 14400 and Linux doesn't support this baud rate. (dear Maxim friends, can you change the baud rate to a standard one?)

I was desperate and trying through different bauds, surprisingly I found that it can work under 2400bps instead of 14400. (Anyone can explain to me why?)

If you are interested, there are a few more further readings of development using DS89C450 under Linux:

Monday, January 28, 2013

Arch Linux: systemctl dhcpcd netcfg problem

I think the Arch Linux dhcpd / dhcpcd thing is kinda broke...
I read many installation guide which says to start dhcp use the following command but it NEVER works for me:
# systemctl enable dhcpcd@.service 
eth0 or enp2s1 whatever won't work.  I don't know what the heck is enp2s1 in my system...

Anyway, this is what I do to fix it(mine is just VMware NAT network):


  1. cp /etc/network.d/examples/ethernet-dhcp /etc/network.d/mynetwork
  2. vi /etc/network.d/mynetwork  , modified line INTERFACE='enp2s1'
  3. try in root, netcfg mymetwork, see if it can fetch IP properly
  4. if everything looks good, # systemctl enable netcfg@mynetwork
It should create the symbolic link.  Then reboot to see if it works properly...

Friday, January 18, 2013

VirtualBox UUID already registered

Stupid VirtualBox after you copied it and use it again it will complain the UUID already registered. Use the below Linux command to assign it a new random UUID:
$ vboxmanage internalcommands sethduuid arch.vdi

Wednesday, January 16, 2013

BloggerPaste: convert your code to HTML

For many times the blogger editor messed up my code when I paste it here.  Obviously blogger is not intended for programmer.

I found an excellent tool to convert my code into HTML so that I can put it correctly here.

http://francois.schnell.free.fr/tools/BloggerPaste/BloggerPaste.html

Linux Mint 14 and Ubuntu 12.10 Chinese fonts Blur problem

Wenq.org offered an excellent tool to generate the .fonts.conf

http://wenq.org/cloud/fcdesigner_local.html

And also for the Chinese fonts packages


# aptitude install ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy



e.g. I used the tool to generate the below config file, save to ~/.fonts.conf and now the Chinese fonts looks much clear to me.

To download my file https://docs.google.com/file/d/0B7j0X0cOW5wTWnV2N3Y3NS1FeVE/edit

Or copy and paste here (Hope blogger won't do weird thing to mess up my code):

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- created by WenQuanYi FcDesigner v0.5 -->
<match>
 <test name="family"><string>sans-serif</string></test>
 <edit name="family" mode="prepend" binding="strong">
  <string>DejaVu Sans</string>
  <string>WenQuanYi Bitmap Song</string>
  <string>WenQuanYi Micro Hei</string>
  <string>WenQuanYi Zen Hei</string>
  <string>Liberation Sans</string>
  <string>Droid Sans</string>
   <!-- Please install WenQuanYi Bitmap Song first -->
 </edit>
</match>
<match>
 <test name="family"><string>serif</string></test>
 <edit name="family" mode="prepend" binding="strong">
  <string>DejaVu Serif</string>
  <string>WenQuanYi Bitmap Song</string>
   <!-- Please install WenQuanYi Bitmap Song first -->
  <string>AR PL UMing CN</string>
  <string>AR PL SungtiL GB</string>
  <string>WenQuanYi Zen Hei Sharp</string>
  <string>AR PL UMing TW</string>
  <string>Liberation Serif</string>
  <string>Bitstream Charter</string>
  <string>Droid Serif</string>
 </edit>
</match>
<match>
 <test name="family"><string>monospace</string></test>
 <edit name="family" mode="prepend" binding="strong">
  <string>WenQuanYi Zen Hei Sharp</string>
  <string>WenQuanYi Zen Hei Mono</string>
  <string>WenQuanYi Micro Hei Mono</string>
  <string>DejaVu Sans Mono</string>
  <string>Droid Sans Mono</string>
  <string>Liberation Sans Mono</string>
   <!-- Please install Liberation Sans Mono first -->
  <string>AR PL UMing TW</string>
 </edit>
</match>
</fontconfig>

Thursday, January 03, 2013

Viewnior fast image viewer

Just found Viewnior a pretty good image viewer, much faster image loading than the Ubuntu default image viewer. It doesn't need to import images like shotwell, and it allows left and right button to scroll to the next image.

so much to ask for a simple image viewer huh?

http://xsisqox.github.com/Viewnior/index.html

Wednesday, August 15, 2012

Ubuntu 10.04 "Android Ant-based build system requires Ant 1.8.0 or later"

I got this crap when I was trying to compile the sample android app:

gideon@desktop-i7:~/workspace/MyFirstApp$ ant debug
Buildfile: build.xml
-set-mode-check:
-set-debug-files:
-check-env:
BUILD FAILED
/home/gideon/android-sdk-linux/tools/ant/build.xml:377: The Android Ant-based build system requires Ant 1.8.0 or later. Current version is 1.7.1
Total time: 0 seconds
The fix is easy, just install the ant1.8 package:

apt-get install ant1.8 
That'll do.