Archive for the 'tips' Category
I’m a pretty big macOS user with a combination of my primary Mac laptop, an iMac desktop machine and also an ancient Mac Mini Server machine. I’m also a really heavy Terminal user with someone commenting that they’ve not seen a Mac user with so many terminal windows. There’s a secret to this: the terminal and the Mac share many keyboard shortcuts that you’d not expect.No comments
From time to time I buy products online via eBay or AliExpress. I use a Tap Forms 5 database to track my orders and make sure I keep track of everything from when I ordered it to when it arrives. Tap Forms 5 however doesn’t have a feature that let’s me take the value of a random field and template that into a URL (I should probably ask for that). However the Mac has a powerful framework called “Services” that allows you to hook into applications and execute code. One of the easiest ways to build a service is to use Automator.No comments
One of the most annoying things for me about the QWERTY keyboard is the location of the “Q” key next to the “W” key. If you’re not a Mac user and if you’re not someone who heavily uses keyboard shortcuts you probably have no idea what I’m talking about. However if you are a keyboard heavy Mac user like myself you’ve probably run into the situation where you meant to hit Command-W to close a window but you accidentally hit Command-Q to close the entire application.
This can range from annoying to near data loss situations depending on the application you’re in. For me in the case of Safari, I have a lot of tabs and windows. Hundreds of tabs and tens of windows at one stage. Hitting Command-Q on that doesn’t lose me data but it does unload it from memory. Then I need to relaunch Safari again and it has to reload all of those tabs. This can range from a mild annoyance if I’m not in the middle of something right up to being a massive pain because I’m not somewhere with good internet or potentially any internet like a plane.
Now I have a work around I use to prevent me from unintentially quitting Safari when all I wanted to do is close a window or even tab to another application. This workaround just saved me from accidentally quitting Safari and triggered me to write this blog post!No comments
Recently I went through setting up a new Mac from scratch instead of porting it from another machine. As part of this process I set up Apache with a bunch of log files for various VHost’s I’m working on for a side project I’m playing with. This means plenty of logs files. In the past I’ve generally not worried about doing anything with the log files, I just let them grow and if they got too big, nuked them by hand. However this time round I figured I’d get them rotated properly so that I could have clean logs each day that I’m working.
For some reason today my Mac decided it didn’t want to work any more and essentially froze up. It was getting slower over the morning and eventually ground to a halt. I think I might have been able to wait it out and kill some stuff but I ended up hard resetting it. When the machine came back most everything recovered…except for Google Chrome’s tabs.
Google Chrome had opened and left me with a blank window without the normal “It looks like Chrome crashed, do you want to restore the tabs?” button. I have the “Continue where you left off” setting so I’m not sure why that didn’t kick in either. Restoring the tabs restored tabs from one window out of the 10 or so windows I had but also interspersed some tabs I’d closed prior to the crash. A quick Google search for “restore closed tabs after quitting Chrome” gave me a lifehacker article which covered the process. It had some notes on prevention but it had a “Recovery Mode” section which mentioned editing the “Local State” file and changing the “exited_cleanly” entry to be “false”.
The article covers four files in the User Data Directory that are relevant to session and tab restore: Current Session, Current Tabs, Last Session and Last Tabs. The suggestion in “Recovery Mode” is to restore these files. Given I’d lost this data, I wasn’t sure what else had gone so I decided to stop Chrome, rename the “Default” user data directory and then restore the one from an hour ago back in place. Once the restore was done, I edited the “Local State” file as mentioned above and started Chrome. Chrome started and showed the “Chrome didn’t shut down correctly” bar and gave me the option to restore my tabs.
To put this in bullet form, the steps to fix this:
- Stop Chrome.
- Go to ~/Library/Application Support/Google/Chrome/ and rename “Default” to something else. (TIP: You can use SHIFT + APPLE + G in Finder you can paste the path to go straight to that folder).
- Connect to Time Machine.
- Restore the “Default” folder from the Time Machine backup into ~/Library/Application Support/Google/Chrome/ again.
- Start up Google Chrome and click on “Restore” in the bar where it says “Chrome didn’t shut down correctly”.
- All of your windows and tabs should be restored!
This process is very similar to the one for restoring lost Safari tabs. The important piece in both of these cases is to have regular routine backups. Time Machine on Mac OS X provides hourly backups automatically which is invaluable when these sorts of issues occur. Any routine backup solution will work properly (e.g. CrashPlan), you’ll need to adjust the steps to be appropriate for your platform.
Edit: It looks like the Local State file is gone and you may not need to set it anyway according to ssorgs’s comment on this post. If your tabs aren’t automatically restored when you restart, try using SHIFT + APPLE + T to reopen recently closed tabs and that should bring them back.4 comments
Recently I’d been having hardware issues with my Mac which resulted in quite a few hard shutdowns for the machine. Once I got up and running I found to my surprise that I’d managed to lose all of my Safari windows and tabs of which I had in abundance. This was rather distressing as I have far too much research on topics open at any given time for anything from stream processing systems to certificate authorities to research on containerisation to creating grids in AngularJS. Suffice to say I wasn’t excited at the prospect of losing that information.
A quick Google search gave me a bit of hope. There was an article on Mac OS X hints about “Safari loses all your open tabs: recover using Time Machine“. It suggests using a tab backup extension but failing that you can recover it from Time Machine. I have Time Machine backups so this one was easy.
The steps to get this sorted were:
- Stop Safari.
- Connect to Time Machine backup.
- Look for ~/Library/Safari/LastSession.plist in the Time Machine backup (if you press “SHIFT+APPLE+G” and then paste that address, Finder will take you directly to the file).
- Restart Safari and go “History” -> “Reopen All Windows From Last Session”
Once I did that all of my windows and tabs were restored! As an aside I got curious to see what was in the file and if you are curious too there are a few ways to open up a plist file like this one.6 comments
So I don’t have access to my old Huawei modem with my new Mountain Lion box however some comments on my earlier article indicate that the same steps that go Huawei Modems working on Mac OS X Lion also work for Mountain Lion as well. I’ve updated the earlier post title to reflect this and put an update there. Very cool however that it does appear to mostly work.No comments
You know the part before the upgrade where they tell you to check all of your applications before you upgrade? Well, last night I decided that it would be a great idea to upgrade my Mac from Snow Leopard to Lion. Turns out that perhaps wasn’t so great an idea after all when my Huawei USB 3G modem dongle decided that it wasn’t going to work since it wasn’t relevant for the new 64-bit only kernel. Oops, I should have checked first. But it isn’t a complete disaster!
Update: This appears to also work with Mountain Lion as well according to some comments at the bottom. It may not work for everyone but it does appear to work for some.