Skip to content

Instantly share code, notes, and snippets.

View bububa's full-sized avatar
💭
I may be slow to respond.

Prof Syd Xu bububa

💭
I may be slow to respond.
View GitHub Profile
@bububa
bububa / UCoin.sol
Last active December 31, 2018 13:55
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address private _owner;
@bububa
bububa / README.md
Created October 20, 2016 05:22
No name

README is empty

@bububa
bububa / gist:a35319fc6b4cadf95356
Created February 23, 2015 12:47
change nginx server name
cd ~/src/nginx/
vi +49 src/http/ngx_http_header_filter_module.c
static char ngx_http_server_string[] = "Server: XiBWebd";
static char ngx_http_server_full_string[] = "Server: XiBWebd";
:wq
@bububa
bububa / gist:8580106
Created January 23, 2014 15:11
获取内网IP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>获取内网IP</title>
</head>
<body>
您的内网IP:
<span id="list"></span>
<script>
@bububa
bububa / gist:8536141
Created January 21, 2014 08:12
plproxy query setup
CREATE FUNCTION "plproxy"."get_cluster_config"(IN cluster_name text, OUT "key" text, OUT val text) RETURNS SETOF "record"
AS $BODY$
begin
key := 'statement_timeout';
val := 60;
return next;
return;
end; $BODY$
LANGUAGE plpgsql
sudo npm install -g phantomjs
sudo yum install bitmap-fonts bitmap-fonts-cjk liberation-fonts
cd /usr/share/fonts
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -fv
sudo /usr/sbin/chkfontpath -a /usr/share/fonts/default/truetype/
sudo /etc/init.d/xfs reload
@bububa
bububa / gist:5388838
Created April 15, 2013 15:14
problems in install gearmand
wget http://mirrors.ustc.edu.cn/fedora/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -ivh epel-release-5-4.noarch.rpm
yum -y -q install boost141-devel
ln -s /usr/include/boost141/boost/ /usr/include/boost
export LDFLAGS="-L/usr/lib64/boost141"
export LD_LIBRARY_PATH=/usr/lib64/boost141:$LD_LIBRARY_PATH
yum -y -q install e2fsprogs-devel e2fsprogs
yum -y -q install gcc44 gcc44-c++
export CC="gcc44"
export CXX="g++44"
@bububa
bububa / gist:5329604
Created April 7, 2013 08:41
清除Mac OS X文件“打开方式”中的重复项
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"
@bububa
bububa / tmux.conf
Last active December 14, 2015 06:59 — forked from mrosati84/tmux.conf
# status bar
set-option -g status-utf8 on
set-window-option -g mode-mouse on
#set-window-option -g mouse-resize-pane on
#set-window-option -g mouse-select-pane on
#set-window-option -g mouse-select-window on
set -g status-interval 1
set -g status-justify centre # center align window list
@bububa
bububa / gist:5046199
Created February 27, 2013 08:18
Debian管理启动项
通过ls /etc/init.d/以及ls /etc/rc?.d来查看当前的初始化服务。
update-rc.d -f mysqld remove命令将mysqld从启动项里删除
debian:/etc/init.d# cat ifup #ifup 命令
#!/bin/bash
ifup eth0
debian:/etc/init.d# chmod a+x ifup #添加可执行权限
debian:/etc/init.d# update-rc.d ifup defaults #添加启动项目
首先采用rcconf 管理