Skip to content

Instantly share code, notes, and snippets.

View integrii's full-sized avatar
🇺🇸
Remember that LED stop lights failed because they didn't melt snow.

Eric Greer integrii

🇺🇸
Remember that LED stop lights failed because they didn't melt snow.
View GitHub Profile
@yosssi
yosssi / go-nginx.md
Last active April 11, 2024 22:07
Go networking performance vs Nginx

1. Nginx

$ wrk -t12 -c400 -d2s http://127.0.0.1:8080
Running 2s test @ http://127.0.0.1:8080
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.71ms    3.16ms  23.05ms   69.17%
    Req/Sec     3.44k     1.98k    7.80k    58.22%
  63697 requests in 2.00s, 17.86MB read
@gerard-kanters
gerard-kanters / hhvm
Last active January 26, 2017 12:26
HHVM init script
#!/bin/bash
#
# hhvm Startup script for the HipHop Server
#
# chkconfig: - 85 15
# description: HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP
# processname: hhvm
# config: /etc/php.ini
# config: /etc/hhvm/server.ini
# pidfile: /var/run/hhvm/hhvm.pid
@sushat4692
sushat4692 / config.hdf
Created May 15, 2014 12:00
HHVM for Amazon EC2 t1.micro
Eval {
Jit = true
JitASize = 67108864
JitAStubsSize = 67108864
JitGlobalDataSize = 22554432
}
@sushat4692
sushat4692 / HHVMinstall.sh
Created May 15, 2014 11:52
Install HHVM to CentOS
$ wget http://www.hop5.in/yum/el6/hop5.repo
$ yum install hhvm
// libwarf が無いよって怒られる
$ yum install libdwarf --enablerepo=epel
$ yum install hhvm
$ hhvm
// liblcms2.so.2が無いよって怒られる
@Tydus
Tydus / howto-standalone-toolchain.md
Last active May 4, 2023 13:43
How to install Standalone toolchain for Android

HOWTO Cross compiling on Android

5W1H

What is NDK

NDK (Native Develop Toolkit) is a toolchain from Android official, originally for users who writes native C/C++ code as JNI library. It's not designed for compiling standalone programs (./a.out) and not compatible with automake/cmake etc.

What is Standalone Toolchain

"Standalone" refers to two meanings:

  1. The program is standalone (has nothing connect to NDK, and don't need helper scripts to run it)
  2. The toolchain is made for building standalone programs and libs, and which can used by automake etc.

(Optional) Why NDK is hard to use

By default, NDK uses android flavor directory structure when it's finding headers and libs, which is different from GNU flavor, so the compiler cannot find them. For Example:

@DavidVaini
DavidVaini / round.go
Created April 9, 2014 19:58
Arggh Golang does not include a round function in the standard math package. So I wrote a quick one.
package main
import (
"log"
"math"
)
func Round(val float64, roundOn float64, places int ) (newVal float64) {
var round float64
pow := math.Pow(10, float64(places))
@aurman
aurman / exampleOauth.php
Last active July 4, 2022 13:00
SmartThings .php example authenticating and controlling SmartThings API endpoints
<?php
//client id and client secret
$client = '';
$secret = '';
//hardcode the full url to redirect to this file
$url = "";
//STEP 1 - Get Access Code
@shivaas
shivaas / codeigniter-apache-hhvm.md
Last active March 13, 2018 16:08
CodeIgniter with Apache & HHVM as FastCGI

Apache Configuration:

<VirtualHost *:80>
  ServerName blah.com

  DirectoryIndex index.html index.php
  ProxyRequests On
  ProxyPreserveHost On
  ProxyVia full
@brianredbeard
brianredbeard / syncrepos.sh
Last active January 30, 2024 06:23
Reposync - A better tool than mrepo. Use this to sync down all channels a RHEL system is subscribed to and turn them into locally exposed yum repositories.
#!/bin/bash
# This tool can be used to sync down Red Hat based packages from RHN using only Red Hat shipped tools
# Brian "Red Beard" Harrington <brian@dead-city.org>
# Copyright 2013
#
# To satisfy the pre-reqs for this script install the following two rpms:
# yum-utils
# createrepo_c (in RHEL 8 createrepo and createrepo_c have been combined)
# See https://github.com/rpm-software-management/createrepo_c#differences-in-behavior-between-createrepo_c-and-createrepo
@floer32
floer32 / centos_python_env_setup
Last active May 2, 2022 03:47 — forked from stantonk/doit
CentOS 6: Install Python 2.7.4, pip, virtualenv, and virtualenvwrapper on CentOS (plus some bonus items at the end if you want). You should probably run with `sudo`.
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs