$ cat check_weekly_update.sh
#!/bin/bash
## check if the last cygwin update is less than a week back by
## checking if the newest file in /etc/setup is younger than a week
This file contains hidden or 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 | |
# TMOUT is implemented using SIGALRM, so blocking it stops bash from terminating itself. | |
/usr/bin/env --block-signal=SIGALRM bash |
This file contains hidden or 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
(defun region-length-kill (pref beg end) | |
"counts the length/chars in the region. | |
Prefix argument counts newlines twice for DOS" | |
(interactive "P\nr") | |
(let* ((reg-len (- end beg)) | |
(reg-len-dos? (if pref (+ (count-matches "\n" beg end) | |
reg-len) | |
reg-len))) | |
(message (format "Region length: %s" reg-len-dos?)) |
This file contains hidden or 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
;; stuff taken and modified from ement-room.el -- ement-room-compose-org | |
(require 'ement) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;;;;;;; revert to fundamental composing | |
(defun ement-room-compose-fundamental () | |
"Activate `fundamental-mode' in current compose buffer. | |
Configures the buffer appropriately so that saving it will not use any filter" |
This file contains hidden or 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
(defun mo-compare-killring () | |
"copy some text to kill-ring, set point to the beginning of similar looking text, run this function. | |
The cursor will be set to the first difference" | |
(interactive) | |
(let ((s (current-kill 0 t)) | |
(pos 0)) | |
(while (and (< pos (length s)) | |
(equal (aref s pos) (char-after (point)))) | |
(forward-char) | |
(incf pos)) |
This file contains hidden or 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 | |
if [ "${1::1}" == "/" ]; then | |
echo "refusing to archive absolute filenames" >&2 | |
exit 1 | |
fi | |
while [ "$1" != "" ]; do | |
if [ -d "$1" ]; then | |
"$0" "$1"/* |