Gnokii with CLI PHP

Linux Server Leave Comment »

I’ve been messing around with Gnokii, an open source program that communicates with mobile phone (mostly Nokia). Upon installing the Gnokii from source, I can fire up SMSD a daemon that listens for incoming messages from the phone and display them on the computer screen or save into a database program such as MySQL.

To make things more exciting, I slightly patch the SMSD source code to process PHP script when a message arrives. You can download my complete patched Gnokii here. First, compile the Gnokii from source. After that change destination into smsd folder and run again the usual configure, make and make install.

Example how to execute SMSD:

# ./smsd -m file -i 5 -a /usr/local/bin/php -e /tmp/test.php

test.php:
print_r($argv);

Format
$argv[0] = PHP_PATH
$argv[1] = PHP_EXEC_FILE
$argv[2] = incoming number
$argv[3] = incoming message

As for the mobile phone, I use Nokia 6070 which being sold at forum.lowyat.net around RM265.

Nokia 6070

Nokia 6070 POP-Port

I also got the CA-42 Nokia cable from Lowyat Plaza for RM35

CA-42 Box

CA-42 USB

The complete Gnokii installation instruction can be found at Gnokii Wiki.

With this successfully installed, I can use the SMS, for example, to check on my server health or other cool stuff.

–>

tagged as

Running Schtasks with interactive mode

Linux Server Leave Comment »

I received a project providing a system that will do the following things automatically:

  • Switch on every day at 9AM
  • Run a selected application such as video or Microsoft PowerPoint Slide
  • A remote administration can access the PC using web-based application to re-schedule running applications or upload new files
  • Shutdown at 10PM every night

As you probably already guessed, it’s a system that will eventually locate in Shopping Malls to display digital signage. Although currently on the market there are already existents of such solutions, I was advised that the project owner wanted it to be simple. The selling software out there is just too expensive but very detailed.

Here is the technical idea on how I’m gonna do the steps:

  • I will configure a server Linux server to host as a Torrent Tracker. This will balance load the host server when transferring Video files across the network of clients.
  • On client side I will host it using Windows XP Home. This would be fairly easy for their admin to play around.
  • I will use PHP on Windows to execute schtasks.exe for scheduling. However, schtasks.exe is not available on Windows XP Home. Therefore, I just copied the file from XP Pro and pasted into XP Home System32 folder.
  • I will install Another Bittorrent Client (ABC) at client side for files receiving.

This project is almost complete after couple weeks of testing. During the test period, I had major problem with auto login and running the Schtasks.exe on client windows. I will explain what had happened.

Read the rest of this entry »

tagged as

Sybase searching with no case sensitive

Linux Server Leave Comment »

I had problem with Sybase in searching a varchar column with different character case. So, I transformed the existing character in Sybase to all lower case and then only perform the comparison.

The Sybase code below have worked on me:

SELECT full_name FROM db_name.table_owber.users WHERE LOWER(full_name) LIKE ‘%fendy%’

I learned it.

–>

No Tags

Generate SSL Certificate on Apache 2 and mod_ssl

Linux Server Leave Comment »

My yearly self signed SSL certificate for www.fendy.org has expired. It’s quite exciting that this is my fourth time generating my own certificate. That means, I’ve already been using fendy.org for the past 4 years.

Maybe I should start to think of buying the recognised certificate from www.godaddy.com after all, it is quite cheap nowadays for a single domain.

Anyways, I’m going to describe how to create a new SSL certificate. This does not cover the installation of Apache and Mod SSL.

Read the rest of this entry »

tagged as

Get the directory/folder size on Linux

Linux Server Leave Comment »

At times, I do find myself needing to find out the size of the folder in certain directory on my Linux server.

And the weirdest part is; I always forget this command combinations. I’m gonna put it here so that I will remember it.

Command: du -sh /home/fendy
Display: 1.2M /home/fendy

Command: du -h /home/fendy
Display: *List of directories in the folder and their size

I learned it.

–>

tagged as

Permalink Gives 404 Page Not Found

Linux Server Leave Comments »

I had a slight problem when installing this wordpress on my server. I realised that the .htaccess file just isn’t working properly.

After a quick check on my httpd.conf, it seemed that apache just wouldn’t parse the .htaccess file inside my wordpress folder.

A very fast way to solve the problem is to open the httpd.conf file and add these lines (configure the path based on your server setting. Mine was “/usr/local/apache/htdocs/wordpress”) :

<Directory “/usr/local/apache/htdocs/wordpress”>
AllowOverride Options FileInfo
</Directory>

Also, remember to restart your apache server for the new setting to take effect.

I learned it.

–>

tagged as


WordPress Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login