I had a java project in my ubuntu netbeans, that used a keystore file created using keytool for secured communication with the server. When i deployed the project into a windows server it didnt work. When I tracred i was getting this exception
java.io.IOException: Keysize too big
Some times googling just doesnt work. I know only sometimes, most times it helps. I thought, it could be some JVM memory issue, then thought Windows OS issue. Finally decided to list the keystore using keytool in the server itself. I got the error,
keytool: java.io.IOException: Keysize too big
Now came to a conclusion its the keystore file is corrupted. WIth some help from IRC and stack over flow narrowed the problem. It was the way i copied the file to the server, i had used normal TEXT MODE FTP, which will mess the keystore file. As TEXT MODE copies line by line, few characters will be interpreted wrongly like ‘\n’. Using sftp, scp or binary mode is best. I used scp and it worked. I couldnt just accept i had been spending hours to trace the issue. Let me call it a day.. cheers.
A Nice reasoning in stackoverflow for my post: FTP programs try to convert between different line-ending modes, so one 10 byte on the unix side gets converted to one 10 and one 13 byte on the windows side – by Pa?lo Ebermann
http://stackoverflow.com/questions/5142396/java-io-ioexceptoin-keysize-too-big-in-windows-2003-server
Java, Programming, Ubuntu
keytool, Shell
DarGTUG as got a new likely permanent venue its COSTECH building at science. Thanks to COSTECH. I prepared a quick presentation on SEO and Adsense for the enthusiastic members. Members actively took part in the discussion and from every meeting I keep on justifying myself there is a need for such a forum in Dar es Salaam, Tanzania. The members well realized that. I was very happy to share bit and pieces of information that I learned in my life. Its good that we transform what ever we learn… find the presentation here
http://dl.dropbox.com/u/12254041/seo_dargtug.pdf
Web
SEO, Web
It was my first day in University of Dar-es-Salaam. I was pretty impressed seeing the campus. The event was organised by DarGTUG. There were almost a 100 students. The students were so enthusiastic firing questions on the day. Welcome to the technical club in Tanzania, DarGTUG. Join here lets share what we know.
The presentation is here http://dl.dropbox.com/u/12254041/online_games.pdf
Internet, Web
Online Games, Web
I always like to do thinks in terminal, let me explain you in my way. Use lsusb command to find if the modem is detected.
If detected use lsusb -v, to find the product id and vendor id of the modem.
In my case I am using Huawei EC168C – the vendor id is “12d1″ and product id is “1446″.
Open the terminal and follow the instructions
#sudo gedit /etc/udev/rules.d/15-huawei-115x.rules
Now paste the following content as follows and save.
SUBSYSTEM==”usb”,
SYSFS{idProduct}==”1446″,
SYSFS{idVendor}==”12d1″,
RUN+=”/lib/udev/modem-modeswitch –vendor 0x12d1 –product 0×1446 –type option-zerocd”
Save the file. Unplug and plug the modem. Now right click the network icon , goto Mobile Broadband and click Edit. Enter the phone and username.
In my case I am in Zantel network. The phone number is #777 and username is @zantel.com. Click the network icon again and click the detected modem to enjoy surfing.
Ubuntu
Huawei, Shell, Ubuntu
When i installed an ndb clusters, i found sometimes one of the datanodes, fails for some reason and they never start again untill it is manually done. So i wrote a shell script for the datanodes to check itself. The script checks in the ndbd process is running, if not its starts the process and writes a log. I added this shell script to the cron job to run the script every 10 minutes. Now the ndb clusters is perfectly stable for some months.
You may ask, 10 mins is too long. Does it mean, the database server will be down for 10 mins. Not beacuse there are more than 1 data node in the cluster, during this 10 mins other nodes will serve.
#!/bin/sh
logfile=/usr/local/mysql-cluster/restart.log
PID=`ps -eo ‘tty pid args’ | grep ‘ndbd’ | grep -v grep | tr -s ” | cut -f2 -d ”`
if [ -z "$PID" ]
then
message=`service ndbd start`
echo “`date` – NDBD started”>>$logfile
fi
Cron job that I added, (edit the file /etc/crontab and add the following line at the end)
*/10 * * * * root /path/to/the/script
This would keep the ndbclusters live for ever.
Linux, MySql NDB Clusters
MySQL, NDB Clusters, Shell
A simple way to have a password protected wordpress.org blog. You may ask, if a blog is to be password protected, what is the need for it. Sometimes we may need a small office or company internal blog which may have confidential information of the company. Here you go
Add the following code to the beginning of the index.php file of the Theme you are using.
<?php
if (!is_user_logged_in()) {
auth_redirect();
}
?>
And thats it…
Web
Internet, PHP, Web, Wordpress
To solve this issue you should make sure you have installed the right driver and also you should make sure you removed all the conflicting drivers. Because if there is any conflicting drivers installed it will not allow the kernel to load the right driver.
Packages to be intalled
bcmwl-kernel-source
bcmwl-modaliases
Packages that should not be installed or removed
b43-fwcutter
linux-backports-modules-karmic
linux-backports-modules-karmic-generic
actually no backports-modules need not be installed.
Problems solved
- detecting wireless connections, but not able to connect.
- Wireless not working
- wireless is enabled but doesnt work.
Linux, Ubuntu
Dell, Ubuntu, Wireless
I am trying to create secure mobile application that would be used for m-commerce. From day one of the development i faced several challenges. I made the application more like a web browser, and the connection using http, (ofcourse finally after development it would be https) for the request and response. I created a cool graphical user interface with Kuix Library. The J2ME application would interact with a PHP server application and all transactions will be in xml. I made the transactions light weight. Making the application look like it is loading the data from the local. I took care of all the security flaws, hiding most of the implementation from the user.
But still I am not satisfied of the security.
I wanted to create a seperate protocol, to ensure high security. Features
- The application should be bound to the mobile number, the user should be able to access the m-commerce service only through the mobile number he/she has registered.
- The application should be bound to the SIM card and the mobile itself. More to the SIM card.
Methods
- Try to push an sms from the server, on each login with a encrypted session key. After that use that key for every transaction you make in that particular session.
- Try to push an SMS with a generated permanent private key, on your first login with the application. Take the signature of the SIM card and save this private key and simcard signature in phone memory. From next login check if the saved signature and SIM signature matches. If so procees with the http login sending the username, password, and the private key.
Challenges in implementation,
- Its is very hard to know the mobile number from the J2ME application. There are some methods available, but they are not perfect and differs from each model.
- Still wondering if i could read the signature of the simcard, so that i could deactivate the Java application on sim card change.
- Waiting for the SMS would incur much time.
Any suggestions are most welcomed. Awaiting your comments
Applications, Mobile App
e-commerce, j2me, mobile
Z-Connect is one of the fastest wireless modem in Tanzania. Connecting it in Linux was a challenge. Here is the configuration file to connect to the Internet in Linux. I am using Ubuntu.
- In your terminal give the command
#wvdialconf
- Edit the file /etc/wvdial.conf with your favorite text editor and overwrite the entire contents with the following
Init2 = AT+CRM=1
Dial Command = ATM1L3DT
Modem Type = Analog Modem
Phone = #777
ISDN = 0
Username = “@zantel.com”
Init1 = ATZ
Password = ” ”
Modem = /dev/ttyUSB0
Baud = 519600
- Now come to the terminal and type the command
#wvdial
Enjoy Browsing.
Bash, Internet, Linux, Ubuntu
Ubuntu, wvdial
Firebug is a firefox plugin, which converts a simple browsers into a powerful debugging tool. When I was learning how to develop a Drupal module i came across the term Firebug. Now it has become part of my life. The day i found firebug, I was just thinking why it didn’t come to my sight all these days when i was surfing the net.
Firebug, gives so many reasons for a web developer to use it. May be let me list in what all ways Firebug helped me
- It was very hard to find the bugs in Java Script. Most of the time if there is a syntax error, the code would not respond, Firebug often helps me in tracking the bug in the Java script.
- Tracing through the HTML code. When you keep your mouse on each HTML, tag below Firebug will highlight the content at the top of the screen. It would be so helpful to trace, which part of the HTML creates a particular segment.
- Then it can also trace CSS. Most commonly when you are trying to edit a template to create you website. Firebug when play a greater role in it.
- I don’t think its over, but I am using Firebug for all these, still very often it gets updated with new features added.
Firefox is the Browser that i really love and the two plugins Delicious and Firebug have become my intimate these days, helping me every moment.
Internet, Web
Firefox, Internet, Web