Skip to content

Instantly share code, notes, and snippets.

@hcooper
hcooper / ping_tcp.pl
Created February 8, 2011 15:24
Script to ping tcp connections, which gets round firewall ICMP blocks. Taken from the Backuppc mailing list here: http://www.mail-archive.com/[email protected]/msg07903.html
#!/usr/bin/perl -w
use strict;
use Net::Ping;
die "usage: $0 port hostname\n" unless(@ARGV == 2);
my $serv = shift @ARGV;
my $host = shift @ARGV;
my $p = Net::Ping->new("tcp", 30);
@hcooper
hcooper / new-apache2-site.sh
Created February 7, 2011 11:03
Script to automate creating new apache2 virtual hosts
#! /bin/bash
# Script to automate creating new apache2 virtual hosts.
# Logs go in /var/log/apache2/$SN
# DocRt is /var/www-vhosts/$SN
# SN = shortname -- used for directory names etc.
# DN = domainname -- used only in apache config file
#
# H Cooper - 18/10/06
#
@hcooper
hcooper / new-openvpn-client.sh
Created February 7, 2011 11:01
Script to automate creating new OpenVPN client certificates and make them easy to download
#! /bin/bash
# Script to automate creating new OpenVPN clients
# The client cert and key, along with the CA cert is
# zipped up and placed somewhere to download securely
#
# H Cooper - 05/02/11
#
# Usage: new-openvpn-client.sh <common-name>
# Set where we're working from