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 / 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 / find.sh
Created June 7, 2017 15:27
Find with Exec
find . -type f -name "*.log" -exec rm {} \;
@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 / 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 / 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 / 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 / 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"/>
# run multiple websites from nginx
# https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3
chgrp -R www-data /var/www
sudo chmod 775 /var/www
sudo mkdir -p /var/www/example.com/public_html
sudo chown -R www-data:www-data /var/www/example.com/public_html
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/example.com
sudo vi /etc/nginx/sites-available/example.com
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com
sudo rm /etc/nginx/sites-enabled/default
@lloydroc
lloydroc / linodefresh.txt
Last active December 23, 2016 04:56
Fresh Linode Installation
# Create an image (Ubuntu 16.04 LTS) and boot it up - see https://www.linode.com/docs/getting-started for help
# ssh into it
# install nginx - https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04
sudo apt-get update
sudo apt-get install zsh
sudo apt-get install git
sudo apt-get install nginx
sudo ufw app list
sudo ufw allow 'OpenSSH
@lloydroc
lloydroc / nah
Created December 17, 2016 22:14
alias nah='git reset --hard; git clean -df'