Skip to content

Instantly share code, notes, and snippets.

todgru

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
todgru / starttmux.sh
Last active Jan 17, 2020
Start up tmux with custom windows, panes and applications running
View starttmux.sh
#!/bin/sh
#
# 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`
#
session="work"
View git_tag.md

#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
todgru / vim_git_gpg.md
Last active Dec 12, 2019
vim git gpg password manage gnupg
View vim_git_gpg.md
@todgru
todgru / remote-office-not-required-my-take-home-points.md
Last active Nov 26, 2019
Remote, Office Not Require - summary of points that stood out for me
View remote-office-not-required-my-take-home-points.md

Remote, Office not Required https://basecamp.com/books/remote

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
todgru / vpn-in-a-vpn.md
Last active Nov 15, 2019
vpn route through another vpn pihole pivpn dnsmasq openvpn
View vpn-in-a-vpn.md

Vpn-ception

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
todgru / launchd.md
Last active Oct 25, 2019
Launchd and plist, replace cron in Mac OS X
View launchd.md

#launchd Usage

I have a bash script called foo.sh 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
  • com.mydomain.foo.plist Name of launchd plist file should be a reverse fqdn, like (this may not be required, but convention)
  • com.mydomain.foo.plist lives in $HOME/Library/LaunchAgents and is ran as that user.
  • com.mydomain.foo.plist can also live /Library/LaunchDaemons or /Library/LaunchAgents, have requirements, ran as root
  • Load plist with launchctl load com.mydomain.foo.plist
  • Unload plist with lauchctl unload com.mydomain.foo.plist
@todgru
todgru / dns-troubleshooting.md
Last active Oct 18, 2019
setting up dnsmasq on raspberry pi nmap ports dns
View dns-troubleshooting.md

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 duckdns.org 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. http://www.raspbian.org/

NOTE

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:

View aws-ec2-redis-cli.md
@todgru
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
From: https://edwilliams.org/sunrise_sunset_algorithm.htm
Sunrise/Sunset Algorithm
Source:
Almanac for Computers, 1990
published by Nautical Almanac Office
United States Naval Observatory
Washington, DC 20392
Inputs:
You can’t perform that action at this time.