Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block todgru

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
todgru /
Last active Jan 17, 2020
Start up tmux with custom windows, panes and applications running
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`

#git tag

Think of a git tag as an alias to a sha1 or to a branch.

The Git Book on tagging says there are two main typs of tags, lightweight and annotated. Lightweight only records commit and tag. Annotated records who, what, when and where. Use annotated, -a.

List all tags:

$ git tag
todgru /
Last active Dec 12, 2019
vim git gpg password manage gnupg
todgru /
Last active Nov 26, 2019
Remote, Office Not Require - summary of points that stood out for me

Remote, Office not Required

1. If I can't see them, how do I know they're working?

(pg 54) People have amazing ability to live down to low expectations, or live up to high expectations. If there are trust issues with employees, then the employer made poor hiring decision. Employer/Employee trust is fundamental.

2. People’s homes are full of distractions

(pg 58) being easily distracted from work could mean the work is not well defined or the task is menial, pointless. Might be a chance that if someone feels like this, others on the team might feel the same.

todgru /
Last active Nov 15, 2019
vpn route through another vpn pihole pivpn dnsmasq openvpn


Ideally, I like to run one vpn. I have OpenVPN/PiVPN working just fine.

On the PiVPN server, I'd like to run a VPN client to my work office.

It's difficult to get Cisco VPN client and Tunnelblick clients running side-by-side on the same machine, ie my local dev machine, without a seeming hack(see below).

I have it working locally.

  • Cisco AnyConnect Client connect to work VPN. Only specific resources are made available. All other traffic is routed as normal.
todgru /
Last active Oct 25, 2019
Launchd and plist, replace cron in Mac OS X

#launchd Usage

I have a bash script called that takes one command line argument, bar. I want it to run every 60 seconds and load at startup.

  • an XML plist is Apple Property List
  • Name of launchd plist file should be a reverse fqdn, like (this may not be required, but convention)
  • lives in $HOME/Library/LaunchAgents and is ran as that user.
  • can also live /Library/LaunchDaemons or /Library/LaunchAgents, have requirements, ran as root
  • Load plist with launchctl load
  • Unload plist with lauchctl unload
todgru /
Last active Oct 18, 2019
setting up dnsmasq on raspberry pi nmap ports dns

Local DNS dnsmasq

Use case

I wanted to have an outside domain name resolve to a computer inside my local private network. I am tyring out to handle the resolution. The DNS resolves fine outside of my local network, yet locally the fqdn will not resolve. To enable this, a local dns needs to handle the request, routing to the local server.

This is where the raspberry pi dns comes in. I'm running Raspbian GNU/Linux 9 (stretch), a Debian variant.


I have been unable to get dnsmasq to start correctly on reboot. Nothing stands out in daemon.log. sudo service dnsmasq status shows one particular line that is different from the status of a reboot vs a manual service restart:

todgru / full-object-logging.js
Created Oct 9, 2019
javascript display entire object without truncating object depth
View full-object-logging.js
// to log an entire object without trucated depth:
console.dir(myDeeplyNestedObject, { depth: null });
View sunrise-sunset-algorithm.txt
Sunrise/Sunset Algorithm
Almanac for Computers, 1990
published by Nautical Almanac Office
United States Naval Observatory
Washington, DC 20392
You can’t perform that action at this time.