Skip to content

Instantly share code, notes, and snippets.

View cjk's full-sized avatar
💭
I may be slow to respond.

Claus Klingberg cjk

💭
I may be slow to respond.
View GitHub Profile
;; -------------------------------------------------------------------------------------------------------------------------
;; Neo tree open xdg on point helpers
;; -------------------------------------------------------------------------------------------------------------------------
(defun neotree-open-xdg-on-point ()
"Open a file under point."
(interactive)
(call-process "xdg-open" nil 0 nil
(neo-buffer--get-filename-current-line)))
;; Add "o" as the key that will launch the function
@felipou
felipou / retry.sh
Last active March 26, 2024 16:41
Retry command
#!/bin/bash
#
# Created by Felipe Machado - 2016/02/14
#
# A retry command for bash
# Retries the given command up to MAX_RETRIES, with an interval of SLEEP_TIME
# between each retry. Just put it on your bash_profile and be happy :)
# Usage:
# retry [-s SLEEP_TIME] [-m MAX_RETRIES] COMMAND_WITH_ARGUMENTS
#
@wsargent
wsargent / docker_cheat.md
Last active May 27, 2026 15:46
Docker cheat sheet
@henrik-muehe
henrik-muehe / Dockerfile
Created August 5, 2013 11:47
Allows installing the ubuntu "fuse" package without creating any devices. Used to install packages on docker which require fuse but do not actively use it.
...
# Fake a fuse install
RUN apt-get install libfuse2
RUN cd /tmp ; apt-get download fuse
RUN cd /tmp ; dpkg-deb -x fuse_* .
RUN cd /tmp ; dpkg-deb -e fuse_*
RUN cd /tmp ; rm fuse_*.deb
RUN cd /tmp ; echo -en '#!/bin/bash\nexit 0\n' > DEBIAN/postinst
RUN cd /tmp ; dpkg-deb -b . /fuse.deb
@machty
machty / new-router-examples.md
Last active April 16, 2020 22:03
How to do cool stuff with the new Router API
@0
0 / cols.txt
Created April 30, 2013 01:41
Brief awk tutorial
abc 1 2 3
def 4 5 6
ga 7 9 10
hij 1 5 99
@KartikTalwar
KartikTalwar / Documentation.md
Last active July 24, 2026 21:21
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@lackac
lackac / config.coffee
Created October 25, 2012 14:31
Simple configuration which is overridable through env vars
# Find the appropriate setting for the provided key
module.exports = config = (key) ->
# return setting from environment variable
if env_value = process.env[key.toUpperCase()]
try
return JSON.parse(env_value)
catch err
if err instanceof SyntaxError
return env_value
else
@glenrobertson
glenrobertson / cool_story_bro.md
Created August 30, 2012 22:15
git access behind http proxy

I shouldn't have to do this shit..

  1. Install corkscrew

  2. Setup corkscrew auth file

     echo your_proxy_username:your_proxy_password > ~/.corkscrew_auth
    
  3. Add to ~/.ssh/config

@rauchg
rauchg / ms.md
Created December 21, 2011 00:25
Milliseconds conversion utility.