Skip to content

Instantly share code, notes, and snippets.

@ajorpheus
ajorpheus / zmv-examples.md
Created May 1, 2018 13:40 — forked from niksmac/zmv-examples.md
ZMV-Examples (require autoload zmv)

rename a section of a filename, i. e. example.1.{txt,conf,db} or 12345.1.{wav,ogg,mp3} and

change the 1 to a 2 in the filename while preserving the rest of it.

$ zmv -n '(.)(<->)(.[^.]#)' '$1$(($2+1))$3' # would rename x.0001.y to x.2.y. $ zmv -n '(.0#)(<->)(.[^.]#)' '$1$(($2+1))$3'

Rename files to lower case

$ zmv '*' '${(L)f}'

serially all files (foo.foo > 1.foo, fnord.foo > 2.foo, ..)

$ autoload zmv

@ajorpheus
ajorpheus / tmux.md
Created June 10, 2018 11:10 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@ajorpheus
ajorpheus / README.md
Created June 13, 2018 14:13 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@ajorpheus
ajorpheus / gist:77e2dc36f3adffa191b131f9228e9cf7
Created June 22, 2018 12:28 — forked from mestizo/gist:9167834
Completely disable IPv6 on OSX
#To Get List of Hardware
sudo networksetup -listallhardwareports
#To Disable IPv6 on Wifi Adapter
sudo networksetup -setv6off wi-fi
#To Disable IPv6 on Built-in Ethernet Adapter
sudo networksetup -setv6off Ethernet
@ajorpheus
ajorpheus / IFTTTDate.md
Created July 20, 2018 13:42 — forked from oscarmorrison/IFTTTDate.md
Make IFTTT Date Format play nice with Google Spreadsheets

##Date and Time

=TIMEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " ")) + DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Date

=DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Time

@ajorpheus
ajorpheus / slackpost
Created July 26, 2018 15:42 — forked from dopiaza/slackpost
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1
@ajorpheus
ajorpheus / socks_proxy_2_http_proxy.md
Created August 1, 2018 23:25
How to convert SOCKS proxy (e.g Shadowsocks) to HTTP proxy

How to convert SOCKS proxy (e.g Shadowsocks) to HTTP proxy

Step 1

Install Privoxy

brew install privoxy
@ajorpheus
ajorpheus / ios-compile.sh
Created September 19, 2018 23:00 — forked from wtlangford/ios-compile.sh
libjq ios-compile.sh
#!/bin/bash
# old values
OLD_CFLAGS=$CFLAGS
OLD_LDFLAGS=$LDFLAGS
# might fail. This is okay.
make distclean
rm -rf `pwd`/build/ios
@ajorpheus
ajorpheus / gist:3382de02fd569cd27071eb9ab681ca1f
Last active January 30, 2019 19:27 — forked from kevinhooke/gist:d2eabbd402741ae728ef6ab2985dfddd
Using Docker on Windows with Cisco AnyConnect VPN in non-split tunnel mode
@ajorpheus
ajorpheus / jenkins-dsl-textarea-resize.user.js
Last active February 21, 2019 16:12
Resize the textarea (ace_editor) containing the Jenkinsfile (pipeline DSL) when replaying a build
// ==UserScript==
// @name Fix Jenkins Pipeline DSL textarea height
// @version 0.1.2
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @match https://jen-m.ons.statistics.gov.uk/*
// ==/UserScript==
waitForKeyElements (".ace_content", actionFunction);