Menu

  • Home

  • Forums

  • Adamsinfo Blog




  • [Valid RSS]

    Latest Blog Postings at adamsinfo

    UDP Tunneling to avoid hotspot or firewall restrictions

    netfilter/iptables split access with multiple ISPs

    Linux LUKS Crypt HOWTO

    Linux Controlled Door Entry

    PHP Security

    Website Security Scan

    Linux Consultant - Server Management, Basic Housekeeping

    SSHing from a compromised machine

    PHP Programmer - Logical Operators

    PHP Programmer - Numeric Shorthand

    PHP Programmer - Reading from files

    PHP Programmer - strlen, count and substr

    PHP Programmer - strpos, finding the position of a word in a string

    PHP Developer - Serialize

    PHP Developer - Loops in General

    Full NAT, DNAT and SNAT aka 1:1 NAT, 1 to 1 NAT

    UK VPN Hosting

    Freelance PHP Programmer - Managing Estimates

    String replacement with sed

    PHP Developer - Looping through database results

    Easy Reverse Engineering

    Move Xen Guest from loopback filesystem to LVM

    Setting up an LVM filesystem

    Installing and Configuring Xen with guests

    dd progress update

    Xen, LVM and friends

    Copy/Export MySQL User Priviledges

    Linux Consultant - How to recover a compromised server

    Recursive FTP/HTTP Download

    New Rapidswitch Server

    BASH Script - Blank Out CC Details

    Hosting - Users too quick to judge?

    Embedded Linux Programmer

    PHP Programmer - Modulo Operator

    UK VPS

    Hosting

    Linux C setuid setgid tutorial

    Linux Security Freelancer - Securing a node - Where to start?

    Linux Consultant - Disk Speed

    Security Consultant - Man In The Middle Attacks (MITM)

    Self Signed Certificates

    Security Consultant - London Site Visits

    Security Consultant - Scope of work

    Contact Me

    PHP MySQL Developer - A Freelancer in London

    PHP MySQL Developer - Using MySQLi Prepared Statements to Avoid SQL Injection

    Blog fork()s some children

    Shrinking/Resizing ext3 Partitions

    Installing Linux on the Embedded PPC50 Touchscreen

    How to Find and Replace data in MySQL

    Looking for a New Linux Project

    Multithreaded Tunnel Proxy and OpenVPN experiment

    Linux - Exim, Avenger and SpamAssassin Tips

    Linux Color Directory Listings

    Web Application Security Consultant Methodology

    What is my IP?

    Good UK VPS Provider?

    Security Consultant - Ports & Port Knocking

    Shell Return Codes - Ping Monitoring

    Security Consultant - PHP Developer - SQL Injection Attacks

    Security Consultant - PHP Developer - Exploiting Common PHP Code Flaws

    Multithreaded Multi-Connection TCP Proxy Tunnel Update

    Security Consultant

    Security Consultant - Basic NMAP Usage

    Linux NAT Masquerading HOWTO

    Multithreaded TCP Proxy Tunnel Code

    PHP Developer - PHP Sessions

    Using the Phidget Interface Kit under Linux

    Multithreaded TCP Proxy Tunnel

    The Linux Robot - In hindsight

    The Linux Robot - Dancing Beat Recognition

    brctl: Creating a network bridge

    cPanel rebuild all DNS zones

    at, batch scheduling

    Simple text sorting

    shPanel - the Linux System and Hosting Control Panel

    Creating an MD5 on Linux with md5sum

    Admin Management System

    An idea - cPanel like host management

    htop - top on steroids

    Copy files securely from host to host with SCP

    Linux SCREEN Command

    Linux DHCP Server

    Simple MySQL Developer Intro

    umount: device is busy

    How to create a simple disk image formatted to ext3

    Linux piping and redirecting stdin stderr stdout

    BASH Shell Scripting - Sort a string alphabetically

    Linux Command History

    Linux diff and patch

    bc - Linux command line calculator

    How to upgrade from Debian Etch to Lenny

    Local and Remote Kernel Upgrades - Failsafe Grub

    Linux and the Huawei HSDPA 3G E220 modem for mobile broadband

    Linux PPTP (Poptop) VPN Setup with MPPE and MPPC

    Linux Squid Transparent Proxy

    A Beginner's Guide to Object Oriented Programming (OOP) in PHP5 - Classes, Objects and Methods

    DNS based Load Balancing

    How to reset forgotton MySQL root password

    How to recover your Linux root password

    How to remove the tray icon from VNC (RealVNC) with XN Resource Editor

    Linux IP Address Configuration Static or DHCP

    Blackberry Bold - Today Theme

    A rudimentary PHP POP3 example

    PHP - fsockopen, TCP and UDP

    PHP - Ternary Operator

    The Linux Robot - Progress, Software & a Video

    Simple POP3 Communication HOWTO

    Linksys WRT54G Serial Console

    A BIND9 zonefile and commentary

    Debian Lovers - Why I love Voyage Linux

    The Robot - Progress and a Video

    The Robot: Hardware working and ready to go, a few minor glitches

    Using distcc for distributed compiling on an alix 3c2

    The Robot: Independant, moving, talking, and controlled via WiFi

    Linux: AVIT Research USB to TTL Cable

    Some simple filtering and sniffing with tcpdump

    The Robot: Base, Wheels, Motors, and Sabertooth Motor Controllers

    The Robot: A body, Sensors and Good Progress

    The Robot: More good progress

    The Robot: Phidgets USB Interface Board Kit works

    Linuxuk.org - A good resource

    The Robot: Successful installation of Debian onto the Alix 3c2 board

    Robot Update

    rsync over SSH, SSH key login, public keys, automated backups

    mknod tutorial

    Linux on a Mikrotik 532a , Part 5 Final - OpenWRT and Custom Scripts

    Robot: Initial Hardware Order [rev 2]

    Help Debian, today's Linux news.

    Linux on a Mikrotik 532a, Part 4 - Customization, Debian Scripts, Shaping, Firewall, NAT, picoLCD

    The Robot: Hardware List, Wheel Plan, More Ideas, Steps to launch

    Robot

    Linux Robot, more hardware ideas

    Linux Robot - Watch this space

    Diffie-Hellman Key Exchange

    True Infrastructure On Demand

    PHP MySQL Developer

    PHP, MySQL, Apache2 install HOWTO on Debian

    APNIC Box - Linux on a Mikrotik 532a, Part 3 - Installing Debian, Prebuilt Disk Image

    APNIC Box - Linux on a Mikrotik 532a, Part 2 - Hardware Modifications

    APNIC Box - Linux on a Mikrotik 532a, Part 1 - The Device

    Linux Consultant

    Playing poker on Linux

    DNS Hijacking, ISP Packet Modification, Morals and Privacy

    The Legality of Peer to peer software

    APNIC Box

    Linux Benchmark, IO statistics and system statistics with dstat

    Thoughts on "Google denies disassembling Vista code for Chrome"

    Great news for adamsinfo.com

    95th percentile billing explaination

    Wireless Hacking, Problems with WEP, Wireless Security and WPA

    Adam's Custom Kernel

    Going Green, PC Hibernation, Saving Money & Common Sense

    NetCat tutorial for Linux & Windows, HOWTO, nc

    Using picolcd on linux, lcdproc, routerboard, liblcdusb

    Quick Linux and Windows OpenVPN HOWTO and tutorial, including VPN routing

    Linux virtualization, vmware, xen, hosting, and squeezing the most out of your resources

    Extending tc and iproute2. Linux routing split access multiple uplinks multiple isps iptables masquerading

    VMware Time Problems

    Resume & Portfolio

    Bandwidth Limiting HOWTO with linux, tc and iproute2

    Exim, MySQL, Courier IMAP, Courier POP3 & Spamassassin - vdomain and vuser set up.

    LAMP Optimization

    Split access SSH problems

    Custom linux router, routing, split access and more..

    Custom linux router, the story..

    Linux device names & mounting

    Hello world!

    How To Autocomplete Commands Preceded By 'sudo' [Quick Ubuntu Tip]

    When writing a command in the terminal, you can autocomplete it by pressing the TAB key. Example: type "nau" in the terminal and press TAB -> "nautilus" should show up (if you have Nautilus installed, obviously).

    However, the autocomplete doesn't work in Ubuntu if you are trying to run a command with "sudo". For example, typing "sudo nau" and then pressing the TAB key will not autocomplete the command to "sudo nautilus".


    Here is how to get autocomplete to work in the Terminal while using "sudo". Simply open the ".bashrc" hidden file from your home folder. If you use GNOME, paste this in a terminal to open it:

    sudo gedit ~/.bashrc
    Then paste this at the bottom of the file:
    if [ "$PS1" ]; then
    complete -cf sudo
    fi
    Then type this in a terminal to reload:
    bash

    Now try the example in the beginning of the file "sudo nau" and press TAB. It should now work.

    [via La Ventana Muertawww.webupd8.org 2009-2010. | What's New on the World Wide Web

    Posted on 9 March 2010 | 10:43 pm

    Lovely Review of Manage Your Project Portfolio

    Steve Berczuk has a lovely discussion of Manage Your Project Portfolio. You can see his review here.

    Tweet This Post

    Posted on 9 March 2010 | 10:14 pm

    OpenSSH 5.4: Great Scott!

    One point twenty one jiggawatts! Yesterday (March 8, 2010) the OpenSSH project released version 5.4 and naturally will start hitting the various distributions and platforms soon, and again there are some great things to be interested in:

    Although many distributions of OpenSSH have SSH1 disabled, the project is now shipping with SSH1 disabled by default.There is the ability to revoke keys (host and user) in both sshd and ssh.Netcat mode connects stdio on the client to a single port forward on the server. For example the following would connect to smtp.server.example.org on port 25, and redirect the output to stdio on my client side. Useful if you need to test connectivity to a mail server, but can't from your direct location, but can from your SSH server (my.ssh.server.example.org). ssh -W smtp.server.example.org:25 my.ssh.server.example.org That has pretty much bags of possibilities, ranging from simple connection tests to piping a file to a remote server that you can't get to directly.sftp-server has gained a read only mode!Passphrase-protected SSH2 private keys are now protected with AES-128 instead of 3DES. This counts if you reencrypt your key or create a new one.

    Posted on 9 March 2010 | 9:23 pm

    Austin Texas - Linux Against Poverty 2010

    It's spring time in Texas.

    The Bluebonnets are fixin' to get ready to bloom, today's temperature is going to be around 80 degrees Fahrenheit and a solid date for the second annual Linux Against Poverty is, with a fair amount of certainty... official.

    June 19th, 2010.

    Yes, we realize the website says it is a May event...there are several changes being made to the site so that correction will be made shortly.

    For those who may not know what we do, The HeliOS Project takes donated P4 computers, refurbishes or repairs them and then gives them to Austin or Central Texas kids who normally would not be able to afford one.  Linux Against Poverty is an annual event put together in order to collect those computers while members of the Austin Tech Community gather to repair and prepare them to be given away.


    We had initially planned a May event but with South By South West happening within that 90 day window, we thought it would be a good idea to let both events have some breathing room.

    With the Upcoming Texas Linux Fest, it's going to be a busy spring in Austin Texas.  Hopefully, we'll be meeting with Robbie Williamson of Canonical on these pages to talk more about that event in particular in the next week or so..

    But for now, let's talk about Linux Against Poverty.

    Lynn Bender, founder of geekaustin.org  and the organizational force behind LAP, called me last night to talk about how this year will be different.

    We had a fair amount of corporate involvement last year.  Many companies donated their decommissioned computers and sundry hardware components, however we didn't see the participation we had hoped for.  Individual donations and drop-offs carried the day.  We gained just over 200 placeable computers by the time the day ended.  Those computers were gone by November that same year.

    This year, we think and hope we might be able to increase that participation.

    With several companies already showing an interest in offering prizes, Lynn has begun to put together a prize drawing to entice equipment donations.  Each computer donated will enter the donor into a drawing at the end of the day and winners will be awarded prizes from the participating businesses. Businesses who donate computers can give their tickets to their employees if they wish to do so.  We have yet to firm up those prizes and companies so watch this blog or the facebook page for LAP for details.

    Many of the people who volunteer for Linux Against Poverty work at large corporations that may have a back room full of these decommissioned computers just waiting for Goodwill or the scrap yard.  You can see our specific needs on our website. If you work for such a company, please let them know that we will put these computers and equipment to good use and their donations are tax deductable.  Oh and again...we cannot accept CRT monitors any more...the liability and storage costs just won't allow it.

    While Union Park is almost certainly available for us as a venue this year, there are a number of other businesses and places that have shown an interest in hosting the event for us.  Lynn will announce the location for Linux Against Poverty 2010 when it is decided and I will pass it along to you via this blog as soon as it is known.

    Other Bid'ness

    While we were able to obtain permission from The Cristo Rey Catholic Church to name our computer learning center after Bruno Knaapen we have not yet been able to raise the funds for the brass plaque for that room.  Unfortunately, response from Bruno's community has not been very good so I thought I would come here to mention it.  If you would like to help us purchase this plaque, you can do so here.

    AND...we are in need of a small flatbed scanner for our operations.  With funding being as tight as it is, we've not been able to allocate the money to buy one so if you have one laying around, we sure could use it.  If I had a wishlist to write to, I would hope that it would be USB-powered.  We don't need anything powerful as much as we need it compact...our administrative space is small.

    We are also humbled to be named as a nominee for the Dewey Winburne Community Service Award.  The party and ceremony will be held at 6 PM on March 15th at Sholtz Garden in Austin during the SXSW Interactive portion of SXSW.  Dewey Winburne was the PowerSource behind SXSW Interactive.

    May God rest him.

    Volunteer sign-up for LAP 2010 is doing extremely well and I want to thank those who are returning for the second event.  I appreciate you more than you know...especially when I know YOU know just how much work last year was.  We hope to streamline some of that this year and make it that much smoother.

    Stay Tooned...

    All-Righty Then
    .

    Posted on 9 March 2010 | 7:43 pm

    Banshee Telepathy Extension Allows You To Stream And Share Music With Your Jabber (Including Gtalk) Empathy Contacts



    Speaking of Banshee extensions and Jabber, I've recently came across a very interesting Banshee extension which I'm sure many of you will find to be useful.

    The extension is called Banshee Telepathy Extension and you can use it to share or stream music through Empathy instant messaging client with your contacts (Jabber (including GTalk) only) through a p2p protocol.


    Banshee Telepathy Extension features:
    Download your friends' Banshee library metadata and check out what they listen to, their ratings, BPM values, etc.View your friends' playlists and export them to diskShare what you're listening to with all your instant messaging friends by advertising the track, artist, and album of the currently playing track in Empathy's status message. This can be toggled on / offDownload your friends' music; one track at a time or a selection. You can cancel ones in progress, queued, individually or all at once. The sender has the option to cancel all in progress / queued only. Both sender and receiver get a progress bar. File sharing can be toggled on / offStream your friends' music. Streaming can be toggled on / off.

    If you use both Banshee and Empathy IM client, you should give this extension a try.

    A note before you try it out: it seems you need to restart the plugin after both you and your friend(s) have logged in for Banshee to see you. This can easily be done by going to Banshee: Edit > Preferences > Extensions and disable and then re-enable the Telepathy plugin.

    I tried testing this plugin but I then realized the computer I use at work uses an firewalled internet connection with most of the ports blocked so it seems it's up to you to try out this great Banshee / Empathy extension. See the installation instructions below.


    Install Banshee Telepathy Extension in Ubuntu
    Installing Banshee Telepathy Extension in Ubuntu is pretty easy as there is a .deb package available (if you want, you can also add the PPA) but unfortunately for Ubuntu Karmic only. However the package might work in Lucid too (please let us know in the comments if you try this in Lucid).

    Download Banshee Telepathy Extension .deb:
    32bit: banshee-telepathy-extension_0.1.1-0ubuntu0~janvitus+karmicppa3_i386.deb (136.4 KiB) 64bit: banshee-telepathy-extension_0.1.1-0ubuntu0~janvitus+karmicppa3_amd64.deb (136.4 KiB)


    Ubuntu Karmic users will also need a newer version of Telepathy-gabble:
    32bit: telepathy-gabble_0.9.2-1~janvitus+karmicppa1_i386.deb (386.5 KiB) 64bit: telepathy-gabble_0.9.2-1~janvitus+karmicppa1_amd64.deb (422.5 KiB)
    Install Banshee Telepathy Extension in openSUSE
    There are also packages available for openSUSE (including dependencies). Grab them from HERE.



    If you don't use Ubuntu or openSUSE or just want to install the latest version of the Banshee Telepathy Extension, see it's github page.

    For more info and how to use, see this READMEwww.webupd8.org 2009-2010. | What's New on the World Wide Web

    Posted on 9 March 2010 | 6:45 pm

    ONLINE LEGAL RIGHTS - LIBEL & PRIVACY

    USING A VIRTUAL PRIVATE NETWORK
    Most Virtual Private Networks (VPNs) are used within a commercial environment, but some wireless networks do not have strong enough security measures – for example, poor firewall management. This may lead to them being exploited for free internet access. A network intruder – or hacker – is in breach of the Computer Misuse Act with offences punishable by fines and/or conviction. The severity of the punishment is determined by what you do once you have gained access to the internal and private network and the valuable – sometimes sensitive – information stored on it.


    ACCESSING ANOTHER PERSON’S SOCIALNETWORKING ACCOUNT
    Recent research by internet security firm Trend Micro (http://uk.trendmicro.com) revealed that more than four out of 10 UK teenagers have logged into another person’s social-networking profile without that person’s permission. Another survey by security firm Sophos (www.sophos.com) found that 21 per cent of people have been ‘phished’ on a social-networking site such as Facebook (www.facebook.co.uk), Bebo (www.bebo.com) and MySpace (www.myspace.com) by hackers trying to gain access to their account details. Hacking – gaining unauthorized access to a computer system – is an offence under the Computer Misuse Act 1990 (http://bit.ly/hack232). “Whether you have authorized access to the account or not is the key thing. If someone asks you to log in on their behalf, it is not against the law, but unauthorized access is. To keep accounts secure, make passwords hard to guess and update your anti-virus software,” said Graham Cluley, senior technology consultant at Sophos.


    POSTING DEFAMATORY COMMENTS ONLINE
    The UK has strict libel laws covering the publication of statements that damage the reputation of an individual or company. Traditionally, claimants have used libel laws to sue journalists and their publishers. In terms of the web, libel now also applies to defamatory comments published on a forum, blog or website. The writer, the website owner and your ISP can be sued, so think carefully before posting any potentially derogatory comments online. If your target is identifiable and what you have written exposes them to ‘hatred, ridicule or contempt’, hurts their reputation or causes them to be ‘shunned or avoided’, you could end up in a civil court, defending an expensive libel claim. It would be up to you to prove your comments are true and, if you are not successful, you could pay out a lot of money in damages to compensate the claimant. See the BBC article ‘How to avoid libel and defamation’ (http://bit.ly/libel232) for more details. But don’t be too scared. Under the defence ‘fair comment’, you can post honestly held opinions, columns and reviews about a service being rubbish, for example, or your dislike of a particular celebrity. An advantage of the web over a newspaper is that content is less permanent and comments can be taken down in the event of a complaint. Struan Robertson, a legal director at law firm Pinsent Masons and editor of Out-Law (www.out-law.com) said: “If you have a blog, are a webmaster or forum moderator and are made aware of defamatory comments, you should act quickly in taking them down. The law says if you act ‘expeditiously’, your defence is ‘stronger’”.


    CHANGING WIKIPEDIA ENTRIES
    Anyone with internet access can make changes to the publicly editable pages on the free online encyclopaedia Wikipedia (http://en.wikipedia.org). However, the site recognises that this public participation means the process is “vulnerable to certain kinds of abuse and counterproductive behaviour,” including vandalism, harassment of other users and disruptive behaviour. To prevent this, the Wikimedia Foundation warns that – under its Privacy policy – when investigating abuse, the IP addresses of users may be used to identify the source of the abusive behaviour. Recently, the High Court ordered Wikipedia to divulge the IP address of someone suspected of blackmail who edited the alleged victim’s Wikipedia entry. Although Wikipedia is outside the British courts’ jurisdiction, the Wikimedia Foundation said it would abide by the ruling. The message is that no-one can make changes to Wikipedia for suspected criminal reasons and expect to hide behind anonymity.


    POSTING PHOTOS OF PEOPLE ONLINE
    You do not necessarily need permission to take a photo of someone, but be careful how you use the image – for example, sharing it on Facebook (www.facebook.com) or Flickr (www.flickr.com). Protection of children is a big consideration and many people are concerned about ‘invasion of privacy’. Although the UK does not have a dedicated privacy law, Article 8 of the Human Rights Act 1998 (http:// bit.ly/priv232) gives people “the right to a private life” and the Data Protection Act (DPA) 1998 (www.legislation.org.uk) protects how people’s information is processed. For example, the privacy watchdog, the Information Commissioner’s Office (www.ico.gov.uk), told Google that it should blur images of adults and children on its Street View service, but the ICO does ask for a commonsense approach. “It is not illegal to take a photo of someone in the street, but how it is used could lead to identification issues and a possible breach of the DPA. However, the DPA does not cover personal use and publication of online albums,” said an ICO spokeswoman.

    Source of Information : WebUser January 28 2010

    Posted on 9 March 2010 | 6:38 pm

    Google - the Evil Empire?

    According to this video, which portrays Google as being an evil empire, Google serves over 1 billion search results daily from over 450,000 servers, is valued at $200 billion, and has the motto "Do no evil". The video does a good job at shedding light on Google's reach into almost everything. As evil as Google may be, they sure have created some amazing tools and opened up a lot of doors for small business around the world by connecting them with customers through Adsense and search results. What may be unsettling though, is Google's CEO saying, "If you have something that you don't want anyone to know, maybe you shouldn't be doing it in the first place" (See second video). Even though he's right, because of the Patriot Act, Google is legally bound to provide the government with information on their servers. That's probably the real source of the evil if there is any.





    Posted on 9 March 2010 | 5:29 pm

    Fedora 13 Alpha Now Available, What are the features??


    "The Fedora 13 'Goddard' alpha release is Now available.  Now it supports automatic Printer Installation, You can Plug and Play your USB Printers in Fedora 13. It supports  automatic installation of language packs; redesigned user management interface; color management to better set and control your colors for displays, printers, and scanners; NetworkManager improvements include Command Line Interface; experimental 3D extended to free Nouveau driver for NVIDIA cards." Firefox 3.6.1 included. Linux kernel 2.6.32, Greater suport for webcams. Fedora 13 alpha comes with KDE 4.4.

    Download Fedora 13

    Posted on 9 March 2010 | 5:10 pm

    Reduce the Bitrate of MP3 Tracks Using MP3 Bitrate Changer

    MP3 is most popular format for listening the music tracks. If you have notice that, The larger size of MP3 files creates the problem while reducing it. MP3 Bitrate Changer is freeware app that compress size of Music tracks with user defined bitrate. One thing, you need to know that, if you reduce the bitrate , it will reduce the quality of audio.

    MP3 Bitrate Changer has simple, intuitive interface, you can change MP3 bitrate simple as possible, in few clicks. MP3 Bitrate Changer supports all mp3 bitrates specified in MPEG-1 Layer 3 Standard: 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 and 320 kbit/s

    Download Mp3 Bitrate Changer

    Posted on 9 March 2010 | 2:03 pm

    Download Powerful Sound Recording for Windows

    Windows has bultin sound recorder with limited features. if you are looking for improved and powerful sound recorder for Windows. Sonarca Sound Recorder Free is a powerful sound recording software, with it you can easily record various sound input to WAV and MP3 audio formats.

    Features of Free Sound Recorder
    It is a FREE sound recorder (for personal, non-commercial, non-profit usage only). Supports multiple sound input, audio/video files playback, CD player, line in, microphone, internet radio, even the obsolete tape/VHS cassette or anything else. Record various sound input to WAV and MP3. CD quality sound recording. Extremely resource friendly, CPU usage is below 1% on some new computers.It uses latest Lame MP3 encoder which is generally believed as the the best MP3 encoder in the world. On-the-fly recording, no temporary file generated. Intuitive output file management. Diagnose and print detailed sound device info. Supports majority of modern sound cards: multi channel/professional/external USB sound cards. Supports several sound cards at the same system. All events are logged for future diagnosis. Windows Vista compatible and works with Windows 7.

    Download Free Sound Recorder

    Posted on 9 March 2010 | 1:47 pm

    Shotwell 0.5 To Bring PicasaWeb Publishing, Tags, Printing, More [Latest SVN Available In Our PPA]

    Shotwell is (well almost) a relatively new open source photo organizer for the Gnome desktop which we were telling you about some time ago. Since then, Shotwell progressed a lot and the latest version 0.5 (not yet released) brings a lot of cool new features:

    Shotwell 0.5 To Bring PicasaWeb Publishing, Tags, Printing, More [Latest SVN Available In Our PPA] (Full Story)

    Posted on 9 March 2010 | 11:36 am

    Launchy 2.5 Beta 2 Released

    Launchy 2.5 Beta 2 was released and the new version includes bug fixes, performance overhauls, and new shortcuts and controls but also a version for Mac OS X too (previously, Launchy was only available for Windows and Linux).

    Launchy 2.5 Beta 2 Released (Full Story)

    Posted on 9 March 2010 | 11:34 am

    How to Monitor Process on Linux using pidstat

    The pidstat command is used for monitoring individual tasks currently being managed by the Linux kernel. It writes to standard output activities for every task selected with option -p or for every task managed by the Linux kernel if option -p ALL has been used. Not selecting any tasks is equivalent to specifying -p ALL but only active tasks (tasks with non-zero statistics values) will appear in

    Posted on 9 March 2010 | 5:19 am

    Get Google Doodle Logo Archives via RSS

    Over the years, doodles on the Google homepage have made searching on Google more fun and enjoyable for its users worldwide. When doodles were first created, nobody had anticipated how popular and integral they would become to the Google search experience. [...] Continue Reading : Get Google Doodle Logo Archives via RSS. © Debajyoti [...] Related posts:Explanation : What Exactly is RSS ? Google Logo Dedicated to Michael Jackson's Birthday Find RSS Feeds Based on your Keyword Choices

    Posted on 9 March 2010 | 3:30 am

    BEST NEW WEBSITES

    Babbel
    www.babbel.com
    Foreign-language expert Babbel has relaunched its online collection of courses and tutorials. The site looks very smart, is incredibly easy to navigate and has a simple but really effective design; it’s basically all about learning a language in the best, most interactive way possible. Babbel’s web-based courses in English, French, Spanish, German and Italian are very well-structured and tailored according to your previous experience of the language. The testing process doesn’t leave you feeling overwhelmed, and you can get a free taster of each course before you pay from around £4.50 per month, with a 20-day money-back guarantee. You can also chat to and practise with other students. Some of the example phrases given are a little random but that’s our only criticism of this brilliant educational resource.


    National Rail Enquiries
    www.nationalrail.co.uk
    The National Rail Enquiries website has been a source of national embarrassment for the past few years. However, the terribly dated design has at last been addressed and the refreshed website is now much less frustrating to use. Start and destination fields now autocomplete, for instance, and clickthroughs are provided to vendors selling journey tickets. There are other welcome touches, too, such as the ability to generate week-long ‘pocket timetables’ (in PDF format) of any chosen journey. The website is still far from perfect but at least it’s getting back on the right track.


    Bid & Deliver
    www.bidanddeliver.co.uk
    Similar to Shiply (www.shiply.com) – reviewed in Web User last year – this service helps you arrange delivery of large items with people who have the means to transport them. List your goods on the site and couriers and haulers will contact you with shipment quotes. You can then select the best offer to get your item delivered as cheaply as possible. The system is simple to use and real-time bids are displayed at the bottom of each page – we saw a Ford Fiesta when we visited. Yet the design is uninspiring and some prices are given in dollars.


    Britainthinks
    www.britainthinks.com
    Is immigration good or bad for Britain? Are footballers good role models? Is democracy dead? Share your thoughts on these topics and more and find out what other people think at this site, which aims to serve as an independent space for public opinions. Categories include Business, Politics and Sport, and you can watch and rate clips of folk expressing their views, vote in polls and submit your own comments and videos. Britainthinks is neatly laid out, with colour-coded sections, thumbnail images of contributors and a strong interactive element.


    PPI Claims
    www.ppiclaimsspecialists.co.uk
    This site has been set up by Q&A Law solicitors to help you claim back mis-sold payment protection insurance (PPI) from your bank, credit card company or loan provider. Clarity of information is important in this area and the site succeeds by providing key points in plain English. We also like the fact that you only pay (25 per cent plus VAT) Q&A Law if your claim is successful and there are no upfront fees. On the downside, you can’t interact with the team directly through the website – only by phone.


    Bookatree.co.uk
    www.bookatree.co.uk
    If you love reading but worry about the drain on natural resources that books entail, you’ll appreciate this green online bookstore. Bookatree.co.uk promises to replace the wood used to create its wares by putting 15 per cent of its profits towards planting trees in or near your neighbourhood. It sells a wide range of paperbacks, hardbacks, maps and audiobooks at competitive prices – some cheaper than Amazon. It won’t win any prizes for design but Bookatree.co.uk’s eco-friendly approach is very commendable.


    SellMyMobile.com
    www.sellmymobile.com
    Phone-comparison websites are ten a penny but SellMyMobile.com turns the concept around. Instead of hunting for the lowest price for a particular handset, the site compares the best cash offers mobile-phone recyclers will make you for your old one. Just tap in your phone model and peruse the chart to see which company will pay you the most in cash, credit, vouchers or loyalty points, then click through to complete the deal if you’re tempted. It’s a great idea that seems to work well. The site did throw up a few errors, but these are probably teething troubles.


    Bigwardrobe.com
    www.bigwardrobe.com
    Popular clothes-recycling community Bigwardrobe.com has relaunched with a spruced-up design and useful new features. The eye-catching layout now includes a Bottom Drawer area, where you can buy, sell and swap books, CDs, gadgets and more; an Alerts tool that notifies you when your favourite brands and most wanted clothes, shoes and accessories are listed; and a social-networking function that lets you set up groups of friends and send instant messages. Unlimited access to this superb site now costs £12 per year, but you can still browse and swap stuff (one item per month) for free.


    Dwink
    www.dwink.com
    If you want to know what, where and how to drink, check out this online magazine. Dedicated entirely to the wet stuff, Dwink has been set up by two alcohol experts aiming to broaden our imbibing horizons with drinking advice, bar reviews, cocktail video recipes and much more. Design and content are both on the quirky side – there’s an area called Muckin’ Abaht, a page about French wrestler Andre the Giant and entertaining news stories – which all give the site a distinct flavour. It’s a shame there’s no blog or forum, but with lots to quaff, great competitions and a fun, friendly tone, Dwink is well worth a sip.


    iWikiPhone
    www.iwikiphone.com
    This social network for iPhone users provides a place to discuss, share and build killer apps. You can browse and download thousands of the things in the Apps section, which spans everything from books to weather and includes both paid-for and free options. Each app can be rated, reviewed and commented on, which helps create a community feel, as does the ability to see who has added an app to their collection. Best of all is the App Farm area, where you can suggest an idea for an app and earn $500 (about £312) if iWikiPhone develops it. With an airy, ad-free design, there’s lots here to keep iPhone addicts happy.


    Best Buy
    www.bestbuy.co.uk
    US electronics chain Best Buy is opening its first UK high-street stores in spring and has launched this swish-looking site to whet your appetite. You can browse categories such as TV & Home Cinema, Computing and Mobile for in-depth buyer’s guides, FAQs and glossaries of technical terms. There’s an impressive emphasis on community, with blogs, social-networking pages and forums for sharing your views and tips, and a useful Inspiration & Advice section where you can find out about home-help service Geek Squad. The main gripe is that the site hasn’t actually started selling anything yet, but watch this space!


    The Zouk
    www.thezouk.com
    Booking hotel accommodation online can take hours of comparing rates and availability before finding the perfect room. The Zouk saves you time by doing the hard work for you. Simply submit a request specifying your preferred dates, destination, price range and other requirements and the site will search for matching hotels. You can then review the results and accept the best offer to arrange your room. This ‘reverse bidding’ system is a fantastic idea and is complemented by the site’s friendly design that couldn’t be easier to use. It’s completely free, too. Accommodation types include apartments, pubs and private residences.


    Airfarewatchdog.co.uk
    www.airfarewatchdog.co.uk
    Save money when booking flights online using Airfarewatchdog.co.uk. Owned by TripAdvisor (www.tripadvisor.co.uk), this UK version of a popular US site lets you instantly view the lowest air fares by entering the name of a departure city on the homepage. It presents its hand-picked results as an alphabetical list from which you can then choose a destination, before viewing details and checking availability for your desired dates. Alternatively, you can search for fares to a specific city or browse the Top 50 fares to find out which place is currently the cheapest to fly to. Airfarewatchdog.co.uk is very easy to use and offers handy email alerts and airline route maps.


    Start4Life
    www.nhs.uk/start4life
    The NHS has launched Start4Life to help new and prospective parents give their baby “the building blocks for a healthier and happier future”. It covers such topics as the benefits of mother’s milk, the best food to give your child from birth up to the age of five, and how to keep your tot active to help develop brain and muscle power. There’s a very short video explaining the purpose of the site and a set of links to family-help websites. While Start4Life’s intentions are honourable, it’s skimpy on content compared to most other online parenting resources and the garish, cartoony design seems more geared towards kids than parents.


    Wispa
    www.wispa.co.uk
    Wispa is a brand that inspires real affection – just ask the Facebook users who successfully campaigned for its return to the shelves in 2007 – and this is reflected in its revamped online home. The lively site offers lots of fun things for fans of the Cadbury chocolate bar to do, from creating a personalised virtual Wispa to composing a song celebrating its tastiness. You can also view a video about ‘the Facebook affair’ in the ‘Wis-tory section’ and read the latest chocolate news. The illustrated layout is pleasantly messy yet easy enough to navigate, and it’s sweet that Cadbury is acknowledging the loyalty of Wispa lovers.


    Virtual Farmers Market
    www.vfmuk.com
    This site applies the concept of a virtual-shopping mall to the traditional farmers market, letting you buy fresh, independently produced food from the comfort of your PC. Stroll around dozens of stalls in a 3D environment and click anything that takes your fancy to watch videos of the producers discussing their fare and farms. It’s a brilliant idea and there’s tons of tasty stuff, including meat, cheese and seafood – all delivered to your doorstep in a temperature-controlled box. To experience the full 3D market, you’ll need to download the 27MB farm file, or you can browse in the usual way.


    Japan Journeys
    www.japanjourneys.co.uk
    If you’re considering a trip to the land of the rising sun, this relaunched site has a selection of tours on offer, whether you’re interested in Japanese cuisine, Manga or bonsai. There are also options for exploring the country’s gardens and hidden islands. Information is presented clearly, if a little too concisely, within the tasteful red-and-white design, and the site includes a new About Japan section covering topics such as etiquette and expenses. Sadly, you can’t book your trip or rail pass online – instead you’ll need to pick up the phone or download and post a reservation form – and it’s a shame there aren’t any videos to further entice you.


    Source of Information : WebUser January 28 2010

    Posted on 8 March 2010 | 6:08 pm

    All Twitter Users Be-Aware! Your Account Might be Hacked!

    Recently, you might have seen lots of news about Twitter accounts being hacked! People will see unknown tweets sent through their own accounts! How can they hack our accounts like this? Lets find out... Related Posts Facebook to Twitter Do you tweet madly? Want to earn from your tweets? Meebo Bar : Now You Can Chat With Your Friends Within Tech Hamlet Ubuntu : How To Take Facebook, Twitter, Gmail and Some Others to Your Desktop Twitter : How Many Unfaithful People are You Following?

    Posted on 8 March 2010 | 5:41 am

    Links/Online Guides/Forums for top Linux Distro's

    Here is a huge list of Links/Online Guides/Forums for Linux, These are mainly Official Links which you can find on the respective site========================================== General Linux Guides/LinksThe Linux Documentation Project : – The Linux Documentation Project How-To : – Index of /pub/Linux/docs/HOWTO/other-formats/html Easy Linux : – Main Page - HowtoForge : – HowtoForge – Linux

    Posted on 8 March 2010 | 5:22 am

    ANL4U Goes Simple!

    ANL4U theme is changed to simple and powerful one, here is the announcement from ANL4U:

    There are some changes in anl4u.com. Theme is changed due to loading issue. Some widgets are also removed for faster loading. There were few issues with the previous theme, one was loading of the pages. Which led us to change the theme to simple and powerful one and make the web pages load faster.

    Check out ANL4U with new theme.

    MMA

    Posted on 8 March 2010 | 3:36 am

    Ancient Greece, Athens added in Google Earth 3D

    With the Winter Olympics coming up, Google decided to revisit the site of the first modern Olympic games. They’ve added detailed 3D view of Athens, with thousands of other important buildings showing off sharp 3D models like in the real city. [...] Continue Reading : Ancient Greece, Athens added in Google Earth 3D. © [...] Related posts:Take a Virtual Tour in Moon with Google Earth How to Find a Location Using its Latitude and Longitude ? Download HD Photos from Google Maps with Google Map Buddy

    Posted on 8 March 2010 | 3:30 am

    Simple Ajax with PHP click tracker

    This tutorial shows how to track your vistors click using simple php and Ajax To implement the click tracking tool we need to create 2 files: Demo.html: This file contains the html with the links and the Ajax code. clickTracker.php: This files will be called by Ajax and records the click event. DEMO.HTML will look like this <!DOCTYPE html PUBLIC [...] Related posts:Ajax Page With PHPAutomatic Ajax Loading Images With PrototypeDisabling right click menu using javascript Enhanced Version

    Posted on 7 March 2010 | 6:03 pm

    Virtual Consoles / Terminals in Ubuntu / Debian Linux

    If you have not configured Ubuntu /Debian  automatically start a graphical environment during startup. If you want to kill a process from a hanged graphical environment, you need to open a virtual console or virtual terminal.
    How to start a Virtual Consoles /  Terminals in ubuntu / Debian
    Just press the following Keys

    Alt+Ctrl+F1 (F1 to F6) . Using F1 to F6 You can open 6 Virtual Terminals.

    this will ask for
    ubuntu 9.10 abc-Desktop tty1 abc-Desktop login:
    Now you can enter your username and password
    Return to Graphical Screen by Pressing

    Alt+Ctrl+F7

    Posted on 7 March 2010 | 5:10 pm

    Change Ubuntu Login Screen

    One of the joys of using Ubuntu is the ability to easily customize even the most obscure features of the operating system and the login screen included with the default GDM theme is no exception. As with most light Linux tweaks, this one is quite straight-forward. There is a utility included with Ubuntu that allows quick [...]

    Posted on 7 March 2010 | 2:12 pm

    The battle of the browsers, part 2

    Not too long ago I wrote a post about the most popular operating systems and browsers on the Internet (read here). I quoted statistics from the w3schools Web site, which gave Firefox the number one spot among all browsers. They collected data for over 5 years and came to this conclusion. Internet Explorer (6, 7 and [...]

    Posted on 7 March 2010 | 3:24 am

    Collapsible Menu with jQuery

    To begin with we need to make a menu, which I've just done a quick temporary 5 items in mine using the HTML lists tags. <pre class="brush:plain;">&lt;menutitle&gt;Main&lt;/menutitle&gt; &lt;ul id=&quot;menu&quot;&gt; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Item 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Item 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Item 3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Item 4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Item 5&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;</pre> Then in the header of your page, you will need to call your jQuery file. <pre class="brush:plain;">&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;</pre> Now beneath the line where you're calling your jQuery from, you will need to write some more JavaScript to tell the document to run the later bit of code when the document has loaded. <pre class="brush:jscript;">&lt;script type=&quot;text/javascript&quot;&gt; $(document).ready(function(){ }); &lt;/script&gt;</pre> Now the document is ready for your jQuery code, we need to tell it that when the "title" bit of the menu (which we've tagged as &lt;menutitle&gt;) is clicked, it should slide it closed. <pre class="brush:jscript;">&lt;script type=&quot;text/javascript&quot;&gt; $(document).ready(function(){ $(&quot;menutitle&quot;).click(function () { $(&quot;#menu&quot;).slideToggle(&quot;slow&quot;); }); }); &lt;/script&gt;</pre> The above code will toggle the sliding action of anything we've put <em>id=&quot;menu&quot;</em> on, which is why we've put it on the &lt;ul&gt; bit. Now with everything put together and saved, you should have a menu that toggles closed and open when you press the top bit, which in my example is &quot;Main&quot; <strong>Please Note</strong><br />Please note though, that this is just an example of doing a menu that can open and close. You can use a cookie to saved if you've closed the menu so that when you refresh the page it stays closed or you can style the menu nicely with CSS. You can also use this method for anything if you wanted from showing and hiding an image, paragraphs, forms, buttons, flash applications, etc... You can get hold of the latest copy of jQuery from the <a href="http://jquery.com/" title="jQuery: The Write Less, Do More, JavaScript Library">jQuery website</a>.

    Posted on 6 March 2010 | 11:44 pm

    Setting up nginx as reverse proxy on Linux Centos 5.2 (and Plesk 9)

    Following my blog article on optimizing your web server by using nginx and memcached, I'll now detail the first step: setting up nginx as reverse proxy on your server. This is going to be a bit tricky, and you'll be getting your hands dirty, so be warned.

    What does this consist in?
    Well basically, your website will be served by two daemons: nginx for the static content (images, js, css, html...) and Apache for the dynamic content. Nginx will be listening on port 80, will serve static content to visitors, and redirect any dynamic data query to Apache, running on another port -- in our case we'll be using port 8080.

    What is nginx?
    Nginx is a lightweight open-source http daemon (http server). It is said to be extremely fast, a lot more than Apache, and I have to admit by personal experience this seems to be very true. Using nginx for serving static content dramatically improved the speed of my high traffic website. Actually, some major websites such as Wordpress.com, *cough* Youporn.com, use nginx exclusively for serving web content.

    Major issues
    This configuration is a bit tricky and can be difficult to achieve particularly if you have numerous domains & subdomains. There are several issues with this configuration:
    1) I happen to be using Plesk 9 (admin control panel) for easy domain & subdomain management. Unfortunately it doesn't seem to be compatible with nginx at the moment, it only works with Apache. So we'll run into a few problems very soon.
    2) We'll have to work out the configuration files manually (including vhosts - virtual hosts configurations)  so be careful about what you're doing or you might run into annoying problems.
    3) Plesk rebuilds the virtual hosts configuration files every time you make the slightest change in the web configuration.

    Step 1: download and install nginx
    nginx requires the PCRE library. If it's not installed on your system, run the following command:
    # yum install pcre# yum install pcre-develTry these libraries aswell just in case they aren't on your system already:
    # yum install zlib# yum install openssl# yum install openssl-devel# yum install gcc

    Visit the official nginx website (nginx.net) and find the latest version. From your shell, run this command:
    # wget http://sysoev.ru/nginx/nginx-0.7.62.tar.gzUnzip the files with the following command
    # tar zxvf ./nginx-0.7.62.tar.gzChange directory to the nginx folder
    # cd nginx-0.7.62Run the following commands:
    # ./configureIf you get no errors, you're all set, go on with the next couple of commands. If you get an error, try to make sure all the libraries are installed.
    # make# make install
    2. Nginx base configuration
    Congrats if you've made it this far! Now let's have a look at the base configuration of nginx. By default, the main configuration file should be found here: /usr/local/nginx/conf/nginx.conf or /etc/nginx/nginx.conf
    Open it up and we'll have a look at some of the settings:
    - worker_processes : the amount of processes that will be ran. In most architectures, 1 process = 1 core; so if you want to fully make use of your multi-core CPU, might aswell use as many processes as your CPU has cores. In my case my CPU's a quad-core, so I'll be using 4 worker processes.
    - worker_connections : how many connections a process will accepted simultaneously.
    For more configuration keys, I suggest having a look here ! Excellent article.
    If you can't be arsed, here's the configuration I'll use:
    - user apache apache; # might aswell use the same user and user group as apache! this will allow nginx to have read permissions on the same files as apache
    - #tcp_nopush on -- leave this commented.
    -  tcp_nodelay on; # to be inserted below #tcp_nopush on;
    - keepalive_timeout 30; # should be enough unless your site's really slow- gzip on; # yeah, why disable it? unless you have a really crappy CPU...- gzip_proxied any; # proxied requests will also be gzipped- gzip_comp_level 2; # set gzip compression to 2 (from 1-fast to 9-highly compressed)
    There isn't much more to configure here, so we'll start configuring Apache. But before doing so, there's one little additional configuration directive we'll add to nginx.conf, which will make handling virtual hosts a lot easier. In the nginx configuration folder, create a new folder: sites ( /usr/local/nginx/conf/sites/ ).In the configuration file, below the configuration directives you've put above, insert that new one:include /usr/local/nginx/conf/sites/*.conf; 

    3. Configuring Apache
    This is where it'll get dirty. If like me you run Plesk, you probably already have some vhost configuration files all over. You'll have to edit these configuration files one by one, after having modified the main conf file.

    - Open your main apache configuration file, probably located somewhere like: /etc/httpd/conf/httpd.conf. Find the "Listen" directive at the beginning of your configuration file. It's probably already set to listen on port 80, so change it to port 8080, and add the line below.
    Listen 8080NameVirtualHost X.X.X.X:8080 Replace X.X.X.X by your actual server IP address. Save and close the file.

    - Open your vhosts configuration files one by one, we're going to make some changes. If like me you're using Plesk, the config files for each domain should be located here: /var/www/vhosts/mydomain.com/conf/httpd.include
    Replace all references of port 80 by 8080.
    Example:
    < VirtualHost 49.32.113.160:80 > => < VirtualHost 49.32.113.160:8080 >
    ServerName   mydomain.com:80  =>  ServerName   mydomain.com:8080
    Do the same for all domains and subdomains that use port 80. We can't allow Apache to use port 80 as it'll be used by nginx! No need to edit the 443 references though, we'll still use Apache for all our https content.

    - Once you've edited the configuration files of all your websites, reload your httpd service: service httpd restart.
    An error may (or may not) appear upon restarting: [warn] VirtualHost 49.32.113.160:8080 overlaps with VirtualHost 49.32.113.160:8080, the first has precedence, perhaps you need a NameVirtualHost directive.
    No need to worry, the fix is simple. Pick one of the vhosts configuration file. Find a vhost directive section such as this: , and add below: NameVirtualHost X.X.X.X:8080 where X.X.X.X is your server's IP address. Save the conf file and reload httpd.

    If your httpd reloads without warnings or error, you can proceed to the next section. Otherwise, read carefully the steps I've described above to see if you missed anything.
    You can test your changes by accessing your website on port 8080, for example: http://www.mydomain.com:8080/ . Your website should load, even though there might be some display errors due to the port change.

    Major issue: when you make any change to the web configuration in Plesk, Plesk rebuilds the vhosts configuration files, which means you'll have to make these changes every time you modify the configuration! There may be some way to prevent this, if you know any, please let me know by posting a comment, I'd be very grateful.

    4. Configuring nginx as reverse proxy

    So far, we've only installed nginx, and made Apache listen on port 8080 instead of 80. If you stop here, everything's pretty much broken. So read on.
    The next step is to configure nginx in order to redirect dynamic content requests to Apache, and return them to the user properly. Start by creating a new file in the nginx configuration folder (same folder as your nginx.conf). Name this file proxy.conf. In this file we'll define the proxy settings. I won't detail each of the settings, this would take ages and you might aswell use the settings below as they should be valid for most sites:
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    client_max_body_size 10m;
    client_body_buffer_size 128k;
    proxy_connect_timeout 90;
    proxy_send_timeout 90;
    proxy_read_timeout 90;
    proxy_buffer_size 4k;
    proxy_buffers 4 32k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;Credit: papygeek.com
    Paste the above lines in the proxy.conf file you've created. We'll be using this file to configure the proxy options in each of our virtual hosts. That's not all though, there is a problem introduced by the proxification of our architecture: how is Apache going to know the real client's IP address? Since nginx will forward the http requests, Apache will be receiving the nginx IP address, in other words, your local IP (your server's IP address). In order to fix this problem, an apache module was created: mod_rpaf.

    Begin by installing said module:
    # wget http://stderr.net/apache/rpaf/download/mod_rpaf-0.6.tar.gz# tar zxvf mod_rpaf-0.6.tar.gz# cd mod_rpaf-0.6# make rpaf-2.0 && make install-2.0
    If you run apache2, replace "apxs" by "apxs2" in the command below. If apxs/2 isn't installed on your machine, run this command first: yum install httpd-devel
    # apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
    # a2enmod rpaf
    # service httpd restart

    5. Configuring the virtual hosts

    Let's now see the final part of this tutorial: configuring the virtual hosts for nginx. First go to your "sites" folder, which you created in the nginx configuration folder (default should be /usr/local/nginx/conf/sites/ ). We'll do this the clean way: for each domain hosted on your machine, create a new .conf file.

    Here is the configuration for the "mydomain.com" domain (and thus the content of your mydomain.conf) :
    server {
      listen      80;
      server_name www.mydomain.com;
      access_log      off; # Apache already creates access logs, I'd disable them unless you really need them
      error_log       /var/log/httpd/nginx.errors.mydomain.com.log warn; # error log, level "warn":
      # Forward requests to Apache! This is the key to our system
      location / {
        proxy_pass         http://www.mydomain.com:8080/;
        include  /usr/local/nginx/conf/proxy.conf; # the proxy.conf file
      }
      # Select files to be deserved by nginx
      location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|txt|srt|swf|zip|rar|html|htm|pdf)$ {
        root  /var/www/vhosts/mydomain.com/httpdocs; # the httpdocs folder of your domain
        expires           7d; # caching, expire after 7 days
      }
    }
    # same configuration, without the www. server {
      listen      80;
      server_name mydomain.com;
      access_log      off;  error_log       /var/log/httpd/nginx.errors.mydomain.com.log warn;  location / {
        proxy_pass         http://mydomain.com:8080/;
        include  /usr/local/nginx/conf/proxy.conf; # the proxy.conf file
      }
      location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|txt|srt|swf|zip|rar|html|htm|pdf)$ {
        root  /var/www/vhosts/mydomain.com/httpdocs;    expires           7d;  }
    }

    # subdomains! replace "mysubdomain" by your subdomain name

    server {
      listen      80;
      server_name mysubdomain.mydomain.com;

        access_log      off;    error_log       /var/log/httpd/nginx.errors.mysubdomain.mydomain.com.log warn;
      location / {
        proxy_pass         http://mysubdomain.mydomain.com:8080/;
        include  /usr/local/nginx/conf/proxy.conf; # the proxy.conf file
      }

      location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|txt|srt|swf|zip|rar|html|htm|pdf)$ {
        root  /var/www/vhosts/mydomain.com/subdomains/mysubdomain/httpdocs; # httpdocs folder of your subdomain
        expires           7d;
      }
    }

    Feel free to copy the subdomain section as many times as you have subdomains.
    Try your nginx configuration by running the following command:
    # /usr/local/nginx/sbin/nginx -t
    You should be receiving this message, provided you've done it correctly:
    the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    configuration file /usr/local/nginx/conf/nginx.conf test is successful


    6. Setting nginx as service & startup
    I've written an init.d script for you to use. Nearly all the credit goes to Slicehost for writing the original Ubuntu one; the one I wrote is for CentOS, although it should work for other systems: download here. Unzip it and place it in your /etc/rc/init.d/ folder. If you have placed the nginx binary in a different folder, you'll have to open up the script and change the $DAEMON path. Give it execute permissions ( chmod +x /etc/rc/init.d/nginx ), after which you'll be able to use the following commands:
    Starting the server: # service nginx start
    Stopping the server: # service nginx stop
    Reloading the configuration: # service nginx reload
    Restarting the server: # service nginx restart

    If you wish, you can add the "service nginx start" command in the /etc/rc.local file, this will allow you service to be ran on startup.

    Well, I guess that's about it!
    The next article will deal with memcached, so stay tuned!
    Clem

    Posted on 6 March 2010 | 7:53 am

    Comment on XCP Tutorial – Building a HVM Guest using Command Lines by Xen.org Weekly Newsletter Vol 10 No 9 – blog.xen.org

    [...] Tutorial – Building a HVM Guest from Command Line Interface – Memory Issues with new VMs – Installing a VM Operating System from [...]

    Posted on 5 March 2010 | 5:49 pm

    Comment on Xen Mascot Contest – Current Voting Results by Xen.org Weekly Newsletter Vol 10 No 9 – blog.xen.org

    [...] Mascot Contest – Three finalists [...]

    Posted on 5 March 2010 | 5:48 pm

    Xen.org Weekly Newsletter Vol 10 No 9

    Welcome to the new Xen.org weekly newsletter with a variety of information to keep you updated on all things Xen. This newsletter is an upgrade from my previous weekly communications and is meant to offer a broader scope of Xen.org activities. Please feel free to contact me with suggestions for the newsletter. There will be no [...]

    Posted on 5 March 2010 | 5:48 pm

    Oracle Releases Virtual Box 3.14

    From virtualization.info: Oracle just released its first updated for VirtualBox after the acquisition of Sun. The list of bugs corrected in version 3.1.4 is long but there are no new features . An interesting thing is that the company decided to change the default behavior of the engine: now VirtualBox tries to leverage hardware virtualization acceleration by default, [...]

    Posted on 5 March 2010 | 2:55 pm

    Storing trees in databases

    A tree is a graph which is connected, uni-directed and acyclic. Lets look at different options of storing such trees in databases. Parent - Child Model The most common model for storing hierarchical information is storing the reference of the parent node along with the child node. so for a tree EmployeeBosssalary ANULL1000 BA900 CA950 DC800 EC700 FC600 For this model, the table to be

    Posted on 5 March 2010 | 9:18 am

    Using the Hama MCE remote on Linux with MPlayer

    This blog post describes how to control your MPlayer media playback using the Hama MCE remote control on Linux. The instructions and software were tested on Ubuntu Jaunty, but they should work on any Linux 2.6 system which has sysfs mounted and which has USB HID support compiled to the kernel (can be checked with ls -l /sys/bus/usb/drivers/usbhid).

    The Hama MCE dongle, when connected to the USB port of a Linux machine, registers itself as two USB HID devices: a keyboard and a mouse. Most of its buttons generate regular keyboard events, for example, the numeric keys correspond to numpad keys, and its Enter key corresponds to the Enter key. You can use its mouse controls to move the mouse or click (the left and right buttons). On Ubuntu Jaunty, even the volume buttons work (they adjust the master volume).

    However, if you don't want to use your Hama MCE remote as a regular keyboard or mouse, but you'd like to control MPlayer (and possibly some few other applications you specify) with it, then you need special software. LIRC, the de facto standard remote control driver and server does support USB HID devices in general, but the Hama MCE sends some quite unusual events which LIRC seems to be impossible to make recognize. (For example, the hashmark button sends Shift, 3 and 5, and some other buttons send Shift or Control too, and LIRC doesn't seem to be able to track the Shift and Control state, which would be needed to distinguish some buttons from each other.)

    So I've implemented my own lircd, hama_mce_lircd.py, which can read button presses and other events from the Hama MCE remote, and it can broadcast them to applications via the socket /dev/lircd, using the traditional lircd protocol. The link above contains installation, usage and configuration instructions for controlling MPlayer with Hama MCE, using hama_mce_lircd.py.

    Each button works and can be bound to any MPlayer input.conf command, with the following limitations (of the dongle hardware):the ok and enter buttons are the same;the play and pause buttons are the same;the right click and the info buttons are the same;most buttons don't repeat when held down for a long time.

    An alternative and more generic Python Linux event reading and mangling library with Hama MCE support is available at http://github.com/rmt/pyinputevent/.

    Posted on 5 March 2010 | 8:26 am

    We have a Review Writer Winner

    Well as promised we give away 1 year of free (bought item) downloads to one person per month who writes a review in the Joomla! extention system. As we don’t get 5 reviews per month, (Yet) we just picked one for the month of january. And the winner is…….. Erik of the company Digitivity Have fun downloading Erik ! Well…. [...]

    Posted on 5 March 2010 | 6:53 am

    New version of Calculator Plus Module

    Yesterday i published a new version of my Calculator Plus Module for Joomla! 1.5 and it has everything in it what you need. It’s got : MS M+ M- MR MC, EXP, SQR plus minus divide times clear decimals plus/minus So.. basicly everything. This module is usage free. You can see the demo here. You can download the module here.

    Posted on 5 March 2010 | 6:00 am

    Linux Learning Centers Growing in Central Texas







    Aaron wasn't much interested in what his friends were doing.  They were busy trying to choose a game to play on agame.com.  Aaron wasn't having any of it.  He stood beside me as I coaxed the wireless connection to life on another machine and asked me if there were any math games.




    Arron is 7.

    The Little Ebenezer Baptist Church in Hutto Texas is the newest home to a HeliOS Project Linux Learning Center.  The center is built in a small church annex but all area children are allowed to use the computers, regardless of their affiliation.  Skip Guenter Our Director of System Engineering is the driving force behind  making this happen...because as it happens, Hutto is his home.  Skip knows who is in  need in Hutto and he saw to it that need was met.  While it isn't anywhere near our biggest project, it is going to have an impact.

    "Are there any math games in that computer sir?"

    You bet there are Aaron.

    Skip is working with the manager of the Annex to arrange weekly classes for local people who want to learn how to use a computer.  From what we have seen at The Bruno Knaapen Center, we will have equal numbers of adults to kids.

    That's fine with us.

                                                                             
    While most children Aaron's age are more than happy to make bunnies jump over mushrooms and race little cars around a flash-based gamescreen, kids like Aaron inspire us to get stuff like this done.  As of now, there are only 4 machines in this center.  Judging from the competition between kids vying for computer time, I'm thinking we might have to adjust some table space and install two more.  That will take up the remaining space comfortably available for machines there.

    Flash back 60 minutes that same evening...

    The Bruno Knaapen Technology learning Center is a hub of activity for us on Wedensday nights.  That is the night our Directors go there to teach basic computer and Internet skills to those who need to learn them.  Most of our students are Hispanic and not native English-speakers so we rely upon the good nature of Christine and Ceasar Collazo to translate our lessons into Spanish in real time.  Non-English speakers are clustered into groups of three to make it easier to teach.



    It gets interesting to say the least.

    Tom King, our Network Director is currently working with Caesar and Christina in setting up a project for the summer to teach kids to build their own computers.  We've had a great response from some of the parents in the area for Tom's idea.  As Linux Against Poverty 2010 enters it's hard planning stage, we are hoping to have plenty of machines to work with for this project.

    As of now, we are critically low of both machines and funding so any further efforts are going to rely upon the good nature of this community to get it done.  While we have no shortage of grants that now want to pay for vechicles, office space and computers for our administrative use, we are finding it difficult to nail down funding for day-to-day operations.  We don't want to apply for grants for things we already have...that just makes those resources unavailable to someone that really needs them.  We already have the things they are offering.  If you can give us a hand, it would be greatly appreciated.  As of now, we are to a point where we just can't do much more without some help.

    I will be meeting with Lynn Bender, the creator and force behind Linux Against Poverty this week.  Once we get some things ironed out, I will publish the information here.  We already have a greater number of volunteers to man the triage and repair tables than last year.  Of course, our goal is 100 computers more than the 200 we put into service from Linux Against Poverty 2009.

    ...And that's a good thing.

    All-Righty Then

    Posted on 4 March 2010 | 3:20 pm

    Microsoft Security Advisory --- F1 Key on Web

    A friend of mine from Japan emailed me this interesting article and thought I would share it.
    Microsoft has issued a security advisory warning users NOT to press the F1 key when prompted by a website. This vulnerability could allow a hacker to hijack a computer. This vulnerability affects all versions of Internet Explorer on computers running Windows 2000 and Windows XP operating systems. More information can be found at
    http://www.computerworld.com/s/article/9164038/Microsoft_Don_t_press_F1_key_in_Windows_XP
    DO NOT press the F1 key if prompted by a website. Doing so could allow a hacker to hijack your computer!

    Posted on 3 March 2010 | 11:37 am

    KDE4.4.1 released!

    More details here.

    MMA

    Posted on 3 March 2010 | 3:17 am

    Hide your tracks with XB browser

    I have recently published a post about Ultrasurf, a program that enables you to surf the Net anonymously and securely, but now I have found something even better: the XeroBank Browser. Previously called Torpark, the XB browser is an open source browser that works similar to other ‘anonymous’ browsers, but it may be even better. Open source means it’s free. XB [...]

    Posted on 2 March 2010 | 12:50 pm

    Options available for heating water

    The simplest and easiest way is to get a big utensil and fill it up with water and heat it on the stove. Remember to cover it up, and it gets hot faster. Another option that we used when we were living as tenants was an electric rod. It costs between 200 to 500 INR and depending upon the wattage heats up water fast - a

    Posted on 28 February 2010 | 1:39 pm

    Import and Enable the NFS Service

    Last week we had a little issue with mounting directories from a new Solaris 10 server. It was noted the nfs service was not running on it. We had to import and then enable the service. After that, we were able to mount the required directories from the server.


    # svcs -a | grep nfs
    # cd /var/svc/manifest/network
    # svccfg -v import nfs/server.xml
    # svcadm enable nfs/server

    or

    # svccfg -v import /var/svc/manifest/network/nfs/server.xml
    # svcadm enable nfs/server

    If you want to disable and delete a service, see below.

    # svcadm disable network/nfs/server
    # svccfg delete network/nfs/server

    Posted on 28 February 2010 | 6:16 am

    Warning: session_start(): Cannot send session cookie headers already sent

    Some times when you intergrate your existing wordpress blog with an external website or at times when you go for something like <?php require_once('body.php'); ?> 2.php <?php session_start(); ?> in your webpage, you will be getting a warning stating that Warning: session_start(): Cannot send session cookie headers already sent To eliminate this warning it is pretty simple just add this code <?php ob_start(); <!–YOUR INCLUDE SCRIPT HERE–> ob_end_clean(); ?> Thats [...] Related posts:Simple Code To Set And Retrieve Cookie Using PHP“Header already sent” in php error and other use of Header function in PHPInclude files in php using include, include_once, require or require_once

    Posted on 26 February 2010 | 5:42 pm

    Error compiling cairomm

    While compiling cairomm i got this error:

    configure.ac:37: error: possibly undefined macro: AC_DISABLE_STATIC
          If this token and others are legitimate, please use m4_pattern_allow.
          See the Autoconf documentation.
    configure.ac:38: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
    configure.ac:39: error: possibly undefined macro: AC_PROG_LIBTOOL
    autoreconf: /usr/bin/autoconf failed with exit status: 1

    Solution:
    Install libtool:

    [root@dyn854450 ~]# yum install libtoolLinux system administration and security

    Posted on 26 February 2010 | 5:16 pm

    Badly formed XML, there is no tag

    Using glade-3 i got with this error/warning:


    [walter@talent Projects]$ gtk-builder-convert uno.glade uno.xmlTraceback (most recent call last):File "/usr/bin/gtk-builder-convert", line 772, in
    sys.exit(main(sys.argv))
    File "/usr/bin/gtk-builder-convert", line 760, in main
    conv.parse_file(input_filename)
    File "/usr/bin/gtk-builder-convert", line 161, in parse_file
    self._parse()
    File "/usr/bin/gtk-builder-convert", line 233, in _parse
    assert glade_iface, ("Badly formed XML, there is "
    AssertionError: Badly formed XML, there is no tag.
    Try saving the file as a libglade project and then try again. It work'd for me.

    Linux system administration and security

    Posted on 26 February 2010 | 4:50 pm

    Accessing a Data Source Remotely in FMW 11g (11.1.1.2.0) from JDeveloper 11g (11.1.1.2.0)

    I needed to access a data source remotely on FMW 11g server from JDeveloper 11g. I found that to do this I needed to follow these steps.

    Note: This was done using 11.1.1.2 which is the latest version of FMW 11g and JDeveloper 11g

    1. Edit setDomainEnv script to ensure you set this property to true. By default it's false.

    WLS_JDBC_REMOTE_ENABLED="-Dweblogic.jdbc.remoteEnabled=true"

    2. Re-start your server to pick up the change done at step #1 above.

    3. In your project add the following libraries to allow remote access and the required JDBC driver library.
    Weblogic 10.3 Remote-ClientOracle JDBC4. From JDeveloper access your data source remotely with code as follows making sure you use your connection details and the correct JNDI name for the data source.


    package pas.au.remote.wls11g;

    import java.sql.Connection;

    import java.sql.SQLException;

    import java.util.Date;
    import java.util.Hashtable;
    import java.util.logging.Level;
    import java.util.logging.Logger;

    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;

    import javax.sql.DataSource;

    public class RemoteDataSourceAccess
    {
    private Logger logger = Logger.getLogger(this.getClass().getSimpleName());
    public RemoteDataSourceAccess()
    {
    }

    public void run ()
    {
    logger.log(Level.INFO, "Started RemoteDataSourceAccess at " + new Date());

    InitialContext ctx = null;

    try
    {
    ctx = getInitialContext();
    DataSource ds = (DataSource) ctx.lookup("jdbc/scottDS");
    Connection conn = (Connection) ds.getConnection();
    logger.log(Level.INFO, "Got connection : " + conn);

    logger.log(Level.INFO, "Auto Commit = " + conn.getAutoCommit());
    }
    catch (NamingException e)
    {
    logger.log(Level.SEVERE, "Error occurred", e);
    System.exit(1);
    }
    catch (SQLException e)
    {
    logger.log(Level.SEVERE, "SQLException occurred", e);
    System.exit(1);
    }

    logger.log(Level.INFO, "Ended RemoteDataSourceAccess at " + new Date());
    }

    public static InitialContext getInitialContext() throws NamingException
    {
    String JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
    String url = "t3://wayne-p2.au.oracle.com:7003";
    String username = "weblogic";
    String password = "welcome1";

    Hashtable<String,String> env = new Hashtable<String,String>();
    env.put(Context.SECURITY_PRINCIPAL, username);
    env.put(Context.SECURITY_CREDENTIALS, password);
    env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
    env.put(Context.PROVIDER_URL, url);
    return new InitialContext(env);
    }

    public static void main(String[] args)
    {

    RemoteDataSourceAccess test = new RemoteDataSourceAccess();
    test.run();
    }
    }

    5. Output as follows.

    25/02/2010 9:22:56 AM pas.au.remote.wls11g.RemoteDataSourceAccess run
    INFO: Started RemoteDataSourceAccess at Thu Feb 25 09:22:56 EST 2010
    25/02/2010 9:23:03 AM pas.au.remote.wls11g.RemoteDataSourceAccess run
    INFO: Got connection : weblogic.jdbc.rmi.SerialConnection_weblogic_jdbc_rmi_internal_ConnectionImpl_weblogic_jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4CConnection_1032_WLStub@1
    25/02/2010 9:23:03 AM pas.au.remote.wls11g.RemoteDataSourceAccess run
    INFO: Auto Commit = true
    25/02/2010 9:23:03 AM pas.au.remote.wls11g.RemoteDataSourceAccess run
    INFO: Ended RemoteDataSourceAccess at Thu Feb 25 09:23:03 EST 2010http://feeds.feedburner.com/TheBlasFromPas

    Posted on 24 February 2010 | 11:09 pm

    UDP Tunneling to avoid hotspot or firewall restrictions

    UDP tunneling is an attack that is often overlooked when manufacturers design wireless hotspot and other firewall/proxy based devices. When you try and resolve a domain name, you make a request to a name server on UDP port 53. The way that a lot of wireless hotspot, firewalls and proxies work, is that your DNS request [...]

    Posted on 24 February 2010 | 10:16 pm

    Getting detailed logging for Universal Connection Pool (UCP) / Fast Connection Failover (FCF) Testing

    While testing UCP/FCF I was having some issues with the RAC cluster setup. One useful way to determine exactly what is happening or not happening from the FAN events sent from RAC cluster to the pool was to setup logging as described below.

    1. Create a properties file as follows.

    # This is the sample logging properties file that configures
    # loggers of some classes (FCF-related ones) to produce detailed logging
    # (all levels) and just SEVERE and WARNING level messages for the rest
    # of loggers. Console output via UCPFormatter (ODL-like messages).

    handlers = java.util.logging.ConsoleHandler
    java.util.logging.ConsoleHandler.level = ALL
    java.util.logging.ConsoleHandler.formatter = oracle.ucp.util.logging.UCPFormatter

    .level = WARNING

    oracle.ucp.common.FailoverEventHandlerThreadBase.level = ALL

    oracle.ucp.jdbc.oracle.ONSDatabaseEventHandlerThread.level = ALL
    oracle.ucp.jdbc.oracle.ONSDatabaseFailoverEvent.level = ALL
    oracle.ucp.jdbc.oracle.ONSOracleFailoverEventSubscriber.level = ALL
    oracle.ucp.jdbc.oracle.OracleDatabaseInstanceInfo.level = ALL
    oracle.ucp.jdbc.oracle.OracleDatabaseInstanceInfoList.level = ALL
    oracle.ucp.jdbc.oracle.OracleFailoverEventImpl.level = ALL
    oracle.ucp.jdbc.oracle.OracleFailoverEventNotification.level = ALL
    oracle.ucp.jdbc.oracle.OracleFailoverEventSubscriber.level = ALL
    oracle.ucp.jdbc.oracle.OracleFailoverHandler.level = ALL
    oracle.ucp.jdbc.oracle.OracleFailoverablePooledConnection.level = ALL
    oracle.ucp.jdbc.oracle.OracleConnectionConnectionPool.level = ALL
    oracle.ucp.jdbc.oracle.OraclePooledConnectionConnectionPool.level = ALL
    oracle.ucp.jdbc.oracle.OracleXAConnectionConnectionPool.level = ALL
    oracle.ucp.jdbc.oracle.OracleJDBCConnectionPool.level = ALL
    oracle.ucp.jdbc.oracle.OracleUniversalPooledConnection.level = ALL

    2. Add the JVM command line option as follows - -Djava.util.logging.config.file=ucp_fcf_log.properties.

    Then you should see some detailed output as follows. Very useful information in diagnosing UCP/FCF issues with your pool. Just showing small snippet as this is detailed output.

    [java] 2010-02-24T10:44:16.734+1100 UCP FINE seq-103,thread-11 oracle.ucp.jdbc.oracle.ONSDatabaseEventHandlerThread.run event
    triggered: Service name: orcl.apemrac.au.oracle.com, Instance name: orcl1, Unique name: orcl, Host name: apemrac1, Status: down,
    Cardinality: 0, Reason: user, Event type: database/event/service
    [java] 2010-02-24T10:44:16.734+1100 UCP FINEST seq-104,thread-11 oracle.ucp.jdbc.oracle.ONSDatabaseEventHandlerThread.run che
    ck for events
    [java] 2010-02-24T10:44:16.734+1100 UCP FINEST seq-105,thread-11 oracle.ucp.jdbc.oracle.OracleFailoverEventImpl.setEventType
    eventType: database/event/service
    [java] 2010-02-24T10:44:16.750+1100 UCP FINEST seq-106,thread-11 oracle.ucp.jdbc.oracle.OracleFailoverEventImpl.validateEvent
    Type eventType: database/event/service
    [java] 2010-02-24T10:44:16.750+1100 UCP FINEST seq-107,thread-11 oracle.ucp.jdbc.oracle.ONSDatabaseFailoverEvent. event
    Type: database/event/service, eventBody: VERSION=1.0 service=HASERVICE.apemrac.au.oracle.com instance=orcl1 database=orcl host=ape
    mrac1 status=down reason=failure
    [java] 2010-02-24T10:44:16.765+1100 UCP FINEST seq-108,thread-11 oracle.ucp.jdbc.oracle.OracleFailoverEventImpl.setServiceNam
    e serviceName: HASERVICE.apemrac.au.oracle.com
    [java] 2010-02-24T10:44:16.765+1100 UCP FINEST seq-109,thread-11 oracle.ucp.jdbc.oracle.OracleFailoverEventImpl.setInstanceNa
    me instanceName: orcl1
    [java] 2010-02-24T10:44:16.765+1100 UCP FINEST seq-110,thread-11 oracle.ucp.jdbc.oracle.OracleFailoverEventImpl.setDbUniqueNa
    me dbUniqueName: orcl
    [java] 2010-02-24T10:44:16.765+1100 UCP FINEST seq-111,thread-11 oracle.ucp.jdbc.oracle.OracleFailoverEventImpl.setHostName h
    ostName: apemrac1
    [java] 2010-02-24T10:44:16.765+1100 UCP FINEST seq-112,thread-11 oracle.ucp.jdbc.oracle.OracleFailoverEventImpl.setStatus sta
    tus: down
    [java] 2010-02-24T10:44:16.781+1100 UCP FINEST seq-113,thread-11 oracle.ucp.jdbc.oracle.OracleFailoverEventImpl.setReason rea
    son: failure
    [java] 2010-02-24T10:44:16.781+1100 UCP FINEST seq-114,thread-11 oracle.ucp.jdbc.oracle.OracleJDBCConnectionPool.handleFailov
    erEvent failover event: Service name: HASERVICE.apemrac.au.oracle.com, Instance name: orcl1, Unique name: orcl, Host name: apemrac
    1, Status: down, Cardinality: 0, Reason: failure, Event type: database/event/service
    [java] 2010-02-24T10:44:16.796+1100 UCP FINEST seq-115,thread-11 oracle.ucp.jdbc.oracle.OracleJDBCConnectionPool.handleFailov
    erEvent service name HASERVICE.apemrac.au.oracle.com in event does not match that in the pool: haservice.apemrac.au.oracle.com. No
    FCF attempt.
    http://feeds.feedburner.com/TheBlasFromPas

    Posted on 24 February 2010 | 3:10 am

    Atherstone Ball Game 2010

    <div style="float: left; padding: 4px;"><object width="425" height="344"> <param name="movie" value="http://www.youtube.com/v/an2rGMwffNw&hl=en_GB&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> <embed src="http://www.youtube.com/v/an2rGMwffNw&hl=en_GB&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed> </object></div>Shrove Tuesday in Atherstone saw another game of the yearly Atherstone Ball Game. Roughly 901 years old now, this game begins with large crowds gathering in the main street (Long St) and await the huge ball to be thrown out of Barclay's Bank window. Once it's thrown out the people in the street boot the ball up and down the street for about an hour and a half, then once that time is up the mayhem erupts and everyone goes for the ball to see who has it when the claxon goes at 5pm. The game does involve violence, so if you're tempted to get the ball around 4.50pm then you more than likely will be punched, kicked or thrown everywhere... that's just how the game is. Anyways, this years winner was Mark Rollinson (I think I've spelt his name correctly). &raquo; <a href="http://en.wikipedia.org/wiki/Atherstone#Shrovetide_Ball_Game" target="_blank">WikiPedia :: Atherstone Ball Game</a>

    Posted on 22 February 2010 | 1:14 pm

    Long Time no post!

    Work, Work, Work! School, School, School! No time to write on my blog but it is nice to see that Failserver has grown ! THANK YOU ALL!

    Posted on 20 February 2010 | 5:20 pm

    Debian Installer

    A Slight Flaw with the Debian Installer A few weeks ago, I noticed some really good e-Bay deals on used, Opteron-based servers. I mean, they were going for less money than I had to pay for old Pentium III-based servers just three years ago. So, I decided that maybe it was time to upgrade. Three [...]

    Posted on 20 February 2010 | 1:17 pm

    How to try the GDM login screen in many resolutions

    This blog post explains how to try the GDM login screen and make screen shots in any, user-specified screen resolution. This can be useful when designing GDM themes. The instructions were tried on Ubuntu Hardy (8.04), but they should work on Ubuntu Intrepid (8.10) and Ubuntu Jaunty (9.04). They won't work on Ubuntu Karmic, because it contains a custom GDM.Installation instructions:(When asked to run a command, run it in a terminal window.)Make sure GDM is your display manager. Since GDM is the default, chances are that it is. To make sure, run sudo dpkg-reconfigure gdm, and select GDM if it asks you.Log in using GDM if you haven't already done so. To do that, run sudo /etc/init.d/gdm restart . (You will lose your X11 session doing so.)Install Xephyr, a modern nested (embedded) X server, similar to Xnest: sudo apt-get install xserver-xephyrInstall ImageMagick for making screen shots in various image file formats: sudo apt-get install imagemagickTry Xephyr: Xephyr :9 -screen 800x600 -extension RANDR . A new window should appear with the usual a black-and-white diagonal background and a diagonal cross-shaped cursor. Abort Xephyr in the terminal window. Try with different -screen sizes.Find your GDM Xnest command line by running grep ^Xnest= /etc/gdm/gdm.conf . You should see something like Xnest=/usr/share/gdm/gdmXnestWrapper -br -audit 0.Create a new xnest wrapper script:echo '#!/bin/sh
    GEOMETRY="`cat /tmp/new-xnest-geometry`"
    GEOMETRY="${GEOMETRY:-800x600}"
    exec Xephyr "$@" -screen "$GEOMETRY" -extension RANDR' |
    sudo tee /usr/local/sbin/gdm-xnest &&
    chmod 755 /usr/local/sbin/gdm-xnestCreate the screenshot helper script: echo '#! /bin/bash --
    # by pts@fazekas.hu at Sat Feb 20 11:09:20 CET 2010
    GOT=($(ps x | perl -ne '\''if (/[ ]Xephyr :/) {
    $c++;
    print"$1 $2\n" if (/[ ]Xephyr :(\d+)(?= ).* -auth (\S+)/)}
    END{die"Xephyr not found\n"if!$c;die"multiple Xephyrs found\n"if$c>1}'\''))
    test "$?" = 0 || exit "$?"
    if test ${#GOT} != 2; then
    echo "Xephyr detection failed" >&2
    exit 90
    fi
    export DISPLAY=":${GOT[0]}" XAUTHORITY="${GOT[1]}"
    exec import -window root "$@"' |
    sudo tee -a /usr/local/bin/xephyr-import &&
    sudo chmod 755 /usr/local/bin/xephyr-import Change the Xrandr= setting in /etc/gdm/gdm.conf to use the new wrapper script: sudo perl -pi -0777 -e 's@^Xnest=.*@Xnest=/usr/local/sbin/gdm-xnest -br -audit 0@gm' /etc/gdm/gdm.confMake sure the Xrandr= setting is changed: check that running grep ^Xnest= /etc/gdm/gdm.conf displays Xnest=/usr/local/sbin/gdm-xnest -br -audit 0Save your work in your X11 session, and restart GDM: sudo /etc/init.d/gdm restart . (You will lose your X11 session doing so.)Usage instructions (how to show the GDM login dialog inside a window, and how to make a screen shot):If not already logged in, login in at the GDM login screen.Run gdmflexiserver --xnest to get the GDM login dialog inside a window of your regular session. You can specify the window size using e.g. echo 1024x768 >/tmp/new-xnest-geometry && gdmflexiserver --xnestTo make a JPEG screen shot, run xephyr-import -quality 75 screenshot.jpg while the Xephyr window with the GDM login screen is still open.To make a PNG screen shot, run xephyr-import screenshot.png .

    Posted on 20 February 2010 | 10:26 am

    Cisco GRE example setup

    Hosts from LAN1 should be able to access hosts at LAN2 and vice-versa through GRE tunnel between R1 and R2. ISP doesn’t care what networks are behind R1 and R2 so the only way to establish connection between LAN1 and LAN2 is to use VPN, in this example we use GRE. GRE setup example topology R1’s startup-config [...]

    Posted on 18 February 2010 | 3:06 pm

    KDE 4.4 is ready for Mandriva

    Run one of these to add KDE-4.4.0 repo (depending on your OS of course):

    32 bits:urpmi.addmedia kde-4.4.0 ftp://ftp.kde.org/pub/kde/stable/4.4.0/Mandriva/2010.0/i586


    64 bits:urpmi.addmedia kde-4.4.0 ftp://ftp.kde.org/pub/kde/stable/4.4.0/Mandriva/2010.0/x86_64
    After adding the KDE 4.4. repository you will need to update, download and install all of KDE 4.4 packages. You can do all of this in one command, but, I, for safety, prefer to do it in two steps. First, update the repositories and download all the packages before installing them to make sure that the installation is possible:
    urpmi --auto-update --auto-select --test
    When all packages finish downloading and you see a message at the end saying that the installation is possible, you can run the same command without the --test parameter to now actually perform the installation:
    urpmi --auto-update --auto-select
    After the package installation finishes, logout and log back in, that's it !! you will have a brand new, shiny, awesome and rocking KDE 4.4 desktop :D

    Enjoy!!

    Credit goes to Juan Luis Baptiste for the info.

    Posted on 17 February 2010 | 7:29 am

    D&D on Microsoft Surface

    This is cool. CNET has an article up, with video, of Dungeons and Dragons being played on the Microsoft Surface. Now, I've never actually played D&D, mostly because all the tables and math and line of sight scares the crap out of me. But if I ever got the chance to play on a Surface, I'd definitely go for it, because the computer handles all the boring crap for you. 

    Considering that Surface costs over $12000 dollars, I doubt I'll ever get the chance to play on it, but if costs come down on similar units in the future, your kids just might be playing D&D on a device similar to it in the future.... of course, that future might be a long ways away if you play D&D :)

    Here's the video.

     

    If you want to read the CNET article, click here.

    Posted on 12 February 2010 | 2:17 am

    Full NAT, DNAT and SNAT aka 1:1 NAT, 1 to 1 NAT

    Full NAT, DNAT and SNAT aka 1:1 NAT, 1 to 1 NAT – this is used when you want to map a dedicated external IP on an external interface to another IP on a separate interface with everything routed between them. EXTERNAL_IP=”87.117.XXX.XXX” EXTERNAL_IF=”eth1″ INTERNAL_IP=”192.168.1.105″ INTERNAL_IF=”eth0″ echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A PREROUTING -i ${EXTERNAL_IF} -d ${EXTERNAL_IP} -j DNAT –to-destination [...]

    Posted on 10 February 2010 | 3:29 pm

    Bash - find diff based on a field

    Input files:

    $ cat file1.txt
    timestamp,records,attempts
    1264723200,96,6117
    1264809600,856,7298
    1264896000,904,8628
    1264982400,0,0
    1265155200,644,1786

    $ cat file2.txt
    timestamp,records,attempts
    1264723200,96,6117
    1264809600,859,7298
    1264896000,904,8628
    1264982400,0,0
    1265155200,641,1786

    Required:

    If file1.txt and file2.txt do not have same values in the 2nd field (i.e 'records' field) in any one of the lines (both the files are sorted on first field), print "BAD", else "GOOD".

    As the above two files are already sorted based on first field (i.e. timestamp), we can use join command to join the lines of the two files and then use awk to perform the comparison between two fields of the joined output.

    $ join -t, -1 1 -2 1 file1.txt file2.txt

    Output:
    timestamp,records,attempts,records,attempts
    1264723200,96,6117,96,6117
    1264809600,856,7298,859,7298
    1264896000,904,8628,904,8628
    1264982400,0,0,0,0
    1265155200,644,1786,641,1786

    Lines for which the 2nd and 4th fields in the above output do not match.

    $ join -t, -1 1 -2 1 file1.txt file2.txt | awk '$2 != $4' FS=\,
    1264809600,856,7298,859,7298
    1265155200,644,1786,641,1786

    How many lines like that ?

    $ join -t, -1 1 -2 1 file1.txt file2.txt | awk '$2 != $4 {++c} END {print c}' FS=\,
    2

    or you can use 'wc -l' for the count

    $ join -t, -1 1 -2 1 file1.txt file2.txt | awk '$2 != $4' FS=\, | wc -l
    2

    Now based on the above count, you can conclude if there is difference between file1.txt and file2.txt based on the 2nd field (i.e. records).

    $ unmatched_count=$(join -t, -1 1 -2 1 file1.txt file2.txt | awk '$2 != $4 {++c} END {print c}' FS=\,)
    $ [ -z $unmatched_count ] && echo "OK" || echo "BAD"

    Output:
    BAD

    or

    $ unmatched_count=$(join -t, -1 1 -2 1 file1.txt file2.txt | awk '$2 != $4' FS=\, | wc -l)
    $ [ $unmatched_count -eq 0 ] && echo "OK" || echo "BAD"

    Output:
    BAD

    Related posts:

    - Bash join command explained
    - Perform outer join using awk
    - Performing join using awk
    - Search and print output using awk

    Posted on 10 February 2010 | 10:34 am

    Unix - delete file with hyphen at beginning

    Accidentally one of my script created a file named '-1264924755.done' (i.e. filename starting with a hyphen).

    When I tried to remove this file:

    $ rm -1264924755.done

    rm: invalid option -- 1
    Try `rm ./-1264924755.done' to remove the file `-1264924755.done'.
    Try `rm --help' for more information.

    This is because the command line parser treats the filename as a command line switch (because of the hyphen). So commands like mv, rm etc treats the file name itself as a parameter(option) to the command.

    The ways to delete such files:

    1) Referencing the filename to the command via its path location (so that the special character is not the first character after the white space)


    $ rm ./-1264924755.done

    or

    $ rm ~/work/temptest/-1264924755.done

    2) A special way:

    $ rm -- -1264924755.done

    Related posts:

    - Find last modified directory in UNIX
    - Grep and print control character characters in UNIX
    - Find process running time in UNIX
    - Bash - save command in history without executing it
    - Display file permissions in octal in UNIX

    Posted on 31 January 2010 | 8:15 am

    Helping Haiti: With Crystal of the International Medical Corps…

    It has been in the recent news the devastating twin earthquakes that mostly flattened Haiti. While the rest of the world stared with horror and shock many people has lost their home, their family, their near and dear ones in a few minutes of nature’s whims. Help poured in from all quarters and my friends [...]

    Posted on 25 January 2010 | 2:17 pm

    originalip option in dansguardian

    I upgraded my firewall on Mandriva 2009.1 to 2010 and got into problem with dansguardian. Client computers got DansGuardian 400 - Bad Request , url is malformed for certain sites such as google and facebook. I suspected it must be related to new option introduced by newly installed dansguardian (2.10.1.1). In changelog, I got this:


    Jan 21 17:18:39 firewall6 dansguardian[1090]: Destination host of dnl-15.geo.kaspersky.com did not match the original destination IP of 95.211.85.42
    Jan 21 17:18:40 firewall6 dansguardian[1111]: Destination host of www.google-analytics.com did not match the original destination IP of 72.14.213.113
    Jan 21 17:18:40 firewall6 dansguardian[1074]: Destination host of us.bc.yahoo.com did not match the original destination IP of 216.252.124.30
    Jan 21 17:18:40 firewall6 dansguardian[1072]: Destination host of dnl-11.geo.kaspersky.com did not match the original destination IP of 38.117.98.202
    Jan 21 17:18:41 firewall6 dansguardian[1091]: Destination host of dnl-04.geo.kaspersky.com did not match the original destination IP of 38.117.98.199
    Jan 21 17:18:42 firewall6 dansguardian[1083]: Destination host of dnl-07.geo.kaspersky.com did not match the original destination IP of 38.117.98.199
    Jan 21 17:18:42 firewall6 dansguardian[1116]: Destination host of newsrss.bbc.co.uk did not match the original destination IP of 212.58.226.73
    Jan 21 17:18:43 firewall6 dansguardian[1076]: Destination host of dnl-11.geo.kaspersky.com did not match the original destination IP of 38.117.98.202
    Jan 21 17:18:43 firewall6 dansguardian[1086]: Destination host of dnl-02.geo.kaspersky.com did not match the original destination IP of 38.117.98.196
    Jan 21 17:18:49 firewall6 dansguardian[1270]: Started sucessfully.


    After diff'ing between previous dansguardian.conf (currently in use) and the current version of the file (not in use). It turned out that originalip option was the culprit. It was on by default if it wasn't in there. To turn it off, I must tell it off as below:


    # Network Settings
    #
    # the IP that DansGuardian listens on. If left blank DansGuardian will
    # listen on all IPs. That would include all NICs, loopback, modem, etc.
    # Normally you would have your firewall protecting this, but if you want
    # you can limit it to a certain IP. To bind to multiple interfaces,
    # specify each IP on an individual filterip line.
    filterip = 192.168.6.6

    # the port that DansGuardian listens to.
    filterport = 8080

    # the ip of the proxy (default is the loopback - i.e. this server)
    proxyip = 127.0.0.1

    # the port DansGuardian connects to proxy on
    proxyport = 3128

    originalip = off

    This is what changelog says about originalip option:

    Fri 5th June 2009 - DansGuardian 2.10.1.1 - stable
    Add "originalip" option to dansguardian.conf, for determining the original destination IP in transparent proxy set-ups, and ensuring that the destination domain of the request resolves to that IP. This can help to address a particular transparent proxy security vulnerability (US-CERT VU#435052), but because of certain limitations - only implemented on Linux/Netfilter; potential breakage of websites using round-robin DNS - the code is not enabled by default. Enable by passing "--enable-orig-ip" to the configure script. Fix a crash which could occur when dealing with simultaneous incoming connections in configurations using more than one listening socket. Fix a crash when checking time limits on item lists. Fix potential usage of uninitialised memory during phrase filtering.

    Luckily, Mandriva package was built with --enable-orig-ip enabled.

    Cheers.

    Posted on 22 January 2010 | 3:19 am

    Extract Audio (.mp3) from Video Files Like .flv, .mov, .avi and Others with Ubuntu

    It is very easy to extract the audio track from video files using Linux. All you need is ffmpeg and some codecs. Let’s get started… Note: The commands below are for Ubuntu (or Debian derivatives) but you can do the same with any other Linux distribution provided you can install the necessary packages. 1. Add the Medibuntu’s repository [...]

    Posted on 20 January 2010 | 8:49 pm

    Domain management on mobile

    It was pure delight to find out that GoDaddy — arguably the #1 domain registrar in the world — has an app for the iPhone / iPod touch. According to the App Store, it was posted late last year. Sometimes I get an inspiration for a domain name, and it’s now so much easier and [...]

    Posted on 12 January 2010 | 3:05 pm

    My Apostille Woes and Shashi Tharoor…

    My book was published this July and I got my first royalty statement soon after. My contract with Galileo Press was executed in the US and hence this required me to apply for a TIN to get the actual payment as well as claim tax exemption from the Indian Government. The process, it seemed, was [...]

    Posted on 8 January 2010 | 7:54 am

    How to Resume Partial File Transfers

    I work primarily with UNIX and Linux machines and scp is my main choice to transfer files with. It is both convenient, short and secure. Example: scp localfile user@remotecomputer:/path/to/target/dir Recently I was transferring an 8GB file and due to a network issue, the transfer was interrupted at nearly 40%. I found a solution at joen.dk ,which uses rsync to [...]

    Posted on 8 January 2010 | 5:03 am

    FAQ: How to install manual pages in Solaris?

    In order to use install man pages for various commands in Solaris it is necessary to get two packages: SUNWman and SUNWdoc. You can check if they are already installed using commands ‘pkginfo SUNWdoc' and 'pkginfo SUNWman', or just try ‘man man‘. If they are not present in your system you can install them from [...]

    Posted on 25 December 2009 | 12:47 pm

    Banking with Facebook - Probably not the best idea ever

    Mike Bailey at Skeptikal.org wrote up last week about a new Facebook app called MyMoney. MyMoney is an application that according to its creators allows you to:

    Manage your finances right from your Facebook profile, simply and securely! MyMoney is an online home banking application that interacts with a variety of financial institutions, so you can view your account balances, transfer money between accounts, review histories, and much more.  

    Sounds kind of cool? Hold your horses. In a post dripping with sarcasm (letting you know in case your detector is a bit off) he says:

    I know you're thinking this is a bad idea, and are concerned about MyMoney's security. Don't worry, I checked it out. They have "multiple layers of security protecting...data and accounts." The application iframes you into their site (hosted on https://mm.galaxyplus.com). If you forget the URL, they left zone transfers enabled for you, so you can just select from a list of galaxyplus.com subdomains. The iframe's URL has a parameter called "fb_sig_user." If you manipulate this parameter, you get to see the contents of all your friends' accounts (presumably so you can borrow money without all that awkward asking). The only thing I don't like about this application is that they left error reporting on. I don't like seeing those ugly ASP stack traces every time I use an HTML tag as a form parameter. Lol!

    Note to readers: online banking should be done in a virtual machine if at all possible, and that is all that you should do with VM, nothing else. If that is too much of a hassle, at least download and install a browser like Firefox or Chrome and use that browser exclusively for your banking.

    If you'd like to read the entire (hilarious) post, click here. 

    Did you like this article? If you want to get more articles like it, please consider subscribing to the Bud Boy Tech RSS feed by clicking here.

     

     

    Posted on 11 December 2009 | 4:13 am

    Start and Stop Tomcat from within the Eclipse IDE

    Starting and stopping Tomcat from within the Eclipse IDE, once set up, can speed up your Java Web Application development time because you won't have the extra step of opening the terminal to start and stop Tomcat. The following instructions assume you have Eclipse installed and Tomcat installed.

    Step 1: Open up the External Tools Configurations in Eclipse. In Eclipse's toolbar click on the little icon with a run symbol and the toolbox, then External Tools Configurations... .



    Step 2: In the dialog box that pops up, right-click on Program and select "New".



    Step 3: Give the new run configuration a name such as "Stop Tomcat", and in the "Location" text field enter "/Library/Tomcat/bin/shutdown.sh". You need to adjust the path of the shutdown.sh to match the file's location on your computer. Also, if you're using a Windows machine you need to call shutdown.bin instead. Click "Run".



    Step 4: Create another configuration for starting Tomcat be repeating steps 1 through 3.

    From now on, starting and stopping Tomcat as well as building your projects is accessible with a click of the mouse. Just click the little down-arrow next to that icon with a run symbol and the toolbox, and you'll see a list of the run configurations that you have set up.



    Piece of Cake!!

    Posted on 15 November 2009 | 8:20 pm

    Introduction to Computer Vision with the OpenCV Library on Linux

    Author: Lubos Rendek

    Abstract The purpose of this document is to help a reader to get started with Computer Vision library OpenCV on Linux system. OpencCV is a multi-platform library, but this article will be focused only on OpenCV using Linux operating system ( although, just the installation of the OpenCV library and video camera is platform-specific, all examples in this article should compile on any platform where OpenCV is properly installed such as  Mac OS, MS Windows and etc.).  Reader will be guided through a step-by-step guide on how to install and use some of the basic functions of OpenCV library such as displaying images, playing a video or using a video camera to process a video input stream.

    Conventions used in this article:

    $ - execution on the command line by a non-privileged user# - execution on the command line by a superuserthe actual command to be executed on the command line or code of program to be compiled
    OUTPUT: output produced on the command line by command executionNOTE: general notes and additional informationIntroductionIn simple words a Computer Vision is a scientific field which attempts to provide a sight to the machine. This scientific field has expanded rapidly in recent years. Among researchers this growth is because of many improvements of vision algorithms and among the computer vision hobbyists this is due to the cheaper hardware components and processing power.  OpenCV library plays a great role in the Computer Vision field as it helps greatly to reduce cost and preparation time of computer vision research environment needed by university students, hobbyists and professionals. OpenCV also provides a simple to use functions to get the work done in a simple, effective and elegant manner.  OpenCV was started by Intel, and later it was transformed to an open source project now available on SourceForge.net. OpenCV library has multi-platform availability,  and it is partially written in C++ and C language. Despite the fact that this library is available on many Linux distributions from its relevant package repositories, in this article we will attempt to install and use OpenCV library compiled from a source code downloaded from SourceForge.net web site.


    The reasons for compiling a source code may include:
    new version 2.0.0 recently released and more features available
    some bugs fixed which affected Linux OpenCV 1.0.0 versions ( such as cvGetCaptureProperty() etc. )more support is available for OpenCV 2.0.0 version than for former 1.0.0 version

    This article will start with installation of OpenCV on Debian 5.0 ( Lenny ). Later a reader will be guided through a number of examples on how to use OpenCV to display an image, play a video and use camera to capture the video input stream.

    Posted on 10 November 2009 | 10:58 pm

    Traveling with my Globe T@ttoo

    I’ve been traveling around Mindanao these past few months and, to keep myself connected to the Internet I’ve been bringing along my Globe Tattoo broadband device. No matter where I am, and even if I’m on vacation, I can’t imagine not being able to connect to my email, social networking services, etc., so I don’t [...]

    Posted on 27 October 2009 | 12:36 pm

    Setting up and using memcached & memcache on Linux CentOS 5/Plesk 9

    The second part of my tutorial on optimizing your server for hosting high traffic websites: installing and configuring memcached and the memcache php extension for your server. This is a little easier than the first step (setting up nginx as reverse proxy, see article below) and can be applied to any kind of dynamic website.


    What's the point ?
    On highly dynamic websites such as forums, news sites or any user content based website, the database server load is often very high. The more traffic you get, the more cluttered your database server becomes, sometimes rendering your website completely unavailable to visitors. Using a data caching daemon will allow you to save some data in memory instead of fetching the data from the database every time. You should know that memcached is used by major websites such as Wikipedia, SourceForge, SlashDot... need I say more?

    What is memcached ?
    Memcached is the daemon running on your server. Its usage is extremely simple, there are no configuration files, all you do is start the daemon on a given port, and your websites will connect to this daemon to store data in memory. Yes, the data is stored in your RAM. So when starting memcached you'll have to decide how much RAM memcached will be allowed to use. If you start memcached with a 1GB memory space, memcached will store this much data; when the cache is full some of the older data will begin to disappear from the cache.

    What is memcache ?
    Memcache, in our case, is the PHP extension that will allow us to connect to and make use of Memcached. This PHP extension is not part of the default ones so you'll have to download and install it (see step 2). It provides classes as well as functions that I must admit are very easy to use and understandable. In this article, I provide a mysql+memcache wrapper class for anyone to use.

    What is the difference between memcached and memcache ?
    Well if you've read the two points above, you should already know. In short, memcached is the daemon running on your machine; memcache is the PHP extension allowing you to make use of memcached.


    1. Setting up memcached

    I haven't found memcached in my repositories (might aswell try # yum install memcached just in case?) so I'll download the source and compile it. First go get the latest version from the official website.
    # wget http://memcached.googlecode.com/files/memcached-1.4.1.tar.gz
    # tar zxvf memcached-1.4.1.tar.gz
    # cd memcached-1.4.1
    # ./configure
    If like me you get this message "libevent is missing" or something, you can run this command:
    # yum install libevent-devel
    And then run configure again:
    # ./configure
    Install memcached:
    # make install
    That's it, you're set! That was pretty easy wasn't it? We'll now see the command line arguments for starting memcached:
    # memcached -d -m 1024 -l 127.0.0.1 -p 11211 -u nobody
    The arguments are:
    -d : start as daemon, running in the background
    -m 1024: allow memcached to use up to 1024 MB of RAM (1GB)
    -l 127.0.0.1: listen on local interface
    -p 11211: listen on port 11211
    -u nobody: run as user "nobody"

    If you're not sure how much memory you should allocate to memcached, try running this command first:
    # free
    It will tell you how much free RAM you've got left.
    Note that upon starting memcached, if all is OK, you will see no output message. To see if memcached is correctly started, run this command:
    # ps aux | grep memcached
    You should be seeing something like this:
    nobody   13133  0.0  0.0  43580   732 ?        Ssl  07:11   0:00 memcached -d -m 128 -l 127.0.0.1 -p 11211 -u nobody
    user     13143  0.0  0.0   4152   648 pts/0    R+   07:11   0:00 grep memcached



    2. Setting up memcache PHP extension
    The memcache PHP extension should be found in the classic repositories, so try this command:
    # yum install php-pecl-memcache
    If you're lucky (why should you be unlucky anyway?) the install will work fine and you'll be seeing these messages:
    Installed: php-pecl-memcache.i386 0:2.2.3-1.el5_2
    Dependency Installed: php-pear.noarch 1:1.4.9-4.el5.1
    Complete!
    Just for reference, here's a link to the official memcache website, if you need to grab the sources.

     Let's see if memcache was installed properly. First restart the httpd:
     # service httpd restart
    Then place a simple php file on your website containing the following code:
    phpinfo(); 
    Open the PHP file in your browser (eg. http://mydomain.com/phpinfo.php ) and have a look at the output. If you can find a "memcache" section looking like the following picture, it means memcache was successfully installed.

    We will now have a look at the memcache configuration file. First locate your php module configuration files folder, in my case /etc/php.d/ . You should find the newly installed "memcache.ini" configuration file. Open it up to see a list of configuration keys and their meaning.
    The default options are just fine, but if you're interested, you should know that memcache offers load-balancing features through the "allow_failover" configuration key. I'm not going to make use of this feature so I will not be editing any of the settings.


    3. Using memcache in your code
    Unfortunately, installing both components isn't enough. You'll have to edit your code in order to make use of the caching features. Be reassured though, it couldn't be easier! There are a couple of functions you'll need to use, nothing complex.
    If you want to find out the complete listing of the memcache php functions, visit the official website. Basically we'll be using 5 methods:
    - Memcache::connect($host, $port, $timeout): connect to your daemon
    - Memcache::get($key) : fetch data from your cache
    - Memcache::set($key, $var, $flag, $expire): store data in your cache
    - Memcache::delete($key): remove data from your cache
    - Memcache::close(): disconnect.

    You can cache any data that you want:
    $mc = new Memcache;
    $mc->connect("localhost", 11211);
    $saved_data = $mc->get("saved_data");
    if (!$saved_data) {
      $saved_data = file_get_contents("myfile.txt");
      $mc->set("saved_data", $saved_data, MEMCACHE_COMPRESSED, 60*60*24*7); // store for 7 days
    }
    echo $saved_data;
    $mc->close();

    Applied to MySQL queries:

    $mc = new Memcache;
    $mc->connect("localhost", 11211);
    $news_articles = $mc->get("news_articles");
    if (!$news_articles) {
      $news_articles = array();
      $query = "SELECT * FROM news_articles ORDER BY article_id DESC LIMIT 0,10";
      $result = mysql_query($query);
      while($row = mysql_fetch_assoc($result)) $news_articles[] = $row;
      $mc->set("news_articles", serialize($news_articles), MEMCACHE_COMPRESSED, 60*60*24*7); // store for 7 days, but don't forget to rebuild the cache when a new article is posted!
    } else {
      $news_articles = unserialize($news_articles);
    }
    // Display articles..
    $mc->close();
    As you can see in the example above, I use the "serialize" and "unserialize" php functions. Why is that? The reason is because the Memcache::get() function always returns a string. So if you want to store an array of data (or an object), you'll have to serialize said array, and unserialize it after having read it from the database.
    If you know a better workaround for this problem please feel free to leave a comment.


    4. Wrapper class for memcache & mysql
    I have just written a simple wrapper class for MySQL, making use of the powerful caching system offered by memcache. You can download the class here, I included a simple example for testing the class.
    The principle is very simple: when executing a query, the script will check if the query result is already in the cache. If the data is in the cache, it is returned immediatly (no query executed). if the data is not in the cache, the query is executed, and the results are then placed in the cache with the specified "time to live".

    Here are the wrapper class functions:
    function MySQLMemcache($mysql_info, $memcache_info, $autoconnect=true, $enable_logging=true);
    function connect();
    function disconnect();
    function dataQuery($query, $usecache=true, $ttl=0);
    function nonDataQuery($query);
    function fieldDataQuery($query, $field, $usecache=true, $ttl=0);

    More documentation is provided inside the actual php file.

    Thank you for reading, feel free to leave a comment if this article has been helpful to you.
    I'm finished with my server optimization thematic.
    TTFN!

    Posted on 30 September 2009 | 8:03 am

    Strategie-online.nl – Online Strategie

    Het laatste nieuws op Online Strategisch gebied! Het hebben van een online strategie is tegenwoordig een veel gebruikte marketing term, maar wat houdt het nu in? Geinteresseerd in het laatste nieuws op Online Strategisch gebied? Wat is online strategie? Neem even een kijkje op www.stategie-online.nl of check de MaxServ Twitter http://www.strategie-online.nl

    Posted on 28 September 2009 | 2:27 pm

    C++ : Understanding pointers

    Author: Lubos Rendek

    Date: 10.09.2009

    Update: 04.03.2010 - Section 7.2 created clarify relation between Pointers and Arrays in C++

    Introduction

    This article is intended to all programing enthusiasts on all levels who do wish to understand pointers in C++ language.  All code presented here is not a compiler specific and all examples will be written in plain ANSI C++. Debate about pointers can stretch for miles, and you would need to go really far to master it all. If you really want to run that far, this article gives you a clear understanding of fundamental concepts about pointers and prepares you for that journey. However, those who are new to C++ programming make sure that  you are able to write and run your own C++ “hello world” program, and also it is recommended that you have a basic understanding of C++ functions and classes. If you need to refresh your knowledge about how to compile and run C++ program, use functions and classes, please read an appendix at the end of this document before you continue reading this article.

    What is a Pointer?

    Pointer is a variable that stores a memory address. OK, that is simple ! But, what is a memory address then? Every variable is located under unique location within a computer's memory and this unique location has its own unique address, the memory address. Normally, variables hold values such as 5 or “hello” and these values are stored under specific location within computer memory. However, pointer is a different beast, because it holds the memory address as its value and has an ability to “point” ( hence pointer ) to certain value within a memory, by use of its associated memory address.

    Retrieving a Variable's Memory Address

    OK, enough talking and let's get down to the pointer business. To retrieve a variable's memory address, we need to use address-of operator &.

    #include <iostream>
    int main()
    {
    using namespace std;
    // Declare an integer variable and initialize it with 99
    unsigned short int myInt = 99;
    // Print out value of myInt
    cout << myInt << endl;
    // Use address-of operator & to print out
    // a memory address of myInt
    cout << &myInt << endl;

    return 0;
    }

    OUTPUT:

    99
    0xbff26312

    The first line of the output contains an integer value 99 and on the second line, there is a memory address of myInt printed out. Please note that your output will be different.

     

    Assigning a Variable's Memory Address to a Pointer

    Before we can assign a memory address to a pointer, we need to declare one. Declaring a pointer in C++ is as simple as to declare any other variable with one single difference. Asterix symbol " * " needs to be add and located after variable type and before a variable name. One rule has to be followed when assigning memory address to a pointer: pointer type has to match with variable type it will point to. One exception is a pointer to void, which can handle different types of variables it will point to. To declare a pointer pMark of type unsigned short int a following syntax is to be used:

    #include <iostream>

    int main()
    {
    using namespace std;

    // Declare and initialize a pointer.
    unsigned short int * pPointer = 0;
    // Declare an integer variable and initialize it with 35698
    unsigned short int twoInt = 35698;
    // Declare an integer variable and initialize it with 77
    unsigned short int oneInt = 77;
    // Use address-of operator & to assign a memory address of twoInt to a pointer
    pPointer = &twoInt;
    // Pointer pPointer now holds a memory address of twoInt

    // Print out associated memory addresses and its values
    cout << "pPointer's memory address:\t\t" << &pPointer << endl;
    cout << "Integer's oneInt memory address:\t" << &oneInt << "\tInteger value:\t" << oneInt << endl;
    cout << "Integer's twoInt memory address:\t" << &twoInt << "\tInteger value:\t" << twoInt << endl;
    cout << "pPointer is pointing to memory address:\t" << pPointer << "\tInteger value:\t" << *pPointer << endl;

    return 0;
    }

    OUTPUT:

    pPointer's memory address: 0xbff43314
    Integer's oneInt memory address: 0xbff43318 Integer value: 77
    Integer's twoInt memory address: 0xbff4331a Integer value: 35698
    pPointer is pointing to memory address: 0xbff4331a Integer value: 35698

    The diagram above is a high level visual abstraction of how are variables stored within a computer memory. Pointer pPointer starts at memory address 0xbff43314 and takes 4 bytes. Pointer pPointer holds as a value a memory address of a short int twoInt ( 2 bytes ) which is 0xbff4331a. This address is stored as a binary data within a pointer's memory space allocation. Therefore, dereferencing a pointer with a memory address 0xbff4331a will indirectly access a value of twoInt which is in this case a positive integer 36698.

    Posted on 9 September 2009 | 8:44 pm

    Linux Learning Zone subsidiary of APNIC Solutions Ltd. (c) 2008