Are you looking for my non-technical blog?

This is now my technical-only blog, my non-technical blog is here.
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

07 January 2006

Writing Arabic on Ubuntu

بسم الله الرحمن الرحيم
To write Arabic on Ubuntu, first make sure that you have Arabic Language Pack (use Synaptic Package Manager to find "language-pack-ar", and "language-pack-ar-base") I also have "ttf-arabeyes" and "libfribidi0" installed here. By the way there is a package called "language-support-ar" that I think it includes all of the above stuff. Then go to System->Preferences->Keyboard and from the "Layouts" tab add the "Arabi/qwerty" layout. Now right click on an empty area in the "Panel" (The bar at the bottom of your screen) and choose "Add to Pannel" and add the "Keyboard Indicator" and here you go.

Tags: , ,

03 December 2005

Python Mobile Bluetooth Console

So, now you wanna write Python scripts on your phone, but you are sick of the phone keyboard. Then it is time for BTConsole (Bluetooth Console), where you can have a console connection to the Mobile Phone from your PC using the Bluetooth connection as a Serial Port Emulator. This can be done on both Windows or Linux, but I am going to describe the Linux part as I don't like Windows and also I failed to set it up on it. First of all you have to have the Bluetooth Protocol Stack (BlueZ) installed on your machine. You may also use an "ipconfig" or "ifconfig" like command on you Computer to get information about your Computer's Bluetooth Address (It looks like the MAC Address) and so ... this command is called "hciconfig" Also to discover the Bluetooth devices near you, use "hcitool scan" Now create a Virtual Port (/dev/rfcomm0) on your Linux Machine for the Bluetoot connection and start listening on that port ... Type the following two commands on you computer:
"sdptool add-channel=2 SP" (It shall tell you someting like "Serial Port service registered" now) "rfcomm listen /dev/rfcomm0 2" (It shall tell you something like "Waiting for connection on Channel2")
Then on you Mobile Phone, go to Python (You have Python for Series60 installed on your phone, don't you !?). And choose Bluetooth Console from the Options menu. It should connect to the computer now. And the following will be shown on you computer "Connection from AA:BB:CC:DD:EE:FF to /dev/rfcomm0" then "Press CTRL-C for hangup", where AA:BB:CC:DD:EE:FF is your Mobile's Bluetoot Address The Linux equivalent to HyperTerminal is called minicom, so it's time to use it to open a console connection to the mobile phone. To run minicom type "minicom -s -m" then choose "Serial Port Setup" and set the Serial Device to "/dev/rfcomm0" and leave the rest as it is. Now press escape and exit the Serial Port Setup Menu. Here we go, you are now connected to the Python Shell on your Mobile Phone. If you'd like you may use this to send an SMS from your PC:
>>> import messaging
>>> messaging.sms_send("+20101234567",u"Hello World")
Where +20101234567 is the phone number you want to send your SMS to. Resources:
By the way if this doesn't work, try the following howto by Dankoozy: HOWTO: Use the Bluetooth console in PyS60

Tags: , , , , ,

31 July 2005

OpenSSL: Creating Digital Certificate Tutorial

Here is the way to - HOWTO - create a Digital Certificate using OpenSSL software.
First of all install OpenSSL on you PC, and add its bin file to your executables path.

Create your Own CA
Then create some directory to be your CA directory (let's call it demoCA)
Now create the following 3 directories in demoCA (requests, certs, and keys) and create the following to files (database.txt, and serial.txt) and open serial.txt and write 01 in it. Also don't forget to copy the file openssl.conf there too.
Now you need to create your CA key:
"openssl genrsa -des3 -out keys/ca.key 1024"
Create a master certificate based on this key, to use when signing other certificates:
"openssl req -config openssl.conf -new -x509 -days 1001 -key keys/ca.key -out certs/ca.cer"

Create the Digital Certificate
Generate private key for the certificate:
"openssl genrsa -des3 -out keys/foo-key.pem 2048"
Create a certificate request:
"openssl req -new -key keys/foo-key.pem -out requests/foo-req.csr"
Sign the certificate by the CA:
"openssl ca -policy policy_anything -config openssl.conf -cert certs/ca.cer -in requests/foo-req.csr -keyfile keys/ca.key -days 3650 -out certs/foo-cert.cer"
Convert the certificate format to x509 to be used by Windows Internet Explorer
"openssl x509 -in certs/foo-cert.cer -out certs/foo-cert-509.cer"

Note1: For windows users replace all "/" with "\"
Note2: You can get openssl.conf from anywhere, just google for it.
Note: This is how to use a self signed certificate on a Netscreen firewall

Tags: , , , ,

11 July 2005

Linux USB to Serial to Console NetScreen Firewall

I have Linux installed on my laptop, and the laptop does not have serial port that's why I am using a usb2serial in order to console any external devices. So here is the configuration I done on my Ubuntu linux 5.04 in order to console NetScreen firewall (this can be used with many other devices as well).

First of all I installed minicom then configured it as follows:
Ctrl+A then press Z then O, then choose "Serial port setup", then press A and configure " Serial Device : /dev/ttyUSB0" then press enter and press E and configure "Bps/Par/Bits: 9600 8N1" then press enter and save setup as default and exit and here we go.

Tags: , , ,

30 June 2005

TAR.GZ

Many people keep on asking how to archive and compress a folder on a UNIX/Linux system.

Suppose you have a directory /usr/myDir and want to compress it to myDir.tar.gz
# tar –cvf myDir.tar /usr/myDir
# gzip myDir.tar

And to unzip and untar a ".tar.gz" file type
# tar -zxvf myDir.tar.gz