Home » Page 3

I Won’t Go Back to Buying Mac

mac_keyboard

Here’s a little topic I wanted to explore in written form – why I have used Mac for so long, why I still have a Mac as my main desktop…. and why despite this I won’t buy Mac again.

I Used to Love the Mac

My first computers were of course not mine – they were my dad’s. I have a vague recollection of us having a PC with 8” floppy drives and having to type commands… this was probably in 1987 or so. But that memory never really took hold, for very soon after, my dad bought a Mac: an LC II that I think is still in the cellar due to me insisting on not throwing it out.

It was graphical, it was friendly. It supported 16 colours (and not just 8 colours like many PCs still shipped with as standard). There was no command line, you could just click for everything. It was a revolution in home computing and we were on the cutting edge.

We were continually treated, with Macs, to the newest and greatest home technology: stable systems to run months without a single application crash (System 7.5.1 I particularly single out), advanced graphical UIs (Mac OS 9 was great comfort to the eye at the time), easily automated applications via AppleScript, including a fully scriptable Netscape Navigator; the first laptops and desktops with built-in Wifi, the first LCD desktops where the entire computer was hardly wider than the screen, the advent of UNIX-based systems on the home computer. Every Mac shipped with a full productivity suite included (what would become iWork), as well as a full media editing suite (photo editing, video sequencing, and audio production, which collectively would become iLife), and a couple of well-designed, full-on 3D games to boot. There was hardly anything you couldn’t do with a Mac I thought…. except perhaps write programs for Windows.

When the time came for me to go to university, I believed I would have to get a Windows PC to allow me to do some proper programming, not knowing that we’d be using many different and equally (even more so) viable systems for programming on. It was a mistake I do not regret, as it had great learning benefits to me, and gave me the ability to understand the Windows paradigm so many people endure, and the ability to operate in the average workplace; but after that laptop died (in a literal puff of smoke after an ill-fated attempt to “repair” it), I was back to buying a Mac in 2007.

Even in 2011 I was agonizing over whether or not to spend hard-earned cash on a new MacBook Pro or not. I drew up my list of pros and cons, and decided, over a solitary steak and pint, that yes, I did want that Mac after all.

It would be the last Mac I would ever personally buy.

The Mac – the good

The year is 2015. I still have that MacBook Pro. And it still serves as my main workhorse for spinning up Linux virtual machines. 4 years on, and it’s still the most powerful computer in my home.

It has a quad-core i7 hyper-threaded processor at 2.2 GHz, effectively  showing up as 8 cores – it’s the same processor family as found on entry-level business servers. I’ve upped the RAM to 16 GB. It has a 500 GB HDD.

Most computers even today ship with 4 GB RAM and a lesser i5 processor clocked at 1.7 GHz and not hyper-threaded, and still a 500 GB drive.

Needless to say, that Mac was a fantastic investment, as it remains still more powerful than an equivalently priced Windows PC on today’s market.

So why will I never buy Mac again? Put simply: Apple has chosen to go where I will not follow.

Apple – the Bad

Even back in 2011, the Apple Genius who was trying to sell to me was extolling the benefits of the new MacBooks with no CD/DVD drive: “who uses CDs these days anyway?” Well I do, for one. I experiment with computing, and in doing so sometimes break my systems. I need to reinstall the system sometimes. The one time I needed to reinstall OSX, I had to purchase a brand new copy. Gone are the days of providing a free re-installation DVD. These days, you’re lucky if you can connect anything at all.

I don’t tie up my bandwidth with movies and music I have to wait for and download, online, every time I want to consume them. I still buy DVDs and CDs because, in case you haven’t noticed, online “purchase” does not allow you to own a copy – just the license to watch, if it’s still available on the provider’s website (remember mycokemusic.com?). We do not own “our” online movies and music – only the permission to watch them, which can be revoked at any time – with no refunds.

I have become a near-full Linux convert. I use Linux for my personal machines at work, my secondary and tertiary laptops run Linux, and my private cloud servers all run Linux.

Only my Mac doesn’t run Linux, and that only because when I tried to install Linux on it, the graphics card and wireless card decided to throw a hissy fit. Apple’s choice of highly-proprietary components meant that despite the best efforts of open source developers, Apple held on closely to the proprietary mantra: the machine is Ours, you only have a license to use it. You can’t even “own” something as rustic as a tractor these days.

I feel I am not in control of my Mac because I have been told what I can and cannot run on it. I own the machine, but not the software. If it breaks, I just get to keep the pieces – not the ability to tweak and fix.

My hardware today

My preferred computer for “getting things done” nowadays, the one I am currently typing away on, is a Lenovo Flex 15. Lenovo do very good hardware, its pro line, the ThinkPads, are durable business machines much like the MacBook Pros in quality.

They’re also generally highly compatible with open source drivers and mainstream Linux distributions. Where I’d hesitate before buying a Dell or HP laptop as to whether I think Linux will work on them, I have virtually no qualms when buying a Lenovo laptop, knowing it will likely take the erasure of Windows just fine. Not that this necessarily won’t change in the future.

Open Source – Freedom and Privacy

Lenovo was in the news recently for a piece of advertising software called Superfish they had included in new laptops and desktops for a few months in their Windows deployments. This particular set of software and configurations meant that not only were users seeing even more advertising in the web browsing experience, but implementing the advertising solution was also breaking the very core security mechanisms that keep all other parts of the system secure. Lenovo makes great hardware, but they aren’t immune to woefully bad decisions.

Thankfully, they reverted their decision to include this software as soon as their technical analysts realized what had happened, and issued fixes, but it has damaged the company’s reputation.

Persons like myself who chose to erase Windows completely were not affected.

This is why I use Open Source Free Software: to maintain control over my own digital assets, and freedom in my digital life. I am fully aware that my digital identity is tightly woven into my real-world identity, whether I want it to be or not.

I now run Linux on nearly everything – more specifically, I run Ubuntu on my laptops, and a mix of Ubuntu and CentOS on my servers.

I can choose what software is on it. I can choose what software is not on it (have you not yet noticed how there is some software on Windows that you cannot get rid of for neither love nor money… pestering you for upgrades at best, selling you out at worst). I don’t have to pay an arm and a leg for it either.

What’s more, I remain in control of my data. Not only on my computer, but also in the Cloud. Windows will try to shove you onto SkyDrive and Office 365 Online. Apple is shoe-horning you into iCloud services (yeah, sync your photos all over the place, you can trust Apple… hmmm)… Google is trying to get into both spaces of storing all your photos “for” you and getting up in the online office suite as well. You can’t get an offline Adobe Creative Suite anymore – just keep up the eternal payments if you want to continue being able to access your Photoshop and Illustrator projects. At least they didn’t discontinue their editing suite altogther like Apple did with Aperture. Gone is your investment.

If I ever stopped paying once for any of these applications or services, or if the service is suddenly discontinued, I would stand to lose all my data – everything I’ve purchased, everything I’ve created, either because I no longer have the software to read the files, or because the files themselves have been whisked away to an online vault “for my convenience”. That’s why there’s hardly any storage on Chromebooks. Surrender your data to the Cloud.

I am staying firmly on Linux and virtual private servers that I control and can pull data off of as I wish. I can fully program the computer to make it do what I want – and stop if from doing things I don’t want it to do (granted, some tasks are easier than others, but at least it’s actually possible in the first place.)

One Linux distribution in particular, Ubuntu (the very same I use!), tried to follow the Big Boys like Apple, Google and Microsoft: Canonical announced a partnership with Amazon in the form of search functionality, where any keywords used for a file search was also sent to Amazon, and other online providers. Thankfully, it was easy to purge from the system the minute I heard of it. You cannot defenestrate such “features” with the other Big Three.

Building Trust

I use open source software from centralized trusted software repositories (which were the spiritual precursors to app stores) – I don’t need to hunt around on the Internet to find some software whose source I do not know. On Windows, I constantly need to fret before installing an app: Does it have a virus? Does it have a trojan? Will it send all my purchasing, credit card details, photos and other identity to some unknown third party?

What I get from the centralized repositories constitutes my base web of trust –  and that base web offers a collection of software so large and varied that I know I can get a tool for any job, be it office, media, programming, scientific or leisure, and more.

No piracy = no legal troubles AND no viruses.

Or at least, a vastly reduced risk compared to downloading anything willy-nilly from random websites. And personally, I expand that web of trust with informed decisions.

I use LibreOffice which allows me to read and save in Microsoft’s document format if I need to, but I mainly use the Open Document Format to ensure I can still edit them in decades to come, and that I can share documents with anybody who does not want to shell out for Office Pro, Office 365 or GoogleDocs.

I use ownCloud for my file synchronization so that I can keep control over what is stored, and where. It replaces services such as DropBox, Google Drive, Sky Drive and iCloud without trying to force me to store online-only and forgo local copies. If my account is terminated on the latter services, there’s no guarantee I’ll also still have the data that it ran away with. ownCloud is in my control, and I know I have the copies locally too.

I use Krita and the GNU Image Manipulator instead of PhotoShop, InkScape instead of Illustrator, Scribus instead of InDesign, digiKam instead of Lightroom. I don’t need to be online to do any of this.

I choose freedom.

In the words of Richard Stallman and the Free Software movement: “Free Software is is a matter of Freedom, not price.

Piracy might make things surreptitiously free (as in “a free lunch”), but still ties you to the control systems and spyware that is rife on the Internet.

Apple, like so many other computer manufacturers and software licensors, has taken a route I cannot go down, one I will not follow. It has taken a route that specifically makes it difficult for me to remain free. It has taken a route that stifles experimentation and learning. It has taken a route that privileges perpetually tying-in my spending on one side, as well as the monetization of my identity on the other, whilst at the same time denying me ownership both of what I purchase and what I create, and where the only solutions are either piracy… or just leaving altogether.

forget-piracy(… graphic of my creation, released under CC 4.0 Attribution Share-Alike. Anyone who wants to make a better derivative is most welcome…!!)

About that: Thalys’s response to All out

Thalys, a French national train operator, suffered recently from a backlash from an All Out campaign after a member of Thalys’s partner staff reprimanded a lesbian couple for kissing on the platform , denouncing the activity as “intolerable.”

Thalys yesterday released a French language press release, which I have opted to translate below.

Please note that this translation has not been performed from a professional standpoint, and that only Thalys’s original official press release is relevant for further quoting.

Read more

What Cameron Doesn’t Realize: Encryption Keeps Us SAFER

To Mr David Cameron, Prime Minister and person responsible for our (lack of) safety.

This is war – and you know it. A defensive war against those who would, and do, assail us. War against those who seek to undermine our values. War against those who attack us, day after day, relentlessly, on our streets and in our homes.

And amidst this ongoing conflict, you would have us break down the walls of the only fortress protecting us so as to better see our enemies charging.

You call for the private encryption of our personal messages to be undermined, and even qualify it as thoroughly undesirable – for the purpose, you say, of facilitated public protection, and the promise of a safer Britain. It will be none such, but the contrary, should your stance prevail.

The rogues who attacked Charlie Hebdo, the London buses and 9/11 were all already known to Intelligence. You have more means than the mere electronic surveillance of their messages. You are the govenrment. You can access airport records at will. You have CCTV on every major street and transport link. You intercept physical mail. You can bug our hardware. You impose police checks and searches anywhere and anywhen. You monitor bank transfers. You have the legal mandate to pry open or seize property of any private enterprise, and through international agreements, the power to reach even overseas.

I do not doubt that a government can carry out surveillance, nor that it will. Even non-governmental groups can crack highly secure networks, given sufficient determination. Just ask any computer security expert – the first thing they ever teach us is that no system is 100% “unhackable”.

Were I sufficiently deluded I would demand that you stop such mass trawling. But I see no point in such advocacy on my behalf. It will happen whether I wish it or not, with my knowledge or without. For the government to demand that private communications cease to exist outright, in reality, makes it marginally easier for your intelligence services to reap information.

However it makes an unfathomable differece to any others who would (and already try to) get control of us or those we hold dear, whilst driving the poster-criminals away from surveillance’s reach.

You say you want to better monitor terrorists and violent criminals. Would the most dangerous use your government-sanctioned communication tools to operate? No – they would simply switch to other channels of communication and “go dark” once more. Years of your agencies’ efforts to best mine the Internet and otherwise secure communications would surely go to waste – for none but the most incapable “terrorists” would be there anymore, and your agencies will have to play catch up in an entirely new arena. It is astounding that they are there at all, which in fact is a benefit to you.

In the mean time, the rest of us will be fed to the wolves.

In reality, encryption has never protected us from government spying. It has only ever protected us from non-government spying.

The holes already opened up by GCHQ and the NSA (and other lower-profile national security agencies) are already letting in criminal hackers – known in the trade as “crackers.” Computer systems will always have issues, as every computer scientist, engineer and technician knows from day one. We work hard to plug them as soon as we – or others – find them. And yet you bore more holes behind our backs.

The attacks on Sony and the leaks of celebrity photos from Apple demonstrate how easily compromised computer systems can be, even when dutifully guarded.

With mass policy of non-encryption, we open ourselves to ills no government could guard against, no matter how otherwise benevolent it were.

We already have open networks in the form of free Wireless in airports, hotels and cafes, ready to testify to the dangerous absurdity of not encrypting one’s communications. Any computer enthusiast with a modicum of technological education and a standard laptop can snoop the details of anything unencrypted. One needn’t even look underground or seek to circumvent anything for such tools: this is what was shown with the FireSheep debacle that proved that websites badly needed encryption – not to save us from the government, but from simply unscrupulous other network users.

Our devices connect automatically to these networks because we let them: rather than have to remember passwords and type them in conscientiously. We are all ripe for picking. And anyone can setup a network to trick our devices. Making better technology will not solve our desire for convenience, and crackers will always be ahead of the game – it’s what makes them such formidable foes.

Cracks employed by News of the World were already unsophisticated, but without the safeguards and encryptions there would be no need for them – all our communications would be laid bare to anyone who so much as desired to listen in.

Who would be listening? Crooks out for a quick buck perhaps. Set up a little device and listen in to rich investors’ casual discussions face to face or over some “pravate” chatting channel. At the club house, or in a restaurant, or in a hotel bar or elsewhere the likes… Some people wonder how crackers get information on certain transactions… It’s easier than Hollywood lets on…

Who else would be listening? Oh nobody but insurers and marketers, eager to have the first word in negotiations. They know who’s depressive and who’s terminally ill. Up the premiums. And crooks too. They’ll know who’s bought the latest PC, which model from which store. Let’s call them and impersonate a Customer Service representative to con them.

Who else would be listening? Only the local thugs who know how to use the government tapping loopholes to get onto some family’s network – cause their bills to skyrocket by hacking their smart energy metres, cause their fridges to turn off over holidays and everything to spoil, overheat ill-secured sensors and cause fire even as they sleep, browse private files to dig up dirt, monitor their childrens’ movements… and hold the home owner to ransom.

Lovely house and family they had there…. pity if anything were to happen to it.

Who else would be listening? Not to sound alarmist, an an open, unencrypted network would be a boon for predatory paedophiles and other sex offenders who could operate all the more efficiently. For every one paedophile who would no longer be sharing vile pictures through the Internet, a thousand more could spy on any one family out and about one sunny afternoon. Photos of our children shared with our loved ones would be available for anyone to intercept and recorgnize (see how quickly the Chinese “human flesh search engine” can identify a person from casual shots). Our daily habits and patterns would be open to anyone to see, analyze and mine. The kids get home at this time. The parents get back at that time. The parents are out to dinner on Tuesday evening. Interesting information on that couple we spied on in the cafe last Sunday. And if the paedophiles were the ones supplying the laptops and phones… what then? (Yes, we’ve already seen something like this happen.)

Who else would be listening? Maybe the disgruntled neighbour. Maybe the local bullies. Maybe some sect that really has it in for you. Maybe some ill-advised political activist hell-bent on attacking a candidate and any of their supporters.

Mr Cameron, I can’t comment on the rest of your political decisions. I disagree with your policies, but I am not an expert in any of those matters. I don’t like what you’ve done to welfare, I don’t like the Conservatives’ privatization of what I believe to be national infrastructure such as the NHS, I don’t like your government’s stance on immigration, nor how they are undermining education, and I am disappointed that I feel my vote to stay with the Union this past November seems to have come back to bite me. And so forth. Frankly I have not educated myself enough in those areas to properly comment on them. Suffice to say I disagree, and will need to leave it at that.

But I am competent in computing, as can be anybody studious enough. You seem to think cracking is only the capability of those grimly determined – but it is at the grasp of even the most puerile of pranksters. All you have shown is that you persist in ignorance and lack of judgement, from a stance of power and authority – a very dangerous combination.

You would feed us to the wolves to gauge just how hungry they were; and take a cannon your own castle out of spite.

Read more:

[1] Cameron wants nobody to have privacy. http://readwrite.com/2015/01/13/david-cameron-encryption-messaging-apps-imessage-whatsapp-snapchat

[2] Encryption makes us safer. http://www.forbes.com/sites/kashmirhill/2010/10/25/firesheep-why-you-may-never-want-to-use-an-open-wi-fi-network-again/

[3] The surveillance state made corporate (and private) espionage worse. http://www.bloomberg.com/news/2014-04-11/nsa-said-to-have-used-heartbleed-bug-exposing-consumers.html

[4] Letting companies have a know about their users tends to backfire. http://theweek.com/articles/441995/uber-growing-threat-corporate-surveillance

[5] There are people you trust spying on your children in their own bedrooms. http://www.macworld.com/article/1146666/macbook_spycam.html

[6] Why privacy matters. http://www.groklaw.net/article.php?story=20130818120421175

Protect your privacy and freedom

EFF.org

https://www.openrightsgroup.org/

About that: GNU/Linux (and cousins) are a big family – and the kids are growing up

It does seem that Linux has become too big and complex – but perhaps not in the way we think.

Some voices indicate that the problem is being un-UNIXy, others insist that systemd is the heart of all woes (well it certainly threw oil on the fire…), others think it’s just too bloated… some even think it is just not popular enough (non sequitur??)

Personally, I think it suffers from a very basic meat-space problem: identity. There are too many distros for Linux to be homogenously named, and too many people with strong (mostly valid) visions for what it should do to be recincilable accross the board.

It is clear to me that no Linux distro family is interested in doing what the other does, like siblings with rivalry, but that some “parent figures” are trying to ship them all into the same roles.

Rather than recognize that they need to have their own spaces and come into being their own, “unification” attempts are falling flat because simply not matching up to the ideals the now grown up youngsters have.

My response to a comment on iTWire’s article follows:

My general stance is that Linux’s “killer app” is “Linux” 🙂

To elaborate on that, maybe I should stretch my explanation to mean: a platform on which I can bothplay games and surf the web, whilst at the same time do development work and granularly control its maintenance, depending on the role I want to to fit on any particular deployment… The lack of household-name-fame is not prticularly a problem. Technical capability has always come first, and that has not hampered its growth.

I do think (though I am no longbeard!) that there needs to be more pointedly a differentiation between desktop/laptop purpose (where you want everything to work with little fuss) and server purpose (no GUIs, high control, high debuggability)

Perhaps the danger we are seeing is the trend for a one-size-fits-all approach swalling the ecosystem whole, whether it be systemd or any other project, mind: we tend to see Linux distros as one big close-knit family, and thus create attempts to unite them under a common set of tools, orchstrators and platforms.

Maybe it’s time we stopped looking at Linux that way. UNIX split off into various mildly-related sub groups, and which still thrive, and it looks like Linux could soon do the same. Ubuntu is on course to becoming its own thing, and Chrome has taken Gentoo and created something barely related, even as they are deployed on the same kernel as the rest of distros. Android has already dropped the GNU side and, whilst it is still “Linux”, it cannot be considered in the same family as the desktop and server distros we have at the moment.

So yeah – I’d say, stop thinking of “Linux” as “a cohesive group of operating system variants” and start looking at key families of distros as operating systems in their own rights. Allow more individulaization in the nucelar family to allow a broader unification of the genealogy – our BSD cousins are doing well in server space, and if they are not taken into the unification attempts, may well fill the server niche in our stead whilst we remain with the consumer and mobile markets… who knows who will get gadget-space.

Stop trying to cram all the family members in the same bed. It’s time for the kids to fly the nest.

Technical Support as a Career

“I work in technical support” is probably one of the less impressive admissions at a sociable meetup, and to be fair, it’s not ever been glamourous, nor will it ever be. The most admiration you’ll probably get is “Oh wow; hey I have this computer problem actually, you see it …. (badly summarized problem in absence of broken thing…) … do you think it’s a virus?”

However it is a viable career (with its admitted share of dead ends), with training on offer in the right companies, and plenty of potential for exposure to the core of businesses and some Real Computing (TM).

The following is a quick profile description of the most common configurations, if you were ever curious, or looking to move into IT – and one or two profiles to avoid as much as you can. Read more

Moving “/” when it runs out of space (Ubuntu 14.04)

konata_pc

My root (“/”) partition filled up nearly to the brim recently on one of my test servers, so I decided it was time to move it elsewhere… but how?

You can’t normally just add another disk and copy files over – there’s a bit of jiggery-pokery to be done… but it’s not all that difficult. I’d recommend doing this at least once on a test system before ever needing to do it on bare a metal install…

What you will need:

  • a LiveCD of your operating system
  • about 20 minutes of work
  • some time for copying
  • A BACKUP OF YOUR DATA – in case things go horribly wrong
  • a note of which partition maps to what mount point

For note, I had my partitions such initially:

/dev/sda1 : /boot
/dev/sda3 : /
/dev/sda5 : /home

I then added a new disk to my machine

/dev/sdb

In this walk-through, I will refer to your target PC, the one whose “/” needs moving, as “your PC” from now on. If you’re using a VM that’s the one I am referring to – you needn’t do anything in the host.

Note that in my setup, the “/boot” and “/home” directories are on their own partitions. If you don’t have this as your standard setup, I highly recommend you look at partitioning in this way now – it helps massively when doing long-term maintenance, such as this!

1/ Boot your PC from the LiveCD.

I recommend you use the same CD as from where you installed the OS initially, but probably any Linux with the same architecture will do (x86_32, AMD64, ARM, etc)

Once the Live environment is started, open a command line, and switch to root, or make sure you can use sudo.

2/ Prepare the new root

Use lsblk to identify all currently attached block devices.

I am assuming that /dev/sdb is the new disk. Adjust these instructions accordingly of course.

You want to first partition the new drive: run the command `fdisk /dev/sdb` as root

Type `o` to create a new partition table – you will be asked for details, adjust as you wish or accept the defaults

Type `n` to create a new partition. Adjust at will or accept the defaults

Type `w` to write the changes to disk.

As root, run `mkfs.ext4 /dev/sdb1`

Your new drive is ready to accept files…

3/ Copy the files

Make directories for the old and new roots, and copy the files over

mkdir newroot
mkdir oldroot
sudo mount /dev/sda3 oldroot
sudo mount /dev/sdb1 newroot
sudo rsync -av oldroot/ newroot/

Note: in the rsync command, specifically add the slashes at the end: “oldroot/ newroot/” and not “oldroot newroot” !!

Go do something worthwhile – this copy may take some time, depending on how full the partition was…

4/ Modify fstab

Run the following command to get the UUID of the new drive:

sudo blkid /dev/sdb1

Keep a copy of that UUID

Edit your fstab file

sudo vim newroot/etc/fstab

Keep a note of the old UUID

Change the UUID of the line for your old / partition to the new UUID you just got; and save.

5/ Edit the grub.cfg

Mount your old /boot partition into the *new* location

sudo mount /dev/sda1 newroot/boot

Now we edit newroot/boot/grub/grub.cfg

sudo vi newroot/boot/grub/grub.cfg

Locate instances of the old UUID and change them to the new UUID

Quick way: instead of using `vi` you could use `sed` instead

sudo sed -e 's/OLD-UUID-FROM-BEFORE/NEW-UUID-ON-NEW-DISK/g' -i newroot/boot/grub/grub.cfg

Of course, adjust the UUID strings appropriately. If you have never used sed before, read up on it. Keep a copy of the original grub.cfg file too, in case you mess it up first time round.

In the above command, the “-e” option defines a replacement pattern ‘s/ORIGINAL/REPLACEMENT/g’ (where ‘g’ means ‘globally’, or in the entire file); the “-i” option indicates that the file specified should be modified, instead of writing the changes to stdout and leaving the file unmodified. Using the “-r” option, you can also make use of Perl-style regular expressions, including capturing groups.

After making the change, reboot. Remember to start from the hard disk, remove the Live CD from the slot.

6/ Reboot, and rebuild grub.cfg

If all has gone well, you should now find your Ubuntu install rebooting fine. Open a terminal and run

df -h

See that your root is now mounted from the new disk, with the extra space!

There’s just one more thing to do – make the grub.cfg changes permanent. Run the following:

sudo update-grub

This will update the grub config file with relevant info from the new setup.

You have successfully moved your “/” partition to a new location. Enjoy the extra space!

Watcher-RSS : Your own, Personal, Feeder

fosdem-rss

I finally got around to putting together some initial code for that thing I wanted – a script to detect changes in a page and produce an RSS entry as an outcome.

watcher-rss” is just that – a simple script that can be called by cron to check a page for a significant area, and generate an RSS “feed” in response.

It’s designed such that you need to define a bash handler script that sets the required variables; after that it can generate an RSS entry in response to anything. Read more

Freelancing – lessons learned

Back in April, for various reasons in my personal circumstances, I decided to give freelancing a go. I quit my permanent job, and set myself up as a sole trader. I wish I had done this from the very start, back when I was at university…

Being self employed allows you to try your hand at a number of different roles before you decide to settle on a specialization – if you specialize at all! From an employer’s perspective, they are getting a skilled individual who they can keep on or let go of easily; from your perspective, you have the freedom to take on a variety of projects and diversify your experience fairly fast.

Here’s what I’ve taken away from my experience so far:

  1. Sole traders have greater freedom than temp workers
  2. You can be a sole trader and be in education or full-time employment
  3. Tax is complicated
  4. Take customers with you

Read more

Moving ownCloud from Ubuntu default repo to openSUSE build service repo

ownCloud example

ownCloud is a popular self-hosted replacement to cloud storage services such as Dropbox, Box.net, Google Drive and SkyDrive: ownCloud lets you retain ownership of the storage solution, and host it wherever you want, without being at the mercy of service providers’ usage policies and advertising-oriented data-mining.

Recently the ownCloud developers asked the Ubuntu repo maintainers to remove owncloud server from their repos.

The reason for this is because older versions of ownCloud have vulnerabilities that don’t necessarily get patched: whilst the original ownCloud developers plug the holes in the versions they support, they cannot guarantee that these fixes propagate to the code managed by repos – and Ubuntu is widely used as a base for other distros. For example, Ubuntu 12.04 is still supported and forms the base for many derivatives, and has ownCloud 5 in its repos – but is not managed by ownCloud developers.

The ownCloud developers recommend using the openSUSE build service repository where they publish the latest version of ownCloud, and from which you can get the newest updates as they arrive.

If you’ve installed ownCloud from the Ubuntu 14.04 repositories, and you want to move over to the openSUSE build repo, here’s how you do it.

If moving up from ownCloud 5, consider migrating first to version 6 by way of a PPA or an older OC6 TAR… I’ll have to leave it up to you to find those for yourselves…

Backing up

These instructions are generic. You MUST test this in a VM before performing the steps on your live system.

Mantra: do not trust instructions/code snippets from the internet blindly if you are unsure of what exactly they will do.

Backup the database

Make a backup of the specific database used for ownCloud as per your database’s documentation.

For a simple MySQL dump do:

mysqldump -u $OC_USER "-p$OC_PASS" $OC_DATABASE > owncloud_db.sql.bkp

replacing, of course, the placeholders as appropriate.

Backing up the directories

If you installed ownCloud on Ubuntu 14.04 directory from the regular repos, you’ll find the following key anatomies:

  • Main owncloud directory is in /usr/share/owncloud (call it $OCHOME)
  • The $OCHOME/config directory is a symlink to /etc/owncloud
  • the $OCHOME/data directory is a symlink to /var/lib/owncloud
  • the $OCHOME/apps is where your ownCloud apps are installed

If this is not already the case, it wouldn’t hurt to change things to match this setup.

It would also be a very good idea to make a tar backup of these folders to ensure you have a copy should the migration go awry. You have been warned.

Moving apps, data and config folders

Move your ownCloud data directory to some location (for this example /var/lib/owncloud but it could be anywhere) ; move your ownCloud config directory to /etc/config

It’s probably simply a good idea to not have your data directory directly accessible under $OCHOME/data

It is also probably good to keep the original more variable apps directory in /var/owncloud-apps instead of lumped straight into the ownCloud home directory. Note that this directory also contains the “native” ownCloud apps, which get updated with each version of ownCloud – not just custom apps.

Once you have moved these folders out, $OCHOME should no longer have data and config symlinks in it. As these are symlinks you can simply rm $OCHOME/{data,config}

If you get an error about these being actual directories that cannot be removed because they are empty…. you haven’t actually moved them. If they do not exist of course, that’s fine.

Uninstall and reinstall ownCloud

Uninstall ownCloud (do NOT purge!!)

apt remove owncloud

And add the new repo as per the instructions in http://software.opensuse.org/download/package?project=isv:ownCloud:community&package=owncloud

For Ubuntu 14.04 this is

wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key
apt-key add - < Release.key
echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud.list
apt-get update && apt-get install owncloud

This makes the repository trusted (key download) then updates the sources and installs directly from the openSUSE repo.

NOTE – if you are following these instructions for Ubuntu 12.04 or any distro shipping a version older than ownCloud 6, you may want to consider upgrading to OC6 first before converting to the latest version 7 – make sure your test this scenario in a VM before doing anything drastic!

Restore files

The new ownCloud is installed at /var/www/owncloud

Remove the directory at $OCHOME, then move /var/www/owncloud to $OCHOME so that it takes up the exact same place your old ownCloud directory was at.

Disable the automatically added owncloud site

a2disconf owncloud

And optionally delete /etc/apache2/conf-available/owncloud.conf

Now remove the default data and config directories, and link back in the other directories that you had cautiously moved out previously

rm -rf $OCHOME/{data,config}
#ln -s /var/owncloud-apps $OCHOME/apps
ln -s /etc/owncloud $OCHOME/config

(the apps line is commented out – because you must check what apps you are specifically restoring before squashing the default apps directory)

Finally edit $OCHOME/config/config.php to be sure that it points to the correct locations. Notably check that the $OCHOME/apps location exists, and that the data folder is pointing to the right place (especially if you had to move it).

Update

Now go to your ownCloud main page in your web browser. You will be told that ownCloud needs to be updated to the newer version 7 – this will be done automatically.

Once done, ensure that everything is working as expected – add/remove files, navigate around ownCloud web, check that your apps are all working…

Reverting

If you do need to revert,

apt remove owncloud
rm /etc/apt/sources.list.d/owncloud.list
apt update && apt install owncloud

Finally proceed to restoring the files as above – or from backup TARs

Additionally, you will want to restore the old version of the database.

mysql -u $OC_USER "-p$OC_PASS" < owncloud_db.sql.bkp

Smash – the snack

At some point I’m going to compile a list of tips and recipes for lunching at the office – for situations where you only have a spoon, bowl, fridge, microwave and kettle, like many office and lab kitchens I’ve seen so far…

Here’s one such recipe.

Smash – a brand of instant mashed potatoes in the UK – is a fairly easy to come by commodity. Most of my friends shudder at the thought of it and wonder why I even keep any in my pantry.

Now I know better than to use it to serve anybody but myself – but I also know that it can be a perfectly decent fill-in for when you’re too lazy/tired to cook, and can be made to taste perfectly fine – it’s just dessicated potatoes. The trick is not to follow the instructions on the packet – the end result of doing so does indeed taste awful.

Thankfully, an equivalent product I used to eat in France, called Mousseline, gives much better instructions – which I simply re-use here.

  • 6-7 tbsp Smash flakes
  • 100 mL milk
  • 100 mL boiling water
  • knob of butter
  • salt & pepper

Put the Smash flakes in a bowl, along with the butter, salt and pepper, then add the milk.

Add the boiling water now, and stir repeatedly. At first it’ll start off as watery nothingness, and gradually coalesce into creamy potato-y snackage.

If necessary, pass through the microwave for about 15 seconds before stirring, as the flakes absorb the liquids better when hotter, and the cold milk makes the biling water tepid.

Add some peas (not the tinned stuff mind – heated from frozen is best) and ham or frankfurters for a more filling dish.

Voila, easy to make at the office, or in the evening if you want to be minimalist in effort.