Looks like this is now fixed as of Docker v1.2.0
For the benefit of the interwebs I'm documenting this here as I've spent several hours pulling my hair out.
package main | |
import ( | |
"fmt" | |
"github.com/codegangsta/martini" | |
"github.com/porjo/goauth2/oauth" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) |
-- Select empty JSON field | |
select * from mytable where jsonfield::text = '{}' | |
-- Select 'title' within JSON field | |
select * from mytable where jsonfield->>'title' = 'Great Expectations' | |
select * from mytable where jsonfield->>'title' like 'Great Expectations%' | |
-- Update: Postgres 9.3 you must update whole field | |
update mytable set jsonfield = '{}' where id = 1 |
import ( | |
"strings" | |
u8 "code.google.com/p/go.exp/utf8string" | |
"github.com/garyburd/redigo/redis" | |
) | |
// Based on code by Salvatore Sanfilippo | |
// http://oldblog.antirez.com/post/autocomplete-with-redis.html | |
func RedisComplete(prefix string, count int) (results []string, err error) { |
# Example reminders file | |
FSET _yr_num(yr) ORD(YEAR(TRIGDATE()) - yr) | |
# Trigger warning every 14, 7, 1, 0 days | |
FSET _warnfunc(x) choose(x, 14, 7, 1, 0) | |
# ------------------- | |
# Birthday's | |
# ------------------- | |
REM 3 Jan WARN _warnfunc MSG %"John's [_yr_num(1970)] Birthday%" is %k (%xd) |
syntax on | |
nnoremap <C-n> :tabnext<CR> | |
nnoremap <C-p> :tabprevious<CR> | |
nnoremap <C-w>t :tabnew<CR> | |
set number | |
set smartindent | |
set autoindent | |
set ruler |
# --------------- | |
# Container | |
# --------------- | |
# Ensure that a default IPv6 route exists on the container (it should match the link-local address of the host running radvd) | |
ip -6 route | |
# --------------- | |
# Radvd Host | |
# --------------- | |
# Ensure that the host has IPv6 address and gateway *statically* assigned (don't rely on autoconf here) |
Looks like this is now fixed as of Docker v1.2.0
For the benefit of the interwebs I'm documenting this here as I've spent several hours pulling my hair out.
Forked from: https://gist.github.com/mmoulton/6224509
This script can be used to feed collectd with cpu and memory usage statistics for running docker containers using the collectd exec
plugin.
This script will report the used and cached memory as well as the user and system cpu usage by inspecting the appropriate cgroup stat file for each running container.
# Look for instantiations of error using fmt.Errorf or errors.New, where first letter is upper-case. Convert that letter to lowercase. | |
# e.g. | |
# return fmt.Errorf("User... | |
# return errors.New("User... | |
# becomes | |
# return fmt.Errorf("user... | |
# return errors.New("user... | |
find -name '*.go' -exec sed 's/\(\(errors\.New\|fmt\.Errorf\)("\)\([A-Z]\)\(.*\)/\1\l\3\4/' {} \; |
visually select A "ay
, visually select B "by
then :s/<ctrl-r>a/<ctrl-r>b/g
Note: pasting in from register produces ^M
and ^I
in place of newlines and tabs. These need to be converted to \n
and \t
respectively.
(Technique also documented here: http://vim.wikia.com/wiki/Search_and_replace)