History
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Dec | ||||||
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 | |||||
Topics
Top Posts
Blog Stats
- 135,705 hits
Anything about Ubuntu, Centos, openSuSe and Fedora
Installing fresh Ubuntu 11.10 and check out what Unity and Gnome-shell has to offer, everything works great until I found something..syslog error message appears very frequent: “keyboard: can’t emulate rawmode for keycode 240“. I remember having this problem in my previous Ubuntu 11.04 installation on my Lenovo z370 laptop, thought it’s gone back then..but to the point on installing newer kernel which is Linux kernel 3.1.
As I’m going to compile Linux kernel again to make everything work. I found a much simplier solution. Here’s how:
1. Install dkms (Dynamic Kernel Module Support Framework)
$> sudo apt-get install dkms
2. Download the ideapad-laptop package which supposed to be fore natty narwhal but still working greate on oneiric.
$> cd ~/Downloads $> wget https://launchpad.net/~lexical/+archive/ideapad/+build/2529783/+files/ideapad-laptop-dkms_0.1-1ubuntu1~foshan2_all.deb $> sudo dpkg -i ideapad-laptop-dkms_0.1-1ubuntu1~foshan2_all.deb
3. Reboot for everything to work in effect.
4. Done.
Previously using gconftool-2 to replace the current desktop wallpaper via a script (normally a starting bash script). But with Gnome3 its not working anymore. As an alternative or should I say the proper way to do it in Gnome3 is via dconf-tools. Here’s the sample command via console:
$> gsettings list-recursively
will list all known schema and keys
$> gsettings list-keys org.gnome.desktop.background
will list all keys under the defined schema.
$> gsettings get org.gnome.desktop.background picture-uri
to change the value, enter this command:
$> gsettings set org.gnome.desktop.background picture-uri "file:///path/filename"
Done.
As of Ubuntu 11.04, the package lxpanel 0.5.6 and Libreoffice 3.3.x, the bug still exist, freezing lxpanel after saving and closing current ODF files. I suspected lxpanel bug, looking it over the Internet and haven’t found any confirmation that it actually does the freezing. While seeking answers over the Internet I’ve found this bug thread: (click here), which fixes my problem, I’m not 100% sure it will work on all cases though, but good enough to give it a try.
1. Install the necessary libraries and tools to compile the lxpanel 0.5.8 from source.
sudo apt-get install libgtk2.0-dev libmenu-cache1-dev intltool
2. Download the lxpanel 0.5.8 source from here, of check the newest version here.
3. Compile the source code. Go to the folder of lxpanel source and perform the following command:
./configure --prefix=/usr
make
sudo make install
4. Logout the current session or reboot your machine to confirm.
5. Done.
Here’s a bash script that will automatically mount all available SAMBA shares that has access permission for the current user. The script composes of two part: (1) The script itself and (2) the user’s credentials.
But current problem is that the user must store the password to access the SAMBA shares in the keyring before the script runs smoothly. It requires the user to access the any of the permitted shares and store the password permanently to the keyring, then add the script to the Startup Applications(System Settings -> Startup Applications)
Autfile is a simple text file contain the following:
username = myuser password = mypass domain = localdomain servername = localserver
Here’s the code:
#!/bin/bash
ARGS="$*"
BASEDIR="/home/rnartos/.scripts/uicsmb"
OPTYPE=""
CMDTYPE=""
FILTERARGS=`echo "$ARGS" | sed 's/ /#/g' | sed 's/-/ -/g'`
AUTHFILE="$BASEDIR/authfile"
NETBASENAME="WinShares"
if [ ! -f $AUTHFILE ]; then
echo "ERROR: neither default or user-defined authfile not exist."
exit 0
fi
for CMD in $FILTERARGS; do
MCMD=`echo $CMD | sed 's/#/ /g'| awk '{print $1}' `
#umount
if [ "$MCMD" = "-u" ]; then
OPTYPE=" -u "
fi
#help
if [ "$CMD" = "-h" ]; then
echo "GFVS WinShares - rnartos"
echo "$0 -u -a <authfile> -h"
echo "-u umount current shares"
echo "-a process authentication file"
echo "-h this help message."
exit 0
fi
#authfile
if [ "$MCMD" = "-a" ]; then
PCMD=`echo $CMD | sed 's/#/ /g'| awk '{print $2}' `
if [ "$PCMD" = "" ]; then
echo "ERROR: parameters for -a <authfile>"
else
if [ -f $PCMD ]; then
AUTHFILE="$PCMD"
else
echo "$PCMD authfile not exist."
exit 0
fi
fi
fi
done
SERVERNAME=`cat $AUTHFILE | grep servername | sed 's/=//g' | awk '{print $2}'`
DOMAINNAME=`cat $AUTHFILE | grep domain | sed 's/=//g' | awk '{print $2}'`
USERNAME=`cat $AUTHFILE | grep username | sed 's/=//g' | awk '{print $2}'`
PASSWORD=`cat $AUTHFILE | grep password | sed 's/=//g' | awk '{print $2}'`
CHECKMOUNT=`gvfs-mount -l | grep "smb:"`
GETIP=`nmblookup $SERVERNAME | grep -v "query" | awk '{print $1}'`
GETSHARES=`smbclient --debuglevel=0 -A $AUTHFILE -L $SERVERNAME -I $GETIP -g 2>/dev/null | grep "Disk" | sed 's/|/ /g' | awk '{print $2}'`
WINSHARENAME="$HOME/$NETBASENAME/$DOMAINNAME/$SERVERNAME"
if [ ! -d $WINSHARENAME ]; then
mkdir -p $WINSHARENAME
fi
for NAMES in $GETSHARES; do
CHECKSHARE=`smbclient //$SERVERNAME/$NAMES -A $AUTHFILE -c '' 2> /dev/null | grep 'DENIED'`
if [ "x$CHECKSHARE" = "x" ]; then
if [ "$OPTYPE" = "" ]; then
if [ "$CHECKMOUNT" = "" ]; then
CMDTYPE="mounting"
fi
else
CMDTYPE="umounting"
fi
if [ "$CMDTYPE" = "" ]; then
echo "Shares Already mounted."
exit 0
else
echo "$CMDTYPE $NAMES"
if [ "$OPTYPE" = "" ]; then
gvfs-mount $OPTYPE smb://$SERVERNAME/$NAMES 2> /dev/null
GVFSNAME=`echo $NAMES | tr '[:upper:]' '[:lower:]'`
ln -sf "$HOME/.gvfs/$GVFSNAME on $SERVERNAME" $WINSHARENAME/$NAMES
else
gvfs-mount $OPTYPE smb://$SERVERNAME/$NAMES 2> /dev/null
fi
fi
fi
done
exit 0
Currently unning a Novell eDirectory LDAP service and wonder how to use iManager on your Ubuntu workstation.
Here’s how:
1. Download the latest iManager Workstation for Linux in Novell Download Center
2. Extract the package (for me usually in $HOME/Desktop)
3. Install the necessary packages and libraries for alien (alien, libstdc++5, gcc), installing alien package also includes rpm in the requirements.
4. Prepare NICI for installation.
$> cd $HOME/Desktop/imanager $> cd NICI/linux $> sudo alien -d --scripts nici.i386.rpm $> sudo dpkg -i nici_2.7.3-1.01_i386.deb
5. Modify the current iManager.sh in the bin folder ($HOME/Desktop/imanager/bin) and remove the word ”function” in every functions of the script.
example:
function CHECK_PERMISSIONS() { echo "Test permissions" > $IMANAGER_BIN_NATIVE_DIR/perm.txt .... }
should be
CHECK_PERMISSIONS()
{
echo "Test permissions" > $IMANAGER_BIN_NATIVE_DIR/perm.txt
....
}
5. In the STARTMANAGER() function, remove the CHECK_NICI;
6. Save the script and do some test run.
$> cd $HOME/Desktop/imanager/bin $> ./iManager.sh
7. Done.
UPDATE(07/29/2011): The GRUB thing didn’t work at all, back to basic trapping signal via upstart scripts in /etc/init/dbus.conf. I tried it before using /etc/init/network-manager.conf but on Ubuntu 10.10, it’s not working anymore. Here’s another test and works for me.
1. Modify the current /etc/init/dbus.conf.
$> sudo vi /etc/init/dbus.conf
2. Add a pre-stop script, which looks like this:
pre-stop script trap "TERM signal" TERM /bin/umount -a -t cifs -l -f trap - TERM end script
3. Save the script and have a test.
4. Done.
UPDATE(07/28/2011): Found a better alternative via GRUB, link here. Mainly you just need to modify the /etc/default/grub. Here’s the details:
1. Edit the /etc/default/grub
$> sudo vi /etc/default/grub
2. Add “reboot=pci” on the GRUB_CMDLINE_LINUX line, it should look something like this:
... GRUB_CMDLINE_LINUX="reboot=pci" ...
3. Update the grub
$> sudo update-grub
4. Done
—————
It’s an ancient bug (here), which still exist in Ubuntu 11.04, or even in other distros. When you got a mounted samba shares before the shutdown or restart process, the machine waits for around 10 minutes before it complete the operation. Very troublesome that’s why I tried various workaround but none of them works with Ubuntu 11.04. Not even the /etc/rc6.d/K* or the upstart /etc/init configurations, nor the old python script I posted before (here’s the link).
After few considerations, I made a desperate workaround, creating a script that triggers before the /sbin/shutdown, /sbin/reboot and /sbin/restart commands.
1. Rename the current shutdown, reboot and restart commands in /sbin.
#> mv /sbin/shutdown /sbin/shutdown2 #> mv /sbin/reboot /sbin/reboot2 #> mv /sbin/restart /sbin/restart2
2. Then create scripts with names of the previous commands in /sbin, which contains the following:
#!/bin/sh umount -t cifs -a -f -l /sbin/shutdown2 $@ exit 0
3. Make similar script for reboot and restart command which also points to /sbin/reboot2 and /sbin/restart2.
4. Until the dbus implementation of stop on deconfiguring-networking comes to Ubuntu 11.04, which I think working with
Ubuntu 11.10 oneiric. I think this is the least workaround that works for me.
5. Done
GMail Notifier and Vuze are some of my mostly used application, and when I upgraded my previously 10.04 to 11.04 system (Ubuntu), I noticed that some of my currently running application that has system tray icon or indicator gone in the Unity side panel and in the system tray area. Googled it and found this link: Ubuntu 11.04 Fix: Show All Icons/Indicators Notification Area.
The quickest way to deal with it is the following:
1. From console:
$> gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"
2. Then refresh the Unity. Press Alt-F2 and type:
unity --replace
3. Done.
After reading “Inkscape 0.48 Essentials for Web Designers“, I then encountered this book, “Inkscape 0.48 Illustrator’s Cookbook” by Mihaela Jurković, and I must say, this is one of the best book learning this wonderful cross-platform application.
While the first book is mainly more for web designers, this book focuses on broader aspect of Inkscape, from creating basic objects to live path effects and guides of using current extensions. The book are aimed at the beginner with no previous experience of vector graphics design. Throughout the pages, the book provides fundamental knowledge in details, from getting to know the interface, command short-cuts, up to the keen concepts of speeding up your workflow.
As with the popularity of Inkscape and vector graphics increases , getting the edge of this application is must and “Inkscape 0.48 Illustrator’s Cookbook” delivers it best.
Vector graphics are becoming increasingly important at the turn of this decade, now that theWorld Wide Web has begun its transition towards HTML5 technologies. All the major Webbrowsers are striving to conform to the SVG specification, as the attractiveness of scalable, high definition, three-dimensional, and Flash-free Web sites and games is irresistible. Thefuture is bright, but the true outcome will ultimately depend on one decisive factor: user and developer adoption.
The best things about this book, is how it guides the reader in doing things with Inkscape, after stating the overview of the operation, it follows with “How to do it” part, which gives the step by step procedure and then goes with “How it works“, for the the teaching style is very effective both for starter and experienced Inkscape users.
To sum all up, ”Inkscape 0.48 Illustrator’s Cookbook” is a great tool in learning this vector graphics designer application. Good for “want to learn” and “want to learn more” types of people.
Want to know more about the book? Head to this links:
I have several notebooks that is connected to our File Server via OpenVPN, the problem is sometimes the connection from and to the server is slow and problematic, cannot browse files or takes to long to upload or download things, and the idea of DropBox like application or tool will eventually fix things around those problems.
I found this old link “How to build your own dropbox clone ” (link here) and gives me an idea on howtos.
The key tool is lsyncd (http://lsyncd.googlecode.com)
Lsyncd watches a local directory trees event monitor interface (inotify). It aggregates and combines events for a few seconds and then spawns one (or more) process(es) to synchronize the changes. By default this is rsync. Lsyncd is thus a light-weight live mirror solution that is comparatively easy to install not requiring new filesystems or blockdevices and does not hamper local filesystem performance.
Here’s the details:
1. From you current Ubuntu Desktop, install rsync and other necessary packages.
$> apt-get install rsync libxml2-dev build-essential lua5.1
2. Then download the lsyncd souce code and compile.
$> wget http://lsyncd.googlecode.com/files/lsyncd-2.0.4.tar.gz $> tar xvfz lsyncd-2.0.4.tar.gz $> cd lsyncd-2.0.4 $> sudo -s #> ./configure #> make; make install
3. Then create a configuration file in your $HOME/.config/lsyncd path called lsyncd.lua
$> mkdir -p ~/.config/lsyncd $> vi ~/.config/lsyncd/lsyncd.lua
4. The content as follows:
sync{default.rsyncssh, source="/home/username/mybox", host="server.localdomain", targetdir="mybox/", rsyncOps="-ltus"}
5. Save the file, and before the sync test, make sure you have a passwordless ssh session to the given host, if not, follow this steps:
On your Desktop/client:
$> ssh-keygen -N '' -f ~/.ssh/id_dsa
On paraphrase prompt, just press ENTER, then the following (note: REMOTE_SERVER is the ssh server host)
$> cat ~/.ssh/id_rsa.pub | ssh REMOTE_SERVER 'cat - >> ~/.ssh/authorized_keys2' $> ssh REMOTE_SERVER 'chmod 700 .ssh'
Then have a test
$> ssh REMOTE_SERVER
6. When all are successfully done, create your preferred name for the sync folder, mine.. I just called it “mybox”. It should have the path as follows:
/home/username/mybox
server.mydomain.local:~/mybox
7. All are set and ready to go, test the lsyncd.
$> lsyncd -nodaemon ~/.config/lsycnd/lsycnd.lua
8. Populate the local folder and watch the remote ssh server for changes.
9. Done.
Note: This is currently a definitely Linux workaround, haven’t tried it in other OS (using cygwin on Windows).
I got this old mainboard (ASUS M2V-MX SE) which I need to install a newer version of Ubuntu (10.10 in this case) from previously 8.04. Decided to have a clean install and found that there’s a current bug in kernel regarding the VIA VT1708/A audio card. Here’s what I’ve found in the net
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/664785
After few minutes of searching for possible solution, finally I’ve found one that works:
https://bugzilla.kernel.org/show_bug.cgi?id=16921#c5
Here’s how:
1. Modify your grub default boot options
$> sudo vi /etc/default/grub
2. Add “pci=use_crs” on your current grub option, which looks like this:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash pci=use_crs”
3. Then update your grub.
$> sudo update-grub
4. Reboot and done.