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
#!/bin/bash | |
# Icons and names | |
ICONS=( | |
"icon_16x16.png:16x16" | |
"[email protected]:32x32" | |
"icon_32x32.png:32x32" | |
"[email protected]:64x64" | |
"icon_128x128.png:128x128" | |
"[email protected]:256x256" |
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
cat /sys/fs/cgroup/memory/memory.stat | awk 'BEGIN{suffixes_len=split("B KB MB GB",suffixes)} {n_suffix=1; while($2 > 1000 && | |
n_suffix < suffixes_len) {$2 /= 1024; n_suffix++;}; printf "%20s %7.2f %2s\n",$1,$2,suffixes[n_suffix]}' |
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
# 事务隔离级别, | |
# READ-UNCOMMITTED 读未提交 | |
# READ-COMMITTED 读提交 | |
# REPEATABLE-READ 可重复读 | |
# SERIALIZABLE 串行化 | |
show variables like 'transaction_isolation'; | |
# 事务事件执行事件大于 60 秒的操作 | |
select * from information_schema.innodb_trx where TIME_TO_SEC(timediff(now(),trx_started))>60; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
//copy: http://c.learncodethehardway.org/book/ex20.html | |
#ifndef __dbg_h | |
#define __dbg_h | |
#include <stdio.h> | |
#include <errno.h> | |
#include <string.h> | |
#ifndef NDEBUG |
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
#! /bin/bash | |
# install dependencies | |
sudo apt-get install gcc cmake build-essential libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy | |
# get source | |
git clone https://github.com/Itseez/opencv.git | |
cd opencv | |
mkdir build |
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
function hex2ascii(hex) { | |
var str = ''; | |
for (var i = 0; i < hex.length; i += 2) | |
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); | |
return str; | |
}; | |
function ascii2hex(ascii) { |
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
/* | |
* Copyright 2010 Georgios Migdos . | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
#!/bin/bash | |
# | |
# redis Startup script for redis processes | |
# | |
# author: snowolf | |
# | |
# processname: redis | |
redis_path="/usr/local/bin/redis-server" | |
redis_conf="/etc/redis/redis.conf" |
NewerOlder