Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Kareem H neumachen

🏠
Working from home
View GitHub Profile
@neumachen
neumachen / rpn.go
Created Jul 18, 2016
Reverse Polish Notation Calculator
View rpn.go
package main
import (
"fmt"
"strconv"
"unicode"
"unicode/utf8"
)
func skipSpaces(s []byte) []byte {
@neumachen
neumachen / RELK.sh
Created Jul 24, 2016 — forked from adionditsak/RELK.sh
Install the ELK stack (with Redis) with one script for the central log server (CentOS 6.5).
View RELK.sh
#/bin/bash
##########################################################
### INTRODUCTION
##########################################################
: '
Install and configure R (Redis) + ELK server from scratch on CentOS 6.5.
* Logstash version 1.4.2
* Elasticsearch version 1.3.2
@neumachen
neumachen / Vagrantfile
Created Jul 28, 2016 — forked from davisford/Vagrantfile
Vagrantfile with postgres
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$script = <<SCRIPT
echo "-------------------- updating package lists"
apt-get update
@neumachen
neumachen / README.md
Created Aug 4, 2016 — forked from jonathantneal/README.md
createElement.js // a 300 byte DOM Element creator
View README.md

createElement.js

createElement.js lets document.createElement use CSS selectors.

This is a pretty useful library for building out DOM elements. The whole thing runs on one regex and a for loop, so it’s plenty fast. The script is 300 bytes when compressed and gzipped. For 524 bytes (advanced), it includes nesting support and can generate entire DOM hierarchies, including text nodes.

Usage

document.createElement(); // generates <div />
@neumachen
neumachen / db.go
Created Aug 16, 2016 — forked from SchumacherFM/db.go
GoLang Database SQL: Selecting an unknown amount of columns from a query. Benchmark results in db_test.go
View db.go
package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
"log"
)
const (
@neumachen
neumachen / config.yml
Created Aug 18, 2016 — forked from seratch/config.yml
AWS SQS Example
View config.yml
access_key_id: xxx
secret_access_key: yyy
@neumachen
neumachen / nginxproxy.md
Created Sep 2, 2016 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?
View nginxproxy.md

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

View keybase.md

Keybase proof

I hereby claim:

  • I am magicalbanana on github.
  • I am manbearpig (https://keybase.io/manbearpig) on keybase.
  • I have a public key whose fingerprint is 7ED3 0E32 6243 C187 A302 08C3 374C 3667 270F A9FD

To claim this, I am signing this object:

@neumachen
neumachen / http-benchmark.md
Created Dec 22, 2016 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
View http-benchmark.md

Tools

Located in alphabetical order (not prefer)

  • ab – slow and single threaded, written in C
  • apib – most of the features of ApacheBench (ab), also designed as a more modern replacement, written in C
  • baloo – Expressive end-to-end HTTP API testing made easy, written in Go (golang)
  • bombardier – Fast crossplatform HTTP benchmarking tool, written in Go (golang)
  • curl-loader – performance loading of various application services and traffic generation, written in C
  • gatling – High performance load testing framework based on Scala, Akka and Netty, write in Scala