Skip to content

Instantly share code, notes, and snippets.

@rmrf-run
rmrf-run / code.py
Created November 3, 2019 16:02
servo control with circuit python and trinket m0
import board
import digitalio
import time
import pulseio
import adafruit_motor.servo
import random
pwm = pulseio.PWMOut(board.A2, frequency=50)
servo = adafruit_motor.servo.Servo(pwm, min_pulse=900, max_pulse=2400)
led = digitalio.DigitalInOut(board.D13)
@rmrf-run
rmrf-run / gist:5889f5a842ea7ae78ce81ec2db303ae9
Created April 5, 2019 14:49 — forked from bsmartt13/gist:efa02c40ea12c09d9c3a
OTX IP Reputation download links (updated hourly)
https://reputation.alienvault.com/reputation.generic.gz
https://reputation.alienvault.com/reputation.generic
https://reputation.alienvault.com/reputation.data
https://reputation.alienvault.com/reputation.snort.gz
https://reputation.alienvault.com/reputation.snort
https://reputation.alienvault.com/reputation.iptables.gz
https://reputation.alienvault.com/reputation.iptables
https://reputation.alienvault.com/reputation.squid.gz
https://reputation.alienvault.com/reputation.squid
https://reputation.alienvault.com/reputation.unix.gz
@rmrf-run
rmrf-run / updateEBSTags.py
Created April 23, 2018 20:55
Lambda function to update Volume tags with same tags from instance
import json
import boto3
'''
Works as Lambda function
Could pass in region from event or hardset region
'''
def main(event, context):
#print("Received event: " + json.dumps(event))
responseString = ''
region_list = ['ap-southeast-2']
8.2.3. HTTP log format
----------------------
The HTTP format is the most complete and the best suited for HTTP proxies. It
is enabled by when "option httplog" is specified in the frontend. It provides
the same level of information as the TCP format with additional features which
are specific to the HTTP protocol. Just like the TCP format, the log is usually
emitted at the end of the session, unless "option logasap" is specified, which
generally only makes sense for download sites. A session which matches the
"monitor" rules will never logged. It is also possible not to log sessions for
@rmrf-run
rmrf-run / run-innobackupex.sh
Created April 17, 2017 04:49 — forked from jmfederico/run-xtrabackup.sh
Script to create full/incremental backups with innobackupex script.
#!/bin/sh
TMPFILE="/tmp/innobackupex-runner.$$.tmp"
USEROPTIONS="--user=XXX --password=XXX"
FILTERTABLES="--include=.*[.].*"
BACKDIR=/var/mysql-bak
BASEBACKDIR=$BACKDIR/base
INCRBACKDIR=$BACKDIR/incr
FULLBACKUPLIFE=3600 #604800 # How long to keep incrementing a backup for, minimum 60
KEEP=1 # Keep this number of backups, appart form the one currently being incremented
@rmrf-run
rmrf-run / ddns.sh
Created September 27, 2016 15:07 — forked from lyoshenka/ddns.sh
Quick and dirty DDNS using Bash and Cloudflare (API v4 compatible)
#!/usr/bin/env bash
# Step 1: Fill in EMAIL, TOKEN, DOMAIN and SUBDOMAIN. Your API token is here: https://www.cloudflare.com/a/account/my-account
# Make sure the token is the Global token, or has these permissions: #zone:read, #dns_record:read, #dns_records:edit
# Step 2: Create an A record on Cloudflare with the subdomain you chose
# Step 3: Run "./ddns.sh -l" to get the zone_id and rec_id of the record you created.
# Fill in ZONE_ID and REC_ID below
# This step is optional, but will save you 2 requests every time you this script
# Step 4: Run "./ddns.sh". It should tell you that record was updated or that it didn't need updating.
# Step 5: Run it every hour with cron. Use the '-s' flag to silence normal output
@rmrf-run
rmrf-run / c-ddns.sh
Created September 26, 2016 19:11 — forked from kevinoconnor7/c-ddns.sh
CloudFlare Dynamic DNS
#!/bin/sh
WAN_IP=`curl ifconfig.io/ip`
OLD_WAN_IP=`cat /var/CURRENT_WAN_IP.txt`
if [ "$WAN_IP" = "$OLD_WAN_IP" ]
then
echo "IP Unchanged"
else
curl https://www.cloudflare.com/api_json.html \
-d 'a=rec_edit' \
-d 'tkn=8afbe6dea02407989af4dd4c97bb6e25' \
@rmrf-run
rmrf-run / rpmcve
Created August 24, 2016 18:27
Useful function to query change log to check if cve fixes have been applied
rpmcve () {
rpm -qa --changelog $1 | grep $2
}
@rmrf-run
rmrf-run / CiscoKeyGen.py
Last active August 16, 2016 14:37 — forked from paalfe/CiscoKeyGen.py
Cisco IOU License Generator. Originally found at http://www.routingloops.co.uk/cisco/gns3-v1-1-install-on-ubuntu-14-04-lts/, I have done a few changes to it. Make the file executable with " chmod +x CiscoKeyGen.py " and execute it " ./CiscoKeyGen.py ".
#! /usr/bin/python
#Run this locally on your remote gns3 server
#copy output to file on your local desktop
#upload license file at gns3.yourdomain:8000/upload
#upload your iou file at same spot if you haven't done so
print "\n*********************************************************************"
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version"
import os
import socket
import hashlib
@rmrf-run
rmrf-run / Vagrantfile
Created March 5, 2016 01:04
My CentOS vagrant setup at work
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
# For a list of vagrant boxes visit the site below
# http://www.vagrantbox.es/
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|