This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PIDFILE=/tmp/kswapd-check.pids | |
scanpids() | |
{ | |
cat -s /proc/[1-9]*/stat 2>/dev/null | | |
awk 'BEGIN { | |
want["(kswapd0)"]=1; | |
want["(kswapd1)"]=1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Source https://gist.github.com/hilbix/5597981 | |
Public Sub CopySelectedMessagesHeadersToClipboard() | |
Dim sel As Outlook.Selection | |
Dim msg As Outlook.MailItem | |
Dim n As Integer | |
Dim all As String | |
Dim errcnt As Integer | |
Dim omsg As Object | |
Dim mmsg As MAPI.Message | |
Dim spid As String, seid As String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Section "InputDevice" | |
Identifier "Keyboard" | |
Driver "kbd" | |
# Option "XkbModel" "pc105" | |
Option "XkbLayout" "us,de" | |
Option "XKbOptions" "grp:alt_shift_toggle" | |
EndSection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Excerpt of nginx config file | |
#.. | |
# | |
set $ts 0; | |
if ($cookie_TOKEN ~ ",(.*)$") { | |
set $ts $1; | |
} | |
secure_link $cookie_TOKEN; # See TYPO3_ACCESSTOKEN | |
set $sec CHANGE_THIS_SHARED_SECRET; # See TYPO3_ACCESSKEY | |
secure_link_md5 $sec$ts$sec; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see http://www.identityblog.com/?p=645 | |
dir = . | |
[ ca ] | |
default_ca = CA_default | |
[ CA_default ] | |
serial = $dir/serial | |
database = $dir/certindex.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
# Warning, do not keep this publicly reachable, it is dangerous. | |
header("Content-type: text/plain"); | |
$ch = curl_init($_SERVER["QUERY_STRING"]); | |
curl_exec($ch); | |
echo "-- errno: "; | |
echo curl_errno($ch); | |
curl_close($ch); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global --replace-all alias.relate '!f(){ git for-each-ref --format="%(refname:short) %(upstream:short)" refs | while read -r l r; do printf "%24s %s\\n" "$(git rev-list --cherry-mark --dense --left-right --boundary --oneline "${r:-${1:-HEAD}}...$l" -- | sed "s/^\\(.\\).*/\\1/" | sort | uniq -c | tr -d " " | tr "\\n" " ")" "$l"; done; }; f' | |
git config --global --replace-all alias.graph '!f(){ case "$#:$1" in 0:) r="HEAD...HEAD@{u}";; 1:*...*) r="$1";; 1:*) r="HEAD...$1";; *) r="$1...$2";; esac; git rev-list --cherry-mark --dense --left-right --boundary --pretty --graph "$r" -- | less -XFp "$(git rev-parse "${r%...*}")"; }; f' | |
git config --global --replace-all alias.graph1 '!f(){ case "$#:$1" in 0:) r="HEAD...HEAD@{u}";; 1:*...*) r="$1";; 1:*) r="HEAD...$1";; *) r="$1...$2";; esac; git rev-list --cherry-mark --dense --left-right --boundary --oneline --graph "$r" -- | less -XFp "$(git rev-parse "${r%...*}")"; }; f' | |
# THIS IS PUBLIC DOMAIN. | |
# Thanks to the makers of GIT for the extremely impressiv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.exec '!exec ' | |
git config --global alias.top '!f() { GIT_TOP="${GIT_DIR%%/.git/modules/*}"; [ ".$GIT_TOP" != ".$GIT_DIR" ] && cd "$GIT_TOP"; exec "$@"; }; f' | |
# THIS IS PUBLIC DOMAIN. | |
# | |
# `git exec` executes something in the current GIT module's base directory. `git exec pwd` gives this base. | |
# Stolen from http://stackoverflow.com/questions/957928/is-there-a-way-to-get-the-git-root-directory-in-one-command/957978#comment9747528_957978 | |
# | |
# `git top` is like `git exec`, but executes in the topmost GIT directory, even from within a GIT submodule. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOC="$HOME/.local/share/applications" | |
OOPS() | |
{ | |
echo "OOPS: $*" >&2 | |
exit 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: relpath A B | |
# Calculate relative path from A to B, returns true on success | |
# Example: ln -s "$(relpath "$A" "$B")" "$B" | |
relpath() | |
{ | |
local X Y A | |
# We can create dangling softlinks | |
X="$(readlink -m -- "$1")" || return | |
Y="$(readlink -m -- "$2")" || return | |
X="${X%/}/" |
OlderNewer