Saturday, December 24, 2011

NAS my drive

Internet can be found in almost any home today, and as the demand for wireless access rise, so does the demand for portability rise. As a result, electronic manufacturers prefer using flash drives than using standard rotating drives.
Why?
  • Ultra-fast response time and speed – You can check out my experience using Solid-State drives and see how fast they really are.
  • State of the art technology – Standard rotating drives and SSD drives have been around for more than half a century, but while rotating drives have changed very little over the years, SSDs were an ever changing platform, which brought into consumers mind only a few years back. Let’s face it folks, as we see it today, we’re marching into an SSD world, so using this kind of tech seems only logical
  • Shock resistance - Since handheld computers (tablets, netbooks etc.) are constantly moving, they’re more likely fall once or twice during their lifetime. While rotating drives can absorb up to 350G while operating and up to 1000G while not operating, SSD can withstand up to 1500G in either case.
  • Weight, power consumption– A standard SSD weighs approximately 50% less than a rotating drive, and consumes less power because it has no moving parts.
Why not?
The only trouble with SSD drives is their capacity. The bigger the capacity, the more it costs to manufacture it, so electronic companies tend to leave the user high and dry with a mere 64GB tops. In such cases, users would probably use another drive (external hard drive, flash drives etc.), but this beats the whole purpose of becoming completely portable.
Enters NAS – Network Attached Storage
A NAS unit is a computer or device that provides file-based data storage services to other devices on that network.
NAS Implementation
There are several main ways you can implement NAS at your network:
  1. Dedicated Server
  2. Standalone NAS device
  3. Wireless Access Point with NAS capabilities
Dedicated Server

Placing a dedicated NAS server on your network seems logical only if you’re an enterprise client tries to implement a NAS solution or a user with very high demands.

Advantages Disadvantages
Complete control over configuration High maintenance overhead
Expanding NAS array easily High cost: 200$ and up (depends on speed/capacity)

If you consider setting up a dedicated NAS server, you might want to check out a project called FreeNAS – an open source NAS operating system, based on FreeBSD
Standalone NAS device

For those of you who don’t want to mess around, this is the perfect solution.

Advantages Disadvantages
Easy to use interface Features may vary depending on the vendor
Almost no hassle with equipment Limited capacity
Connects via Ethernet & Wireless Price range: 140$-2500$ depends on features

For many, this is the ultimate solution for NAS. It has most of the required features, it can come with a RAID enabled configuration, and fairly easy to install. The only concern is the cost, which can sometimes go up to 2500$.

If you’re after a cheap solution, check out Western Digital My Book Live Personal Cloud Storage

Wireless Access Point with NAS capabilities

Since the vast majority of users already own a wireless access point, it’s safe to assume most of them already have unexploited NAS capabilities.

Advantages Disadvantages
Integrates to your current network Internet speed can be influenced
Low cost: 140$ to 500GB Basic interface
Support several drive sizes Storage capacity is limited to 2TB
USB port exist in most access points Mostly USB 2.0, sometimes not enough

Because of the floods in Thailand, most hard drive vendors suffered damages. The price should drop in the next few months, allowing this option to become even more appealing.

Sometimes, USB 2.0 is not enough, and if you used a high speed hard drive, and want to exploit the full benefits from its speed, you’ll have to invest in a wireless access point that comes with a USB 3.0 port. Just to get you started, you can check out D-Link media router

Cheers q[^_^]p

Saturday, December 10, 2011

TRIM For the masses

A TRIM command, allows an operating system to inform a solid-state drive (SSD) which blocks of data are no longer considered in use and can be wiped internally. TRIM was introduced soon after SSDs started to become an affordable alternative to traditional hard disks. Because low-level operation of SSDs differs significantly from traditional hard disks, the typical way in which operating systems handle operations like deletes and formats resulted in unanticipated progressive performance degradation of write operations on SSDs. TRIM enables the SSD to handle garbage collection overhead, that would otherwise significantly slow down future write operations to the involved blocks, in advance.

More recent SSDs will often contain internal idle/background garbage collection mechanisms that work independently of TRIM; although this successfully maintains their performance even under operating systems that do not support TRIM, it has the associated drawbacks of increased write amplification and wear of the flash cells.

What’s it for?

The TRIM command is designed to enable the operating system to notify the SSD of which pages of data are now invalid due to erases by the user or operating system itself. During a delete operation the OS will not only mark the sectors as free for new data, but it will also send a TRIM command to the SSD with the associated flash cell to be marked as no longer valid. After that point the SSD knows not to relocate the data in those flash cells during garbage collection. This will result in fewer writes to the flash enabling a lower write amplification and longer endurance. Different SSDs will act on the TRIM command somewhat differently so the final performance can also be different between different SSDs. As the command completely purges the data it affects, typical data recovery is made impossible.

TRIM was firstly introduced to Windows users back in 2009 along with the release of Windows 7 and Windows Server 2008 R2.

If Windows detects the presence of an SSD drive, it should automatically disable several services in order to optimize performance. While this may be true, users keep argue about which settings should be changed to optimize performance.

Tips and tricks

After owning three SSD drives (two OCZ Vertex2 and an OCZ Agility3), I thought it might be a good idea to share some insights and some of my experience in configuring those settings.

1. Make sure you have the latest firmware – Drive vendors often don’t take any responsibility for data loss while upgrading firmware. Also, if you consider making the SSD your operating system drive bear in mind, you won’t be able to upgrade your firmware since this operation is not supported, so this should be the first thing to do. There are sometimes issues with the Intel Rapid Storage Managerso make sure you read the firmware release notes before making any changes, some versions are better and more compatible then others.

2. Set your disk controller to AHCI mode – AHCI stands for Advanced Host Controller Interface, allows using legacy IDE or ATA mode in SATA drives. Usually this prevents from installing proper disk controller drivers which in many cases will result in reduced performance, so this step is crucial.

3. Install the latest storage drivers – if your system includes an Intel SATA controller, you should use the most recent version of the Intel Rapid Storage Technology driver, which is located here

4. Install SSD Tweaker to automatically configure all related settings and optimize performance.

5. Although the TRIM command should work automatically with Windows 7, it sometimes can be a bit “lazy”. For those of you who have Windows 7 with SSD and feel the drive could use some freshen-up, check out a little app called ForceTrim. This tool is not supported with RAID.  ForceTrim will force the drive to go over all free flash cells and use the TRIM command on every cell that is marked for deletion. It should work on any vendor. Make sure you run ForceTrim as Administrator.

6. Monitor your drive’s health using a monitor tool such as CrystalDiskInfo

Final notes

If you’re like me, and want to keep the drive in ship-shape at all times, you can schedule the program to be launched every week from command line using:

schtasks /Create /SC WEEKLY /D SUN /TN ForceTrim /ST 00:00 /TR "C:\ForceTrim.exe C"

This will schedule ForceTrim to run every Sunday at midnight and optimize drive C

Cheers q[^_^]p

Sunday, November 13, 2011

SSD – Encrypted Sold State Drive

About 6 months ago, I’ve decided to upgrade my laptop (see specs below) and purchase an SSD as my operating system drive.
For those of you who don’t know SSD, stands for Solid State Drive, Is a new form of data storage of hard drives. Similar to a USB storage device, an SSD uses a single/multiple chips to store data. Because of this, SSD is superior to Hard-Drives (or H.D.D) in several fashions:
  • It allows faster data transfer rates – While a High-End SATA3 desktop H.D.D today can reach up to a maximum of 150MBp/s read/write, an average SATA3 SSD drive can reach a whopping 500MBp/s read/write
  • It allows faster access times –Hard drives access time can go as low as 6 milliseconds, while an average SSD will reach 0.6 milliseconds easily
  • More durable and shock resistant – Having no moving parts, SSDs are able to absorb shocks 10 times stronger without being damaged (Standard H.D.D has a 150G, SSD has more than 1500G in some cases), in other words, if you had a 50 meter SATA cable, and you’d throw off a 50 meter building both an H.D.D and a SSD, while active, the SSD will have no problems operating, while the H.D.D may have write failures or even stop working for a little while.
  • Better support in Allocation Unit Size – While Hard Drives are just going passed 4k, SSD can support up to 8MB which can improve file access times and file transfer rates if the drive stores large files mostly.
While the above features will probably be familiar to most SSD users, there’s one added feature that up until now was a bit sneaky: Real-time Drive Encryption.
At its first boot, the drive generates a random number, and with that number, the drive use encrypts the data before it goes into the chip. In order to access the data, the drive sends a signal with the pre-generated random number, and only after approval can the operating system read/write from the chip. According to the manufacturers, this random number is not stored anywhere on the SSD to prevent unauthorized access to the data.
Although you might think this is an advantage, this actually works a double-edged sword: in case your SSD suffers physical damage (suffers electric surge, heavy beating, deep fried in oil, etc.), the data will be significantly harder to extract. Thanks to its encryption, your data will be secured behind a AES 128-256 bit encryption (depends on the model, newer ones such as the OCZ Agility 3 have the 256 bit support), or even worse, you can’t disable this feature.
In my case, I’ve purchased the award winning Vertex-2 from OCZ. The drive was crazy fast until suddenly one day it stopped working: Windows had trouble booting, rebooted and the BIOS was unable to detect the drives, despite my efforts. I turned to a recovery company in attempt to save some of the data, but they told me since the data is secured, and charged 8 times more for the extraction.
My lesson, and I hope whoever reads this may benefit from my experience, backup your stuff: External drives, NAS, Flash drives, Cloud storage or whatnot. Never compromise!
Cheers q[^_^]p

Tuesday, October 4, 2011

What time is it?

Digging about Windows features a bit, I found Windows could also be used as an NTP server, and since I’ve been working on a native Windows environment lately, those are great news :)

Among other ways, there are two main ways Windows could set a remote clock:

  1. Via DC - If remote computer is in a domain, the DC (Domain Controller) is responsible of setting the time
  2. Via DHCP – if the remote machine has an active DHCP client, Windows can also send the clock via internal clock or fetch the time from a remote NTP server and return the current time to the remote machine.

This article is divided into two groups:

  • Windows 2000
  • Windows XP/Vista/2003/2008/7

The reason for this division is because Microsoft had changed the Windows Registry values since Windows 2000 (XP and up has much more granularity now), and that using XP and up machines with a Domain Controller turns on this feature by default.

Configuring Windows 2000 to act as an NTP server
  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following registry subkey:

    HKEY LOCAL MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters

  3. In the right pane, right-click ReliableTimeSource, and then click Modify.
  4. In Edit DWORD Value, type 1 in the Value data box, and then click OK.
  5. Locate and then click the following registry subkey:

    HKEY LOCAL MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters

  6. In the right pane, right-click LocalNTP, and then click Modify.
  7. In Edit DWORD Value, type 1 in the Value data box, and then click OK.
  8. Quit Registry Editor.
  9. At the command prompt, type the following command to restart the Windows Time service, and then press ENTER:

    net stop w32time && net start w32time

  10. Run the following command on all the computers other than the Time Server to reset the local computer's time against the Time Server:

    w32tm –s

Configuring Windows Windows XP/Vista/2003/2008/7 to act as an NTP server
  1. Create a text file and the file format to reg
  2. Open the file in notepad and copy the following:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\TimeProviders\NtpServer]
    "Enabled"=dword:00000001

  3. Save the file and execute it
  4. At the command prompt, type the following command to restart the Windows Time service, and then press ENTER:
  5. net stop w32time && net start w32time
  6. Run the following command on all the computers other than the Time Server to reset the local computer's time against the Time Server:
  7. w32tm –s

More information could be found in the below links from Microsoft:

Windows 2000

Windows XP/Vista/2003/2008/7

Have fun ^_^

Saturday, October 1, 2011

(90%) Gone in 60 seconds

I've decided that I need a software that could lock a folder in my machine. On one hand, Since the open source software out there to deal with locking folders lack a GUI I like (and I'm a sucker for GUI eye candies), and on the other hand I'm just too lazy to write a kernel driver to hook to SSDT and use NewNtQueryDirectoryFile()  (kernel32.dll).

Enters Folder Lock from NewSoftwares, with an easy to use GUI, great features with a matching price - 50$

As much as I like supporting developers, 50$ was too rich for my blood so I’ve decided to remove it, and by doing that accidently found a way to get around the problem – TrialPay

TrialPay offers the product for free as long as you purchase something else from them.

Browsing a bit, I’ve found a game I like for 10$ before a 10% discount. To that add the fact that new users get a 50% off on their first purchase.

So instead of purchasing a 50$ worth of software I’ve ended up with a free software plus a nifty game for 4.5$… not too shabby :)

Think about it next time you’d want to buy a software online.

Cheers ^_^

Wednesday, September 28, 2011

Display driver amdkmdap has stopped responding and has recovered (say WHAT?!)

Yesterday i've encountered a strange error:
"Display driver amdkmdap has stopped responding and has recovered"

After a little bit of research it seems Windows (Only Vista SP1 and 7) display drivers have an issue with the TDR (Timeout and Detection Recovery) mechanism.

While both Nvidia and ATI drivers had suffered from this issue, it seems Nvidia had successfully managed to overcome it, while ATI still hasn't.

Using TDR, "Windows attempts to detect problematic hang situations and recover a responsive desktop dynamically... If the GPU cannot complete or preempt the current task within the configured TDR timeout, then the GPU is diagnosed as hung" ~ Microsoft.

That sucks... and if you have a power supply that couldn't provide enough energy to your display adapter this will probably happen often, eventually causing your computer to reboot.
So what can you do?

Well, this is a false positive alert in most cases. You can disable the TDR mechanism completely using this quick fix:Copy paste the below text into notepad and save it with a .reg suffix, then execute it.

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers]"TdrLevel"=dword:00000000

This should reduce the rate of this errors significantly if not solve the problem.

Cheers q[^_^]p

Saturday, September 24, 2011

How to make your Orange Cellular modem SIM free (or how can you save two business days)

After putting up with low speeds, high latency and bad reception from my Orange operator I’ve decided to move to Pelephone (which has the BEST coverage in the country in case you didn’t know).

While purchasing, I was presented with only one option:
Buy a Cell modem + Sim for 99 NIS/Month - The deal consists of 9.99 NIS for Sim and a whopping 80 NIS for the Cell modem. In exchange you’ll get 5GB traffic with 3.6MBp/s and 200KBp/s for the rest of the month.

For all of you who don’t know, if you already have a Cell modem like me Pelephone offers a smaller package of 1GB of traffic with 7.6MBp/s and 200KBp/s for the rest of the month for only 45 NIS, no package , no commitment for more than one month, pay as you go. The only issue is that this offer only applies for those with an iPad… and Pelephone are really strict and verifies if you have and iPad or not:

Seller: “Do you have an iPad”
Me: “Sure”
Seller: “Good enough for me”

After purchasing this package I faced a different problem, my Option iCON 225 was SIM locked and I had to unlock it to use the Pelephone SIM.A short conversation with an Orange representative discovered the bitter truth: one must place the modem in customer service for two days for it to be unlocked.I enjoy wasting my time like the next guy, but something told me there’s another way so I kicked the guy over the 25-yard line (laces out, of course) and used some Google-FuAs it turns out, someone had already wrote a Python module for unlocking Option iCON 225 so no much work had to be done.

Simply follow the instructions in the link below and you’ll be good to go:http://dogber1.blogspot.com/2010/01/unlocker-for-option-gio225.html

There will be two modules:Msm_unlock – This will load a new firmware to your modem and generates a new unlock codeMsm_apply – This will use the generated unlock code and turn your modem to SIM free

C:\msm-unlock-v1.6>msm_apply.py
msm_apply.py v1.6
Copyright (c) 2009 dogbert <dogber1>, http://dogber1.blogspot.com</dogber1>
This scripts applies the unlock code of Option 3G modems (Icon 225).
Searching for serial ports...
Application serial port: COM3
Please enter the unlock code:
45668462
Unlocking modem...
Disabled PN lock
Unlock successful.
done.

Two days saved ^_^
Update:A month after unlocking the modem, it will start acting a bit funny and won't connect to the new APN.Simply change the APN back, log using your previous SIM and change the APN and SIM back

Saturday, September 17, 2011

Easily downloading videos from YouTube

 
A bit frustrated from my internet connection, i mean, 15Mbp/s are all fun and games, but watching video clips, trailers etc on YouTube is slow (and if you take into account i only use HD it's mega-slow).

You can use tools such as SpeedBit to download the files, but they don't support HD for free and charge a yearly subscription of 15$ :-O

Using WireShark and a simple download manager such as FlashGet or even Wget you can download files from YouTube

After launching WireShark with your captured HTTP stream, look for a GET request to a relative path starting with /videoplayback.

Then start constructing your request:http://Host_Header/Get_Request
Configure your download manager to use the User-Agent you browser use (http://whatsmyuseragent.com/) and then pass that request to your download manager to start the download.

Note: This is relevant for all resolutions (up to 1080p)

Happy sniffing ^_^

Monday, September 5, 2011

Ubuntu/Windows Dual boot, still not perfect...

Even if you put away all the nifty things Natty Narwhal (Ubuntu 11.04) has to offer you can still feel it's not as complete as it should be.
  • Unity has some GUI issues that needs to be solved
  • Battery consumption is bad, and power saving options are too simple
  • P&P is not always P&P but Plug-wait-install-configure-Play
But 11.04 IS a major leap forward with much better hardware support, Gnome 3 and Unity, TRIM, LibreOffice,convinient-then-ever dual-boot installation and its blazing fast performance.
Installed mine on the SSD on top of Windows 7 at the same partition (the installation process is great btw) But as it turns out, using a dual-boot will increase your power consumption for some reason.
Before the installation, i could last exactly 5:45 hours while (see specs below) working only on my SSD (Wifi,documents, music with 100% brightness, which is a bit harsher then Apples' benchmark for their laptops for all you iLovers)

After installation Ubuntu lasted only 2:30 hours with the same settings while Windows lasted 4:45.
Uninstalling Ubuntu brought the power consumption back to normal.

Btw, if you ARE considering using dual-boot with Ubuntu, keep in mind that in order to uninstall you'll have to restore your MBR using the Windows Repair Disc (just type create in the start menu), and snatch it back from the "evil" GRUB.

Boot from the repair disc, and while in the main menu, choose Command Prompt and type:
bootrec /FixMBR
bootrec /FixBoot
bootrec /RebuildBCD
reboot and GRUB will be removed from boot, and Windows will be back to normal.

Specs:
Dell Vostro 3700
CPU: Core i7 720-QM, 1.6Ghz, 2.8Ghz w/TB
Mem: 6Gb DDR-3 1333Mhz
GPU: Geforce 330GT 1GB Dedicated Memory
8-Cell battery
H.D.D-Storage: WD 500Gb 7200rpm
H.D.D-Boot: OCZ Vertex-2 60Gb

Cheers q[^_^]p