Friday, February 01, 2008
We can have peer to peer (ad-hoc) WiFi for sharing internet connection with another PC/Laptop.
In my notebook HP 520 Intel Core Duo, I create couple files for this purpose :
Also I use wvdial to dial Nokia E61 modem.
1. Bash script file, you can name it as 'internet_sharing.sh'.
#!/bin/sh
#########internet_sharing.sh#############
# released old rfcomm0 connection
sudo rfcomm release 0
sleep 3
# bind my E61 via bluetooth, provided you already paired it
sudo rfcomm bind 0 00:12:D2:6B:1F:4F 2
sleep 5
wvdial -C btcentrin.wvdialconf &
## eth1 is my WiFi
sudo iwconfig eth1 mode Ad-hoc channel 1 ESSID migenet
## sharing the WiFi
sudo modprobe iptable_nat
## You may need one of these lines to set the ip_forward
# sudo echo 1 > /proc/sys/net/ipv4/ip_forward
# sudo systcl -W net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
sudo iptables -A FORWARD -i eth1 -j ACCEPT
#########internet_sharing.sh#############
2. btcentrin.wvdialconf file . Centrin is my gprs provider .
[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","centrin.net.id"
Modem Type = Analog Modem
Phone = *99#
ISDN = 0
Username = johndoe
Init1 = ATZ
Password = thesecret
Modem = /dev/rfcomm0
Baud = 115200
Then you just run the internet_sharing.sh file.
And your partner PC/Laptop just need to set the appropriate WiFi ESSID and key.
Wednesday, January 30, 2008
Tuesday, January 29, 2008
Since last October '07 I use Nokia 3500c (classic).
I tried to connect with Wammu on Ubuntu 7.10 GG but can't connect at that time.
I don't know what the system updates but currently It can communicate with the mobile using bluetooth.
Wammu can retrieve Info, Contacts and Calls records. Still can not retrieve Messages, Todos and Calendar.
The Wammu version is 0.22 running on Python 2.5.2 using wxPython 2.6.3.2 , python-gammu 0.22 and Gammu 1.13.0.
Monday, January 28, 2008
Somehow my notebook still can not hibernate. I'm using Ubuntu 7.10 GG.
With the default system, I didn't get a clue was the hibernate process success or not. It just then shutdown. And it can't resume.
I tried to install uswsusp. The installation process was OK and it can hibernated but still can not resume from hibernation.
The notebook is HP 520 Intel Core Duo.
Any idea ?
Tuesday, January 22, 2008
I'm still looking for Photos/Images Manager for Ubuntu Linux. The requirements are :
- basic images processing (rotation, etc )
- assign IPTC / EXIF fields into multiples files in one click
- search for all IPTC / EXIF fields in one text box to type only
I already try some application :
- F-Spot Photo Manager
- jBrout
- mapivi
Mapivi is quite good for the search combination.
Any other alternative ? Please comment ...
Saturday, December 08, 2007
Before that you need to install these packages :
glade-gnome
libglade2.0-cil
mono-mcs
libgtk2.0-cil
And also your favorite text editor or IDE.
Create a new file GladeApp.cs with the source-code below.
using System;
using Gtk;
using Glade;
public class GladeApp
{
// declare the widgets you will use from glade
[Glade.WidgetAttribute]
Gtk.Entry MyEntry;
public static void Main (string[] args)
{
new GladeApp (args);
}
public GladeApp (string[] args)
{
Application.Init();
Glade.XML gxml = new Glade.XML ("gui.glade", "MyWindow", null);
gxml.Autoconnect (this);
Application.Run();
}
// Connect the Signals defined in Glade
public void OnMyWindowDeleteEvent (object o, DeleteEventArgs args)
{
Application.Quit ();
args.RetVal = true;
}
public void OnMyButtonClicked(object o, EventArgs args)
{
Console.WriteLine("In entry: " + MyEntry.Text);
}
}
Then, start your Glade.
Build a simple window with a text entry and a button. It will be looked like this :

With additional event & signal. delete_event event for MyWindow

and clicked signal for MyButton.

Saved the glade file as gui.glade . You may need to learn a little bit to create these user-interface. Please keep trying.
Then you are ready to compile our code.
myprompt: mcs -pkg:gtk-sharp-2.0 -pkg:glade-sharp-2.0 GladeApp.cs
And run our application.
myprompt: mono GladeApp.exe

Congratulation...
Friday, December 07, 2007
After I installed Zekr from Ubuntu 7.10 repositories I found that It didn't support to play a recitation.
So I downloaded the newest release from http://siahe.com/zekr/ . Zekr version 0.6.6 Debian package.
You also need sun-java5-jre or sun-java6-jre to complete required dependency. I use sun-java5-jre in my case.
Also I downloaded http://siahe.com/zekr/download/recitation/minshawi.zip as I want to hear recitation as my first objective.
Just follow installation instruction here http://siahe.com/zekr/wiki/index.php?title=Installation#Ubuntu.2FDebian .
It works as I expected but the recitation is not as smooth as I wanted to enjoy the hear it.
Wednesday, December 05, 2007
I tried to install minbar from http://khaled.djihed.com/ubuntu/minbar/minbar_0.1-4_i386.deb .
I still need to install libitl0 before I can install minbar.
You still need to manually enter the Long/Lat of your location + GMT zone.
In my case I got from here http://www.islamicfinder.org/prayerDetail.php?city=Jakarta&state=06&country=indonesia&lang=&home=2007-12-5
due to I live at Jakarta Indonesia.
Latitude: -6.1744
Longitude: 106.8294
Timezone: GMT +7.00
But when I see the prayer time list, the Ashr time is quite different from the usual time of Ashr in Jakarta.
I try all the "Calculation Method" listed in minbar, but I can't get the Ashr time that approximate with Jakarta's Ashr time. Almost all list Ashr time about an hour before except for Hanafi method is about half an hour after the time.
So, I think I should better use Pray Time! FireFox Add-on Extention.
Thursday, November 08, 2007
Saturday, November 03, 2007
Provider : XL & Centrin
Mobile : Nokia E61
using Bluetooth (Dial Up Network/DUN) service
Create new file /etc/ppp/peers/centrin
connect "/usr/sbin/chat -v -f /etc/chatscripts/centrin"
usepeerdns
noauth
defaultroute
noipdefault
nocrtscts
nocdtrcts
modem /dev/rfcomm0 115200
user "user@xl.centrin.net.id"
Replace user@xl..... with your username given by centrin.
File /etc/ppp/pap-secrets, add this line at the end of the file.
"user@xl.centrin.net.id" * "mypassword"
Also replace the mypassword with your password.
Create new file /etc/chatscripts/centrin
TIMEOUT 60
ABORT ERROR
ABORT BUSY
ABORT VOICE
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
ABORT "NO ANSWER"
"" "ATZ"
OK AT+cgdcont=1,"IP","centrin.net.id"
OK-AT-OK "ATDT*99#"
TIMEOUT 75
CONNECT
Prepare your bluetooth connection, so your computer can see your mobile phone. But somehow I cannot pairing from "Bluetooth Manager" :-( .
CLI rulezz .... :-)
Next, some commands need root priviledge.
Search for device and channel for Dial-Up Network.
$ sdptool search DUN
In my case, the device-id is 00:12:D2:6B:1F:4F
and the channel is 2.
We'll use rfcomm0 . So release old connection, if any.
$ rfcomm release 0
Bind the device, use sdptool's result.
$ rfcomm bind 0 00:12:D2:6B:1F:4F 2
Next, we need to pair your computer and your mobile-phone.
Well, I don't know how to do it better. Please advice ....
But we need to open xhost security.
$ xhost +
Place the PIN at the handset.
Match the Bluetooth PIN at the Ubuntu.
$ cat < /dev/rfcomm0
Control-C to back to prompt.
Then close the X security.
$ xhost -
Then call the pppd
$ pppd call centrin
Happy surfing ....
Tuesday, February 20, 2007
To flush unused memory on Linux
% dd if=/dev/zero of=junk bs=10MB count=200 #generate a 2000MB file
% # by now top will show not much free memory left.
% rm junk
You will then see a big jump of free memory because the data in the dirty buffers is no longer valid and the memory is free for other use.
Wednesday, November 29, 2006
Integrating Mantis Bug Tracking with Win32 TortoiseSVN
mike.junk@NOntlworldSPAM.com
25-Apr-2005 11:11 #419
Brief guide to TortoiseSVN integration on Win32. This will allow you to enter a Mantis issue number when doing an SVN commit, automatically add a note to the Mantis 'notes' log containing info about the change, and show a link to the issue from TortoiseSVN log.
1. Set properties for your SVN repository (e.g. in TortoiseSVN, use the file properties dialog) to include the following:
bugtraq:label = issue
bugtraq:url = http://
bugtraq:message = issue %BUGID%
bugtraq:warnifnoissue = true
2. Create a post commit hook file in the SVN respository hooks directory (
REM Post-commit hook for MantisBT integration
SET REPOS=%1
SET REV=%2
SET DETAILS_FILE=
SET LOG_FILE=
echo ****** Source code change ******>>%DETAILS_FILE%
svnlook log -r %REV% %REPOS%>>%DETAILS_FILE%
echo SVN Revision:%REV%>>%DETAILS_FILE%
svnlook diff -r %REV% %REPOS%>>%DETAILS_FILE%
DEL %DETAILS_FILE%
DEL %LOG_FILE%
3. Add the following to your Mantis config_inc.php
#Integration to SVN
$g_source_control_notes_view_status = VS_PUBLIC;
$g_source_control_account = '
$g_source_control_set_status_to = OFF;
$g_source_control_regexp = "/\bissue [#]{0,1}(\d+)\b/i";
Sunday, November 19, 2006
Dump database MySQL tiap hari
To backup MySQL everyday with simple shell script.
I'm using Ubuntu 5, MySQL 5.
Create a file at /etc/cron.daily .
Named, e.g. "backup-mysql" .
The content of the file is (between dashes) :
-------------------------------------------
#!/bin/sh
test -x /usr/bin/mysqldump || exit 0
/usr/bin/mysqldump --all-databases -u root --password=a | gzip - > /backup/mysql/mysql-`date +%F`.sql.gz
cd /backup/mysql
find . -atime +14 -delete
-------------------------------------------
#!/bin/sh
Tell the shell wich shell to run this script. Ubuntu default is bash shell.
test -x /usr/bin/mysqldump || exit 0
Check the /usr/bin/mysqldump is it there ? If not just exit.
/usr/bin/mysqldump --all-databases -u root --password=a | gzip - > /backup/mysql/mysql-`date +%F`.sql.gz
Dump all the databases from server with user 'root' and password 'a' (for example). Zipped with gzip and store at /backup/mysql. The file name generated differently every day prefixed with 'mysql-' follow by the date (from `date +%F`, it's a back quote pair).
cd /backup/mysql
find . -atime +14 -delete
Go to the folder and check if there are some file older than 14 days, delete it.
Tags: MySQL, cron, backup, dump, bash, Ubuntu
Wednesday, August 30, 2006
C Development Environment on Ubuntu
To set C Development Environment on Ubuntu
Just apt-get install build-essential
Sorry one-liner
Tags: Ubuntu, C Development
Monday, July 03, 2006
GSM : XL Xplore
Mobile : Sony Ericsson T610
using Bluetooth (Dial Up Network/DUN) service
Create new file /etc/ppp/peers/xlgprs
connect "/usr/sbin/chat -v -f /etc/chatscripts/xlgprs"
usepeerdns
noauth
defaultroute
noipdefault
nocrtscts
nocdtrcts
modem
/dev/rfcomm0
115200
user "xlgprs"
File /etc/ppp/pap-secrets, add this line at the end of the file.
"xlgprs" * "proxl"
Create new file /etc/chatscripts/xlgprs
TIMEOUT 60
ABORT ERROR
ABORT BUSY
ABORT VOICE
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
ABORT "NO ANSWER"
"" "ATZ"
"" "AT&FH0M0"
OK AT+cgdcont=1,"IP","www.xlgprs.net"
OK-AT-OK "ATDT*99***1#"
TIMEOUT 75
CONNECT
"AT&FH0M0" is specific for SE T610.
Prepare your bluetooth connection, so your computer can see your SE T610.
Some commands need root priviledge.
Search for device and channel for Dial-Up Network.
$ sdptool search DUN
In my case, the device is 00:0F:DE:04:6F:0E
and the channel is 1.
We'll use rfcomm0 . So release old connection, if any.
$ rfcomm release 0
Bind the device, use sdptool's result.
$ rfcomm bind 0 00:0F:DE:04:6F:0E 1
Next, we need to pair your computer and your SE T610.
Well, I don't know how to do it better. Please advice ....
But we need to open xhost security.
$ xhost +
Place the PIN at the handset.
Match the Bluetooth PIN at the Ubuntu.
$ cat < /dev/rfcomm0
Control-C to back to prompt.
Then close the X security.
$ xhost -
Then call the pppd
$ pppd call xlgprs
Happy surfing ....
Wednesday, June 21, 2006
Ubuntu 6.06 Dapper Drake Installation
First of all is to download the ISOs. I managed to download it three of them, the desktop, the server, and the alternate ISOs for i386. Fortunately while I was in Singapore, I had a very good Internet cable in my corp's apartment to get those three in one night.
I had not opportunity to burn when I was there. So, days latter I'm in base city, Jakarta, I burn two of them. The desktop and alternate ISOs.
First idea to make it live CD as interface to install the Ubuntu is a great one. But, my experience is not so good as I expected. I try first the desktop CD.
The CD didn't boot smoothly in my desktop PC [IBM ThinkCenter] also in my notebook [Sony VAIO VGN-B100B]
It hang for quite a while when it try to mount the root on both PC and notebook.
After that many lines of error messages shown up.
So, I suspect the ISO file is broken or the burning process have some glitches.
I check and double check the MD5 hash and it's a correct one. So, I try to burn the desktop ISO for the second time.
Try to boot with the new CD but the same situation always came up.
So, I start to googling the "error while mount the root with Ubuntu 6.06 CD". Fortunately the Ubuntu forums has the work-around. Just type 'evms_activate' (without quote) and press Enter when you see the text error messages in the monitor. For my desktop PC the error is consistent but for my notebook the error is gone and I not doing anything except the CD is the new one. Creepy ...
After I defract my hard-disk and backing-up all important files. I decide to try to install the Dapper Drake.
First try was the notebook. I feel the desktop live CD is quite slow or heavy some way.
But this was my first time of my life while I install the Linux I can play Tetris, Mines, etc (of course Gnome's game version). The resize and install procedures was smooth as I expected but still I feel it's took more time then text-based installer.
Next, my desktop. I try to install with desktop CD. After passing the boot problem, I already got the feeling that this is not a good idea. The boot process took a very long time to show the Gnome Desktop. Even I was trying to pop-up the Terminal it took forever.
So, just push the magic 'ON' button until my PC is off.
Next, I try to boot with alternate CD and try to install with text-based installer. The installation was fast and easy.
Tags: Indonesia, Singapore, Jakarta, Linux, Ubuntu, Dapper Drake, 6.06, mount root file system, hang, error
Wednesday, May 17, 2006
Installing Rails on Ubuntu Breezy
I want to try to install Rails [Ruby] also.
So I do these as root (sudo su) :
apt-get install rails
apt-get install libapache2-mod-ruby
a2enmod rewrite
I don't want to touch my DocumentRoot at
/etc/apache2/sites-available/default
So, I add in the end of but within <VirtualHost></VirtualHost> :
Alias /rails/ "/usr/lib/cgi-bin/rails/"
<Directory "/usr/lib/cgi-bin/rails/">
Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi
AllowOverride all
Order allow,deny
Allow from all
</Directory>
Then re-start the apache
/etc/init.d/apache2 force-reload
Then goto /usr/lib/cgi-bin
cd /usr/lib/cgi-bin
mkdir rails
cd rails
To test the rails at /usr/lib/cgi-bin/rails/
rails test
cd test
ruby script/generate controller pleasework
vi app/controllers/pleasework_controller.rb
Add something inside pleasework_controller.rb, to be look like this :
class PleaseworkController < ApplicationController
def index
render_text "rails ok juga"
end
end
Edit public/.htaccess
vi public/.htaccess
Change the RewriteRule from
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
to this
RewriteRule ^(.*)$ /cgi-bin/rails/test/public/dispatch.cgi [QSA,L]
I don't know how to do this more elegant (damn ... another regex!!)
At last, we ready to shoot the URL :
http://myubuntubox/cgi-bin/rails/test/public/pleasework
Tags: Linux, Ubuntu Breezy, Apache2, rails, ruby, Indonesia
Tuesday, April 18, 2006
Setting autentikasi apache 2 dengan mysql di Ubuntu
Berikut ini spesifik untuk kasus saya yg mungkin berbeda dengan Anda.
Edit file /etc/apache2/sites-available/ssl-default
Kira-kira sebagian isinya seperti ini :
Auth_MySQL_Info 192.168.2.4 "www-data" w
Alias /svnadmin/ "/var/www/svnadmin/"
<Directory "/var/www/svnadmin/">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 192.168.2.0/255.255.255.0
AuthMYSQL on
AuthMySQL_Authoritative on
Auth_MySQL_DB http_auth
Auth_MySQL_Empty_Passwords off
AuthName "Subversion user admin"
AuthType Basic
require valid-user
</Directory>