wget – Prebuilt binary for Mac OSX Lion and Snow Leopard

I love wget. Its simplicity, speed, and small size. I use wget all the time on my linux boxes, and on my macs. Sadly, there are no new binarys of wget for Mac, so you’ll have to build them yourself. This involves downloading Xcode, a massive beast with a size of over 2 GB, and compiling wget from source. It feels like such a waste to have to go through such a hassle just to compile wget. I’ve therefore compiled wget for you, and I’m distrbuting the binary file.

The version that was compiled is the greatest stable release as of now, version 1.9.1, and was compiled by Xcode version 4.1 It was compiled and tested on Mac OSX Lion, and might or might not work on Mac OSX Snow Leopard.

Update 18/08-2011:
The binary has been confirmed to work on Snow Leopard, but you might have to mark it as an executable. The can be done via the terminal, and the command “chmod +x wget”.

Wget for Mac can be downloaded here.

Copy files from computer to computer securely using SCP – A short guide

SCP is a program that enables you to copy a file from one machine to another using an encrypted SSH stream. This makes sure that no-one can read or alter your data while it’s been transmitted. I regulary use this to copy files from my university to my apartment in a secure manner.  You can also use SCP to pull a file remotely to your client. This basic command copies a file from your client to a remote host.

$scp report.doc username@remotehost.com:/directory/subdir

This code will connect via a secure encrypted channel. Change “host.net” to either to the domain or ip adress where you wish to store your files. You will also have to supply a username. In this case, the file will be written to the “/directory/subdir”, relative to root. Note that the you specify needs to have write access to the folder you’re trying to write to. It’s not recommended to use root user as the user for the “receiving” end.

The following code shows how to copy an entire folder recursively, IE including sub dirs.

$scp -r /path/local/directory username@remotehost.com:/path/remote/directory

I’ve now shown your how to copy a file or folder from your computer to a remote host, but what if you want pull a remote file or folder?

scp -r username@remotehost.com:/path/remote/directory /path/local/directory

You can also copy a remote file/folder to a remote host:

scp username@remotehost1.com:/path/remote/host1/file.txt username@remotehost2.com:/path/remote/host2/

You can also compress files on the fly in order to minimize the data needed to be sent. Note that this method doesn’t work well with file already compress, like a video file. It does, however, work very well for text based files or some database setup.

scp -C /path/local/directory username@remotehost.com:file.txt

Monitoring harddrive write and reads individual processes and programs in Ubuntu/Debian using iotops

iotop in an application that enables you to monitor the hard drive write and reads for individual processes, much like in the same way top monitors cpu/memory usage. iotop can easily be installed in Ubuntu, or other Debian based distros by entering this command in a terminal:

sudo apt-get install iotop

iotop can only run under a Linux 2.6.20 or later kernel built with the CONFIG_TASKSTATS, CONFIG_TASK_DELAY_ACCT, CONFIG_TASK_IO_ACCOUNTING and CONFIG_VM_EVENT_COUNTERS build config options on.

Screenshot

iotop measuring disk read and writes

Monitoring bandwidth usage of individual processes and programs in Ubuntu/Debian using NetHogs

Have you ever wondered what programs/processes  are using your bandwidth, and at what rate? With NetHogs, this is very easy. NetHogs groups the usage by processes so you at a glance can see what is using bandwidth.  NetHogs version 0.5 supports both IPv4 and IPv6, and both Ethernet and PPP.

The program can easily be installed using the standard repos of most distributions based on Debian, such as Ubuntu. To install NetHogs simply issue the following command in terminal:

sudo apt-get install nethogs

NetHogs is launched by issuing the following command in the terminal

sudo nethogs eth0

where eth0 corresponds to the network interface you want to monitor.

Screenshot


Using and mounting a RAM disk in Ubuntu – The easy way

Conventional hard drives are great for storing large amounts of information at low-cost, but their speed is not that great.  A SSD boosts the speed to extreme levels in comparison, but they’re still quite expensive. By storing data on a RAM disk, you can get more than the speed of an SSD, without paying the extra cost for  the SSD. A RAM disk stores the information on the system memory it self, which is very fast, usually many times faster than the most expensive SSDs. This is great if you need to process a large amount of information or lots of files at great speeds. This speed increase comes from two things:

1 – The CPU can directly access the files on the RAM chips. Such can’t be done with conventional hard drives or SSDs

2 – The seek time, the time it takes to actually find where the files are located on the storage media, is inherently a lot lower on RAM chips than on mechanical hard drives.

By default Ubuntu has RAM disk that is mounted on /dev/shm/ directory. You can copy/move files to that directory and use that as the RAM disk. This is particularly useful for use-cases where you need to read or write large amounts of data fast, and further processes these. I usually use the RAM disk for reading and consolidating large amount of text divided among many files. This results in a great increase in speed for such applications.

You should not exceed the amount of RAM on your system while using this approach since it will force your PC to swap the data to the hard drive, leading to a loss of speed. System crashes might also happen when you exceed the amount of RAM in your system. It is therefore a good practice to set an upper limit of how much you can store on your RAM disk. The code below shows how this can be done.

mkdir -p /tmp/ram

sudo mount -t tmpfs -o size=512M tmpfs /tmp/ram


This code snippet creates a directory, and mounts it in the RAM. The size

argument here can be adjusted to your needs.

Sad FreeNAS Box

As my earlier post stated, I bought a new CPU to replace the old one, which I suspected was the culprit behind all the checksum errors.  The problem is still persisting. The box is still throwing new checksum errors. I’m starting to suspect that my RAM might be the problem here. I’ll swap them out alternately with another pair I’ve got lying around trying to pin point which of the sticks is fried. I’m also considering running MemTest for a few hours, to see those tests throw any errors. I’ve been living without the FreeNAS server for almost a month now. The transition from storing and fetching everything from central server, to using memory sticks and other means of transferring the data, has been rather hard. I’m hoping to get the box back online soon.

Bringing the FreeNAS Box back to life

A few months ago my beloved FreeNAS Boxed died on me. I was running a ZFS Raidz based system, with a redundancy level similar to a Raid5 setup. The box behaved strangely for a few months after the initial setup, but soon some files on the shared folder refused to load in VLC, giving me read error. After checking the log and status of the ZFS pool, I saw a bunch of checksum error. First I thought one of my disks were dying, but after a closer inspection I noticed that all the disks gave checksum errors. I tried to move the disks to another machine, and reloaded the config files. After a few days of usage I could not see any new checksum errors, so the disks were obviously fine. A closer inspection of the log files showed that Core 1 of the dual core CPU was throwing errors.  It looks like the CPU is not working properly. I moved the disks back to the original server, since I needed the other computer for something else. The FreeNAS box has been dead since. A week ago I ordered a new CPU, and has just installed this. I hope this will resolve the problems I´ve been having. Time will tell.

Self-inflicted Rick Roll

Now and then I look through my old bookmarks. I have a bad habit, I usually don’t label them, or even name them. So my list of bookmarks consists of a whole bunch of URLs. Here the other day I went on my bi-monthly bookmark safari, randomly clicking at unlabeled and un-named bookmarks. One of them was a bookmark for a Rick Roll video.

Long story short: I manged to Rick Roll myself. Big time.

iPad 2 – Why not?

I’ve considered getting an iPad lately. A few days ago I voiced this thought to my friends, who completely raged. Funny thing with Apple products, they spark love, or hate. Either you’re a fierce hater of Apple products, or you love them. Back to my friends. They could not belive that I was considering buying such an, and I quote: “Overpriced, no-use, luxury, closed in, and piece of shit”-product. They promptly suggested that I rather should buy a Samsung Galaxy Tab, or even the Xoom, which has yet to hit the stores btw. Let’s study this statements, shall we?

Price

One of the most used arguments against buying an iPad it its price tag, some people seem to believe that its way to overpriced to for a tablet you should consider buying.  The low-end iPad, 16 GB WiFi edition, comes in  at 499$. The Samsung Galaxy Tab is priced at 600$ dollars. Already the iPad wins hands down. Of course, you can’t make cellphone calls with an iPad, but let’s face it; who want to hold a 7 inch device with one hand while making a call? Come on, it looks ridiculously, and is rather unpractical. Yes, I’m aware that the Galaxy Tab has inbuilt 3G network, and the iPad price quoted is for a model without 3G. The most affordable iPad 3G model comes in at 629$, so it’s a whopping 29$ more expensive than the Galaxy Tab. Rather anti climatic ey?

Closed ecosystem

Another much used argument against the iPad, and other iOS products, is that Apple has its fat iron fist wrapped around all these products. No app is allowed to go live on the App Store before it has been Apple approved. Apple is also known for declining apps which replace, or replicate core functionality of the iOS system. Still, despite the strict regime of Apple, the App Store is filled with apps, both useful and not-so-useful. As of this writing, the App Store has more than 350 000 apps, and over 10 000 000 000 (Yeah, three are that many zeroes) total downloads [Source]. Most of these apps are designed with the iPhone and iPad touch in mind, but will run on the iPad. There are also more than 30 000 apps specifically made for the iPad. The Android Market on the other hand, which is 100% free, anyone can submit an app, has less than 100 native apps for Android powered tablets [Source]. So, you have to choose between buying  an iPad, with a closed in ecosystem, but with more than 30 000 apps made for the iPad, or buy an Android powered tablet with less than 100 native apps? I do grasp the ideological arguments people make against Apples app policy, but come on? 30 000+ apps vs less than 100? Those numbers outweigh  the agony of Apple ruling with its iron fist.

Browsing

iPad 2 wins hands down

Smaller numbers are better

When the iPhone was first launched, it revolutionized the mobile browsing experience. The ease of use, and the quality of the Safari web browser stumped all other mobile browsers on the market. This is still the trend. As you can see by this benchmark [Source] the iPad’s browser has a superior JavaScript performance compared to the Samsung Galaxy tab. One should however note that the Android OS was winning this benchmark until Apple released the iOS 4.3, which featured an updated and optimized JavaScript engine.  The only real downside with the Safari mobile web browser used by the iOS, is the lack of flash. Apple has refused to build this in, criticizing its bad performance, and extreme power draw. Some tests showed that using flash enabled bowers more than halved the usage time of mobile products due to the increased power draw.

It would of course be nice to have a flash enabled web browser, since most sites still contain flash elements, even tho they’re moving over to HTML 5 based elements, which the iOS supports. Apple could add this support, and include an easy toggle for people to either turn on or off flash support in on their iOS products.

Performance

People owning tablets use them for more than browsing and checking their mail. Games on tablets is a marked in strong growth. Customers are demanding more and more life-like graphics. To do all this, you need your tablet to be able to render a lot of data quickly

The following benchmark [Source] shows that the new iPad 2 is more than twice as fast at the yet not released Motorola Xoom. The iPad is clearly winning this one. Not only does it have to power to render high detail game, its App Store also has apps and games which leverage this power. Among these games is Infinity Blade by Epic Games. The game was originally released to showcase the power of the iPad, but has grown to become a popular game on the iPad. The game has now been updated to take advantage of the much more powerful iPad 2, and the results are stunning. A gallery showing the crisp graphics can be seen here [Touch Arcade].

Software support

When Android was first released it was thought of the start a new era for mobile OSes. Google allowed manufacturers to take advantage of the open source Android, and add their own flavour. Soon the Android scene got fragmented with different user interfaces, widgets and so on. The manufactures are in a never-ending race to produce more and more stunning visuals for their phones. Sadly this has  created a problem for Android users. When a new Android version comes out, the manufactures tend to release new phones with the new Android version, leaving customers with older handsets out in the cold.  If you want a phone with the new Android version, you might need to invest in a new mobile phone.  This quickly gets expensive.  Apple on the other hand has a track record for updating older iOS devices with new iOS versions when they’re released. This means that you with an iPad can be guaranteed to get updates from Apple for 2-3 years, most likely for free.

Conclusion

I will most likely buy an iPad and not an Android powered tablet in the future. Not because the iPad is hip, not because it has an Apple logo on it. Not because I’m a fanboy. I will however by an iPad because it is in my opinion a superior product compared to Android based tablets.

What do you guys think? Is the iPad the best tablet, or will Android tablets evolve over time to take the lead?