Skip to content

Instantly share code, notes, and snippets.

#include <stddef.h>
#include "event_queue.h"
// Toggle the MSB every time an index wraps.
// This tells pi and ci apart if they are equal (empty vs full).
#define WRAP_CHECK(var) do { \
if (((var) & QUEUE_SIZE_MASK) == 0) { \
(var) = (~((var) & 0x80) & 0x80); \
} \
/* $OpenBSD: ssh.c,v 1.364 2011/08/02 23:15:03 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
* Ssh client program. This program can be used to log into a remote machine.
* The software supports strong authentication, encryption, and forwarding
* of X11, TCP/IP, and authentication connections.
*
* As far as I am concerned, the code I have written for this software
$ bundle exec rake compile
mkdir -p tmp/x86_64-darwin12.2.0/hiredis_ext/2.0.0
cd tmp/x86_64-darwin12.2.0/hiredis_ext/2.0.0
/Users/pieter/.rbenv/versions/2.0.0-p0/bin/ruby -I. ../../../../ext/hiredis_ext/extconf.rb
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb hiredis.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb sds.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb async.c
ar rcs libhiredis.a net.o hiredis.o sds.o async.o
creating Makefile
#!/usr/bin/env bash
set -e
[ -n "$DEBUG" ] && set -x
# rbenv
if [ ! -d "$HOME/.rbenv" ]
then
pushd $HOME
git clone git://github.com/sstephenson/rbenv.git .rbenv
#!/usr/bin/env bash
set -e
[ -n "$DEBUG" ] && set -x
(
xargs sudo apt-get install -y
) <<EOS
build-essential
libcurl4-openssl-dev
diff --git a/redis/resources/redis.conf.erb b/redis/resources/redis.conf.erb
index 8934ab0..dacfc51 100644
--- a/redis/resources/redis.conf.erb
+++ b/redis/resources/redis.conf.erb
@@ -1,9 +1,6 @@
requirepass <%= password %>
port <%= port %>
maxmemory <%= memory %>mb
-vm-swap-file <%= swap_file %>
-vm-max-memory <%= vm_max_memory %>mb

You may be affected by this bug when the sorted sets you use contain integer members in the 24-bit signed range (+/- ~8 million). If the 2.6 RC server already took writes to these sorted sets, they may be corrupted (contain duplicates).

Running 2.6 RC, fresh instance

Nothing to worry about. You're good to go!

Running 2.6 RC, loaded dump from 2.4

If possible, use the original 2.4 dump, upgrade the 2.6 RC process to the code listed below, and restart Redis loading the dataset from the 2.4 dump.

$ git push pietern 2.6-makeinstall
Counting objects: 363, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (124/124), done.
Writing objects: 100% (308/308), 40.69 KiB, done.
Total 308 (delta 238), reused 238 (delta 182)
remote: WARN The gem environment is out-of-date or has yet to be bootstrapped.
remote: Run script/bootstrap to remedy this situation.
remote: /data/github/current/config/basic.rb:56: gem environment not configured (RuntimeError)
remote: from hooks/post-receive:13:in `require'
#!/usr/bin/env bash
set -e
set -x
path=$(mktemp -d)
rd=$path/rd
wr=$path/wr
mkfifo $rd
@pietern
pietern / mcf_nginx_11.sh
Created March 24, 2012 21:08
Upgrades nginx to 1.1.17 on Micro Cloud Foundry
#!/bin/bash -e
lua_url="http://www.lua.org/ftp/lua-5.1.4.tar.gz"
lua_tgz="lua-5.1.4.tar.gz"
lua_dir="lua-5.1.4"
echo "Downloading and extracting ${lua_tgz}..."
[ ! -f "${lua_tgz}" ] && wget -q -O ${lua_tgz} ${lua_url}
rm -rf ${lua_dir}
tar zxf ${lua_tgz}