This Gist is now part of https://github.com/gmasse/ovh-ipxe-customer-script
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
To limit a CPU to a certain C-state, you can pass the processor.max_cstate=X
option in the kernel
line of /boot/grub/grub.conf
.
Here we limit the system to only C-State 1:
kernel /vmlinuz-2.6.18-371.1.2.el5 ... processor.max_cstate=1
On some systems, the kernel can override the BIOS setting, and the parameter intel_idle.max_cstate=0
may be required to ensure sleep states are not entered:
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
package main | |
// http://play.golang.org/p/fVf7duRtdH | |
import "fmt" | |
import "unicode/utf16" | |
import "unicode/utf8" | |
import "bytes" | |
func main() { |
#!/bin/bash | |
# | |
## redis backup script | |
## usage | |
## redis-backup.sh port backup.dir | |
port=${1:-6379} | |
backup_dir=${2:-"/data/backup/redis"} | |
cli="/usr/local/bin/redis-cli -p $port" |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
What is sync.Pool in golang and How to use it
sync.Pool (1/2)
Many Go libraries include custom thread-safe free lists, like this:
var objPool = make(chan *Object, 10)
func obj() *Object {
select {
(* | |
ToggleGrayScaleMode for MacOSX 10.9 Mavericks | |
works as of 15 april 2014 | |
This is an AppleScript UI script to toggle GrayScaleMode in System Preferences. | |
I am red-green colorblind and grayscale helps a lot... | |
Works for me. Hope it can be usefull for you. | |
Mike |