Recent News

Using rdesktop to connect to your windows box

Posted by Root on October 15th, 2008

Sometimes you find yourself in a position whereby you have to connect to windows from your linux box, well there are various ways to achieve this and with this post we are going to explore rdesktop which works for most of the windows operating system based on the NT platform. This includes Windows XP , 2000 server , windows NT , Windows 2008 and Windows Vista.

You can install it by compiling from source or in my case I installed it as a rpm (suse 10.3), you can choose which ever method suits you best.

Before you try rdesktop please make sure your windows box is setup to accept remote connections. You can confirm this by accessing control panel->system->remote(tab)->remote desktop and select the checkbox there.

Now Lets begin, We first gonna connect to our windows box with minimal settings…

rdesktop -usonny -pmypass  192.168.1.24

This example will connect to your machine at ip address 192.168.1.24 and will login automatically.

Lets make it full screen
rdesktop -ffull -usonny -pmypass  192.168.1.24

Lets Connect to a windows machine on a domain network
rdesktop -ffull -usonny -pmypass  -dmydomain 
192.168.1.24

There are many other settings you can set for e.g. keyboard layout , sound card redirection , clipboard redirection , printer redirection and etc…

This post is meant to be a quick guide on using rdesktop you can find out more information and other config settings by using the man pages

man rdektop

 

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] none

Creating small size ring tones

Posted by Root on February 28th, 2008

When you are in the business of selling ring tones there are certain elements that make it difficult to ensure 100% content delivery and with the added pressures to use DRM. The main issue which we will be looking at in this post will be the size issue, There are various ways to try and reduce the size of your ring tone to allow for easy downloading for instance changing the bit-rate , changing the format(encoding) or just shorting the ring tone length. All the methods I just mentioned work but at a compromise to the quality or length of the ring tone. My solution is no different at all to the suggestions above but at least the quality will still be decent for the phone and the length will still be a full track.

Most ring tones in the market are of mp3 quality(true tone) but it is not easy to download a full track mp3 song on the mobile phone yet, The technology is getting better but it is still very much unstable. An alternative to the mp3 download is to use amr encoding which offers good quality at a small file size, It is not cd quality but it is still decent for the mobile phone. You can offer this as alternative download option to your already mp3 or wma ring tone formats.

With amr you can lower the file size e.g. 3 mega bytes full track(mp3) to 500 kilo bytes full track (amr). The only thing you might have to be careful about would be to check if the particular mobile phone does support amr format first before giving it the file because this can cause problems for you with users complaining about downloads not working. If you do not know how to perform checks on the phone – I would suggest you read my other previous post about achieving this feature – detecting mobile devices on your website .

Lets start converting.
Please Note: This post assumes you have Ffmpeg installed and configured on your machine,if you do not know what I mean please read the Ffmpeg section on the site.

/user/bin/ffmpeg -y -i ring.mp3 -ac 1 -ab 12.2k -ar 8000 -f amr -acodec libamr_nb ring.amr

That is all it takes to get the amr conversion working, you might want to play around with these options -ac 1 -ab 12.2k -ar 8000
until you find the right quality and size for you. Please read about the amr options available for use with Ffmpeg and what values can be or cannot be changed.

That’s it folks, I will try to cover the DRM section next time for those who do not know how to use it.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Tags: , , ,

Detecting mobile devices on your website

Posted by Root on February 26th, 2008

The purpose of this post is to introduce the concept of detecting mobile devices on your website using an open source library called wurfl, The library can be deployed using the following programming languages:

  1. 1C++
  2. Dot Net
  3. Java
  4. Perl
  5. Python
  6. PHP
  7. Ruby

I will be using PHP for all the examples on this post, So I hope you have a little understanding of PHP to go through some of the example code.

Requirements for this Exercise:

  • At least 50 mega bytes of storage(for the wurfl files to be generated).

Step 1:This step can be set up in different ways, It all depends on how you want to use wurfl on your project, I personally use it on more than one project. To avoid creating a wurfl installation for all my projects I have had to set up a global wurfl installation on my web server which allows all my projects to use one wurfl instance.

create wurfl global

go to /www and create a folder called /www/global and inside global create another directory called /www/global/wurfl. We need to create one last directory inside our /www/global/wurfl/ directory which we are going to call /www/global/wurfl/data, Before we close this step please make sure that your directory /www/global/wurfl/data is writeable

chmod 0777 /www/global/wurfl/data

NB chmod 0777 is not recommended on a production server and one must be careful when granting write permission to files. For the sake of the demonstration we will ignore this rule though.

Your directory structure should look like this: /www/global/wurfl/data

Step 2:
Go to wurfl download page and get the PHP files and store them inside /www/global/wurfl directory http://wurfl.sourceforge.net/php/index.php
you need to also download the http://wurfl.sourceforge.net/wurfl.xml(7mb) which contains all the information about the different types of phones in the market. This file is updated constantly and you need to update it on your side regularly. This file must be copied to /www/global/wurfl/data/wurfl.xml

Step 3:
After you uncompress the downloaded PHP files you should have these following files available:1.

  1. check_wurfl.php
  2. update_cache.php
  3. wurfl_class.php
  4. wurfl_config.php
  5. wurfl_parser.php
  6. readme.txt

Step 4:

Now lets configure our library by opening /www/global/wurfl/wurfl_config.php
lets change the config file as shown below.

Line 90:
NB: Make path absolute

// Where all data is stored (wurfl.xml, cache file, logs, etc) define(“DATADIR”, ‘/www/global/wurfl/data/’);

Line 93:
// Path and filename of wurfl_parser.php define(“WURFL_PARSER_FILE”, ‘/www/global/wurfl/wurfl_parser.php’);

Line 96:
// Path and filename of wurfl_class.php define(“WURFL_CLASS_FILE”, ‘/www/global/wurfl/wurfl_class.php’);

That will do for now. If you are interested in some of the configuration settings on this file you can consult the documentation for the library.

Step 5:
We now need to run /www/global/wurfl/update_cache.php on the console which will create a folder called /global/wurfl/data/multicache that has a lot of files inside of it.

/usr/bin/php -f /www/global/wurfl/update_cache.php

After you run the command it will create the folder mentioned above and a file called /www/global/wurfl/data/cache.php. This command will take a while to execute depending on your machine but will take between 30 to 60 seconds to execute. My /www/global/wurfl/data directory’s size is now 37 mega bytes.

Step 6:
Lets write a little test code which determines if the device on our site is a mobile device and if so we can then redirect the device to the mobile version of our site.


Just like that we now have a script that can tell us whether the user is using a computer web browser or phone browser. If the phone is picked up by our script $myDevice->brand = nokia will carry the phone brand while $myDevice->model = N70. But Please remember that this method is not 100% accurate and also keeping an updated version of /www/global/wurfl/data/wurfl.xml will increase the accuracy rate.

$wurfl_class->capabilities holds an array of the device’s capabilities e.g.
can the device support gif images?

Please try and explore the documentation for the library and you will find all sorts of features. For the sake of keeping this post small I will not show any more examples but rather encourage you to read up a bit on this beautiful library. I hope you find this post useful and you get to do magical stuff with this library , Feel free to leave a comment.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Tags: , , ,

Useful linux command reference!

Posted by Root on October 18th, 2007

I came across this list of useful linux commands a while back , Some of them have been very helpful on my quest to learn linux and hope they can help you too.

alias Set and view command aliases.
arch Print machine architecture.
awk Pattern scanning and processing language.
bash Bourne Again SHell.
bg Move process running in foreground to the background.
biff Be notified when mail arrives.
cat Concatenate and print files.
cd Change directory.
chage Change user password expiry information.
chgrp Change group ownership.
chmod Change file permissions.
chown Change file and group owner.
chroot Run command with special root directory.
chsh Change login shell.
clear Clear the terminal screen.
cp Copy files and directories.
crontab Maintain crontab files.
csh C shell.
cut Remove sections from each line of files.
date Print or set the system date and time.
dd Convert and copy a file.
df Print file-system disk space usage.
diff Find differences between files.
dig DNS (Domain Name System) lookup utility.
dmesg Print diagnostic messages from system buffer.
dnsdomainname Show system’s DNS (Domain Name System) domain name.
domainname Show system’s NIS (Network Information System)
du Estimate file space usage.
echo Display a line of text.
env Run a program in a modified environment.
false Exit with a status code indicating failure.
fdisk Disk partition table manipulator.
fg Move process running in background to the foreground.
file Determine file type.
find Search for files in a directory hierarchy.
free Display amount of free and used system memory.
ftp FTP client.
fuser Identify processes using files or sockets.
gcc GNU C and C++ compiler.
grep Print lines matching a given pattern.
groupadd Create a new group.
groupdel Delete a group.
groupmod Modify a group.
groups Print all the groups the user belongs to.
gunzip Uncompress files compressed using Lempel Ziv encoding.
gzip Compress files using Lempel Ziv encoding.
host DNS (Domain Name System) lookup utility.
hostname Show or set system hostname.
id Print real and effective user IDs and group IDs.
ifconfig Configure a network interface.
kill Terminate a process.
ksh Korn shell.
last Show listing of last logged in users.
lastlog Show last login times of accounts.
ln Make links between files.
ls List directory contents.
mail Send and receive mail.
man Format and display manual pages.
mesg Control write access to a terminal.
mkdir Make directories.
more Display file contents one screenful at a time.
mount Mount a file system.
mv Move and rename files and directories.
netstat Print network connections routing tables interface statistics
masquerade connections and multicast memberships.
nice Run a program with modified scheduling priority.
nslookup Query Internet name servers.
passwd Change login and password attributes.
ping Send ICMP ECHO_REQUEST to network hosts.
ps Report process status.
pwd Print name of working directory.
quota Display disk usage and limits.
quotaoff Turn off file-system quotas.
quotaon Turn on file-system quotas.
repquota Summarize quotas for a file system.
rm Remove files or directories.
rmdir Remove empty directories.
route Show or manipulate system routing table.
rpcinfo Report RPC (Remote Procedure Calls) information.
sed Stream Editor.
setquota Set disk quotas.
showmount Show mount information for an NFS (Network File System) server.
shutdown Bring the system down.
sleep Delay for a specified amount of time.
sort Sort lines of text files.
strace Trace system calls and signals.
strings Print printable characters in files.
su Run a shell with substitute user and group IDs.
tail Output the last part of files.
tar Archiving utility.
tcsh C shell with filename completion and command editing.
telnet Telnet client.
tftp TFTP (Trivial File Transfer Protocol) client.
traceroute Print the route that packets take to a destination host.
true Exit with a status code indicating success.
umount Unmount a file system.
uname Print system information.
useradd Create a new user.
userdel Delete user account.
uptime Print how long the system has been running.
vi Text editor.
w Show users that are logged on and what they are doing.
wa ll Send message to every user’s terminal.
whereis Locate the binary
which Show the full path of commands.
who Show users that are logged on.
whoami Print effective user ID.
write Send a message to another user.

Please use man command to find out more details about the command and it’s usage, I hope this helps.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] none

command – tail (part 1)

Posted by Root on September 24th, 2007

This tutorial is meant for those who are newbies to the Linux environment and please feel free to add any suggestion to this material. The command tail is used to output the last part of a file (e.g tail mylog.txt ) this will output the last 10 lines of mylog.txt by default , you can change this by adding an extra parameter to your tail command (e.g tail -n 100 mylog.txt) this will now return the last 100 lines from mylog.txt as suppose to the default 10 lines.

My favorite parameter which you can use with tail command allows you to monitor log files as they are being populated (e.g tail -f mylog.txt) first it will show me the default 10 lines but then as soon as a new entry is inserted into the mylog.txt I will be able to see it without reloading the file or the command, This is useful if you are debugging anything that writes to a log file because you can monitor the log while you attempting to fix your problem.

So next time you want to monitor your log files try and use tail to capture your errors and please try not use vi on log files which are very big(e.g A 5 gigabyte log file will crash your server if you do a vi on it,unless you have a very very very big server thats never worries about Ram ) But you can always tail a big log file and if that does not help then you can try using grep which is something else all together.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Tags: ,

Recent Comments | Recent Posts


designed by: Website Builder | Coded by: Blog Directory | Provided by: Wedding photojournalism chicago
bottom