↓ Skip to main content
  1. Tags/

Tips

Elvish, an awesome Unix shell

Elvish, an awesome Unix shell

·663 words·4 mins
I’m always on the lookout for new toys, particularly if they make my work more productive or enjoyable. For a couple of months now I have been using a little-known Unix shell called Elvish as my default login shell on macOS, and I love it.

Fast translation with Google Translator

·56 words·1 min
via https://medium.com/@mrdoro/fast-translation-with-google-translator-and-mac-osx-817e32233b7a https://medium.com/@mrdoro/fast-translation-with-google-translator-and-mac-osx-817e32233b7a Nice article about how to create a service to automatically translate selected text from any application. I use this all the time, I have a “German-to-English” service bound to Command-Alt-Ctrl-Shift-E, so I can just select text off the screen, press the shortcut, and a window with the translation will pop up. Very handy.

Using Multiple SSH Keys with Github

·78 words·1 min
via http://www.freshblurbs.com/blog/2013/06/22/github-multiple-ssh-keys.html#tldr Since Github doesn't allow us to reuse an SSH Key, the only sane solution is to jump through some hoops and generate + use multiple keys on the server itself. Let's look at some effective approaches of doing that. Short version: define multiple hosts in the SSH config file for each repository, which use different SSH keys, then you can assign different deploy keys to each repo. But read the whole article for the full details.

Fixing Emacs problems with the fish shell

·114 words·1 min
I started getting errors from the TRAMP Emacs package because I was using fish as my default shell, and it does not recognize certain standard syntax elements (such as && to separate commands), and Emacs runs subcommands under the default shell. I fixed this by:

Three levels of GIT config

·119 words·1 min
via http://www.codinginahurry.com/2011/02/05/three-levels-of-git-config/ Very nice explanation, via coding in a hurry There are 3 levels of git config; project, global and system. project: Project configs are only available for the current project and stored in .git/config in the project's directory. global: Global configs are available for all projects for the current user and stored in ~/.gitconfig. system: System configs are available for all the users/projects and stored in /etc/gitconfig. Create a project specific config, you have to execute this under the project's directory. git config user.name "John Doe" Create a global config git config --global user.name "John Doe" Create a system config git config --system user.name "John Doe" And as you may guess, project overrides global and global overrides system.

Moving files between git repositories, preserving history

·238 words·2 mins
I needed to copy a directory between two git repositories while preserving its history. I found some good instructions at http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/, which got me started, but I figured out a way to avoid having to move all the files into their directory again (lines 5-6 in Greg’s instructions) by reversing the filter to remove everything I don’t want instead of only including the directory I want. Here are the steps (the idea is the same as in Greg’s post, so please read that to get the explanation, I’m only listing the commands here for reference):

Watching for changes (Polling notifications) in Evernote

·317 words·2 mins
via https://dev.evernote.com/doc/articles/polling_notification.php Useful note about how to poll an Evernote account for new content. Also a test of web clipping with Enwrite. Polling If your app wants to know about changes in a user's Evernote account, you'll probably consider calling the NoteStore.findNotesMetadata function periodically to search for new notes. findNotes is incredibly powerful, but it's also expensive for our servers - we need to load the user's Lucene index, perform the search across all of their notes, hit the database to pull out the results, and send those results over the network to your app. If you're building a web application, you should use webhooks instead of polling. If you have to poll, you should follow the guidelines below.

How to create a new KVM VM using command line tools

·42 words·1 min
I got tired of clicking through virt-manager to create new VMs, so I found the command needed to create one from the command line (thanks https://acidborg.wordpress.com/2010/02/18/how-to-create-virtual-machines-using-kvm-kernel-based-virtual-machine/): virt-install --name=hostname --arch=x86_64 --vcpus=2 --ram=4096 --os-type=linux --os-variant=rhel7 --hvm --connect=qemu:///system --network bridge:br-fabric --cdrom=/var/lib/libvirt/images/CentOS-7.0-1406-x86_64-Minimal.iso --disk path=/var/lib/libvirt/images/hostname.img,size=32 --accelerate --vnc

Find all single-note tags in Evernote

·109 words·1 min
I’ve been working on cleaning up my Evernote, and noticed that I have a lot of tags assigned to a single note. I had successfully used Veritrope’s excellent Evernote empty tag remover applescript, so I made some small changes to write the attached script, which will find all single-note tags in your Evernote and list them in a new note, including links to each note. This makes it much easier to go through them and see which of those tags could be removed. Just download the script, open it in Script Editor and run it. Tip of the hat to Justin for his excellent collection of scripts at Veritrope!

Mac keyboard shortcuts by Matt Gemmell

·63 words·1 min
Another great article by Matt Gemmell. I knew most of them, but learned a few things. The golden part for me were the third-party utilities, in particular Shortcat, which I didn’t know and is amazing: > It’s basically Spotlight but for all visible controls and objects on the screen: it’s type-to-select for *everything you can see*. The whole article is worth a read.

Airmail tip: prevent "Save to Evernote" action from opening the created note

·197 words·1 min
I’ve been trying out Airmail as my main email app. It’s quite nice, I like the built-in integrations, particularly with Evernote. By default, when you use the “Save to Evernote” action, it saves the current message to Evernote and opens the newly-created note. I went spelunking into the Airmail application directory, and found the way to disable the note-opening. Follow these steps: Quit Airmail (don’t know if this is necessary, but it can’t hurt) Open the Terminal app Run the following command in the terminal (all in a single line): sudo /Applications/Utilities/AppleScript\ Editor.app/Contents/MacOS/AppleScript\ Editor /Applications/Airmail.app/Contents/Resources/Evernote.applescriptThis will ask you for your password and then run the AppleScript Editor. Note: in my experience, the AppleScript Editor app may open behind the terminal window - look at the Dock for its icon, and bring it to the front. In the AppleScript Editor window, find this line: open note window with the noteand comment it out by inserting a # at the beginning, like this: # open note window with the note Save the modified file and quit AppleScript Editor. Restart Airmail. That’s it! Now the “Save to Evernote” action saves the current message to Evernote, but does not open it.

How to stop com.apple.dock.extra from "using significant energy"

·96 words·1 min
I’d been having for some time a problem with `com.apple.dock.extra` appearing in the “Apps using significant energy” section of the battery menu. I just learned the solution (from http://forums.macrumors.com/showthread.php?t=1651662): remove BusyCal 1.6 (I upgraded to BusyCal 2, but left the old version around in case I had to go back to it). After removing it and restarting the Dock, the problem stopped. From the same thread, it seems the problem was caused by BusyCal’s “animate transitions” preference. I didn’t try that, but if you are still using BusyCal 1.6 and have this problem, it’s worth trying.

HowTo: Changing the available display formats for Evernote's "Insert Date" command

·172 words·1 min
Evernote introduced some time ago an "Insert Date" keyboard shortcut, which is very handy. However, the options for the format of the inserted date seemed limited (only four options). I finally learned how this works, and how to change it on the Mac. The formats offered are those that are configured in the "Languages & Text" preferences panel. If you go to "Region" and then click the "Customize button" in the Dates part of the panel, you will see and be able to customize the formats for short, medium, long and full date representations. Those are the options that are offered to you by Evernote. Just change them to whatever you want, and they will be available for selection. What I specifically wanted to do was to use the YYYY-MM-DD format, so I changed it to the following:

Fix journal in an HFS+ file system

·256 words·2 mins
Yesterday my external Western Digital disk (which I use for Time Machine, among other things) stopped mounting automatically when I plug it in. This may *cough*definitely*cough*have something to do with me unmounting it forcefully while it was doing a backup, since I was in a hurry.

GTD tip: clean up physical clutter using ziploc bags

·214 words·2 mins
If you are like me, you carry in your backpack, bag or briefcase all sorts of physical stuff, other than documents, papers or magazines. You know the type: phone chargers, USB cables, power adapters, network cables, USB sticks and other small gadgets or accessories. Over time these things accumulate and it becomes harder and harder to find them and to keep them organized.

Hierarchical copying with cfengine3

·239 words·2 mins
I recently posted a snippet to perform hierarchical copying in cfengine3. As I was attempting to integrate this mechanism into my copy of cfengine's COPBL, I realized that no additional functions or body components are needed. Thanks to cfengine3's list expansion, all you need to do is include in the existing copy promise the list containing the desired list of suffixes to try. For example:

Installing AucTeX on EmacsW32 on Win7/64bit

·107 words·1 min
Today I had to install AucTeX to use on my Win7/64 machine under EmacsW32. I found the basic instructions here: http://www.sturmnet.org/blog/2007/09/01/installing-auctex-in-emacsw32, but I had to modify them a bit (in particular, I am using tetex installed from cygwin instead of MiKTeX). Here are the commands I used:

Must-Have Windows Software (or Windows Programs that I use) - good coders code, great reuse

I am not just a Linux enthusiast, I also happen to use Windows quite often. In fact, Windows is my primary desktop from which I connect to all the other boxes and do my work on. During the years of Windows usage, I have accumulated a list of must-have Windows programs that I wouldn’t be able to work without. Some of them are commercial, some are freeware, but that doesn’t matter. What matters is how productive you are with your setup. If you’re really productive on Linux with your own set of tools, it’s perfectly fine and you have done a great job of finding the best tools of trade. via catonmat.net Having recently moved to Windows as my main desktop OS (out of work requirement, not by wish), I have been trying to find good software that makes it a more pleasant environment. This list has many good recommendations.