Petrol Rush in Malaysia

This was the scene at the petrol kiosk near my housing estate in Cheras.

I did not fuel up and so did many of my friends. We tried our luck at kiosks around but all of them had piles of cars waiting to fuel up. It just wasn’t worth it.

Waiting in line for hours just to save 30 bucks is not me. I’m gonna eventually have to follow the new increased price moving forward so instead, I decided to not smoke for 3 days to cover my loses.

Think green for nature and your pocket. I know many don’t agree with me on this but this is just my opinion.

Defension is down

Defensio

Defensio has been down since yesterday.

Defensio Down

My spam aren’t being filtered, I can’t access my Defensio quarantine page and users are unable to post new comments.

Their hosting provider Amazon (EC2) push some software which caused Defensio’s services to go down. The team’s currently working on the issue and updated can be tracked through their blog and twitter.

Fuel price hike in Malaysia

It’s RUMORED that the new fuel price in Malaysia effective midnight today will be raised from RM1.92 to RM2.70. That’s a 78 cents hike which adds up to about 40%. My Wira gonna cost me about RM110 for a full tank.

Looks like the petrol pumps around town are gonna be filled up today.

You endorse the hike? I do, time to think green I would say.

How to send a process to the background

Sending a process to the background in Linux is quite easy. All you need is bg, fg, &, and ctrl+Z ( ^Z ).

For this example I will use a simple bash script test.sh I put together to print “Test” every 5 seconds.

#!/bin/bash
#This script will print "Test" every 5 seconds
#
while [ true ]
do
echo "Test at `date`"
sleep 5
done
#End

Now let’s see how it’s done.

[user@abubu root]$./test.sh &
This starts test.sh and sends it to the background. You will be back at shell but should see the “Test” message every 5 seconds.

[user@abubu root]$jobs
[1]+ Running ./test.sh &

The jobs command will print all the background processes. Each process is represented by a number to it’s left. For example, tesh.sh is represented by 1.

[user@abubu root]$fg 1
The fg command will send the test.sh process to the foreground and return control to the shell.

[user@abubu root]$ ./test.sh (hit ctrl+Z (^Z) now)
Test at Tue Jun 3 15:11:38 MYT 2008
[1]+ Stopped ./test.sh

The test.sh process is temporarily suspended.

[user@abubu root]$bg 1
The bg command will send test.sh to the background.

[user@abubu root]jobs
[1]+ Running ./test.sh &

The jobs command will print all the background processes. Each process will be represented by a number to it’s left. tesh.sh is represented by 1.

[user@abubu root]$fg 1
The fg command will send the test.sh process to the foreground and return control to the shell.

That’s it.

How to disable directory listing in Tomcat

tomcat

This is how you turn off directory list for yr Tomcat server.

1. Edit the default servlet in the {$CATALINA_HOME}/conf/web.xml file.

2. Look for the <init-param> section within the <servlet section>

<servlet>
<servlet-name>default</servlet-name>
<servlet-class>
org.apache.catalina.servlets.DefaultServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

3. Change the <param-value> to false for the <param-name>listing</param-name> section.

<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>

© 2008-2012 The Danesh Project
Powered by Wordpress and made by Guerrilla. Hosted at ServerFreak