Showing posts with label switch. Show all posts
Showing posts with label switch. Show all posts

Sunday, 9 April 2017

How to Mac - part 2

Well, I'm still making use of a Mac. Four months in I'm starting to get used to the keyboard and some of the oddities (good and bad - I still hate the behaviour of this window management). Time to write some more docs for future-me should I ever have to configure one of these systems again.

Clipboard management


I made the switch to using a clipboard manager years ago and frankly now can't comprehend life without one. I found loads of them on the Mac - mostly expensive and part of much larger packages which I don't need.

The one I settled on is called Flycut. It will only work on text (and will occasionally foul up copying images with a keyboard shortcut) but it works really well for my simple use case and is easily installed via homebrew:

brew cask install Caskroom/cask/flycut

Services


Installing services such as Postgres or Elastic Search via homebrew often writes them into the startup sequence. Sadly, these days I am not coding enough to need these all the time and available RAM is precious so I went looking for an easy way to change what is run when. It seems an easy way to do this is homebrew services, which is easily installed via the homebrew interface and lets me edit the startup sequence and run the services directly without them starting next time I boot the machine. This last command requires a very recent version. Docs on the end of the link, above.

Bash and completion


I took a brief foray into Z shell and found it different enough to bash to irritate me. Given time I think I could configure it to be something I really like, but after some time and rage trying to configure the prompt I decided that I don't have the patience for that at the moment.

The motivator here was improving bash autocompletion - especially for git and homebrew. It turns out the version of bash shipped with OSX is ancient so the first stop was upgrading that via homebrew which then meant changing the bash-completion package (written for bash 3) over to bash-completion2 (which is for bash 4). Next I discovered that both git and homebrew ship with their own completion config which just needed to be parsed when the shell starts.

And thus the fun began.

Homebrew bash autocomplete configuration is hidden in /usr/local/etc/bash_completion.d instead of the more usual /etc/bash_completion.d. I needed to encourage it to parse the contents of this directory instead - which proved surprisingly difficult. In the end I had to add this to ~/.bash_profile:

for bcfile in `brew --prefix`/etc/bash_completion.d/* ; do
  . $bcfile
done

(copied from this Stack Overflow answer because of lazy).

As far as I can tell, bash is supposed to read the contents of the bash_completion.d directory automatically but because homebrew moves it the paths need fixing. There is almost certainly a better way of doing this, but by this point I was bored of this problem and decided to accept something that worked. Then write about it.

I also found I needed to create an empty file at /usr/local/etc/bash_completion because this line was complaining:

[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion

I probably could remove the line, but I had Fear of removing such a standard line of config and ending up breaking something else in the future. Again, probably not the best solution.

And that's it for the moment. Like last time this is mostly my own documentation so I can reproduce these steps in the future written here on the off-chance it is useful to someone else. I certainly don't recommend any of the bash config stuff as the best way of doing things. Think of these notes as a diary, recording my reluctant exploration of MacWorld. End disclaimers...

Wednesday, 21 December 2016

How to Mac

A while ago I made the switch from iOS to Android and now I find myself needing to make a similar transition - this time from Ubuntu to OSX. I've been using Ubuntu for development for around twelve years and like most developers I use a lot of keyboard shortcuts so to say this new world is scary and unfamiliar is more than an understatement. As before I'm writing this for myself in the future if I have to go through this again, and anyone else who has to do this so you know you're not alone.

Getting started


Out of the box nothing was too painful. Sure, the keys are in the wrong place but that is something I'll get used to eventually. I was shown how to put the mouse scroll the correct way up so that helped with moving around (it's in System Preferences -> Trackpad) and since to start with life was all about Chrome and simple text editing it didn't hurt too much. Except for the loss of function keys and the missing delete key (fn+backspace). Sigh. Still, the hardware is genuinely lovely and I'm very impressed with the battery life. As I type this I've been working all day from the battery and I'm still seeing 41% charge. Now; my Linux laptop has seen some serious miles but I don't remember it ever doing this well. Plus it's really nice having the operating system work 100% including hibernating, sleeping and all the other bits and pieces. That has been getting much better on Linux over the years but if I'm honest it's just nowhere near as good as I'm seeing here.

First shot at some real work


So then I had to start installing tools and getting things set up for actual web development. First up, Chrome. Gone are the days of hitting F12 to bring in the developer tools or a two button shortcut to view page source. Now I have to some weird contortion exercise for the tools and I have to include the command key to view source. Maybe it gets lonely and sad if it isn't pressed often enough? Anyway, my brain will remap this eventually so it's not the end of the world. 

Bring forth the command line


At the suggestion of literally everyone I immediately abandoned the default terminal in favour of installing iTerm2. That involved installing a package manager and a plugin for the package manager. This is weird territory for someone who is used to apt being an integral part of the operating system, but I was still impressed by the screen and battery life so I rode that happy wave a bit longer. First I needed some other odds and ends and eventually a friendly Mac user at work gave me some commands and I typed them in and Things Started Working (because when did just typing in commands blindly ever hurt?). I'm impressed with his wizardly powers, but I'm well aware that one day I'll need to do this again and I may be in serious trouble.

Command history suggests "we" did something like:
  1. install xcode to get gcc
  2. install homebrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. install cask: brew tap caskroom/homebrew-cask
  4. install iterm2: brew install iterm2
Well, if my memory has failed me it's a problem for future me. In the meantime I have a package manager and now an exciting terminal which is all the wrong colours, but that's hardly the Mac's fault. A few tweaks and I'll be up and ... wait, why is the window split in half? 

What do the buttons do?


The terminal is where the keyboard shortcuts really started to hurt. A combination of some of the shortcuts being different, an entirely new modifier key to contend with and my brain attempting to use CMD instead of CTRL except now apparently not all the time produced many, many frustrating mistypes and resulted in a couple of hours rebinding keys. It's now better - not as good as the default terminal in Ubuntu, but very usable and at least iTerm2 lets me save my profile for future use so I don't have to go through that again. 

I also discovered that OSX uses slightly different environment files to Ubuntu so I had to source my bashrc file from bash_profile to get that read properly. Apparently age-old Mac users keep build scripts so a new machine is just configured for them while they make tea. 

At least git works, right?


Yup - no problems here. Well, until I attempted tab completion at which point I was told that I actually needed to install something to make it work, which in turn needed me to reinstall git via homebrew.

Sigh.
  1. brew install git
  2. brew install bash-completion
  3. git config --global push.default simple
That last is, of course, not a Mac specific requirement and shouldn't be needed since git 2.0 but I don't trust default behaviour since Code Vanished back in my last place of work and mild panic ensued. If you don't know what it does you should probably be doing it.

Installing SublimeText 3


I had already realised I wasn't going to be able to directly copy my old Sublime config to this machine as I had a whole new button to work around. Still, I assumed installation would be straightforward then I could spend some time remapping keys until I was more or less happy. I also wanted to be able to use the subl command on the command line to open files like in the old days, but this was proving difficult so I had to call in help (from a different helpful Mac user as I was already feeling like a moron at this stage). The look of horror he gave me when he saw how I was running Sublime told me I had done something wrong. Again.

It turns out that running a downloaded dmg file runs from a mounted volume. I needed to drag my running application to the Applications option in the file browser and then the Mac did some more exciting magic things and everything was fine. Right, not going to forget that one in a hurry.

Where are my windows?


One of the other things I really miss from Ubuntu-land is the way it handles multiple desktops. Maximising a window in OSX puts it into a full screen mode which moves it to its own desktop and makes it difficult to move around if you're used to ALT CMD+Tabbing around. There is a way around this - it turns out that if you hold ALT and click the maximise button you get the old "make big" behaviour and ALT+Green toggles back again.

If you want a keyboard shortcut (and you do) you need to install Spectacle (brew cask install spectacle) then you can maximise (not fullscreen) with CMD+ALT+f. To go back to normal size you can use CMD+ALT+z (thanks to yet another friendly Mac user for that one).

Fortunately, the CMD+` shortcut to move between windows of the same type still works, although harder to use with the § ` key moving to pastures new.

Is it working now?


I think so - or at least it nearly. RVM installation didn't bring up any nasty surprises and seems to be working perfectly. On the other hand, Finder is extremely odd. If, like me, you're used to moving around files with the arrow keys then hitting enter to open them, you might be surprised to discover that enter in fact lets you rename the selected file. If, like me, you then go hunting for the alternate shortcut you may struggle to find it unless (unlike me) you think to try CMD+Down which for some reason will do what you want. I had to ask. Now you don't have to.

These are the reports of my adventures so far. I may do a follow-up when I have to do battle with virtualisation if it proves tricksy (which is likely because, to be fair, it's hardly trivial on any platform) or if anything else thrilling comes up. After quite a few hours playing with this system I'm in a position where it is doing a fair impression of vanilla Linux. Albeit with the keys in the wrong places.

I hope this helps someone. Happy Christmas.

Edit: behold Part 2.

Saturday, 25 July 2015

iPhone to Android - apps impressions

The last major change is with the new apps and app store. As I said before, I really like being able to install apps from a desktop web browser but how are the apps themselves? Well, in no particular order...

The default Android calendar app is nice. Not amazing, but definitely more usable than the iOS calendar.

The notes app on the G4 seems ok, but saves its notes to a hidden folder in Google Drive. This fills me with fear for the time I want to migrate to a new notes application. I want to be able to see my backups in plain text somewhere so I can reuse them - migrating from Apple to Android has really shown me the benefit of thinking about that up front. iOS notes was sync'ing to GMail and I wanted something which would do the same. It took some searching, but I turned up GNotes which not only syncs in the same way, but when I gave it access to my Google account pulled all my old iOS notes through. Impressive. At some point I will have a look at Google Keep, but this has got me started.

Shazam seems slightly better designed on Android, although that could be my imagination. Annoyingly (but not surprisingly) I had to buy the ad-free upgrade again. I was hoping it would let me log in cross-platform to avoid that repeat charge, but alas not.

Having Chrome on my phone is lovely. Rather than messing around with bookmarks in Safari they are just sync'd from my desktop. I could have done this on the iPhone of course.

Mailbox isn't quite as nice as the iOS version. Functionality is the same, but I keep opening mail when I am trying to swipe - something I don't remember doing before. It's still by far the best mail app I've used though.

Textra is a great text message app. Not much more to say on this except that I've coupled it with SMS Backup+ which is sync'ing my text messages with GMail to avoid the horror experienced when trying to save them in a readable format from iOS.

The Flickr app. Hmm. Photo uploading was always going to be a big difference between the two operating systems because it demonstrates a major difference in the underlying ideology. In iOS to upload to Flickr you fire up the Flickr app, select your photo, edit it and upload - it starts from the application to upload. In Android you start from the picture, open it in the editing program of choice and push it to another app to handle the uploading. The change takes a little getting used to (change is change, even though the Android setup makes a lot more sense) and would be much better except for one important fact - the Android Flickr app is awful. Significantly worse than the iOS version. It seems to be missing several key features for editing (auto-correct, most of the effects) which makes it only useful for uploading and unless you want to post to Twitter at the same time, the Bot for Flickr is actually a better option for uploading as you can queue a load of pictures to automatically upload next time you connect to a wifi connection.

Photo uploading also highlights a security feature in Android which hasn't fully been adopted by the app developers yet. Resources on the SD card from one application cannot be modified by another application unless permission is given. When you take a photo, the image is a resource owned by the camera so you can't modify it with an editing application. Instead, the editor needs to save a copy but the apps I've used do not switch to this new version on save so I've had to edit, save, back out of the picture, and go into a different picture stream in order to find the saved file for uploading. There is some explanation of the underlying problem in this thread.

The upshot is that uploading photos involves an annoyingly convoluted workflow. It's not the end of the world, but could definitely be better and this is using the (otherwise excellent) Android / LG gallery app.

So far, I'd say none of the apps seem different enough to make a huge difference to anyone's life. I was surprised how easy it was to switch between operating systems and either keep the same apps or find easy substitutions.

Thursday, 23 July 2015

iPhone to Android - LG G4 first impressions

Enough of getting out of Appleville - what is it like in the world of Android?

Initial impressions were a little shaky. I hate unclipping molded plastic. No matter how well it is made, it always feels like it is going to break so getting the back off the phone was fraught. Of course, the fact I could get the back off at all is a point in its favour as this handset has a replaceable battery and expandable memory.

Putting in the micro SD card was a bit odd - it felt like it wasn't locked securely into place. It turned out that it wasn't so I needed to open it up again to fix it but it needed a bit more of a push than I was initially willing to give. Still, having it open let me switch the back for a Qi wireless charging enabled case which clipped into place and Just Worked. I don't need wireless charging in my life but it was one of the little things I was excited to try - it feels like I'm in the future. Yes, I'm a child.

Next, loading it up. Key noises. Argh. First task on any new device - silence the system noises. The Android ones seem particularly obnoxious to me. Also, the default Android (or possibly LG?) keyboard is pretty irritating. Why doesn't it auto-complete for me?

Powering through the horrible sounds and annoying keyboard, I put in my Google account details and ... that's it. The phone thinks for a few moments and EVERYTHING WORKS. Calendar, email, contacts, music, files in Drive, sync - the list goes on. I'm very, very impressed. It's not quite as good as a fully iCloud Apple device, but it's much cleaner than I'm used to using non-Apple services on an iPhone.

It gets better from there. Everything that is annoying can be changed. Keyboard? Swiftkey please. Sounds? Change them. Turn them off. Whatever. Text messaging not great? Install an entirely new text message application (Textra). And so on. If you can't be bothered to do it on your phone, just log into Google Play on your desktop and tell it to install stuff to your phone from there. I think you can do this on an iPhone but since it involves firing up iTunes I'd rather add the applications directly to the phone's hard disk using a magnetised needle.

Out of the box I'd say iOS has the edge. It's more refined, snappier and has much better defaults. But Android gives me options iOS users can only dream about. Arguably far too many configuration options, but it really didn't take too long to go through the ones I cared about and by the end I have something which works very well and is tailored to the way I use the phone. It's still doesn't feel quite as snappy as a new iPhone but it's much more than fine and the personalisation definitely makes up for it.

The LG G4 is a lovely device. Much bigger than the iPhone 4S, but it really didn't take very long to get used to the change. The screen is quite beautiful - quad HD with a great colour definition -  and the camera is fantastic too. The battery started out frightening - I struggled to get a full day out of the charge - but a friend told me they gain life after a day or so of use and he was right. Last time I looked, the indicator said I had 75 hours remaining. My usage has dropped off a bit as I've stopped fiddling with it but not that much.

Android tells me things about the battery. How much it's using and which applications are consuming the power. Why didn't my iPhone tell me this information?

So - first impressions weren't great. Almost every other impression since then has been brilliant. I've been using the system for a little over a week now and it still gives me actual pleasure - it has been a long while since I could say that about a phone.

Saturday, 18 July 2015

iPhone to Android - iMessage

My phone number is attached to iMessage so any incoming texts will disappear into the Apple servers and be delivered to my iOS devices. This was great when using an iPhone but now basically means texts are delivered to my iPad.

This was something that hadn't even occurred to me until a friend complained I wasn't reading his messages. A quick hunt online turned up Apple's Deregister iMessage tool which is very easy to use. I had already put my SIM in my new phone by this point and couldn't be bothered to dismantle everything so I used the SMS deregister and it worked immediately.

I think I'm free now?

Thursday, 16 July 2015

iPhone to Android - music

After the horror of extracting my SMS data from my iPhone, I moved on to music. Currently I have my music in iTunes with Match so I can stream to my device. A little reading showed me Google Play is:

  • bigger (stores at least twice the number of tracks)
  • not using iTunes
  • cheaper (free!)
  • not using iTunes
  • web accessible
  • not using iTunes
The setup was easy, led through by a well designed website. It pushed me to the Chrome app which seemed to have trouble reading my music but then I found the desktop version. I pointed it at my (iTunes) music folder. It scanned it and about 2 hours later I had an online library of around 2500 songs. I am struggling to find the words to express quite how easy it was.

Now, I have a very fast internet connection here but I was also watching stuff on YouTube and talking on Skype while it did its thing and didn't notice any problems. It even handled the multi-artist albums which iTunes sometimes struggles with (albums with "artist featuring another artist" on it). I've not dug through my online library in too much detail yet but I'm yet to find a mistake.

I'm impressed.

Wednesday, 15 July 2015

iPhone to Android - contacts and SMS messages

I want to retain as much data as possible from my iPhone, most importantly my contacts list. In theory my phone contacts should have been sync'd with my Google contacts but that doesn't seem to have worked completely. Instead I made use of Contacts Sync by Playa Apps (a name that inspires trust). The interface was very simple and, although it cost me a couple of quid, it let me push all my iCloud contacts to Google contacts in a few minutes. There was probably a free way to do this but really it wasn't worth finding.

On to SMS messages and this is where I'm reminded one of the reasons I want to escape Apple control. These messages are my data and they are backed up into my iCloud account but can I get at them? Or can I download the iCloud backup and pull them out? Of course not. Cue an hour of hunting around for something which would help me and not try to charge me $20+ for the privilege of extracting my own data. 

Finally, there is light at the end of the tunnel. If I manually back up my iPhone via iTunes (like in the Olden Times) then I can extract the SMS messages using AllYourTexts which is simple to use and free. Finally, I have a folder of my message history, freed from the Apple Prison.

I'm expecting the Android import to be significantly easier but even if it isn't I now have the data saved.

iPhone to Android

After seven years as an iPhone user I have decided to give Android a go. Going into this, my expectations are:
  • significant financial saving on the handset
  • expandable memory on the device
  • pain in the switch over
  • better integration with the services I already use (basically the Google suite)
My first hope was immediately dashed - somewhere along the lines, the handset manufacturers decided to start selling premium phone at premium prices. Fortunately, and unlike the Apple world, prices fluctuate massively so I eventually found an LG G4 for under £400 which was a significant enough saving to be worth a go. It also seems to be one of the few front-runner phones which offers replaceable battery and memory expansion - it seems these features are dying out which is disappointing.

I'm expecting switch over pain. It's a new operating system so there is no way it will be a seamless transition. Also, the handset I've bought is much bigger than my old phone so I'm expecting it to take some time to get used to that.

There wont be any comments on speed here. I'm coming from an iPhone 4S so the new phone will be faster, but it's hardly a point of comparison.

A collection of thoughts and experiences through the change over: