September 5, 2010


It's one of the common Linux mistakes: forgetting to place the /home directory in a separate partition. It's not a critical failture, but it does give you a bit more safety and security. If the latest upgrade turns to custard or you accidentally trash something vital, you can simply reinstall the operating system knowing that all your user data, settings, etc. will remain untouched.

There's also a school of thought that says it means you can use the same user account when installing multiple distributions, but I'm a little hesitant here. Certainly you can use the same /home partition, but I'd suggest setting up different user accounts as there are sometimes subtle differences in program settings that don't translate well between different distros.


Making room

The first step is finding somewhere to put it, and that usually means adding a partition to the current drive. (That doesn't have to be the case of course. You could add it to a second drive, but you're still likely to want to partition the disk, so carry on.)

Obviously you can't repartition a drive you're currently working in so you'll need an appropriate bootable tool. For this I reccommend the System Rescue CD from www.sysresccd.org. I'll admit it's a little bit of overkill as it has tons more tools than just partitioning, but SysRescue is so useful I reckon it should be in everyone's toolbox.



Once you're into the GUI, start GParted from the menu and you'll get a screen like this.

OK, how much space do you give your new /home? That depends on you and the size of your hard disk, but as an indication, 70% of the 15GB I allocated to the / (root) partition on my main machine has been used (and I have lot installed!), so all the rest is /home. If it turns out you want more or less for any particular partition, changing things is just a SysRescue boot away.


Here I've resized the first partition and added a new /home.


Movin' it

Now we need to move the /home folder to it's new location. For this we'll use the command line so switch to SysRescue's Terminal.

Before we can do anything, we need to create mount points for the two partitions:  
mkdir /mnt/part1 /mnt/part2

and mount them  
mount /dev/sda1 /mnt/part1
mount /dev/sda2 /mnt/part2

Note that the /dev (short for "device") settings comes from GParted. Yours may be different!

If you now travel to the first mounted partition ...
 
cd /mnt/part1

... and list its contents ...  
ls

... you should get a display like the following:
bin   cdrom  etc   homee       lib         media  opt   root  selinux  sys 
boot  dev    home  initrd.img  lost+found  mnt    proc  sbin  srv      tmp

It's now simply a matter of copying the contents of the /home
folder from one partition to the other:  
cp -av home /mnt/part2

Note that we're only copying the contents. The next step will mount and use that copy but if anything goes wrong, simply back out the next step and you'll be back where you were with a bootable disk.



Telling it where to go

There's one final step. We need to tell the root partition where the new /home partition now resides. We do this by editing root's file system table /etc/fstab. SysRescue has a built-in GUI editor called Geany so let's use that:  
geany /mnt/part1/etc/fstab

Add a line like the following:  
/dev/sda2 /home ext4 defaults 0 2

What does that all mean?
/dev/sda2 is the device name
/home
is the mount point
ext4
is the partition type
defaults are mount options
0 is the dump frequency (disabled)
2 indicates the partition should be checked for errors at boot time after / (root) has been checked.

Save the file and we're done. Shut down SysRescue, reboot.

As a final check, run
df -h

to see where your filesystems are mounted 
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              15G  9.7G  4.1G  71% /
/dev/sda2              97G 22.1G 75.6G  22% /home


Now enjoy your new /home!


Previous Hidden Linux


Follow Geoff Palmer on Twitter

August 29, 2010

The Electronic Frontier Foundation (EFF) are labelling Apple's latest patent application "traitorware" ...

While users were celebrating the new jailbreaking and unlocking exemptions, Apple was quietly preparing to apply for a patent  on technology that, among other things, would allow Apple to identify and punish users who take advantage of those exemptions or otherwise tinker with their devices. This patent application does nothing short of providing a roadmap for how Apple can — and presumably will — spy on its customers and control the way its customers use Apple products.

Ostensibly designed to respond to the loss of a phone it will give them the ability to;
  • Take a picture of your face "without a flash, any noise, or any indication that a picture is being taken to prevent the current user from knowing he is being photographed".
  • Record your voice, whether or not you're even making a call.
  • Determine your individual heartbeat "signature"(!)
  • Monitor all internet activity and record "any communication packets that are served to the electronic device".

The EFF are calling it "downright creepy and invasive". "Spyware, and its new cousin traitorware, will hurt customers and companies alike — Apple should shelve this idea before it backfires on both it and its customers," they say.

The patent's here.

Follow Geoff Palmer on Twitter

August 24, 2010


I've always been a sucker for the latest download, especially when it comes to KDE, so I was pleased to discover this multi-distro compendium of How to Install KDE 4.5 on MakeTechEasier. You'll find directions on how to upgrade Kubuntu, Mandriva, OpenSuse, Fedora, Slackware, Gentoo, PCLinuxOS and Linux Mint, so what are you waiting for?

And while the upgraded packages are downloading, check out this preview of what you'll find in this release.

Follow Geoff Palmer on Twitter

August 19, 2010



Most people believe that Google is a search engine company. It's not. It's an advertising agency that just happens to own the world's most successful search engine, and every time you use that search engine, they learn a little more about you.

If you're like most internet users, Google knows more about you than you might be comfortable with. Whether you were logged in to a Google account or not, they know everything you've ever searched for, what search results you clicked on, what news you read, and every place you've ever gotten directions to. Most of the time, thanks to things like Google Analytics, they even know which websites you visited that you didn't reach through Google.

If you use Gmail, they know the content of every email you've ever sent or received, whether you've deleted it or not. They know who your friends are, where you live, where you work, and where you spend your free time. They know about your health, your love life, and your political leanings. These days they are even branching out into collecting your realtime GPS location and your DNS lookups. In short, not only do they know a lot about what you're doing, they also have significant insight into what you're thinking.

Back in April a hacker by the name of Moxie Marlinspike came out with a Firefox addon called GoogleSharing to throw a spanner in Google's works.

The addon watches for requests for Google services such as Search and transparently redirects them to a GoogleSharing proxy server. The server contains a pool of fictitious "identities" -- including cookies -- which are used in place of any personal data you might be unwittingly supplying. The altered request is forwarded to Google, and the response proxied back to you. It all happens swiftly and transparently.

There's a few other clever wrinkles. Pooling all traffic and constantly switching identities makes even the proxy server's traffic hard to analyze, and on top of that the proxy constantly injects false but plausible search requests through all the identities it uses.

The result is that you can transparently use Google search, images, maps, products, news, etc... without Google being able to track you by IP address, Cookie, or any other identifying HTTP headers. And only your Google traffic is redirected. Everything else from your browser goes directly to its destination.

In operation, it simply requires a click on the Status Bar ...




... to enable or disable it. Brilliant!



Follow Geoff Palmer on Twitter

August 10, 2010

Flash cookies are nasty and pervasive. Most users aren't even aware they exist because they're tucked away in hidden files. (Full details here.) Browsers don't delete them because they're browser-independent, and even if you kill 'em the companies pushing them at you can respawn them. These "zombie cookies" -- so-called because they just keep coming back from the dead -- are currently the subject of a privacy lawsuit in the States.

All good horror film fans know that killing zombies isn't sufficient, you have to stop them coming back. And that's what we're about to do.

1: Find the zombies.
Open your file browser, go to the /home/your_user_name folder and switch on View Hidden Files. (In Konqueror and Dolphin you'll find this under the View menu item.) Scroll down and click on the .macromedia file. Under it you'll find a folder called Flash_Player and under that two more folders ...



If you click the expanders (those + signs) you'll find dozens of directories you didn't know you had, each containing a *.sol file. Those are the actual cookies.




2: Back 'em up
I'm always wary of just deleting stuff like this as some of it might be important. So instead of wiping it, let's just rename the folder. Right-click .macromedia and give it another name. .macromedia-ZOMBIES will do.




3: Create a link to zombie hell
Right-click in an empty area of your file browser, choose Create New and select Basic Link to File or Directory. Under File Name enter .macromedia and under File Path enter /dev/null .



/dev/null is Linux's black hole. Anything sent there is immediately discarded, but a report is sent back that the write operation was successful. That means that from now on anything writing to .macromedia gets told, "Yep, that was okay" when in fact it was nuked.

Right-clicking on the .macromedia file (it now looks like a file and not a folder) should make this clear. Choose Properties and you'll see where the file now really points. The command line makes it even clearer. Type ls -la and you'll find a line like this:



Now use Flash for a day or two. If you don't notice any effect, you can delete the .macromedia-ZOMBIES folder.

Footnote: Players of Flash games will be affected by this as most games store high scores and levels in Flash cookie files. You may prefer something more selective. Try the Better Privacy add-on for Firefox.


Previous Hidden Linux
Next Hidden Linux



Follow Geoff Palmer on Twitter

August 4, 2010

If you've ever been tempted to give Linux a whirl but have been put off at the thought of installing it, it's time to take a look at PenDriveLinux.

Sure you can run most Linux distributions from a live CD or DVD, but it's not quite the same. For a start CD/DVD drives are a whole lot slower than regular hard drives meaning that you get a somewhat more sluggish experience, but their main drawback is they're not writeable. Obviously putting it on a USB stick is the answer, but how do you get it on there?

PenDriveLinux have a number of solutions ranging from their Universal USB Installer to the Linux Live USB Creator (both for Windows) through to the well-known UNetbootin (available for both Windows and Linux). If you have large USB stick you can create a multiple-boot Linux stick with MultiBoot USB.

The great thing about PDL is that they're a one-stop shop for USB installations with straightforward instructions for a huge range of distributions and a comprehensive Help section with tools, compatibility tests, cheatcodes, common BIOS USB options and directions on restoring your USB stick if everything goes pear-shaped. It' well worth checking out!


Follow Geoff Palmer on Twitter

July 28, 2010




It's been a while, but here's a fresh collection of Linux, computer and programming wit and wisdom. Who says geeks don't have a sense of humour?


General
The Internet‭? ‬Is that thing still around‭?
 - ‬Homer Simpson

If the automobile had followed the same development cycle as the computer,‭ ‬a Rolls-Royce would today cost‭ ‬$100,‭ ‬get a million miles per gallon,‭ ‬and explode once a year,‭ ‬killing everyone inside.‭
 - ‬Robert X.‭ ‬Cringely

Never trust a computer you can‭’‬t throw out a window.‭
 - ‬Steve Wozniak

A computer lets you make more mistakes faster than any invention in human history ‭- ‬with the possible exceptions of handguns and tequila.‭
 - ‬Mitch Radcliffe

Fix a computer for a friend or family member,‎ ‏and you‭’‬ll be tech support for life.‭
‎ - ‏Danny Allen

Any significant boost in technology is indistinguishable from a rigged demo.

Most computer problems occur between the keyboard and the chair.


For Linux Fans
Q:‭ ‬What's the difference between a Windows PC and a Trampoline‭ ?
‬A:‭ ‬You take your boots OFF to jump on a trampoline.

Computers are like air conditioners‭ ‬- they stop working properly if you open Windows.‭

The box said that I needed Windows‭ ‬7‭ ‬or better‭ ‬...‭ ‬so I installed Linux.

The only people who have anything to fear from free software are those whose products are worth even less.‎
 - David Emery

UNIX is basically a simple operating system,‭ ‬but you have to be a genius to understand the simplicity.
‎ - ‏Dennis Ritchie‭

Q: What's the difference between Microsoft and‭ '‬Jurassic Park‭'?
A: In one,‭ ‬a mad businessman makes a lot of money with prehistoric brutes that should be extinct. The other is a film.

Spotted on IRC:
‎<‏timer‭> M‬y penis has a Linux distribution on it.‭
<‬defz‭> M‬inix‭?


Programmers' Corner
Endless Loop:‎ ‏n.,‭ ‬see Loop,‭ ‬Endless.‭
‬Loop,‭ ‬Endless:‭ ‬n.,‭ ‬see Endless Loop.

Hacking is like sex.‎ ‏You get in,‭ ‬you get out,‭ ‬and hope that you didn't leave something that can be traced back‭ ‬to you.

Programmers are tools for converting caffeine into code.

In Ruby,‭ ‬symbols are represented with‭ ‬a prepended colon,‭ ‬eg.:flag.‭ ‬So some guy turned up in a T-shirt that said‭ "‬:sex‭" ‬which everyone at Railscamp knew meant‭ "‬Sex symbol‭"‬.‭ ‬He wore it until someone pointed out that to non-Rubyists it said‭ "‬Colon sex.‭"

If Java had true garbage collection,‭ ‬most programs would delete themselves upon execution.‭
 - ‬Robert Sewell

Saying that Java‭ ‬is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders.‭
 - ‬Alanna

The first‭ ‬90%‭ ‬of the code accounts for the first‭ ‬90%‭ ‬of the development time. The remaining‭ ‬10%‭ ‬of the code accounts for the other‭ ‬90%‭ ‬of the development time.‭
 - ‬Tom Cargill

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.‭
 - ‬Martin Golding‭

The three most dangerous things in the world are a programmer with a soldering iron,‭ ‬a hardware type with a program patch and a user with an idea.‭
 - ‬Rick Cook‭

C makes it easy to shoot yourself in the foot.‭ ‬C++‭ ‬makes it harder,‭ ‬but when you do,‭ ‬it blows away your whole leg.‭
 - ‬Bjarne Stroustrup‭

BASIC programmers never die,‎ ‏they just GOSUB and don't RETURN.‭

Real programmers are surprised when the odometers in their cars don't turn from‎ ‏99,999‎ ‏to‭ ‬99,99A.

Any sufficiently advanced bug is indistinguishable from a feature.

Science is to computer science as hydrodynamics is to plumbing.‎

If at first you don't succeed,‎ ‏you must be a programmer.‭

Real programmers don't comment their code.‭ ‬It was hard to write,‭ ‬it should be hard to understand.

The ‬3‭ ‬Biggest Software Lies:‭
 ‬-‭ ‬The program's fully tested and bug-free.‭
 ‬-‭ ‬We're working on the documentation.‭
 ‬-‭ ‬Of course we can modify it!

The software isn't finished until the last user's dead.


Real geeks only
There are‭ ‬10‭ ‬kinds of people in the world ...‭ ‬those that can read binary and those that can't.

To err is human ...‭ ‬to really foul up requires the root password.

A picture is worth‭ ‬128K words.

The gates in my computer are AND,‭ ‬OR and NOT‭; ‬they are not Bill.

Q:‭ ‬What's tiny and yellow and very,‭ ‬very,‭ ‬dangerous‭?
A:‭ ‬A canary with the super-user password.

Q:‭ ‬What did Linux say to the Windows partition‭?
‬A:‭ ‬Go fsck yourself‭!

Be it ever so humble, there's no place like‭ ~

Q: Why do programmers always get Christmas and Halloween mixed up‭?
A: Because DEC‭ ‬25‭ = ‬OCT‭ ‬31

This is wonderfully subtle. If you get it, you're definitely a geek!
sudo chown‭ ‬-R us‭ ‬./allyourbase

‎And where would we be with XKCD?


Follow Geoff Palmer on Twitter

July 22, 2010


apt-get is the package handling utility behind Debian-based Linux systems such as Ubuntu, Mint and Mepis. You may be using it ‘by proxy’ via GUI-based package managers such as Synaptic, but hardened Linux users tend to prefer the command line - especially as the latter has a couple of neat tricks up its sleeve.

(Not that if you’re not a super-user you’ll need to prefix the following commands with sudo - well, all but the last one ...)

The basics

apt-get update
Resynchronise installed packages with their sources. (Always do this before an upgrade.)

apt-get upgrade
Install the newest version of all packages installed on the system.

apt-get dist-upgrade
Upgrade to the latest version of your distribution.

apt-get install xxx yyy zzz
Install programs xxx, yyy and zzz along with all their dependencies.

apt-get remove xxx yyy zzz
Remove programs xxx, yyy and zzz.

apt-get purge xxx yyy zzz
Remove programs xxx, yyy and zzz and delete any configuration files that they used.

apt-get check
Update the package cache and check for any broken dependencies.

apt-get clean
Clean out retrieved package files.

apt-get autoclean
Clean out retrieved package files, but only those that are no longer needed.

apt-get autoremove
Remove any packages that were installed to satisfy dependencies but are no longer required.



Advanced stuff
So much for the basics, what about those neat tricks I mentioned? Well, did you know you can use apt-get to get a package’s source code?

apt-get source xxx
Retrieve source files for package xxx.

Or its build dependencies?

apt-get build-dep xxx
Get all the dependencies needed to build package xxx.

Or that you could get it to fetch and build the package for you?

apt-get source xxx -b
Fetch the source code then compile it. (The -b switch means ”build it„.)

The result with be a .deb package which you can install using the Debian package manager command:

dpkg -i xxx.deb



Really advanced stuff

apt-get moo
Try it! :)




Previous Hidden Linux





Follow Geoff Palmer on Twitter

July 18, 2010


Just how bad is Windows' latest effort to capture the cellphone market? According to InfoWorld:

"Windows Phone 7 is a waste of time and money. It's a platform that no carrier, device maker, developer, or user should bother with. Microsoft should kill it before it ships and admit that it's out of the mobile game for good. It is supposed to ship around Christmas 2010, but anyone who gets one will prefer a lump of coal. I really mean that."

More here: Windows Phone 7: Don't bother with this disaster


Follow Geoff Palmer on Twitter

July 13, 2010


What do you think when you see a Telecom ad? Personally, I think of a certain brand of beer because -- whatever Telecom are pushing -- my reaction is an ironical, "Yeah, right!"

Look at the company's history. Since 2003 they've been they've been warned or fined eight times for breaching the Fair Trading Act. The latest FTA case, for a 2008 "Broadband at Dial-Up prices" campaign, was settled a few weeks ago with the company crediting more than 1,300 customers who'd been misled and forking out $75,000 so Consumer New Zealand could establish "a price comparison website across all providers." (Kudos to Consumer, but don't we already have one of those in the superlative New Zealand Connections site?)

To cap it all, a few days ago Telecom Wholesale was forced to compensate Vodafone and Orcon to the tune of $1.6 million for breaching its own separation undertakings "not to discriminate between or against its wholesale customers". Add to that last October's High Court ruling that between 2001 and 2004 "Telecom used and/or took advantage of its dominant position/market power ... for the purposes of deterring potential or existing competitors in the wholesale market ..." and you have a picture company that's more like a serial offender. They just can't seem to stick to the straight and narrow and stop telling porkies.

So what do you think when you see a new Telecom campaign? "Oh goody, I must get some of that" or "Oh yeah, where's the catch?"



Follow Geoff Palmer on Twitter