identical mmap programs in C and go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bash <(curl -s https://gist.github.com/drye/5387341/raw/ec72cddfe43ec3d39c91a3c118cb68ab14a049f8/enable_dnsmasq_on_osx.sh) | |
# ---------------------- | |
# installing dnsmasq and enable daemon | |
# ---------------------- | |
brew install dnsmasq | |
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons | |
# ---------------------- | |
# adding resolver for vbox domain | |
# ---------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
hash_ring | |
~~~~~~~~~~~~~~ | |
Implements consistent hashing that can be used when | |
the number of server nodes can increase or decrease (like in memcached). | |
Consistent hashing is a scheme that provides a hash table functionality | |
in a way that the adding or removing of one slot | |
does not significantly change the mapping of keys to slots. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Creating directory structure" | |
mkdir -p ./tmproot/usr/local/bin | |
mkdir -p ./tmproot/usr/share/applications | |
mkdir -p ./tmproot/usr/share/icons/hicolor/128x128/apps | |
mkdir -p ./tmproot/usr/share/icons/gnome/128x128/apps | |
mkdir -p ./tmproot/opt/ | |
cd ./tmproot/opt | |
echo "Downloading tarball" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
"syscall" | |
) | |
const ( |
Prerequisite: latest Docker for Mac on MacOS Sierra
$ brew update
$ brew install --HEAD xhyve
$ brew install docker-machine-driver-xhyve
$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.18.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
After a weekend of research, stress and pain I finally figure out how to install manjaro 17 and configure the nvidia/bumblebee drivers on my avell laptop
Here's my notebook specs:
$ inxi -MGCNA
Machine: Device: laptop System: Avell High Performance product: 1513
Mobo: N/A model: N/A v: 0.1 UEFI: American Megatrends v: N.1.02 date: 09/28/2016
Battery BAT0: charge: 44.0 Wh 100.0% condition: 44.0/44.0 Wh (100%)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<script> | |
// @author: ideawu | |
// @link: http://www.ideawu.net/blog/archives/1021.html | |
var swap_count = 0; | |
var cmp_count = 0; | |
// https://gist.github.com/wintercn/c30464ed3732ee839c3eeed316d73253 | |
function wintercn_qsort(arr, start, end){ |
OlderNewer