This file contains hidden or 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
| # pssh 10.140.0.[3-7] example | |
| pssh -H "`echo 10.140.0.{3..7}`" -i -I "bash -s" < local_script.sh |
This file contains hidden or 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
| # reference CPU num | |
| grep "^processor" /proc/cpuinfo | wc -l | |
This file contains hidden or 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
| func do_something { | |
| ; | |
| } | |
| dir=`mktemp -d` | |
| while [ ]; do | |
| { do_something >/dev/null 2>&1; echo $? >> "$dir/$BASHPID"; } & | |
| done | |
| wait |
This file contains hidden or 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
| #include <linux/kernel.h> | |
| #include <linux/fs.h> | |
| #include <linux/blkdev.h> | |
| #include <linux/elevator.h> | |
| #include <linux/bio.h> | |
| #include <linux/module.h> | |
| #include <linux/slab.h> | |
| #include <linux/init.h> | |
| #include <linux/compiler.h> | |
| #include <linux/rbtree.h> |
This file contains hidden or 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
| /* | |
| * TPPS, or Tiny Parallel Proportion disk Scheduler. | |
| * | |
| * Based on ideas from Zhu Yanhai <gaoyang.zyh@taobao.com> | |
| * | |
| * Copyright (C) 2013 Robin Dong <sanbai@taobao.com> | |
| */ | |
| #include <linux/module.h> | |
| #include <linux/blkdev.h> | |
| #include <linux/elevator.h> |
This file contains hidden or 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
| /* | |
| * Simple IO scheduler | |
| * Based on Noop, Deadline and V(R) IO schedulers. | |
| * This algorithm does not do any kind of sorting, as it is aimed for | |
| * aleatory access devices, but it does some basic merging. We try to | |
| * keep minimum overhead to achieve low latency. | |
| * | |
| * Asynchronous and synchronous requests are not treated separately, but | |
| * we relay on deadlines to ensure fairness. | |
| * |
This file contains hidden or 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" | |
| "bufio" | |
| "os" | |
| ) | |
| var sc = bufio.NewScannner(os.Stdin) | |
| func nextInt() int { | |
| sc.Scan() |
This file contains hidden or 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" | |
| "os" | |
| ) | |
| func main() { | |
| // os.Args ([]string) | |
| fmt.Println(os.Args) |
This file contains hidden or 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" | |
| ) | |
| func typeCheck(value interface{}) { | |
| switch t := value.(type) { | |
| case string: | |
| fmt.Println(t , "is string") |
This file contains hidden or 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 ( | |
| "io/ioutil" | |
| "log" | |
| ) | |
| func main() { | |
| message := []byte("Hello World\n") | |
| err := ioutil.WriteFile("./file_name.txt", message, 0666) |
NewerOlder