Skip to content

Instantly share code, notes, and snippets.

#check for root user TODO: replace this with a call to "id"
if [ `whoami` != "root" ] ; then
echo "You must run this script as root. Sorry!"
exit 1
fi
#! /bin/bash
# test
echo -e "\033[31m[FAIL]\033[0m hello world"
# \033[0m 关闭所有属性
# \033[1m 设置高亮度
# \033[4m 下划线
# \033[5m 闪烁
# \033[7m 反显
@bitkevin
bitkevin / sublime.json
Created August 18, 2013 15:57
configration of sublime.json
{
// Columns in which to display vertical rulers
//列显示垂直标尺,在中括号里填入数字,宽度按字符计算
"rulers": [80],
// Set to true to insert spaces when tab is pressed
// 设为true时,缩进和遇到Tab键时使用空格替代
"translate_tabs_to_spaces": true,
// The number of spaces a tab is considered equal to

=== install pptpd ===

$ yum install -y ppp libpcap
$ wget "https://lnmpp.googlecode.com/files/pptpd-1.3.4-2.el6.x86_64.rpm"
$ rpm -ivh ptpd-1.3.4-2.el6.x86_64.rpm

=== vim /etc/sysctl.conf ===

net.ipv4.ip_forward = 1

Makefile

CentOS 6

# modify
LIBS=-lpcre -lcrypto -lm -lpthread -ldl -L/usr/local/lib64 -I/usr/local/include

Other

modify

@bitkevin
bitkevin / opencl_list.md
Last active June 3, 2016 07:00
show you the OpenCL-capable devices on a given Macintosh

vocaro's answer is absolutely correct; you can always use the CPU compute device on Snow Leopard and Lion, even if your particular graphics chip doesn't support OpenCL.

The following program will show you the OpenCL-capable devices on a given Macintosh:

// clang -framework OpenCL dumpcl.c -o dumpcl && ./dumpcl

#include <stdio.h>
#include <stdlib.h>
#include <OpenCL/opencl.h>
@bitkevin
bitkevin / raspberry_pi.md
Last active January 3, 2016 06:29
Raspberry Pi

Flush img

download img

http://www.raspberrypi.org/downloads

插入SD卡,用df命令查看当前已挂载的卷

$ df -h
@bitkevin
bitkevin / zsh.md
Created January 18, 2014 17:03 — forked from tsabat/zsh.md

WR703N OpenWrt 配置流程

下载安装

访问WR703N在OpenWrt的[Wiki页][wr703n-openwrt],然后在Flashing一节中找到下载链接:[squashfs-factory.bin][flash.bin],下载后别忘了[比对md5][md5sum]。[1]

进入路由器管理界面,出厂配置为http://192.168.1.1,用户名和密码均为admin,然后进入固件更新,选择下载的文件,然后更新。

Abstract

This document specifies proposed changes to the Bitcoin transaction validity rules in order to make malleability of transactions impossible (at least when the sender doesn't choose to avoid it).

Motivation

As of february 2014, Bitcoin transactions are malleable in multiple ways. This means a (valid) transaction can be modified in-flight, without invalidating it, but without access to the relevant private keys.

This is a problem for multiple reasons:

  • The sender may not recognize his own transaction after being modified.