Skip to content

Instantly share code, notes, and snippets.

View BrianGilbert's full-sized avatar

Brian Gilbert BrianGilbert

View GitHub Profile
# prevent the creation of .DS_Store files on network drives
# http://hints.macworld.com/article.php?story=2005070300463515
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
#---------------------------------------------------------------------
# Disable/enable Dashboard:
# http://hints.macworld.com/article.php?story=20050723123302403
defaults write com.apple.dashboard mcx-disabled -boolean YES
Verifying myself: My Bitcoin username is +briangilbert. https://onename.io/briangilbert
@BrianGilbert
BrianGilbert / ipaddress.pl
Created September 16, 2014 20:19
Get internal and public IP addresses (used with geektool)
#!/usr/bin/perl
# a little script to get your network status
$en0_info = `ifconfig en0 | grep "inet" | grep -v 127.0.0.1`;
$en2_info = `ifconfig en2 | grep "inet" | grep -v 127.0.0.1`;
$en4_info = `ifconfig en4 | grep "inet" | grep -v 127.0.0.1`;
$ext_info = `curl --silent http://checkip.dyndns.org | awk '{printf \$6}' | cut -f 1 -d "<" | tr -d '\n'`;
$airport_network = `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | awk -F: '/ SSID/ {print \$2}' | tr -d ' '`;
if($ext_info)
@BrianGilbert
BrianGilbert / gist:cd88e274fe87a1b5ad58
Created September 30, 2014 14:17
Install OS X command line tools (10.9+)
xcode-select --install
@BrianGilbert
BrianGilbert / nginx_ojs_include.conf
Last active January 8, 2021 07:04
nginx configuration for OJS on an aegir box
#######################################################
### nginx compact ojs configuration start
#######################################################
location ~ /\.ht {
deny all;
}
location ~ ^/cache(.*)$ {
deny all;
@BrianGilbert
BrianGilbert / ojs-vhost.conf
Last active August 29, 2015 14:13
OJS VHost example for aegir box
server {
listen 127.0.0.1:443 ssl;
server_name ojs.ld; # only used for logging, because default_server sends all requests to this block
ssl_certificate /usr/local/etc/ssl/private/nginx-wild-ssl.crt;
ssl_certificate_key /usr/local/etc/ssl/private/nginx-wild-ssl.key;
limit_conn gulag 10; # like mod_evasive - this allows max 10 simultaneous connections from one IP address
keepalive_timeout 70;
###
@BrianGilbert
BrianGilbert / homebrew.mxcl.solr4.plist
Last active August 29, 2015 14:20
homebrew.mxcl.solr4.plist for use with OSX Aegir to emulate BOA settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.solr4</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-Djetty.home=/usr/local/opt/solr4/example</string>
@BrianGilbert
BrianGilbert / BI V2.5 Calibration.txt
Last active April 28, 2018 09:45
BI V2.5 Calibration notes
Stepper Calibration (Current)
=============================
Check the Vref of your steppers first, They should be at around 450mV for the X,Y,Z axis. And 700mV for the extruders.
You need a multimeter, a small screwdriver, a steady hand and a lot of patience. With the BI on its side, power it up. Look at each of the drivers (that would be a row of 4-6 identical daughter boards on the RUMBA board. There is a small (really small) potentiometer, that's the screw. Look for the point labeled GND. Take the ground lead from the multimeter and touch it to the GND point, then put the hot lead of your multimeter on the screw -- that will give you the current voltage.
For safety's sake, turn off the printer before adjusting the pot. Use a small screwdriver to adjust the pot. A tiny movement may make a big difference in the voltage so go slowly. Check the voltage. Adjust. Check again. Adjust....
Bed Levelling
@BrianGilbert
BrianGilbert / config.g
Last active January 3, 2018 23:11
Duet BI Config with Nimble with Chimera
; Configuration file for big Kossel from Think3DPrint3D V0.1 Date 20150708 with revisions for Duet V0.8.5 by Tony
; and addition of 3 more drives and second PWM fan for testing
; Communication and general
M111 S0 ; Debug off
M550 PZestyZero ; Machine name and Netbios name (can be anything you like)
M551 zesty ; Machine password (used for FTP)
;*** If you have more than one Duet on your network, they must all have different MAC addresses, so change the last digits
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED ; MAC Address
@BrianGilbert
BrianGilbert / init.lua
Created April 5, 2016 05:35
Hammerspoon Config
local alert = require "hs.alert"
local application = require "hs.application"
local fnutils = require "hs.fnutils"
local grid = require "hs.grid"
local hotkey = require "hs.hotkey"
local mjomatic = require "hs.mjomatic"
local window = require "hs.window"
grid.MARGINX = 0
grid.MARGINY = 0