Skip to content

Instantly share code, notes, and snippets.

Justin J. Novack jnovack

Block or report user

Report or block jnovack

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
@jnovack
jnovack / alfred-4-open-iterm.applescript
Created May 31, 2019
Alfred 4 Custom Terminal Applescript to Open iTerm
View alfred-4-open-iterm.applescript
-- Alfred 4 Custom Terminal Script for iTerm
-- To Install, copy to: Alfred --> Features --> Terminal --> Custom
on alfred_script(q)
if application "iTerm2" is running or application "iTerm" is running then
run script "
on run {q}
tell application \"iTerm\"
activate
try
View gist:61d08890137fb28e0cabf203505e670e
cat files | awk '{for(i=1;i<=NF;i++){ tmp=match($i, /PATTERN/); if(tmp){print $i}} }' | sort | uniq -c | sort -rn
View journal.go
package main
import (
journal "github.com/coreos/go-systemd/journal"
)
func j(message string) {
err := journal.Send(message, journal.PriInfo, tags)
if err != nil {
log.Fatalf("%s", err)
@jnovack
jnovack / break.go
Last active Sep 29, 2018
Handle CTRL-C in Golang
View break.go
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"time"
)
@jnovack
jnovack / docker-compose.yml
Created Sep 17, 2018
Docker Swarm ElasticSearch Cluster (Exposed)
View docker-compose.yml
# Exposes the ElasticSearch cluster on :9200
# of all Docker Swarm Nodes (poor man's clustering)
# [NSFW] X-Pack-Security Disabled, Kibana-Monitoring Enabled
version: '3.7'
services:
node:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.0
ports:
- "9200:9200"
@jnovack
jnovack / wrap.sh
Created Sep 9, 2018
awk word-wrap / trim at certain number of columns
View wrap.sh
!/bin/bash
# `export WIDTH=120` to change the width
## awk-wrap
alias wrap='awk -v WIDTH="${WIDTH:-72}" '\''
{
gsub("\t"," ")
$0 = line $0
while (length <= WIDTH) {
@jnovack
jnovack / file_env.sh
Created Apr 25, 2018
Variables of Variables in /bin/sh
View file_env.sh
#!/bin/sh
file_env() {
local envVar="$1"
local fileVar="${envVar}_FILE"
eval envVarContents="\$${envVar}"
eval fileVarContents="\$${fileVar}"
if [ ! -z "$envVarContents" ] && [ ! -z "$fileVarContents" ]; then
echo >&2 "error: both $envVar and $fileVar are set (but are exclusive)"
exit 1
fi
View keybase.md

Keybase proof

I hereby claim:

  • I am jnovack on github.
  • I am jnovack (https://keybase.io/jnovack) on keybase.
  • I have a public key whose fingerprint is BF9C 783D 2222 5964 3191 04A6 0CD0 19C2 B340 6656

To claim this, I am signing this object:

View ovfenv.py
#!/usr/bin/python
#
# Copyright 2011 VMware, Inc. All rights reserved.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@jnovack
jnovack / README.md
Created Oct 8, 2017
Custom Fibaro RGBW LED Controller in SmartThings
View README.md

This extends the native SmartThings device handler to support editing the device's parameters from the SmartThings GUI, and to support the use of one or more of the controller's channels in IN/OUT mode.

First go to http://bit.ly/rgbwfib and select all, copy. Then Google search SmartThings IDE . Log in there, and then click on "My Device Handlers" and add new. Click "From Code" along the top then paste in the box. Hit "Save"

You can’t perform that action at this time.