วันศุกร์, ธันวาคม 21, 2555

Install Cairo Dock 3.1 in Ubuntu 12.10/12.04/Mint

To Install Cairo Dock, execute the following commands in the Terminal:
(one line at a time, enter then after command complete execute the next command line)

$sudo add-apt-repository ppa:cairo-dock-team/ppa

$sudo apt-get update

$sudo apt-get install cairo-dock cairo-dock-plug-ins


From: Install Cairo Dock 3.1 in Ubuntu 12.10/12.04/Mint (New Release)
'via Blog this'

วันพุธ, ธันวาคม 19, 2555

Fixing Ubuntu theme Gnome Shell 3.6 metacity theme Bug (workaround)

Many thanx to reference source you made my day.

    I just realize that the metacity theme (window decorator) from Gnome Cupertino did not applied when I use it, even though the theme maker already include metacity theme in his release.
    This is because Gnome Shell 3.6 Bugs or they're changed without notice. The .themes folder that placed under user's home will not read by the system, so it will not change your window decorator theme.

   Solution 1: we need to move those package to the system wide's themes folder; /usr/share/themes/
 i.e.: /usr/share/themes/GnomeCupertino 

   Solution 2: make a themes folder under ~/.local/share/ then move that theme into this folder
i.e.: ~/.local/share/themes/GnomeCupertino 
Note: With this solution the themes in this folder will not appear in the Gnome tweak tools.

   Solution 3: make a symbolic link from ~/.themes to the ~/.local/share/
$ln -s ~/.themes ~/.local/share/themes


  • Use the Gnome Tweak tools to select the theme you want 
  • Alt+F2 put r then Enter to refresh the changed.

PS: Use Gnome Cupertino (gtk theme) with Zukitwo cupertino (gnome shell theme) is ROCK! ;)

Reference: http://www.fandigital.com/2012/10/use-custom-theme-in-gnome-shell-36.html

วันพุธ, พฤศจิกายน 28, 2555

XFCE settings on Ubuntu 12.10

    Want to try other window manager than Gnome-shell, which gave me some annoying trouble; hang, freeze need to restart lightgdm or force restart the machine. So, here we go.
   Thanks to K.Thep. your post inspired me to choose XFCE4 (http://thep.blogspot.com/2012/11/my-alternative-desktops-3-xfce.html).

   This post kind of memo to my settings ;) 

Theme

  1. https://p0ngbr.deviantart.com/art/Fundamental-Round-for-XFCE-197537212
    *This on cannot move window button to the left side
  2. https://p0ngbr.deviantart.com/art/Moira-for-XFCE-279849551 
  3. http://xfce-look.org/content/show.php/Greybird?content=142534 
Utility
    Keyboard language switching
[r
ef: http://crunchbang.org/forums/viewtopic.php?id=13026]
    sudo apt-get install xfce4-xkb-plugin
Then we can add it via panel applet.

วันพุธ, พฤศจิกายน 21, 2555

Fixed : Jenkins SVN plugin always throw No credential to try. Authentication failed

I'm Using Jenkins 1.466.2 with Subversion plugins. Config it to always checkout the source code to build every day. One day it cannot build and show this error in the Source Code Management session.

ERROR: Failed to tag org.tmatesoft.svn.core.SVNCancelException: svn: No credential to try. Authentication failed

No matter how I try to enter the correct credential, by click the follow suggest link "Maybe you need to enter credential?" 

 Solution: 

    Got a clue from these post 

  1. http://stackoverflow.com/a/4652362.
  2. http://blog.vinodsingh.com/2009/08/hudson-svn-authentication-cancelled.html 


    I dig in to my .subversion folder; it's in your home directory. 
1.
This is my ~/.subversion/servers file; the configuration that different than the default one is this line.

...
store-plaintext-passwords = yes
...
2.

I found a file 550564593bc22e0166f1d522f51755cc under ~/.subversion/auth/svn.simple/
   I look into its content
$cat ~/.subversion/auth/svn.simple/550564593bc22e0166f1d522f51755cc
K 15
svn:realmstring
V 103
<http://filexchange.{cannot exposed}.com:80> {cannot exposed} System 2.0 Repository Login
K 8
username
V 6
dahoba
END

There's password missing?, I thought. So, I try remove the file 550564593bc22e0166f1d522f51755cc and then try to checkout by command line again
$svn --username dahoba co http://filexchange.cannot-exposed.com/svn/2.0/main/program/trunk/app.web .

It will ask for password again, input the correct password and I choose to kept plain password. If we check the content of a file again, the file 550564593bc22e0166f1d522f51755cc was re-generated.
$cat ~/.subversion/auth/svn.simple/550564593bc22e0166f1d522f51755cc
K 8
passtype
V 6
simple
K 8
password
V 9
rm$pdc124
K 15
svn:realmstring
V 103
<http://filexchange.{cannot exposed}.com:80> {cannot exposed} System 2.0 Repository Login
K 8
username
V 6
dahoba
END

    Now, back to Jenkins web console, navigate to jobs configuration, the problem should now gone.

PS: Jenkins deployed on a Ubuntu server
PS: username, servername, repository name was changed, I cannot expose those information to public.

HOWTO Set Ubuntu proxy ignore-hosts via command line

Instead of use dconf-editor to change the gnome proxy setting (on Ubuntu 12.10) I managed to use command line. This is howto set proxy configuration via command line:

gsettings set org.gnome.system.proxy.http host '127.0.0.1'
gsettings set org.gnome.system.proxy autoconfig-url ''
gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '172.16.0.0/16','10.0.0.0/8']"
gsettings set org.gnome.system.proxy mode 'manual'
gsettings set org.gnome.system.proxy use-same-proxy false
gsettings set org.gnome.system.proxy.ftp host '127.0.0.1'
gsettings set org.gnome.system.proxy.ftp port 3128
gsettings set org.gnome.system.proxy.http authentication-password ''
gsettings set org.gnome.system.proxy.http authentication-user ''
gsettings set org.gnome.system.proxy.http enabled false
gsettings set org.gnome.system.proxy.http host '127.0.0.1'
gsettings set org.gnome.system.proxy.http port 3128
gsettings set org.gnome.system.proxy.http use-authentication false
gsettings set org.gnome.system.proxy.https host '127.0.0.1'
gsettings set org.gnome.system.proxy.https port 3128
gsettings set org.gnome.system.proxy.socks host '127.0.0.1'
gsettings set org.gnome.system.proxy.socks port 8010


Put those lines into a shell scripts; make it executable ;)
Note: For the ignore-hosts value we need to use double quote around the bracket

This command line will not work:
gsettings set org.gnome.system.proxy ignore-hosts ['localhost', '127.0.0.0/8', '172.16.0.0/16','10.0.0.0/8']

This is the correct syntax:
gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '172.16.0.0/16','10.0.0.0/8']"

วันพฤหัสบดี, พฤศจิกายน 15, 2555

Ubuntu: Solving conky did not display on gnome-shell 3.6

Conky, conky lua script that dowloaded from gnome-look did not display any graphics on gnome-shell.

To fix; we need to edit the Conky's config file a.k.a. .conkyrc file


Replace own_window_type override with following lines:

own_window_type normal
...
You might add this line if your script did not have it.
own_window_argb_visual yes
...

Finish? then
killall conky 

then execute conky again, now it should display the graphics


Reference: http://askubuntu.com/a/139867

Bonus, nice conky theme

วันศุกร์, พฤศจิกายน 02, 2555

Ubuntu, 12.10, gnome-shell; Move window buttons back to the left side

HOWTO move the window buttons in gnome-shell to the left side


    I love the Ubuntu button on the left side but after install&setup the 12.10, they move the buttons back to the right.

   So, I searching/googling I use gnome-shell and the gconf method didnot work anymore I know I have to user dconf editor.

There's many many more, but use same command and it did not work on my machine.

Just excute this command in a terminal
$gsettings set org.gnome.desktop.wm.preferences button-layout close,maximiez,minimize:

Or use dconf editor; Well, install the dconf editor.
$sudo apt-get install dconf-tools

Open it go to/navigate to org/gnome/desktop/wm/preferences, change the value of button-layout to :minimize,maximize,close

If you're like mine it will not work! buttons still there, on the right did not moved :(

Here's how
navigate to this instead: org/gnome/shell/overrides/ change the value of button-layout to :minimize,maximize,close 

button are now on the left side

Gotcha! I'm a happy man now :) Have a good day!

วันจันทร์, ตุลาคม 01, 2555

Ubuntu: change eth1 or eth* to eth0

Running Ubuntu in the VM machine. There's quite a lot of time when we change its MAC address. The Ubuntu will generate the new eth for new network device (new MAC).

 Anyway I already have attach 1 NIC to a VM and I want to change eth1 to eth0. Here's the HOWTO

Edit the content of the file /etc/udev/rules.d/70-persistent-net.rules

#sudo vi /etc/udev/rules.d/70-persistent-net.rules

I just comment the old line/the line that had "eth0"  then change eth1 to eth0 in another line. Save changed. We need to reboot the machine.

reference: http://www.caeus.com/articles/how-to-change-which-network-card-eth0-vs-eth1-etc-your-ubuntu-server-uses/

วันพุธ, สิงหาคม 15, 2555

Join the Ubuntu desktop into the LDAP (Active Directory)

HOWTO join Ubuntu desktop into Domain server, LDAP

Scenerio: 

  • LDAP server is Microsoft Active Directory
  • Ubuntu desktop, Ubuntu 12.04 Precise


1. Check the /etc/resolv.conf
i.e.
$cat /etc/resolv.conf

  search test.org
  nameserver 127.0.0.1


If your result like mine,above. We should modify it, to point it to your real nameserver.
i.e.

  search test.org
  nameserver 172.16.0.6


2. Install likewiseopen, the openldap software
i.e.
  $sudo apt-get install likewise-open5

** Note that there's likewise-open5 and likewise-open; must install the one that have 5, otherwise it will not work, cannot join the domain. Anyway the likewise-open is the dependency of likewise-open5, it will installed along with the 5 one.

3. a command to join a domain
i.e.
 $sudo domainjoin-cli join test.org Administrator

* The Administrator should be changed to your account instead.

4. Modification needed to make domain user can invoke the sudo command
Edit the /etc/sudoers. you can add this line at the last line or below the existing one.
i.e
 $sudo vi /etc/sudoers

...
%test.org\\domain^users ALL=(ALL) ALL
...
* The test.org should be changed to your AD, domain name instead.
** (see Adding sudo)

5. Enable the (lightdm) login for a new LDAP account. Otherwise there's noway to login as an LDAP user on this machine.
i.e.

Make a backup of original file.
  $sudo cp -p /etc/lightdm/lightdm.conf /etc/lightdm/lightdm.conf.orig

  $sudo /usr/lib/lightdm/lightdm-set-defaults -m true

  $sudo /etc/init.d/lightdm restart

Reboot the machine OR logout to login as an LDAP user.

Now, next time you can select Other, on login screen to login as an LDAP user.


Reference:
  1. https://help.ubuntu.com/community/LikewiseOpen 
  2. http://www.tejasbarot.com/2012/04/30/howto-other-login-option-on-login-screen-ubuntu-12-04-lts-precise-pangolin/ 
  3. http://manyrootsofallevilrants.blogspot.co.uk/2012/05/ssh-single-sign-on-sso-for-ubuntu-1204.html


วันพุธ, มิถุนายน 13, 2555

Ubuntu on SSD; application tuning for best performance

Ubuntu on SSD

Tuning application's cache/temp directory for best performance.

    From previous post running-ubuntu-on-ssd-tweak. We already have instruction on howto move Firefox's cache to RAM, the tmpfs. This post will show howto do it with others.

Google Chrome

Change execute parameter in Google Chrome launcher file.
$sudo vi /usr/share/applications/google-chrome.desktop 

...
# Exec=/opt/google/chrome/google-chrome %U
Exec=/opt/google/chrome/google-chrome --disk-cache-dir="/tmp/" %U

...

duplicate old line then comment it. put additional parameter to a duplicated line; --disk-cache-dir="/tmp/" 

If you want to specify the cache size see the reference.

reference:
  1. http://www.ghacks.net/2010/10/19/how-to-change-google-chromes-cache-location-and-size/ 
  2. http://www.joeyconway.com/blog/2011/09/11/ubuntu-ssd-move-chrome-cache-to-ram/

Running Ubuntu on SSD; tweak & configuration for best performance

Ubuntu on SSD 

tweak & configuration for best performance



Start with 1st, 2nd reference (1, 2)

Modify the /etc/fstab & I/O scheduler 
 # <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
tmpfs        /tmp        tmpfs        nodev,nosuid,noatime,mode=1777 0    0
# / was on /dev/sda1 during installation
UUID=338c2a9f-8a5f-4e4e-90c5-30d02a7680c5 /               ext4    defaults,noatime,discard,errors=remount-ro 0       1
# /home was on /dev/sdb5 during installation
UUID=68f602b9-5384-4be2-8b7a-cbc1001504d2 /home           ext4    defaults        0       2
# swap was on /dev/sda5 during installation
# ram 8G no need swap
# UUID=2b531fb1-b9fc-4653-859a-58af74951a2c none            swap    sw              0       0
Automatic TRIM  (3)
is supported since kernel 2.6.33 with the EXT4 file system
For automatic TRIM to work, the drive needs to be mounted with the "discard" option in fstab.
...
# / was on /dev/sda1 during installation
UUID=338c2a9f-8a5f-4e4e-90c5-30d02a7680c5 /               ext4    defaults,noatime,discard,errors=remount-ro 0       1
...

Modify /etc/rc.local (1, 2)
...
echo deadline > /sys/block/sda/queue/scheduler
echo 1 > /sys/block/sda/queue/iosched/fifo_batch
...
exit 0
Modify applications (4)
    Firefox puts its cache in your home partition. By moving this cache in RAM you can speed up Firefox and reduce disk writes. Complete the previous tweak to mount /tmp in RAM, and you can put the cache there as well.

Open about:config in Firefox. Right click in an open area and create a new string value called browser.cache.disk.parent_directory. Set the value to /tmp.

reference:

  1. http://askubuntu.com/a/86474
  2. http://itezer.com/blog/ubuntu-linux/125-four-tweaks-for-using-ubuntu-with-ssd.html
  3. TRIM http://askubuntu.com/questions/18903/how-to-enable-trim 
  4. http://tombuntu.com/index.php/2008/09/04/four-tweaks-for-using-linux-with-solid-state-drives/ 

Ubuntu: change,remove gnome-shell network applet

gnome-shell's network applet is a bit unfinished.

1.    disable the gnome-shell's network applet, reverting to the old network-manager applet (nm-applet) by doing sudo mv /usr/share/gnome-shell/js/ui/status/network.js /usr/share/gnome-shell/js/ui/status/network.disabled and execute (via alt+F2) the command 'r' (without quotes), to reload gnome-shell.

2.    run nm-connection-editor to edit the connection (or right click the network icon).

reference: http://askubuntu.com/a/86508

วันอังคาร, พฤษภาคม 08, 2555

Ubuntu file manager context extension (nautilus script)

I want to right click then excute the terminal from that current directory. It's long time ago, I know there's a way to do this. So, this is the ;)

  1. create this folder if it's not existed ~/.gnome2/nautilus-scripts
    (or /home/<your account>/.gnome2/nautilus-scripts) 
  2. Put the wanted script beneath it.

$cd ~/.gnome2/nautilus-scripts/



~/.gnome2/nautilus-scripts$ls -l
total 0



~/.gnome2/nautilus-scripts$ cp ~/script/nautilus_Open_terminal_here.txt .
~/.gnome2/nautilus-scripts$ cp ~/script/root-nautilus-here.txt .


~/.gnome2/nautilus-scripts$ mv nautilus_Open_terminal_here.txt Open-terminal-here
~/.gnome2/nautilus-scripts$ mv root-nautilus-here.txt root-nautilus-here

~/.gnome2/nautilus-scripts$ chmod +x *


Then if we right click on the nautilus there's a 'script' context menu and there's 2 script under it DONE! ;)




The HOWTO I got it from NautilusScriptsHowto.
There're more (nautilus) scripts from this URL.


วันพุธ, มีนาคม 21, 2555

Ubuntu: New Pidgin icon Faenza style

I want to replace Pidgin icon original from Faenza icon package, don't like the smili face icon :P

 So, I googling then found this icon
Thank you http://gnome-look.org/content/show.php/?content=133153







Very impressed.
    But creator provide just a svg image. so I decide to make the others icon dimension, according to the Faenza package.


Download here
(pidgin_apps_icon.tar.gz md5: b2dda311a6f34958d2781dc302c05a27)

How to use? 
   Just replace the pidgin.png under following folder with the corresponding pidgin.XX.png from downloaded file.

  • .. /Faenza/apps/16/pidgin.png 
  • .. /Faenza/apps/22/pidgin.png
  • .. /Faenza/apps/48/pidgin.png
  • .. /Faenza/apps/32/pidgin.png 
  • .. /Faenza/apps/64/pidgin.png 
  • .. /Faenza/apps/96/pidgin.png
  • .. /Faenza/apps/scalable/pidgin.svg

วันอาทิตย์, มกราคม 29, 2555

Ubuntu: 11.10 x64 - Change Firefox JRE plugin from IcedTea to Sun JRE


To Change Firefox java plugin from IcedTeaWeb to Sun JRE on Ubuntu 11.10


execute at terminal to install java plugin for Firefox

$sudo apt-get install icedtea-7-plugin

If you want to change JRE from icedtea java to Sun JRE do this 

Put following command
$cd /etc/alternatives/

$sudo mv mozilla-javaplugin.so mozilla-javaplugin.ori.so
$sudo ln -s /usr/lib/jvm/jdk1.6.0_26/jre/lib/amd64/libnpjp2.so mozilla-javaplugin.so
To check, what we had changed applied.

$ls -l moz*

lrwxrwxrwx 1 root root 58 2012-01-21 01:38 mozilla-flashplugin -> /var/lib/flashplugin-installer/npwrapper.libflashplayer.so

lrwxrwxrwx 1 root root 58 2012-01-21 01:38 mozilla-javaplugin.ori.so -> /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/IcedTeaPlugin.so

lrwxrwxrwx 1 root root 50 2012-01-29 01:38 mozilla-javaplugin.so -> /usr/lib/jvm/jdk1.6.0_26/jre/lib/amd64/libnpjp2.so



วันอังคาร, มกราคม 24, 2555

Ubuntu: reconfig keyboard layout in Ubuntu server

Reconfig keyboard layout in Ubuntu server

sudo dpkg-reconfigure console-setup

Ubuntu: Add permanent static routes

To keep the Static Route persistent or you want to add the route entries to the network script files (not using the route command) then all you need to do is to edit the file


/etc/network/interfaces
and the static routes in the following format:

    up route add [-net|-host] <host/net>/<mask> gw <host/IP> dev <Interface>




sudo cat /etc/network/interfaces

The output should show something like this



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).


# The loopback network interface
auto lo
iface lo inet loopback


# The primary network interface
auto eth0
iface eth0 inet static
address 172.20.10.1
netmask 255.255.255.0
broadcast 172.20.10.255
gateway 172.20.10.254

# static route
up route add -net 172.20.11.0/16 gw 172.20.10.254 dev eth0


** updated 20120702
from: http://www.cyberciti.biz/faq/setting-up-an-network-interfaces-file/
Sample: 
You need to insert the dns as follows:

    dns-nameservers 192.168.3.45 192.168.8.10
    dns-search foo.org bar.com


For the change to /etc/network/interface to take effect. please restart the “networking” service as follows:

sudo /etc/init.d/networking restart

ref: http://www.ubuntugeek.com/howto-add-permanent-static-routes-in-ubuntu.html

วันอาทิตย์, มกราคม 22, 2555

Ubuntu: Android development setup resources

To setup Ubuntu desktop ready for Android development


Eclipse SDK  

    Eclipse Classic 3.7.1 http://www.eclipse.org/downloads/

Android SDK

    Download http://developer.android.com/sdk/index.html

    Installing http://developer.android.com/sdk/installing.html

Android ADT
    http://developer.android.com/sdk/eclipse-adt.html

Optional

Subclipse (Subversion plugin for eclipse)http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA

    Eclipse update site URL: http://subclipse.tigris.org/update_1.6.x

Ubuntu: Got an error libncurses.so.5 wrong ELF class when execute adb

 Got an error libncurses.so.5 wrong ELF class when execute adb


when execute adb, got an error like this

#: adb
adb: error while loading shared libraries: libncurses.so.5: wrong ELF class: ELFCLASS64

Solution

    Install ia32-libs to the system

sudo apt-get install ia32-libs


Refer to Google documentation here
http://developer.android.com/sdk/installing.html#troubleshooting

Ubuntu: Install javaHL for Subclipse, Eclipse plugin

When starting eclipse after install subclipse plugin. Got an error like this
 
Failed to load JavaHL Library. These are the errors that were encountered: no libsvnjavahl-1 in java.library.path no svnjavahl-1 in java.library.path no svnjavahl in java.library.path

means that we did not install some library files for subversion plugin yet.
Execute this command:

sudo  apt-get install subversion libsvn1 libsvn-java

(re)Start the eclipse there's (should) no such an error occurred.