Skip to content

Instantly share code, notes, and snippets.

View dayne's full-sized avatar

Dayne Broderson dayne

View GitHub Profile
@dayne
dayne / ckblock
Last active April 21, 2017 16:08
current knife block hint script
#!/bin/bash
if [ -d $HOME/.chef ]; then
cd $HOME/.chef
knife_target=$(readlink knife.rb)
current=$(basename -s .rb ${knife_target/knife-/})
echo -n $current
else
echo ""
fi
@dayne
dayne / Bleach-README.md
Last active April 21, 2017 16:16
bleach - a silly tool to improve the view & clean vagrant global-status

bleach command helps me clean up my left over vagrant stuff.

Yes, vagrant global-status is not hard. I just dont' like the output. I like the output of bleach

LICENSE: MIT AUTHOR: Dayne Broderson

@dayne
dayne / gina-git_cleanup.sh
Created June 2, 2017 17:28
remove remote branches script
#!/usr/bin/env bash
# Usage: gina git_cleanup
# Summary: Detect and delete git branches that are merged and can be removed.
# This must be run from master
starting_branch=`git branch | grep ^\* | awk "{ print \$2 }"`
git checkout master
if [[ $? -ne 0 ]]; then
echo "git checkout master failed - bailing out before doing any further activities"
@dayne
dayne / 0-NSF-2017-Polar_Hackathon.md
Last active August 1, 2017 18:45
mac-brewing_update notes for 2016 NSF polar hackathon
@dayne
dayne / edex-port-check.py
Created August 29, 2017 20:05
edex port check
#!/bin/env python
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ports = [ 5672 , 9581, 9582, 388 ]
for i in ports:
result = sock.connect_ex(('137.229.19.230',i))
if result == 0:
print "Port %d is open" % i
else:
print "Port %d is not open" % i
@dayne
dayne / commands on LSH
Last active September 1, 2017 01:43
chromebook dev box
Collection of commands typed on the LSH
* `sudo apt install xfce4 xfce4-goodies tightvncserver`
* `vncserver`
* set a password (limit 8 characters)
* now have a vnc server running on :1
* vncserver -kill :1
* backup the .vnc/xstartup
```
#!/bin/bash
@dayne
dayne / bash_it-theme.bash
Created September 30, 2017 01:28
bash_it-theme
SCM_THEME_PROMPT_PREFIX=""
SCM_THEME_PROMPT_SUFFIX=""
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
SCM_GIT_CHAR="${bold_green}±${normal}"
SCM_SVN_CHAR="${bold_cyan}⑆${normal}"
SCM_HG_CHAR="${bold_red}☿${normal}"
case $TERM in
@dayne
dayne / swathviewer.sh
Created November 3, 2017 22:04
a command line launcher for swathviewer
#!/usr/bin/env bash
# Enable completions
# Usage: gina swathviewer
# Summary: Downloads and starts swathviewer
# Help: Options:
# --force-download # force redownload of the client
if [ "$1" = "--complete" ]; then
echo --force-download
exit
@dayne
dayne / Drive_MIgration.md
Last active December 4, 2017 04:19
Migrating Windows to a new drive

Migrating an OS drive to a new drive

Sometimes it is nice to migrate an existing operating system drive to a new drive without having to reinstall or do weird migration things with odd commercial/custom software.

Why do this? A few reasons: My old spinning disk isn't as much fun as a new SSD. My SSD is too small and I need wiggle room!

The following are the steps needed for migrating a windows OS drive to a new drive. Covering two different scenarios:

  1. Scenario 1: Current existing drive smaller than new drive
  2. Scenario 2: Existing drive is larger than new drive.
@dayne
dayne / habitat in general.md
Last active December 8, 2017 03:00
habitat setup

Simple build system for packages

Uses bash scripts for the plans - check out github.com/habitat-sh/core-plans

When making habitat packages you are building packages in isolation, so they don't depend on the build system's libraries tools, and you can make them portable. They are kind of making their own OS packages available.

Any of these packages can run on any linux OS that has a modern kernel on a x86_64 architecture (no love for RPi). Lots of tutorials.

hab studio enter

  • what you will see is only what was in the directory that you entered - it will look for a .bah