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 |
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 |
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) |
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; |
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; |
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; |
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 |
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 |
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