Welcome To DiKnows Tech

[ This Blog Was Moved To : http://www.diknows.com ]

New Connection

Welcome to my technical blog. In this blog, I’m trying not to reinvent the wheel.

Instead, I’m passing knowledge I gain in my technical life to anyone passes by this blog. I’m always hoping for the best, and I want to be a useful element in the wide open society of the internet.

You can share or suggest ( Technical- Programing ) topics to be discussed here, and I will be more than grateful to hear from you.

Recent Blog Posts


What is the Size of ” null ” Operator in Java?

Posted by Diaa Kasem on December 21, 2009

Today, in the Java Developers Group in LinkedIn; I found this question posted by Sneha Kesri. He asked “What is the size of ” null ” Operator in Java ?”. Actually, I never thought of it that way, but I continued reading.

Ramesh Babu Kotehal replied with the following :

from the heap memory perspective it will be 0, as it wont allocate any memory from heap. But from stack memory perspective the object…


How To Change Nagios Password

Posted by Diaa Kasem on December 21, 2009

Later this afternoon, a colleague asked my help to change the Nagios Password.

As I am not a Nagios user, I searched google for it and found this link about Nagios Installation.

So, lets cut to the chase, here are the steps I used:

Read More…


Read/Write System Properties From/Into XML Using Groovy

Posted by Diaa Kasem on December 20, 2009

Inspired by the following post ( http://www.ibm.com/developerworks/library/j-tiger02254.html ), I created the following code snippets to Read / Write System properties from/into XML files.

Writing system properties into XML file (output.xml):

def properties = System.properties
def fos = new FileOutputStream("output.xml")
properties.storeToXML(fos,"")

Read More…


Testing MySQL GET_LOCK() using PHP

Posted by Diaa Kasem on December 20, 2009

Early this morning, a friend of mine was stuck in GET_LOCK() MySQL function. She was using it in her application. The function was working very well from the MySQL Console , but it was not working from PHP ( Neither from her application, nor from PHPMyAdmin web interface).She asked my help, so I searched Google, and had a look at the MySQL Documentation about this function.

This function as it appears in the MySQL Documentation, does the following :

GET_LOCK(str,timeout)


Read More…


Simple Apache Ant Tutorial

Posted by Diaa Kasem on December 16, 2009

Introduction

Ant is free and open source build tool, written in Java, helps in automating the entire build process of a Java development project.

  • Ant uses XML build files.
  • By default, Ant looks for a build file named build.xml.
  • The build file contains information about how to build a particular project.
  • Each project contains multiple targets like creating directory, compiling source codes.
  • Target can depend on other targets.
  • Targets contain tasks.
  • Behind each task is a Java class that performs the described work.

Read More…


Creating Basic Financial JSF CRUD Application

Posted by Diaa Kasem on December 14, 2009

Today, I’m trying to revise my JSF, Hibernate Knowledge. I’m Creating a CRUD application.

Its a simple financial web application where there are admin/viewer privileges. The application will not be fully created in this tutorial.

The main idea is that the Admin can deposit/withdraw and the application should show his financial status to subscribed viewers.

In this basic tutorial I will introduce how to Generate JSF/Hibernate CRUD application using Netbeans 6.8 as a starting point for this small project.

Read More…


Keep Skype Alive Script

Posted by Diaa Kasem on December 14, 2009

I started to dislike skype.

  • Skype Application is closed source.
  • They (Skype Company) force users to use Untested Beta Version.
  • Upgrades are very slow for linux.

Lately, I had an issue the last few days with skype, It crashes while I’m talking and being away from the pc.

So, I tried to make a solution to keep skype alive.

Read More…


Scheduling Windows Server Rebooting

Posted by Diaa Kasem on December 9, 2009

Recently, I was asked to schedule rebooting of some windows server 2003 machines.

I previously knew the command for shutting down is basically

shutdown -r

Which is with some addition if any one wants

Read More…


Connecting Twitter, Facebook, WordPress And LinkedIn For More Audiance

Posted by Diaa Kasem on December 8, 2009

Recently, I have registered in Twitter and LinkedIn. I already have WordPress and  Facebook accounts. I know there are connections between these web applications, but I’ve never tried using them. I don’t use LinkedIn very often, and I don’t open Twitter at all.

Recently, I admired Twitter because its simple. Subscribing to professionals in your career, helps you recieve latest news, wonderful ideas and lots of arguments and suggestions instantly. So, I thought why not to connect them together.

Read More…


Grails, MySQL : Cannot create PoolableConnectionFactory

Posted by Diaa Kasem on December 5, 2009

Ok, You read this post I assume you face the same problem I faced.

Quick Solution :

If this is your MySQL Connection URL :

“jdbc:mysql://localhost/DN_NAME”

Change it to

Read More…


Linux BroadCom Wlan Driver Solution

Posted by Diaa Kasem on December 2, 2009

Recently, I’ve upgraded from openSUSE 11.1 to 11.2. In 11.1 WLAN Card was working like a charm, when I upgraded It didn’t work as expected. So, I used my USB Modem (Mobinil) and searched google.

I found a program called <b>b43-fwcutter</b>.  I tried hard to use it, but in vain.

Read More…


Grails Domains Internationalition

Posted by Diaa Kasem on November 25, 2009

I am currently working at a Project that should be internationalized ( Arabic – English ).  I am still developing it. I needed list of countries to be internationalized and I wanted it to be in the domain constraints (inList). I may later put the data in the database, but for the time being; I’m putting the data in the domain class.

Here is what I did

Read More…


Shell script to count number of Mega Bytes used in PPP connections

Posted by Diaa Kasem on October 31, 2009

Recently I bought, a USB Stick modem that is limited to 500 MB, after the 500 MB each 3 MB = 1 LE. For that I needed to create a counter to check my usage .. not to exceed the 500 Limit. so here it is :

Read More…


Suse 11.1 Linux and Egypt Mobinil 3G USB Stick Modem

Posted by Diaa Kasem on October 18, 2009

Yesterday, I went to Mobinil branch in Tanta, I wanned to buy a USB Stick modem. My issue was that I’m using Linux SUSE 11.1, and I know that the USB Stick modem support is for Windows and Mac OSs only. So, I wanned to know for sure.

There I asked a sales person called “Ahmed Salamah” ( who by the way was really cooporative ).

Read More…


Mounting NTFS Drive ( Read, Write ) to all users.

Posted by Diaa Kasem on October 12, 2009

Recently, I had the issue that my external HDD can’t be mounted as ( Read , Write ). It was getting mounted as read only for root user only. I needed to mount it as Read Write for all users.

The issue :
The HDD was not mounted properly , so that it needs to be fixed.

The solution:
connect the HDD ..

Read More…


Groovy Very Basic Statistics Tool

Posted by Diaa Kasem on October 8, 2009

I am in a project where I am in charge of watching and reporting performance of a JEE Application on JBoss Application Server. Due to my usual need to caculate Average, Max, Min values of the data I observe. I made this little code to help me out ( Which for me it did help out ).

Read More…


Virus Removal Groovy Script

Posted by Diaa Kasem on October 6, 2009

As I’m a Linux User since years ago. I faced the problem of NO Viruses at my PC, but tons of viruses on my Flash Memory ( USB Stick ), due to copying files to/from windows machines.

Actually, I was never affected by these viruses on my own, but I do NOT want to be a transportation facility for the virus to spread across other machines.

Read More…


First Day As A Google Reader JAVA API Contributer

Posted by Diaa Kasem on September 29, 2009

Actually I am more of celibarating than announcing my first contribution to The Unofficial Google Reader APIs Java implementation. Today, I proudly commited some code to this great project that helped me out in my latest project.

I Added the following functionalities :

Read More…


Simple Idea For Passing Data To Huge Number of Users

Posted by Diaa Kasem on August 25, 2009

Three years ago, I had a situation when I was building a web application for a stocks consultant. It should provide users with updates , in a page that gets automatically refreshed every 1 minute.

My problem was that when the number of logged in users exceed 100 users, the page turns to be extreemly slowly rendered.

The problem was that I made that page retrieve the data from database every time the page refresh. Ofcourse it should.

Read More…


Windows Start-up Date

Posted by Diaa Kasem on August 19, 2009

Recently I Needed to know when was the Windows Server Machine restarted and Why ?

So, I executed the command in CMD

net statistics server

The Start up time is : Statistics since 8/16/2009 5:40 AM Read More...

Comments Off
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: