Skip to content

Instantly share code, notes, and snippets.

View funglaub's full-sized avatar
🏠
Working from home

Florian Unglaub funglaub

🏠
Working from home
  • Nürnberg, Germany
View GitHub Profile
// make sure we're using the right db; this is the same as "use aggdb;" in shell
db = db.getSiblingDB("aggdb");
// simple projection
var p1 = db.runCommand(
{ aggregate : "article", pipeline : [
{ $project : {
tags : 1,
pageViews : 1
}}
var crypto = require('crypto')
, key = 'salt_from_the_user_document'
, plaintext = 'password'
, cipher = crypto.createCipher('aes-256-cbc', key)
, decipher = crypto.createDecipher('aes-256-cbc', key);
cipher.update(plaintext, 'utf8', 'base64');
var encryptedPassword = cipher.final('base64')
decipher.update(encryptedPassword, 'base64', 'utf8');
(source "melpa" "http://melpa.milkbox.net/packages/")
(source "marmalade" "http://marmalade-repo.org/packages/")
(depends-on "ag" "20130131.1652")
(depends-on "idle-highlight-mode")
(depends-on "ruby-mode")
(depends-on "ruby-tools")
(depends-on "ruby-end")
(depends-on "rvm")
(depends-on "css-mode")
@funglaub
funglaub / portmaster.rc
Created July 17, 2012 18:41
FreeBSD Portmaster config file
# $FreeBSD: user/dougb/portmaster/files/portmaster.rc.sample.in 226959 2011-10-31 08:32:36Z dougb $
ALWAYS_SCRUB_DISTFILES=dopt
PM_DEL_BUILD_ONLY=pm_dbo
SAVE_SHARED=wopt
PM_LOG=/var/log/portmaster.log
PM_IGNORE_FAILED_BACKUP_PACKAGE=pm_ignore_failed_backup_package
@funglaub
funglaub / make.conf
Created June 12, 2012 17:10
FreeBSD Hetzner Setup
CFLAGS= -O2 -fno-strict-aliasing -pipe -march=native -fno-omit-frame-pointer
CXXFLAGS+= -fconserve-space
WITHOUT_X11=YES
# added by use.perl 2012-06-08 14:34:18
PERL_VERSION=5.12.4
MAKE_JOBS_NUMBER=8
RUBY_DEFAULT_VER=1.9
RUBY_VER=1.9
@funglaub
funglaub / gist:2918703
Created June 12, 2012 16:59
FreeBSD: Install sqlite3 gem
gem install sqlite3 -- --with-sqlite3-dir=/usr/local
package main
import (
"bytes"
"encoding/json"
"errors"
"flag"
"fmt"
"io/ioutil"
"net/http"
#include <sys/param.h>
#include <sys/errno.h>
#include <sys/file.h>
#include <sys/proc.h>
#include <sys/resource.h>
#include <sys/rtprio.h>
#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/user.h>
#define SOCK_PATH "/var/run/devd.pipe"
#define REGEX "subsystem=CDEV type=(CREATE|DESTROY) cdev=(da[0-9]+[a-z]+[0-9]?[a-z]?)"
Save-visited-files 1.2 available save opened files across sessions
abacus 1.0.2 available Abacus Calculator
ac-R 0.1 available Autocompletion routines for R
all 1.0 available Edit all lines matching a given regexp
alpha 1.0 available increase frame transparency
android-mode 0.1 available Minor mode for Android application development
anything 1.287 available open anything / QuickSilver-like candidate-selection framework
anything-R 0.1.2010 available anything-sources and some utilities for GNU R.
anything-complete 1.86 available completion with anything
anything-config 0.4.1 available Predefined configurations for `anything.el'