Skip to content

Instantly share code, notes, and snippets.

@tskrynnyk
tskrynnyk / configs2asciidoc
Created March 16, 2011 00:52
configs2asciidoc
#! /bin/sh
# configs2asciidoc::
#
INC_DIR=.
LIMITER='----'
write_config() {
DST=$1
shift 1
@tskrynnyk
tskrynnyk / log-backup
Created June 26, 2011 09:20
Backup logs.
#! /bin/sh
# log-backup:
#
# Usage:
# log-backup <service>
#
# /etc/logrotate.d/ulogd:
#
# /var/log/ulog/*.log {
# ...
@tskrynnyk
tskrynnyk / Makefile
Created June 26, 2011 11:34
Pandoc makefile
PANDOC = pandoc
%.html: %.md style.css Makefile
$(PANDOC) -c style.css -s -f markdown -t html --standalone -o $@ $<
%.odt: %.md Makefile
$(PANDOC) --standalone -f markdown -t odt -o $@ $<
%.epub: %.md Makefile
$(PANDOC) -o $@ $<
@tskrynnyk
tskrynnyk / reflinks.txt
Created October 21, 2011 19:52
Reference links
@tskrynnyk
tskrynnyk / latex.template
Created October 26, 2011 04:03 — forked from michaelt/latex.template
Simple Pandoc default.latex with comments
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.
@tskrynnyk
tskrynnyk / BOFHexcuse.class.php
Created November 8, 2011 12:13
Random BOFH excuse.
<?php
/*
Random BOFH excuse.
Credit to Jeff Ballard <ballard%cs.wisc.edu> for the original
"The Bastard Operator From Hell"-style excuse server.
See http://www.cs.wisc.edu/~ballard/bofh/ for more info.
*/
//defined('SYSPATH') or die('No direct script access.');
class BOFHexcuse {
$(document).ready(function() {
var fortune_script = '/bofh-excuse.php';
var rotate_timeout = 10000;
var spinner_timeout = 2000;
var rgb = { min:40, range:100 };
var rotate_count = { all:0, max:500, errors:0, max_errors:3 }; /* max:0 for unlimited */
var spinner = $("#spinner");
var fortune = $("#fortune");
var ajax_timeout = 20000;
var ajax_error_msg = "Oops! Error 0xFEE1DEAD.";
@tskrynnyk
tskrynnyk / extract_pandoc_bib.sh
Created November 9, 2011 08:55 — forked from dsanson/extract_pandoc_bib.sh
produce a bibtex file with only the pubs referred to by a pandoc file
#!/bin/sh
# Generate a bibtex file just containing those publications cited in
# a given pandoc document. To use
#
# extract_pandoc_bib.sh myfile.markdown
#
# this will generate `myfile.bib`.
bib="$HOME/.pandoc/default.bib"
@tskrynnyk
tskrynnyk / lwatch-highlights.conf
Created November 30, 2011 22:54
My configuration rules for message higlighting in lwatch
# ------------------------------------------------------------------------------
# My configuration
show_unparsed=yes
# ------------------------------------------------------------------------------
# Higlightings
# Default color for displaying date
date_color=darkgray
@tskrynnyk
tskrynnyk / ufw-script.sh
Last active August 20, 2024 19:05
Simple ufw script
#!/bin/sh
# ufw script
#
ufw disable
ufw --force reset
NET_PRIVATE_ADDR=(10.0.0.0/8 172.16.0.0/12 192.168.0.0/16)
for i in ${NET_PRIVATE_ADDR[@]}; do ufw allow from $i to any app 'SSH'; done
for i in ${NET_PRIVATE_ADDR[@]}; do ufw allow from $i to any app 'WWW Full'; done