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/sh | |
# MAC - L2 address formatter | |
# Copyright (C) 2011, 2014 Matous J. Fialka, <http://mjf.cz/> | |
# Released under the terms of The MIT License | |
FORMAT=Collon | |
LETTER_CASE=Keep | |
while [ $# -gt 0 ] |
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
struct Edge; /* forward declaration */ | |
#define VERTEX_MAX_EDGES 3 /* instead of real memory allocation */ | |
struct Vertex { | |
unsigned long int width; | |
struct Edge *edges[VERTEX_MAX_EDGES]; | |
void *datum; | |
}; |
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
#! /usr/bin/awk -f | |
# DUSUM - Summarize Output of Program du(1) | |
# Copyright (C) 2012 Matous J. Fialka, <http://mjf.cz/> | |
# Released under the terms of The MIT License | |
# | |
# Note: Human-readable mode of du(1) is auto-detected. | |
BEGIN { | |
B = 1 |
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/sh | |
# FRATE - Print file grow rate in Kbps | |
# Copyright (C) 2012 Matous J. Fialka, <http://mjf.cz/> | |
# Released under the terms of The MIT License | |
if [ $# -ne 1 ] | |
then | |
printf 'usage: frate [file]\n' 1>&2 | |
exit 1 |
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/sed -f | |
## Markdown2Dokuwiki - reformat Markdown to Dokuwiki | |
## Copyright (C) 2012 Matous J. Fialka, <http://mjf.cz/> | |
## Released under the terms of The MIT License | |
## TODO: many things yet... | |
# reformatovani nadpisu | |
s/^#####/==/ |
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/sh | |
# ASK - asks Yes/no question (with signal handling) | |
# Copyright (C) 2011 Matous J. Fialka, <http://mjf.cz/> | |
# Released under the Terms of The MIT License | |
signal_handler() | |
{ | |
printf -- 'Interrupted.' |
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/sh | |
# PT - Trace process ID up in the process tree | |
# Copyright (C) 2012 Matous J. Fialka, <http://mjf.cz/> | |
# Released under the terms of The MIT License | |
if [ $# -ne 1 ] | |
then | |
echo usage: pt pid | |
exit |
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/sh | |
# PUT SOME CODE WORKING ON $1 HERE | |
if [ $# -gt 1 ] | |
then | |
shift | |
exec $0 $* | |
fi |
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/sh | |
# lockscript - Shell script locking template | |
# Copyright (C) 2012-2014 Matous J. Fialka, <http://mjf.cz/> | |
# Released under the terms of The MIT License | |
# USAGE | |
# ===== | |
# | |
# Rename, link or source this file to your desired script. |
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/sh | |
date -d "`[ $(date +%u) -eq 1 ] && echo 3 days ago || echo yesterday`" $* |