Skip to content

Instantly share code, notes, and snippets.

@gl-works
gl-works / async_result.cpp
Created April 20, 2021 06:39 — forked from inetic/async_result.cpp
Example usage of boost::asio::async_result
// Example of how to use boost::asio::async_result
#include <iostream>
#include <boost/asio.hpp>
#if BOOST_VERSION >= 106600
template<typename CompletionToken>
typename boost::asio::async_result
<CompletionToken, void(boost::system::error_code, std::string)>::return_type
@gl-works
gl-works / iostat filter disk activity
Created January 14, 2015 10:25
iostat, awk, disk activity, 活动磁盘监测
iostat -d 3 1000 -x | awk '{if($12 > 1.00) printf "%s %3d %5d %5d\n",$1,$12,$6,$7}'
Sample output
sdi 100 59880 76938
sdi 99 76296 77264
sdi 99 70120 60621
sdi 99 52450 58949
sdb 1 31 2790
sdi 99 40138 42854
sdf 1 90 3485
@gl-works
gl-works / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
; Summary: Proxy Switchy! Exported Rule List
; Date: 11/1/2014
; Website: http://bit.ly/proxyswitchy
#BEGIN
[wildcard]
http://*.hulu.com
http://*.blogspot.*
http://*.appspot.com