Below you will find pages that have the tag “tips”
Fast translation with Google Translator
via https://medium.com/@mrdoro/fast-translation-with-google-translator-and-mac-osx-817e32233b7a
Spotlight: use-package, a declarative configuration tool - Mastering Emacs
via https://www.masteringemacs.org/article/spotlight-use-package-a-declarative-configuration-tool
Using Multiple SSH Keys with Github
via http://www.freshblurbs.com/blog/2013/06/22/github-multiple-ssh-keys.html#tldr
Fixing Emacs problems with the fish shell
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:
- Changing my account's default shell back to `/bin/bash`
- Changing my Terminal.app preferences to run `/usr/local/bin/fish` when a shell opens, instead of the default login shell:

Moving files between git repositories, preserving history
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):
Three levels of GIT config
via http://www.codinginahurry.com/2011/02/05/three-levels-of-git-config/
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
.
- project: Project configs are only available for the current project and stored in
-
git config user.name "John Doe"
git config --global user.name "John Doe"
git config --system user.name "John Doe"
Watching for changes (Polling notifications) in Evernote
via https://dev.evernote.com/doc/articles/polling_notification.php
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
Find all single-note tags in Evernote
Mac keyboard shortcuts by Matt Gemmell
Airmail tip: prevent "Save to Evernote" action from opening the created note
- 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.applescript
This 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 note
and 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.
How to stop com.apple.dock.extra from "using significant energy"
Changing "message:" protocol handler from Sparrow back to Mail.app

How to fix "texexpand error: More than one input file specified" in latex2html
There's a bug that causes problems when running latex2html on files which have spaces in the path. The workaround is to either move things to folders with no spaces, or add appropriate symbolic links.
This error had me stumped in trying to process a latex file with latex2html:
texexpand: Error: More than one input file specified.
texexpand failed: No such file or directory
The fix is simple - make sure the path of the current directory does not have any spaces.
Installing latex2html under Win7 with cygwin
I got latex2html to install on the latest cygwin, however to get the configure to pass I had to alter the configure to recognize cygwin as a UNIX.
Using this patch I was able to properly configure and install latex2html under cygwin in Windows 7.
LogParser, Event Logs, and Vista - Neil Carpenter's Blog - Site Home - TechNet Blogs
The only workaround to this is to convert the logfile to the new evtx format prior to parsing it. You can do this in the event log viewer GUI by doing a Save As... but I find it easier to do this at the command prompt:
wevtutil epl application.evt application.evtx /lf:true
I'm trying to process Windows Event Viewer files (.evt) from some servers on my Win7 machine, which kept me giving a "log file is corrupt" error message. The trick is to convert it to the newer .evtx format before processing. Thankfully this can also be easily done using a command-line utility.
Making cygwin, Windows and emacs understand the same symlinks
Today I ran into the problem that symlinks created under cygwin using "ln -s" are not understood by Windows, and of course Windows shortcuts are seen by cygwin as regular files. Happily, this is a (semi-)solved problem. For reference, this is what needs to be done:
- Add "winsymlinks" to your CYGWIN environment variable. For example, in my .bashrc I have the following: export CYGWIN="nodosfilewarning winsymlinks"
This makes cygwin create symlinks differently, in a form that is understood both by it and by Windows.
This is the main step, and the only one if you just need access from the shell and from the Windows explorer. However, emacs still sees those symlinks as regular .lnk files. To fix this, follow the next step.
Hierarchical copying with cfengine3
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:
files: | |
suse_9:: | |
"${sys.workdir}/bin" | |
perms => usystem("0700"), | |
copy_from => mycopy("${repository}/bin/suse_9"), | |
depth_search => urecurse("1"); |
Becomes:
vars: | |
"suffixes" slist => { "${sys.flavour}" }; | |
files: | |
"${sys.workdir}/bin" | |
perms => usystem("0700"), | |
copy_from => mycopy("${repository}/bin.${suffixes}"), | |
depth_search => urecurse("1"); |
While this looks at first sight even longer than the original (and of course, in this case you could just specify ${sys.flavour} directly in the copy_from statement), it is much more flexible. Instead of defining different sections for each class that you want to handle (e.g. suse_9, redhat_5, etc.), the same code is able to copy the corresponding binary directory for any operating system, you just have to put the corresponding bin.* directory in your repository.
Emulate vi's % command (jump to matching parenthesis) in Emacs
; One of my recent favorite pieces of Emacs configuration. The % command was one of the things I missed the | |
; most in Emacs, until I found this little gem. I modified it from its original source by adding | |
; previous-line and next-line to the list of commands. | |
; From http://www.emacswiki.org/emacs/ParenthesisMatching#toc4 | |
(defun goto-match-paren (arg) | |
"Go to the matching parenthesis if on parenthesis AND last command is a movement command, otherwise insert %. | |
vi style of % jumping to matching brace." | |
(interactive "p") | |
(message "%s" last-command) | |
(if (not (memq last-command '( | |
set-mark | |
cua-set-mark | |
goto-match-paren | |
down-list | |
up-list | |
end-of-defun | |
beginning-of-defun | |
backward-sexp | |
forward-sexp | |
backward-up-list | |
forward-paragraph | |
backward-paragraph | |
end-of-buffer | |
beginning-of-buffer | |
backward-word | |
forward-word | |
mwheel-scroll | |
backward-word | |
forward-word | |
mouse-start-secondary | |
mouse-yank-secondary | |
mouse-secondary-save-then-kill | |
move-end-of-line | |
move-beginning-of-line | |
backward-char | |
forward-char | |
scroll-up | |
scroll-down | |
scroll-left | |
scroll-right | |
mouse-set-point | |
next-buffer | |
previous-buffer | |
previous-line | |
next-line | |
) | |
)) | |
(self-insert-command (or arg 1)) | |
(cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) | |
((looking-at "\\s\)") (forward-char 1) (backward-list 1)) | |
(t (self-insert-command (or arg 1)))))) | |
(global-set-key (kbd "%") 'goto-match-paren) |
Installing AucTeX on EmacsW32 on Win7/64bit
$ ./configure --prefix='c:/Program Files (x86)/Emacs/emacs' --with-texmf-dir='/usr/local/share/texmf' --with-lispdir='c:/Program Files (x86)/Emacs/emacs/site-lisp'
$ make
$ make install I then added the following lines to my C:\Program Files (x86)\Emacs\site-lisp\site-start.el file:
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.
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.