View gist:1a35b380bac510ad8795
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 | |
# | |
# chkconfig: 23 90 10 | |
# Description: Quickly hacked together bigcouch init script for CentOS systems. | |
. /etc/init.d/functions | |
PID_FILE=/var/run/bigcouch.pid | |
BIGCOUCH_BIN=/opt/bigcouch/bin/bigcouch | |
SUBSYS_LOCK_FILE=/var/lock/subsys/bigcouch |
View watch_eth0.sh
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/sh | |
if [ -f '/usr/bin/watch' ] | |
then | |
watch -n 1 -d ifconfig eth0 | |
#watch ifconfig eth0 | |
else | |
#while [ 1 ];do ifconfig eth0 ;sleep 1;clear;done | |
while [ 1 ] | |
do |
View find_if_inMemeberFun.cpp
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 <iostream> | |
#include <functional> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
class CMyTest | |
{ | |
public: | |
bool IsOdd ( int i) |
View debugTest.cpp
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 <iostream> | |
//#define NDEBUG // or : g++ -DNDEBUG debugTest.cpp -o debugTest | |
#include <cassert> | |
using namespace std; | |
int main() | |
{ | |
cout<<__FILE__<<endl; | |
cout<<__LINE__<<endl; |
View ptrSwap.cpp
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 <iostream> | |
using namespace std; | |
//using pointer | |
void ptrSwap1(int **pa,int **pb) | |
{ | |
int *ptmp = *pa; | |
*pa = *pb; | |
*pb = ptmp; |
View wordCount1.cpp
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 <map> | |
#include <string> | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
map<string,int> dict; | |
string word; |
View record1.py
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 | |
t1=`date +%Y%m%d%H%M` | |
path1="/tmp/out_$t1.mpg" | |
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq $path1 |
View netstatWatch.sh
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 | |
r_host='10.11.1.100' | |
if [ -f '/usr/bin/watch' ] | |
then | |
watch -n 1 -d "netstat -an | grep $r_host" | |
else | |
while [ 1 ] | |
do |
View streamIteratorTest.cpp
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 <iostream> | |
#include <iterator> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int main() | |
{ | |
istream_iterator<int> cin_it(cin); |
OlderNewer