Or: “Everybody likes being given a glass of water.”
By Merlin Mann.
It's only advice for you because it had to be advice for me.
#!/bin/sh | |
# | |
# /usr/local/bin/ping_check.sh | |
# | |
# First sleep for 3 mins so that we don't run this code if box has only just booted and PPPoE not up yet. | |
/bin/sleep 180 | |
test_http() { | |
url=${1:-http://captive.apple.com} |
set remindersOpen to application "Reminders" is running | |
set monthAgo to (current date) - (30 * days) | |
tell application "Reminders" | |
set myLists to name of every list | |
repeat with thisList in myLists | |
tell list thisList | |
delete (every reminder whose completion date is less than monthAgo) | |
end tell | |
end repeat |
class ApplicationController < ActionController::Base | |
protect_from_forgery with: :exception | |
around_action :global_request_logging | |
def global_request_logging | |
http_request_header_keys = request.headers.env.keys.select{|header_name| header_name.match("^HTTP.*|^X-User.*")} | |
http_request_headers = request.headers.env.select{|header_name, header_value| http_request_header_keys.index(header_name)} | |
puts '*' * 40 | |
pp request.method |
#! /bin/sh | |
# ZFS health version for Ubuntu | |
# You must install the package "dateuils" from the univers | |
# | |
# Based on Calomel.org | |
# https://calomel.org/zfs_health_check_script.html | |
# FreeBSD ZFS Health Check script | |
# zfs_health.sh @ Version 0.16 | |
# Check health of ZFS volumes and drives. On any faults send email. |
require 'net/http' | |
require 'json' | |
require 'uri' | |
@token = '' | |
def list_files | |
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago | |
params = { | |
token: @token, |
WITH RECURSIVE | |
x(i) AS ( VALUES (0) | |
UNION ALL SELECT i + 1 | |
FROM x | |
WHERE i < 101), | |
Z(Ix, Iy, Cx, Cy, X, Y, I) AS ( | |
SELECT | |
Ix, | |
Iy, | |
X :: FLOAT, |
daemon off; | |
# Heroku dynos have at least 4 cores. | |
worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>; | |
events { | |
use epoll; | |
accept_mutex on; | |
worker_connections 1024; | |
} |
#! /usr/local/bin/bash | |
# | |
# Calomel.org | |
# https://calomel.org/zfs_health_check_script.html | |
# FreeBSD 9.1 ZFS Health Check script | |
# zfs_health.sh @ Version 0.15 | |
# Check health of ZFS volumes and drives. On any faults send email. In FreeBSD | |
# 10 there is supposed to be a ZFSd daemon to monitor the health of the ZFS | |
# pools. For now, in FreeBSD 9, we will make our own checks and run this script |
" Assuming keyboard_leds is built and available in your PATH, | |
" this will make capslock indicate whether or not you are in insert mode. | |
autocmd InsertEnter * :!keyboard_leds -c1 | |
autocmd InsertLeave * :!keyboard_leds -c0 | |
" To make Vim control the keyboard backlight, use this. | |
" Note that it's glitchy and you'll probably toss the idea soon after. | |
" I can see programmatically controlling the lights to be useful in other cases, though. | |
" Install Lab tick and set a hotkey for Toggle, and one for Brighten. | |
" http://labtick.proculo.de/ |