pandoc doc.md --pdf-engine=/Library/TeX/texbin/pdflatex -V geometry:margin=1in -s -o leveldb-doc.pdf
const AWS = require('aws-sdk'); | |
const Busboy = require('busboy'); | |
const BUCKET_NAME = ''; | |
const IAM_USER_KEY = ''; | |
const IAM_USER_SECRET = ''; | |
function uploadToS3(file) { | |
let s3bucket = new AWS.S3({ | |
accessKeyId: IAM_USER_KEY, |
Moved to git repository: https://github.com/denji/nginx-tuning
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def utf8cut(ba, l): | |
if len(ba) <= l: | |
return ba | |
pos = l | |
while (pos > 0): | |
b = ba[pos] |
Having trouble installing the latest stable version of tmux?
I know, official package for your OS/distro is outdated and you just want the newest version of tmux.
Well, this script should save you some time with that.
- gcc
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <limits.h> | |
#include <string.h> | |
struct entry_s { | |
char *key; | |
char *value; |
# Install tmux on Centos release 6.5 | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel | |
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL | |
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
tar -xvzf libevent-2.0.21-stable.tar.gz | |
cd libevent-2.0.21-stable | |
./configure --prefix=/usr/local |
(defun mac-notify (&optional content title) | |
"Invoke mac notifier to display a message | |
using terminal-notifier(https://github.com/alloy/terminal-notifier) | |
brew install terminal-notifier " | |
(let ((title (or title "Emacs")) | |
(content (or content "No Content"))) | |
(call-process-shell-command | |
(format "terminal-notifier -title '%s' -message '%s'" | |
title |
;; copy to clipboard from emacs in terminal | |
;; | |
;; if you use emacs in tmux you should enable pbcopy in tmux first | |
;; http://superuser.com/questions/231130/unable-to-use-pbcopy-while-in-tmux-session | |
;; | |
;; (require 'region-bindings-mode) | |
(defun pbcopy-region (start end) | |
(interactive "r") | |
(pbcopy (buffer-substring start end)) |