Skip to content

Instantly share code, notes, and snippets.

@linickx
linickx / cidr2mask.php
Created October 24, 2011 16:04
php network functions
<?php
function cidr2mask($netmask) {
$netmask_result="";
for($i=1; $i <= $netmask; $i++) {
$netmask_result .= "1";
}
for($i=$netmask+1; $i <= 32; $i++) {
@linickx
linickx / README.md
Created April 5, 2020 09:02
Python Test DNS XFER

Testing for DNS Zone Transfers

A simple script to check if a DNS server will zone transfer.

Setup.

  1. Update domains.txt with the domain names (zones) you want to try and transfer
  2. Update servers.txt with the DNS Servers you want to run the script against
  3. Either install Docker/Docker-Compose or Python with dnspython
@linickx
linickx / convertmac.py
Last active March 3, 2021 15:29
Python and MAC addresses
#!/usr/bin/env python
# My Post: http://www.linickx.com/3970/python-and-mac-addresses
# REF: http://craigbalfour.blogspot.co.uk/2008/10/normalizing-mac-address-string.html
# REF http://www.cyberciti.biz/faq/python-command-line-arguments-argv-example/
# Lib
import sys, getopt
@linickx
linickx / cisco_decrypt.py
Created August 31, 2017 16:12
cisco_decrypt.py
#!/usr/bin/env python
# coding=utf-8
"""
My version of cisco_decrypt.py
Version 1.0 - Nick Bettison - linickx.com
USAGE:
------
@linickx
linickx / gist:3692156
Created September 10, 2012 17:01
hubot init script for RHEL / CENTOS
#!/bin/bash
# hubot
# chkconfig: 345 20 80
# description: hubot
# processname: hubot
# REFERENCE: http://werxltd.com/wp/2012/01/05/simple-init-d-script-template/
# This script assumes you have a user called "hubot" on your system and that hubot is installed in /opt/hubot
@linickx
linickx / example.xml
Last active August 21, 2016 16:05
learning syslog-ng patterndb
<patterndb version='4' pub_date='2010-10-17'>
<ruleset name='ssh' id='123456678'>
<pattern>ssh</pattern>
<rules>
<rule provider='me' id='182437592347598' class='system'>
<patterns>
<pattern>Accepted @ESTRING:SSH.AUTH_METHOD: @for @ESTRING:SSH_USERNAME: @from @ESTRING:SSH_CLIENT_ADDRESS: @port @NUMBER:SSH_PORT_NUMBER:@ ssh2</pattern>
</patterns>
<examples>
<example>

Keybase proof

I hereby claim:

  • I am linickx on github.
  • I am linickx (https://keybase.io/linickx) on keybase.
  • I have a public key ASDk_u6nQodqu08rbgg5QjQaZ4YAFh5ArJ8aJxYtIYoZMAo

To claim this, I am signing this object:

@linickx
linickx / rktest.php
Created July 24, 2013 20:32
example wordpress_logged_in for root-cookie
<?php
# Either load WordPress : http://codex.wordpress.org/Integrating_WordPress_with_Your_Website
# or Manually define your url like...
$siteurl = "http://www.linickx.com/wordpress";
define( 'COOKIEHASH', md5( $siteurl ) );
$cookiename = "wordpress_logged_in_" . COOKIEHASH;
@linickx
linickx / broken1.xml
Last active December 31, 2015 20:18
Playing is syslog-ng patterns (quotes and bluecoat)
<patterndb version='4' pub_date='2013-12-17'>
<ruleset name='bluecoat' id='dd001'>
<pattern>bluecoat</pattern>
<rules>
<rule provider='linickx' id='nbdd001' class='system'>
<patterns>
<pattern>@NUMBER:BC_HOUR:@:@NUMBER:BC_MIN:@:@NUMBER:BC_SEC:@ @NUMBER:BC_TIME_TAKEN:@ @IPv4:BC_CLIENT_ADDRESS:@ - - - @ESTRING:BC_ACTION: @ "</pattern>
</patterns>
<examples>
<example>
@linickx
linickx / MBP
Last active December 14, 2015 22:08
Post the brew --config and brew doctor for those machines.
[w:11] homebrew $brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 3531460825aed558858ad6b6d2aa82e0da315ed3
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.8.2-x86_64
Xcode: 4.6
CLT: 4.6.0.0.1.1358221012