Skip to content

Instantly share code, notes, and snippets.

mevanlc / search_and_replace.jse
Created May 15, 2018
Microsoft JScript - Search and replace in a text file using regex
View search_and_replace.jse
var fso = new ActiveXObject("Scripting.FileSystemObject");
var shell = new ActiveXObject("WScript.Shell");
var READ = 1, WRITE = 2, APPEND = 8;
var argc = WScript.Arguments.Count();
if (argc < 4)
mevanlc /
Last active May 8, 2019
Reusing gpg-agent across login sessions (bashrc) on a headless server
# Run:
# sudo apt-get install gnupg-agent
# sudo apt-get install pinentry-curses
# Edit:
# $HOME/.gnupg/gpg-agent.conf:
# pinentry-program /usr/bin/pinentry-curses
# default-cache-ttl 28800000
# max-cache-ttl 28800000
# Edit:
# $HOME/.subversion/config:
mevanlc /
Last active May 9, 2019
In liu of a 'renice' cmdline utility on Windows. Requires Python and the library.
#!/usr/bin/env python
# Copyright (c) 2019, Giampaolo Rodola', Michael Clark. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
In liu of a 'renice' cmdline utility on Windows.
$ winrenice chrome.exe below
mevanlc / cmdhere.reg
Last active May 8, 2019
Add "Cmd Here" context-menu entry to Windows Explorer. Mnemonic hotkey is spacebar.
View cmdhere.reg
Windows Registry Editor Version 5.00
; After right-clicking on a folder in Windows Explorer,
; you can press spacebar to immediately execute Cmd Here and open a cmd prompt.
@="Cmd& Here"
; By using pushd, we are able to open a cmd prompt on \\network\shares as an automatically mapped temporary drive letter.
; Make sure to use the "exit" command to close the command prompt, to automatically unmap the temporary drive.
@="cmd /k \"cls&pushd \"%l\"\""