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 ( | |
"code.google.com/p/leveldb-go/leveldb/db" | |
"code.google.com/p/leveldb-go/leveldb/table" | |
"fmt" | |
"runtime" | |
) | |
type kv struct { |
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
步骤一,将你准备好的U盘或移动硬盘或分区(大于等于6G),用磁盘工具格式化成Mac OS扩展(日志式)格式,名称输入“Mavericks”,并创建 | |
步骤二,从Mac App Store下载安装程序。(或任何地方获得的安装程序) | |
步骤三,请先确认安装程序在应用程序文件夹里。(重要:如下载的是镜像,请挂载后将安装程序复制到应用程序文件夹里。) | |
步骤四,打开终端,输入以下代码,后输入密码确认(密码不会显示): | |
sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Mavericks --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction | |
复制代码 |
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
// Check is current MAC OS X version less than supportedVersion | |
function checkForMacOSX(supportedVersion) { | |
try { | |
// Get current ProductVersion | |
var tProductVersion = system.version.ProductVersion; | |
// Get current ProductName | |
var tProductName = system.version.ProductName; | |
// Check if current version is less than supportedVersion, if yes Set the result type to Fatal, and give correct message to user |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<style> | |
body { | |
font-family: 'Georgia', serif; | |
font-size: 17px; | |
color: #000; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <png.h> | |
#include <webp/encode.h> | |
#include <webp/mux.h> | |
static void PNGAPI error_function(png_structp png, png_const_charp dummy) { |
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
<syscall>2</syscall> | |
<syscall>7</syscall> | |
<syscall>9</syscall> | |
<syscall>10</syscall> | |
<syscall>12</syscall> | |
<syscall>13</syscall> | |
<syscall>14</syscall> | |
<syscall>15</syscall> | |
<syscall>16</syscall> |
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
String file contents |
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
*filter | |
:INPUT DROP [0:0] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
# TCP handling. Allow incoming TCP TPH on WAN | |
-A INPUT -i ppp0 -p tcp -m tcp --dport 40317 -j ACCEPT | |
-A INPUT -i ppp0 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT | |
-A INPUT -i wlan0 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT |
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
sort.Strings(proxyIds) | |
// check every 500ms | |
for times < 60 { | |
if times >= 6 && (times*500)%1000 == 0 { | |
log.Warning("abnormal waiting time for receivers", actionZkPath) | |
} | |
nodes, _, err := zkConn.Children(actionZkPath) | |
if err != nil { | |
return errors.Trace(err) | |
} |
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
RebornDB (Codis) 的设计和实现及我眼中未来的分布式存储 | |
你好, 我是 开源项目 Codis 的 co-author 黄东旭, 之前在豌豆荚做 infrastructure 相关的事情, 现在在创业 公司是 PingCAP, 方向也是分布式存储方向(NewSQL). Codis 是一个分布式 Redis 解决方案, 和官方的纯 P2P 的模式不同, Codis 走了一个 Proxy-based 的方案. 今天我们介绍一下 Codis 及下一个大版本 RebornDB 的设计, 同时会介绍一些 Codis 在实际应用场景中的 Best Practices. 最后抛砖引玉, 我会介绍一下我对分布式存储的一些观点和看法, 望各位首席们雅正. | |
1. Redis, Redis Cluster 和 Codis | |
想必大家的架构中, Redis 已经是一个必不可少的部件, 丰富的数据结构和超高的性能以及简单的协议, 让 Redis 能够很好的作为数据库的上游缓存层, 但是我们总是会比较担心 Redis 的单点问题, 单点 Redis 容量大小总是受限于内存, 在业务对性能要求比较高的情况下, 我们理想上希望所有的数据都能在内存里面, 不要打到数据库上, 所以很自然的就会寻求其他方案, 比如, SSDB 将内存换成了磁盘, 以换取更大的容量. 更自然的想法是将 Redis 变成一个可以水平扩展的分布式缓存服务, 在 Codis 之前, 业界只有 Twemproxy, 但是 Twemproxy 本身是一个静态的分布式 Redis 方案, 进行扩容/缩容时候对运维要求非常高, 而且很难做到平滑的扩缩容. Codis 的目标其实就是尽量兼容 Twemproxy 的基础上, 加上数据迁移的功能以实现扩容和缩容. | |
与 Codis 同期发布正式版的官方 cluster, 我认为有优点也有缺点, 作为架构师, 我并不会在生产环境中使用, 原因有几个: |
OlderNewer