Skip to content

Instantly share code, notes, and snippets.

@tskrynnyk
tskrynnyk / ipdeny2ipset.sh
Created November 18, 2010 21:51
ipdeny2ipset
#! /bin/bash
# ipdeny2ipset:
#
# http://ipset.netfilter.org/
# http://www.ipdeny.com/ipblocks/
# IPdeny fair Usage Limits policy: http://www.ipdeny.com/usagelimits.php
#
# CHINA (CN)
# KAZAKHSTAN (KZ)
# KOREA (KR)
@tskrynnyk
tskrynnyk / ipset-install
Created November 19, 2010 07:43
ipset-install
# ipset in Debian "Squeeze"
# http://ipset.netfilter.org/
aptitude install ipset ipset-source module-assistant
module-assistant auto-install ipset-source
@tskrynnyk
tskrynnyk / grub2_passwd_protection
Created November 21, 2010 00:08
Grub2 passwd protection
. '/etc/grub.d/00_header':
----
cat << EOF
set superusers="user1"
password user1 password1
EOF
----
. '/etc/grub.d/10_linux':
----
@tskrynnyk
tskrynnyk / asterisk-monitor-backup
Last active September 24, 2015 12:07
asterisk-monitor-backup
#! /bin/sh
# asterisk-monitor-backup:
# dev at skrynnyk.pl
#
# echo '10 3 1 * * root test -x /usr/local/sbin/asterisk-monitor-backup && /usr/local/sbin/asterisk-monitor-backup' >/etc/cron.d/asterisk-monitor-backup
#
DELETE_FILE_AFTER_BACKUP=1
COMPRESS=tar # tar, zip
CONVERT=mp3 # mp3
@tskrynnyk
tskrynnyk / bind9-chroot.sh
Created December 26, 2010 14:24
Bind9 in jail
#! /bin/sh
# bind9-chroot.sh: bind9 in jail
# github(at)skrynnyk.pl
#
CHROOTDIR=/var/lib/named
if [ -d $CHROOTDIR ]; then
echo *** $CHROOTDIR exists.
exit 1
== Konfiguracja sprzętowa
- dmesg
- lspci
- fdisk
== Usługi
== Użytkownicy
== Procesy
@tskrynnyk
tskrynnyk / jabber.alert
Created December 30, 2010 01:23
Jabber alert for mon
#!/usr/bin/perl
#
# jabber.alert - Jabber alert for mon
#
# The first line from STDIN is summary information, adequate to send
# to a pager or email subject line.
#
# Jim Trocki, [email protected]
#
# Copyright (C) 1998, Jim Trocki
@tskrynnyk
tskrynnyk / xsend
Created December 30, 2010 02:00
Command-line utility for sending jabber messages.
#!/usr/bin/python
# xsend: command-line utility for sending jabber messages
# http://xmpppy.sourceforge.net/
#
import sys,os,xmpp,time
if len(sys.argv) < 2:
print "Syntax: xsend JID msg"
sys.exit(0)
@tskrynnyk
tskrynnyk / ferm.schema
Created January 19, 2011 22:33
ferm LDAP Schema
# ferm.schema: LDAP schema for ferm
# Written 2008-12-02 by tomasz at skrynnyk.pl
# http://www.openldap.org/
# http://ferm.foo-projects.org/
#
attributetype ( 1.3.6.1.4.1.6987.1.2.3.1 NAME 'fermStatus'
DESC 'ferm status: enabled or disabled.'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
@tskrynnyk
tskrynnyk / simple-fw
Created February 26, 2011 09:18
simple-fw
#!/bin/sh
#
DEV_WAN=ppp0
DEV_LAN=eth0
NET_WAN=
NET_LAN=192.168.1.0/24
IP_WAN=111.222.333.444
IP_LAN=