Friday, October 30, 2009

Windows 7 "endless reboot"...

So now we have new terms for Windows, dubbed as "endless reboot". It seems like it happen to Vista users attempting to upgrade to Windows 7. Also another issue known as "62% bug", which finds the Windows 7 installation stalling at 62% complete. Microsoft’s support forums are rapidly filling with users reporting both issues.

If my memory serve me correctly, including these two now we have
  • Blue screen of death
  • Green ribbon of death
  • Endless reboot
  • 62% bug

What's next?

To Linux user, don't be so happy. It still have "kernel panic" problem sometimes.

Moral of the story.
There's no such thing as "Perfect OS". From the software development point of view, there will always be a bugs. If someone said that it's perfect that means it's bullshit, marketing people tends to say this by sweeping the truth under the carpet...

Thursday, October 29, 2009

Fake Google Chrome OS...

People gets too excited to know how Google Chrome OS looks like thus giving an opportunity for someone to fake it :) If the fake creator targeted high traffic for his/her site, I guess he/she had successfully did it :)

Read it from here.

It's human nature to seek info into something that has been given a lot of coverage on it yet it is still not ready (Windows Longhorn anyone?)...

Wednesday, October 21, 2009

Rise of the laptop...

Screenshots...


Last year, an old friend of mine (Hazman) has given his old laptop (Compaq Presario V2000) for my kids (at first I thought he asked me to fixed it for him). The laptop is still in good condition but without battery and power adapter. I bought a brand new power adapter for RM 120.

Since the laptop only have 256Mb ram, I've installed XP Pro (pirated version) but once connected to internet I'm getting the BSOD complaining about NTOSKernel error. Installed Xubuntu, everything works fine except that when playing an online games the response was too slow. In the end both my kids use back my old machine.

Last weekend I managed to get a secondhand DDR1 PC2700 512Mb ram. Bought it from Meri for RM 65. On Sunday, I've given a new life to the laptop by installing Ubuntu 9.10 beta. The kids love it (not because of the OS and definitely they don't care about it, it's because they can play online games better now).

Talk about Ubuntu 9.10, I noticed there's new software included by default (apart from Empathy). Palimpsest Disk Utility, a nice utility that will notify you if your harddisk life going to end soon. It happen to this laptop :) I guess I need to prepare some money for the new harddisk...

Wednesday, October 14, 2009

MultiGet Download Manager...

Finally I've found a good download manager for Linux. All this while I'm using D4X and had thought that it's the only available download manager for Linux. Yes, I know wget, curl etc. I'm talking about something with GUI instead of command line. MultiGet does the job for me now. Great thing about MultiGet is that it can run on Windows 2000/XP, almost all Linux desktops, MacOs and BSDs.

Features
  • Multi-task/multi-thread/multi-server usage
  • User-friendly interface (resembling Flashget)
  • Multiple language support
  • Proxy support
  • Extension ignoring/capture
  • FTP anonymous pass
  • Panel icon

MultiGet is available in Ubuntu Universe repository. To install, open terminal and type
    $ sudo apt-get install multiget
For the list of download managers available for Linux, you can refer to this blog.

Tuesday, October 13, 2009

Easiest way renaming file extension (in bulk)...

From uppercase to lowercase or vice versa.

In Linux,
1) All files in a directory
    $ for f in *.JPG; do mv "$f" "${f%JPG}jpg"; done
2) Files within subdirectory(ies) included
    $ for f in `find -name "*.JPG" -type f`; do mv "$f" "${f%JPG}jpg"; done
To learn more, go to Command line reference: Database and Operating Systems.

Run Warsow and getting black screen with message...

"Display is not supported" or "Out of Range". This only happen to lcd monitor.
Solution:
1) Edit Warsow config file
    $ gedit ~/.warsow/basewsw/config.cfg
2) Search for "vid_customheight" and "vid_customwidth" and change the value to one of the resolution (higher than 800x600) that works with your monitor
    seta vid_customheight "768"
    seta vid_customwidth "1024"
Same problem happen to me with Extreme Tux Racer.
Solution:
1) Edit Extreme Tux Racer options file
    $ gedit ~/.etracer/options
2) Search for "y_resolution" and "x_resolution" and change the value to one of the resolution (higher than 800x600) that works with your monitor
    set x_resolution 1280
    set y_resolution 1024

Friday, October 9, 2009

Recovering GRUB after installing Windows...

1) Download Super Grub Disk

2) Burn the image to a blank cd and reboot your machine

3) Boot into your Linux (0.9598 and 0.9799 menu options are slightly different)

4) Once in, open terminal and type
    $ sudo fdisk -l
5) You will see an output like this. For this case /dev/sda4 is my /boot partition
    Device    Boot      Start         End      Blocks   Id  System
    /dev/sda1   *          66        5222    41423602+   7  HPFS/NTFS
    /dev/sda2            5223        6266     8385930   83  Linux
    /dev/sda3            6267       30401   193864387+   5  Extended
    /dev/sda4               1          65      522081   83  Linux
    /dev/sda5            6267        6527     2096451   82  Linux swap / Solaris
    /dev/sda6            6528        9138    20972826   83  Linux
    /dev/sda7            9139       24803   125829081   83  Linux
    /dev/sda8           24804       30401    44965903+  83  Linux

    Partition table entries are not in disk order
6) Mount the partition. Change xxx into your partition number (Since I've already boot into my Linux and /dev/sda4 is mounted to /boot, I'm not sure whether this step is still required)
    $ sudo mount /dev/xxx /mnt
7) Install GRUB to the MBR
    $ sudo grub-install --root-directory=/mnt hd0
If step #6 is not required, I'm assuming the command would be (I need to check this with Ady)
Update 2009/10/13: Step #6 is not required if you booted into your own Linux instead of LiveCD.
    $ sudo grub-install --root-directory=/ hd0
8) I didn't make any changes to my existing /boot/grub/menu.lst file

Note:
Steps tested on my wife's machine with Linux Mint 7 after I'm installing Windows Server 2008. SGD version 0.9598.

An easiest way from Ubuntu wiki
1) Download Super Grub Disk

2) Burn into a cdrom

3) Boot from it

4) Select: GRUB => MBR & !LINUX! (>2) MANUAL |8-)

5) Select the Linux or Grub installation you want to restore.

6) You'll see the message: SGD has done it!

7) Reboot

Note:
I haven't try the second option yet.

Thursday, October 8, 2009

Windows Server 2008...

check out the cpu usage


I've installed Windows Server 2008 as a guest OS on my machine. Expecting the installation time will take about 45 minutes to an hour. This time, I'm wrong. After 20 minutes, installation complete. Read a lot of news/blogs/forums, people claims that Window Server 2008 has a great improvement on performance. Haven't got a chance to play around with the OS yet but I'd love to use it at my office if available. That's my first impression.

Windows 7 is going to be release soon. Lots of good response from testers. Let's wait for the final product to come...

Sunday, October 4, 2009

Limiting user accounts that can connect remotely via SSH...

1) Installing SSH
    $ sudo apt-get install openssh-server
2) Backup current ssh server configuration file
    $ sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup
3) Edit the configuration file
    $ sudo gedit /etc/ssh/sshd_config
4) Change the parameter to disallows the root user from connecting
    PermitRootLogin no
5) Add the parameter and specify the usernames (space separated) that can connect remotely.
    AllowUsers <user1> <user2> ...
6) To deny
    DenyUsers <user1> <User2> ...
7) If you enable the OpenSSH server and you do not wish to enable any remote connections, you may add
    AllowUsers nosuchuserhere
8) Restart the service
    $ sudo /etc/init.d/ssh restart

Saturday, October 3, 2009

HttpUtility.ParseQueryString save the day...

Imagine when coding, you're getting a querystring as a parameter in string format with something like "studentid=1024&stateid=12&zipcode=90210&editmode=false". To manipulate the zip code value how would you normally do?

Guess what, I'll blindly do a string manipulation to get or update the value. This is inefficient (on second thought, I feel like I'm stupid). I just noticed that there's an easy way available in .NET Framework that will make my life easier. It's available since .NET Framework 2.0!!! HttpUtility.ParseQueryString definitely save me from headache.

Sample code:
    private void SomeFunction()
{
const string queryString = "studentid=1024&stateid=12&zipcode=90210&editmode=false";

// Parses a query string into a NameValueCollection using UTF8 encoding.
var collection = HttpUtility.ParseQueryString(queryString);

// Original value
Console.WriteLine("original value in string format : ");
Console.WriteLine("{0}", collection);

// Get existing value
Console.WriteLine("existing value : {0}", collection.Get("zipcode"));

// Set new value
collection.Set("zipcode", "10001");

// Display the new value
Console.WriteLine("updated value : {0}", collection.Get("zipcode"));

// Convert back to string
Console.WriteLine("value in string format");
Console.WriteLine("{0}", collection);
}
Here's the output:
    original value in string format :
studentid=1024&stateid=12&zipcode=90210&editmode=false
existing value : 90210
updated value : 10001
value in string format
studentid=1024&stateid=12&zipcode=10001&editmode=false
Press any key to continue . . .

Friday, October 2, 2009

Finally, the winner is...Puppy Linux...

An old post from my lost blog.

Puppy Linux 4.0


I've been looking for a suitable distro to be install onto an old desktop/laptop. Started with DSL, Fluxbuntu, Xubuntu and UbuntuLite. Xubuntu is not suitable if you have ram less than 192Mb. As for DSL and Fluxbuntu, using Fluxbox as a window manager is sort of disadvantage for my targeted user. UbuntuLite doesn't come with a LiveCD for me to show a demo and multimedia codecs by default once I've installed it. It'll be troublesome in case if there's no internet connection available.

JWM window manager


Then Puppy Linux came to the picture. It came with JWM window manager, which is something similar to Windows (again, I'm talking about from end user perspective) and according to Wikipedia, it is possible to run Puppy Linux on a PC with only 48Mb of ram. I've tested it on my neighbour's old laptop (TwinHead Slimnote VX with 192Mb ram with Intel Pentium II 300Mhz) and it works flawlessly. The .ISO image is quite small which is about 87Mb. Don't underestimate something that comes with a smaller size. Once installed, everything works perfectly including multimedia codecs and web browser plugins.

SeaMonkey web browser


This is a perfect solution (at least for me), to promote Linux to my friends and family, especially those with an old machine and no internet connection available. DivX and mp3 files can be play out of the box. All I can say is...I'm very happy with the distro :D



Thursday, October 1, 2009

System.Net.NetworkInformation...

An old post from my lost blog.

My brother was asking for help on how to get the information from network interface so that it can be use to monitor the network activity. I did some googling and I've found this piece of code. Simple enough but can be very useful if we expand it further.
    private static void GetNetworkInfo()
    {
        NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();

        if (NetworkInterface.GetIsNetworkAvailable())
        {
            foreach (NetworkInterface iface in interfaces)
            {
                if (iface.OperationalStatus == OperationalStatus.Up && iface.NetworkInterfaceType != NetworkInterfaceType.Loopback)
                {
                    IPv4InterfaceStatistics stats = iface.GetIPv4Statistics();

                    long newsentbytes = stats.BytesSent;
                    long newreceivedbytes = stats.BytesReceived;

                    long sentbytes = newsentbytes - (oldsentbytes == 0 ? newsentbytes : oldsentbytes);
                    long receivedbytes = newreceivedbytes - (oldreceivedbytes == 0 ? newreceivedbytes : oldreceivedbytes);

                    Console.WriteLine("Bytes sent: {0}", sentbytes.ToString());
                    Console.WriteLine("Bytes received: {0}", receivedbytes.ToString());

                    oldsentbytes = newsentbytes;
                    oldreceivedbytes = newreceivedbytes;
                }
            }
        }
    }