Skip to content

Instantly share code, notes, and snippets.

@mkb
mkb / gist:40bf48bc401ffa0cc4d3
Last active March 3, 2022 19:12
Disable power management on Raspberry Pi USB Wifi interface

Too early to tell whther this solved my problem but recording for posterity anyway. In theory this will stop my Raspberry Pi from dropping off the network after it has been idle for a while.

Before

pi@dashboard ~ $ iwconfig
wlan0     IEEE 802.11bgn  ESSID:"Professor Ping"
     Mode:Managed  Frequency:2.437 GHz  Access Point: B8:E6:25:9B:62:02
     Bit Rate=39 Mb/s   Tx-Power=20 dBm

Retry long limit:7 RTS thr:off Fragment thr:off

@mkb
mkb / manifest.yml
Last active November 29, 2017 10:41 — forked from drnic/manifest.yml
BOSH deployment manifest - AWS
name: redis
director_uuid: 2a535e7b-333c-4830-8042-521eb4c163bc
releases:
- name: redis
version: latest
compilation:
workers: 6
network: redis1
reuse_compilation_vms: true
cloud_properties:
@mkb
mkb / gist:1050659
Created June 28, 2011 07:19
Color scheme for multitail and Pow logs
# % cd ~/Library/Logs/Pow/apps
# % multitail --config <some path>/multitail.conf -CS pow app1.log app2.log ...
colorscheme:pow:
cs_re:blue::
cs_re:cyan:^\[[^]]*]
cs_re:red:ERROR
cs_re:yellow:WARNING
cs_re:green:NOTICE
cs_re:magenta:DEBUG
@mkb
mkb / stub.yml
Last active April 4, 2017 18:02 — forked from drnic/stub.yml
spiff merge stub for redis deployment to aws ec2
---
meta:
environment: redis-warden
service_name: NAME
security_groups:
- default
job_templates:
- name: redis
release: redis
stemcell:
@mkb
mkb / bumpme
Last active January 9, 2017 18:58
Mon Jan 9 18:58:39 UTC 2017
@mkb
mkb / bumpme
Last active September 26, 2016 23:57
Mon Sep 26 23:57:29 UTC 2016
@mkb
mkb / gist:ea429a1e2d78fb602f94
Created December 12, 2014 03:57
Return mana percentage in combat or if less than 100%
function()
local mana = math.max(0, UnitMana("player"));
local max = math.max(1, UnitManaMax("player"));
local p = math.floor(mana / max * 100)
if UnitAffectingCombat("player") or p < 100 then
return string.format("%.f", p);
else
return ""
end
end
@mkb
mkb / I call bullshit.md
Last active December 14, 2015 10:39
I call bullshit

There are quite a few problems with the reasoning that Yahoo had good reasons for their ban on remote work as described in an article by Business Insider.

  1. Does VPN usage have any relationship with productivity? I see no reason to think so.
  2. Did 100% of remote workers have low VPN usage or just some? Does it make sense to drive your best people away?
  3. If an employee is abusing their situation as a remote worker, will that person suddenly become a superstar when chained to a desk? Are they perhaps more likely to become resentful?
  4. Why not speak to managers of employees whose remote work is suspect?
  5. The author does not appear to have spoken with any actual Yahoo employees. Is it so hard to find a few of the 11,500 out there?
  6. I have spoken with actual Yahoo employees and they are livid.
  7. US GDP per capita is rising as is the prevalence of telecommuting. Why would this correlation
@mkb
mkb / gist:5051011
Created February 27, 2013 19:42
rvm install 2.0.0 w/MacPorts
[2013-02-27 11:35:52] /Users/mkb/.rvm/rubies/ruby-2.0.0-p0/bin/ruby
Exception `LoadError' at /Users/mkb/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rubygems.rb:1073 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/mkb/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rubygems.rb:1082 - cannot load such file -- rubygems/defaults/ruby
ERROR: Your gem push credentials file located at:
/Users/mkb/.gem/credentials
has file permissions of 0644 but 0600 is required.
You should reset your credentials at:
@mkb
mkb / gist:4760712
Created February 12, 2013 07:02
Background job processor requirements

Today @jdhuntington suggested writing a queuing system. This got me to thinking: What would I want in an ideal work queue? Here are some of my thoughts. I am eager to hear yours.

Key

Life without these has been difficut.

Reliable requeuing of failed jobs.

If a job craps out, don't just drop it on the floor. Keep re-trying until it succeeds. Bonus points for a configurable retry limit. Über bonus points for sending a notification when a job fails.