Skip to content

Instantly share code, notes, and snippets.

View tzermias's full-sized avatar

Zacharias Tzermias tzermias

View GitHub Profile
#!/usr/bin/php
<?php
# Senderbase Monitoring Plugin for Nagios
# Dan Miller <dm@sub6.com>
error_reporting(E_ERROR | E_PARSE);
# Function to swap the octets of an IP...
# ..address around in to ARPA formatting.

Keybase proof

I hereby claim:

  • I am tzermias on github.
  • I am tzermias (https://keybase.io/tzermias) on keybase.
  • I have a public key whose fingerprint is A5A5 CA5F 3942 49F8 10AF 0B8F 4EB4 A0C3 B597 E551

To claim this, I am signing this object:

@tzermias
tzermias / racktables.py
Created March 17, 2015 09:38
A simple script that parses data from the show "mac address-table" command of Dell Poweredge 5548 switch, and updates a specific network switch object in Racktables.
#! /usr/bin/env python
""" racktables.py
Simple script that parses data from 'show mac address-table' command of Dell
Poweredge 5548 switch, and updates the Racktables DB accordingly
a.tzermias@tophost.gr
"""
@tzermias
tzermias / plesk.fact
Created September 3, 2015 14:09
Ansible fact for retrieving plesk version
#!/bin/bash
VERSION=$(awk '{print $1}' /usr/local/psa/version)
VERSION_MAJOR=$(echo $VERSION | cut -d'.' -f1)
cat <<EOF
{
"plesk_version" : "$VERSION",
"plesk_version_major" : "$VERSION_MAJOR"
}
@tzermias
tzermias / ubuntu.ipxe
Last active October 13, 2015 00:57
Netboot Ubuntu 12.04 (32-bit) from ftp.ntua.gr using iPXE (taken from gist.github.com/2234639.git)
#!ipxe
# Set server where image will be downloaded.
# archive.ubuntu.com works fine but you can use your own.
set server archive.ubuntu.com
# Specify a distro
# Just type the distro codename here...
set distro quantal
@tzermias
tzermias / Dockerfile
Last active December 7, 2015 22:46
Dockerfile from devstaff hack session
# This dockerfile clones github-analytics repository (https://github.com/kabitakis/github-analytics), installs prerequisites
# and runs the app.
# Start the container with `docker run -e TOKEN=test12345 <container>`
FROM node:latest
MAINTAINER tzermias
#Clone repository
RUN git clone https://github.com/kabitakis/github-analytics.git
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
@tzermias
tzermias / geoip_demo.py
Created January 7, 2014 21:38
Script that queries the GEOIP2 Precision Demo by Maxmind from the commandline. Not fully tested.
#! /usr/bin/env python
import urllib2
import json
import sys
def main(args):
if len(args) != 2:
print "%s IPADDR" % args[0]
exit(255)
@tzermias
tzermias / rate_limit.py
Created January 14, 2014 13:03
Find which method of the Twitter API (via tweepy) doesn't have any available requests.
rate_limit = api.rate_limit_status()
[key2 for key in rate_limit['resources'] for key2 in rate_limit['resources'][key].keys() if rate_limit['resources'][key][key2]['remaining']==0]
@tzermias
tzermias / DHT22_BMP180.ino
Last active March 2, 2016 16:34
Sketch that combines measurements from DHT22 and BMP180 sensors
// Sketch that combines measurements from DHT22 and BMP180 sensors
// and prints them to serial.
// Aris Tzermias (github.com/tzermias)
// Pinout on Arduino Leonardo/Yun.
// Pin 2: SDA (BMP180)
// Pin 3: SCL (BMP180)
// Pin 4: DHT22
#include "DHT.h"