Skip to content

Instantly share code, notes, and snippets.

View lloydroc's full-sized avatar

Lloyd Rochester lloydroc

  • Denver, Colorado
View GitHub Profile
@lloydroc
lloydroc / logitech_gs700s_mouse_profile.dat
Created January 21, 2017 14:28
Logitech GS700S Mouse Profile for SW Development
<?xml version="1.0" encoding="utf-8"?>
<obprofiles xmlns="http://www.logitech.com/Cassandra/2013.1/OnboardProfile">
<profile name="Profile 1">
<device anglesnapping="0" powermode="2" reportrate="500" buttoncount="13" model="Logitech.Gaming.Mouse.G700s">
<dpitable currentindex="3" defaultindex="3">
<dpi x="400" y="400"/>
<dpi x="800" y="800"/>
<dpi x="1200" y="1200"/>
<dpi x="1600" y="1600"/>
<dpi x="3200" y="3200"/>
@lloydroc
lloydroc / christmas2014.ino
Created January 29, 2017 15:37
Arduino Sketch giving a Christmas 2014 Lightshow with 75 NeoPixel LEDs - a bit of a hack but it works
#include <SPI.h>
#define NUMLEDS 75
#define LEDPIN 13
#define WRITEPIN 1
#define LED 0
uint8_t counter;
uint8_t pixels[NUMLEDS*3];
@lloydroc
lloydroc / noa_weather.sh
Last active February 27, 2017 00:28
Get the weather from the NOA API
# https://forecast-v3.weather.gov/documentation
curl -ks "https://api.weather.gov/points/39.950859769264014,-105.03283499303978/forecast"
@lloydroc
lloydroc / mytcpdump.sh
Created March 3, 2017 20:55
TCP Dump to Save HTTP Request and Responses
tcpdump -A -i eth0 -s 0 'tcp port 8080 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
@lloydroc
lloydroc / dockernotes.txt
Created May 11, 2017 18:30
Docker Notes
wget https://download.docker.com/mac/stable/Docker.dmg
docker info
docker images
sudo docker run --name helloworld -i -t ubuntu /bin/bash
docker images
docker start helloworld
docker ps
sudo docker attach helloworld # hit enter to bring up the prompt
docker rm helloworld
@lloydroc
lloydroc / find.sh
Created June 7, 2017 15:27
Find with Exec
find . -type f -name "*.log" -exec rm {} \;
@lloydroc
lloydroc / console-to-network-device.sh
Created August 4, 2017 15:45
Mac OS X USB to Serial for Cisco/Juniper Routers and Switches
# Get the prolific driver http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41
screen /dev/tty.usbserial # will appear once plugged in. Use Ctrl-a d to exit
@lloydroc
lloydroc / listen-snmp.sh
Created August 4, 2017 17:52
tcpdump to capture snmp packets
tcpdump -i eno1 -T snmp -n dst portrange 161-162
# output looks like this for an ios router linkup
# 11:47:50.905818 IP 10.10.201.27.56503 > 10.10.202.11.162: V2Trap(138) .1.3.6.1.2.1.1.3.0=791308 .1.3.6.1.6.3.1.1.4.1.0=.1.3.6.1.6.3.1.1.5.4 .1.3.6.1.2.1.2.2.1.1.1=1 .1.3.6.1.2.1.2.2.1.2.1="FastEthernet0/0" .1.3.6.1.2.1.2.2.1.3.1=6 .1.3.6.1.4.1.9.2.2.1.1.20.1="up"
# in ios you can see how many snmp traps, the address its sending to and the port
# router4#show snmp
# Chassis: FTX151202SZ
# 0 SNMP packets input
# 0 Bad SNMP version errors
# 0 Unknown community name
# List them all
sudo iptables -v -t nat -L -n --line-numbers
# Create one in the nat table
sudo iptables -t nat -A POSTROUTING --source 172.17.0.3 --destination 172.17.0.3 -p udp -j MASQUERADE
# Delete one in the nat table
sudo iptables -t nat -D POSTROUTING 12
sudo iptables -t nat -D DOCKER 2
@lloydroc
lloydroc / testsnmptrap.sh
Created August 25, 2017 21:14
Test SNMP Trap
snmptrap -v 2c -c public localhost '' 1.3.6.1.4.1.8072.2.3.0.1 1.3.6.1.4.1.8072.2.3.2.1 i 123456