Oct 16, 2008
Sep 29, 2008
[Ubuntu] Fix GRUB crash at startup [ERROR 15]
Posted by Heriman under troubleshooting | Tags: grub, troubleshooting, ubuntu |[3] Comments
- Run Ubuntu Live CD
- Enter a terminal
- Locate the linux boot partition lives
[user@net ~]$sudo fdisk -l - Assume the boot partition lives in /dev/sda6 then do mount into a directory, example /mnt/root
- [user@net ~]$sudo mkdir /mnt/root
- [user@net ~]$sudo mount -t ext3 /dev/sda6 /mnt/root
- [user@net ~]$sudo grub-install –root-directory=/mnt/root /dev/sda –recheck
- reboot
[Source]
Sep 3, 2008
Configuring Tomcat and Apache using mod_jk
Posted by Heriman under tutorial | Tags: apache, mod_jk, tomcat |Leave a Comment
- The system used in this tutorial has the following installed : Tomcat 6.0.14, Apache 2.2.8
- See on <tomcat_home>/conf/server.xml
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> - Download mod_jk from here
- Install mod_jk in Apache module directory
- On Linux, usual location :
- /usr/lib/apache/
- /usr/lib/apache2/
- /usr/local/apache/libexec/
- On Windows, usual location :
- C:\Program Files\Apache Group\Apache\modules\
- C:\Program Files\Apache Group\Apache2\modules\
- On Linux, usual location :
Aug 21, 2008
[Ubuntu] Playing Restricted Formats
Posted by Heriman under tutorial | Tags: linux, tutorial, ubuntu |Leave a Comment
Ubuntu can play the most popular non-free media formats, including DVD, MP3, Quicktime, Windows Media, and more by following the instructions below:
For Ubuntu 8.04/7.10, open the terminal, and execute the following command:
#sudo apt-get install ubuntu-restricted-extras
Another way is using Synaptic:
- Go to Applications → Add/Remove…
- Set Show: to All available applications
- Search for ubuntu-restricted-extras and install it. Note that there is also xubuntu-restricted-extras (for Xubuntu) and kubuntu-restricted-extras (for Kubuntu.)
[Source]
Aug 5, 2008
[Ubuntu] Enabling Apache user home public_html directory
Posted by Heriman under tutorial | Tags: apache, linux, ubuntu |[12] Comments
In order to enable the user-specific public_html directory open up a terminal and switch to the apache module config directory:
cd /etc/apache2/mods-enabled
If you list all the files inside this directory you’ll notice that all of them are actually symbolic links. To enable mod_userdir, which is the module you’re interested in, you’ll have to create two symlinks to the relevant files:
sudo ln -s ../mods-available/userdir.load
sudo ln -s ../mods-available/userdir.conf
All done! Now restart Apache via:
sudo apache2ctl restart
We can now access the web applications stored in our /home/username/public_html directory via http://localhost/~username/
Jul 28, 2008
Install Java COMM RXTX in Linux
Posted by Heriman under tutorial | Tags: comm, gsm, java, linux, modem |Leave a Comment
Instruction dated May 2005
- First install java SDK as shown above. Let say your java is in /usr/lib/j2sdk1.4-sun. It depends on your version, and where you install it. I will call it $JAVA
- Get the latext binary for linux from rxtx.org.
untar it, you will see lib-something-parallel.so and lib-something-serial.so.
cp those to $JAVA/jre/lib/i386/
you will also see RXTXcomm.jar
cp that to $JAVA/jre/lib/ext - Get Java Comm from sun (http://java.sun.com/products/javacomm/downloads/index.html)
Download Version 2.0 for Microsoft Windows and Solaris/x86
Get the Solaris x86 version
you will see comm.jar
cp that to $JAVA/jre/lib/ext - echo “Driver=gnu.io.RXTXCommDriver” > $JAVA/jre/lib/javax.comm.properties
- Test out your installation
Go to the untar javacomm directory
inside it, there should be a samples/Simple
javac *.java
See if there is error. If there is no error, installation is finished!
[Source]
Apr 10, 2008
[J2ME] Create an Image Object
Posted by Heriman under programming | Tags: j2me, programming |1 Comment
Input : String imgName (Image name)
Output : Image Object
This Procedure can do two things :
- Creating Image object from image file on file system
- Creating Image object from image file on http server
Apr 10, 2008
[J2ME] Resize an Image Object
Posted by Heriman under programming | Tags: j2me, programming |[11] Comments
public static Image resizeImage(Image src, int screenWidth, int screenHeight)
{
int srcWidth = src.getWidth();
int srcHeight = src.getHeight();
Image tmp = Image.createImage(screenWidth, srcHeight);
Graphics g = tmp.getGraphics();
int ratio = (srcWidth << 16) / screenWidth;
int pos = ratio / 2;
// Horizontal Resize
for (int x = 0; x < screenWidth; x++)
{
g.setClip(x, 0, 1, srcHeight);
g.drawImage(src, x - (pos >> 16), 0, Graphics.LEFT | Graphics.TOP);
pos += ratio;
}
Image resizedImage = Image.createImage(screenWidth, screenHeight);
g = resizedImage.getGraphics();
ratio = (srcHeight << 16) / screenHeight;
pos = ratio / 2;
//Vertical resize
for (int y = 0; y < screenHeight; y++) {
g.setClip(0, y, screenWidth, 1);
g.drawImage(tmp, 0, y - (pos >> 16), Graphics.LEFT | Graphics.TOP);
pos += ratio;
}
return resizedImage;
}
Feb 6, 2008
Setting CVS Server
Posted by Heriman under tutorial | Tags: cvs, linux, server, tutorial |Leave a Comment
- Add a user ‘cvs‘ and a group ‘cvs‘
#useradd -M -s /sbin/nologin cvs
#useradd -M -s /sbin/nologin anonymous - Edit /etc/group to add another user to cvs group
#vi /etc/group
cvs:x:502:user1,user2,anonymous - Check whether the following 2 lines has been added on file /etc/services
cvspserver 2401/tcp
cvspserver 2401/udp
If can’t find, you have to add the lines.
Jan 3, 2008
Google Chart API
Posted by Heriman under tutorial | Tags: api, google, tutorial, web |Leave a Comment
The Google Chart API lets you dynamically generate charts. To see the Chart API in action, open up a browser window and copy the following URL into it:
http://chart.apis.google.com/chart?cht=p3&chd=s:hW&
chs=250x100&chl=Hello|World
Press the Enter or Return key and – presto! – you should see the following image:
