2014年11月30日星期日

Communicate thru crossover network cable in Windows

Hints: Some network cards support auto crossover, do not need crossover cable actually.

Computer A:
manual set IP: static, 192.168.2.1
subnet mask: 255.255.255.0
manual set Gateway: 192.168.2.2
preferred DNS Server: 192.168.2.2


Computer B:
manual set IP: static, 192.168.2.2
subnet mask: 255.255.255.0
manual set Gateway: 192.168.2.1
preferred DNS Server: 192.168.2.1



Support exFAT in debian

Install relevant applications:
  sudo apt-get install exfat-fuse exfat-utils

List the disk
  fdisk -l 

Format:

  mkfs.exfat -n LABEL /dev/sdXn
Check file system command:
  fsck.exfat /dev/sdXn

Install flash plugin

apt-get install flashplugin-nonfree

2014年3月31日星期一

My conkyrc file (~/.conkyrc)

background yes
use_xft yes
xftfont Sans:size=8
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 100 100
maximum_width 300
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment top_right
gap_x 12
gap_y 80
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

TEXT
${color FFFFFF}${font sans-serif:bold:size=8:}SYSTEM${hr 2}
${color FFFFFF}${font sans-serif:normal:size=8}$sysname $kernel $alignr $machine
Host:$alignr$nodename
Uptime:$alignr$uptime

${font sans-serif:bold:size=8}${color FFFFFF}PROCESSORS ${hr 2}${font sans-serif:normal:size=8}${color
FFFFFF}
CPU: ${cpu cpu0}% ${cpubar cpu0}

${font sans-serif:bold:size=8}${color FFFFFF}MEMORY ${hr 2}
${font sans-serif:normal:size=8}${color FFFFFF}RAM $alignc $mem / $memmax $alignr $memperc%
$membar

${font sans-serif:bold:size=8}${color FFFFFF}DISKS ${hr 2}
${font sans-serif:normal:size=8}${color FFFFFF}/ $alignc ${fs_used /} / ${fs_size /} $alignr${fs_used_perc /}%
${fs_bar /}
Home $alignc ${fs_used /home/yip} / ${fs_size /home/yip} $alignr ${fs_used_perc /home/yip}%
${fs_bar /home/yip}

${font sans-serif:bold:size=8}${color FFFFFF}TOP PROCESSES ${hr 2}
${font sans-serif:normal:size=8}${color FFFFFF}
${top_mem name 1}${alignr}${top mem 1} %
${top_mem name 2}${alignr}${top mem 2} %
${top_mem name 3}${alignr}${top mem 3} %
${top_mem name 4}${alignr}${top mem 4} %
${top_mem name 5}${alignr}${top mem 5} %

${font sans-serif:bold:size=8}${color FFFFFF}NETWORK ${hr 2}
${font sans-serif:normal:size=8}${color FFFFFF}IP address: $alignr ${addr enp2s0}

$alignr Download
${downspeedgraph enp2s0}
${downspeed enp2s0}/s $alignr ${totaldown enp2s0}

$alignr Upload
${upspeedgraph enp2s0}
${upspeed enp2s0}/s $alignr ${totalup enp2s0}

${color #FFFFFF}Inbound Connection ${alignr} Local Service/Port$color
 ${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
 ${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
 ${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
 ${tcp_portmon 1 32767 rhost 3} ${alignr} ${tcp_portmon 1 32767 lservice 3}
 ${tcp_portmon 1 32767 rhost 4} ${alignr} ${tcp_portmon 1 32767 lservice 4}
${color #FFFFFF}Outbound Connection ${alignr} Remote Service/Port$color
 ${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
 ${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
 ${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
 ${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
 ${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
 ${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
 ${tcp_portmon 32768 61000 rhost 6} ${alignr} ${tcp_portmon 32768 61000 rservice 6}
 ${tcp_portmon 32768 61000 rhost 7} ${alignr} ${tcp_portmon 32768 61000 rservice 7}
 ${tcp_portmon 32768 61000 rhost 8} ${alignr} ${tcp_portmon 32768 61000 rservice 8}
 ${tcp_portmon 32768 61000 rhost 9} ${alignr} ${tcp_portmon 32768 61000 rservice 9}

install acrobat reader using makepkg

install acrobat reader using makepkg

$wget https://aur.archlinux.org/packages/ac/acroread/acroread.tar.gz
$tar -xvzf acroread.tar.gz
$cd acroread
$makepkg -s
$sudo pacman -U *.pkg.tar.xz

if dependence not found - lib32-gtk2..etc...
enable the multilab section in /etc/pacman.cong
------------------------------------------------------------------------------------------------------

To use the multilib repository, uncomment the [multilib] section in /etc/pacman.conf:
[multilib]
Include = /etc/pacman.d/mirrorlist
You will then need to update the package list by running pacman with the -Sy switch.

Note:
  • If the system has the base-devel package group installed, users must replace the [extra] versions with the [mutlilib] versions as shown below.
  • gcc-multilib is capable of building 32-bit and 64-bit code. You can safely install multilib-devel to replace the packages shown below, but you still need base-devel for the other packages it includes. See https://bbs.archlinux.org/viewtopic.php?id=102828 for more information.
# pacman -S gcc-multilib
resolving dependencies...
warning: dependency cycle detected:
warning: lib32-gcc-libs will be installed before its gcc-libs-multilib dependency
looking for inter-conflicts...
:: gcc-libs-multilib and gcc-libs are in conflict. Remove gcc-libs? [y/N] y
:: binutils-multilib and binutils are in conflict. Remove binutils? [y/N] y
:: gcc-multilib and gcc are in conflict. Remove gcc? [y/N] y
:: libtool-multilib and libtool are in conflict. Remove libtool? [y/N] y

Remove (4): gcc-libs-4.6.1-1  binutils-2.21.1-1  gcc-4.6.1-1  libtool-2.4-4

Total Removed Size:   87.65 MB

Targets (7): lib32-glibc-2.14-4  lib32-gcc-libs-4.6.1-1  gcc-libs-multilib-4.6.1-1  binutils-multilib-2.21.1-1
             gcc-multilib-4.6.1-1  lib32-libtool-2.4-2  libtool-multilib-2.4-2

Total Download Size:    25.04 MB
Total Installed Size:   108.27 MB

Proceed with installation? [Y/n]
Reference: https://wiki.archlinux.org/index.php/makepkg

Important:
Even I do the above operation,
I still miss the lib32-pangox-compat dependency,
I manually build above library (extract, config, make, make install) and then delete the  pangox-compat dependency in the PKGBUILD flag,
and it can normally run now... :(


2013年11月9日星期六

Install eclipse in linux

sudo apt-get install eclipse eclipse-jdt eclipse-pde eclipse-platform eclipse-rcp eclipse-cdt g++


Support C/C++: eclipse-cdt g++

2013年11月1日星期五

Download Java SDK for ubuntu

For Oracle-JDK,
 
Step1)
Remove the OpenJDK
sudo apt-get purge openjdk*
 
Step2)
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
 
Step3)
Step3a) For JAVA8, sudo apt-get install oracle-java8-installer
Step3b) For JAVA7, sudo apt-get install oracle-java7-installer
Step3c) For JAVA6, sudo apt-get install oracle-java6-installer   
 
__________________________________________________________________________
For Open-JDK, 
 
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install openjdk-6-jdk
 
 
openjdk-6-jdk 
openjdk-7-jdk

2013年10月30日星期三

Resize VirtualBox disk size

Suppose we are using Windows as the Host

Step 1) List hard disk drive
Open the command prompt and enter:
cd "C:\Program Files\Oracle\VirtualBox\"
vboxmanage list hdds

you will see something like this:
UUID: 5ebf0266-4e9e-4b7e-b9f6-6d67514919c3
Parent UUID: base
Format: VDI
Location: /VBOX/Windows XP/Windows XP.vdi
State: inaccessible
Type: normal
Usage: Windows XP (x86) (UUID: c90339ab-edb1-4b30-890b-ea7153b6cf4b)

Step 2) Determine the file is ended with VDI or VMDK extension.
If it is VDI, goto step 3a.
If it is VMDK, goto step 3b.

Step 3a) Resize the disk using UUID <- Recommended

Using the above as an example:
50000 = 50GB

VBoxManage modifyhd 5ebf0266-4e9e-4b7e-b9f6-6d67514919c3 --resize 50000

Step 3b) Resize the disk size by selecting UUID <- Recommended

Using the above as an example:
50000 = 50GB

VBoxManage clonehd 5ebf0266-4e9e-4b7e-b9f6-6d67514919c3 "c:\temp\clone.vdi" --format VDI
VBoxManage modifyhd "c:\temp\clone.vdi" --resize 50000
VBoxManage clonehd "c:\temp\clone.vdi" "NEW_HARK_DISK_DEST" --format VMDK

Attach the re-sized disk in VirtualBox.


Step 4)
Use GParted to expand the partition.

After verify the disk is working properly,
the original disk and also the "c:\temp\clone.vdi" one can be deleted safely.

2013年8月22日星期四

Encounter "UUID is duplicate" message after moving the VirtualBox image file

C:\Program Files\Oracle\VirtualBox> VBoxManage internalcommands sethduuid "E:\VirtualBox VMs\centos\centos.vdi"