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
for /R %f in (*.cpp;*.c;*.h) do c:\tools\astyle -p -U --style=ansi "%f" | |
来自:http://blog.csdn.net/memory_xj/article/details/2983093 |
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
drop database if exists game; | |
drop database if exists info; | |
create database game default charset utf8; | |
create database info default charset utf8; | |
create user 'game'@'localhost' identified by 'game'; | |
create user 'game'@'%' identified by 'game'; | |
grant all privileges on game.* to 'game'@'localhost'; | |
grant all privileges on game.* to 'game'@'%'; |
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
#coding=gbk | |
import glob, tmxlib, os, base64 | |
""" | |
生成空地图,添加所有物件和地表 | |
""" | |
from tmxlib.fileio import * | |
class MySerializer(TMXSerializer): | |
def image_to_element(self, image, base_path): | |
if image.source is None: | |
element = etree.Element('image', attrib=dict(format='png')) |
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
#coding=gbk | |
import sys | |
import zipfile as zf | |
from urlparse import urlparse | |
from threading import Thread | |
import httplib, sys | |
from Queue import Queue | |
concurrent = 200 | |
q=Queue(concurrent*2) |
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 <sys/types.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/file.h> | |
#include <fcntl.h> | |
#include <utmp.h> | |
#include <pwd.h> | |
#include <lastlog.h> | |
#define WTMP_NAME "/usr/adm/wtmp" | |
#define UTMP_NAME "/etc/utmp" |
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
Q:Grub2 wont start after power failure | |
A:This was actually new for me - but it seems that this behaviour is caused by the last lines in /etc/grub.d/00_header | |
if [ \${recordfail} = 1 ]; then | |
set timeout=-1 | |
else | |
set timeout=${GRUB_TIMEOUT} | |
fi | |
I suggest that you create a /etc/grub.d/01_recordfail_override, set the +x permission, and make it look like this: |
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
#!/usr/bin/python | |
#coding=gbk | |
################################################################################ | |
# guard.py | |
# | |
# Auto restart Service any time it crashes. | |
# If the Servers is manually shut down, this script will terminate. | |
# | |
# usage:./guard.py scene | |
################################################################################ |
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 ~/.ssh/id_rsa.pub | ssh user@machine "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys" |
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 | |
usage () { | |
echo "Usage: $0 [-i [identity_file]] [user@]machine" | |
exit 1 | |
} | |
# Parse options | |
while getopts ":i:" o | |
do case "$o" in |
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
import zlib | |
import base64 | |
import winsound | |
COMPLETE_SOUND_DATA = """eJzt2ltXG1l2AGDPWx6Tf5CV/5C3rEzPTHdnsDEYbGzAICEhkITuJZXqXnXqXlLpLiQkdMHYYGPLxnimJ515SFZ+Wvap0hWD7c5Mt7MmOr1a/tgunXP2rtLRKcqrC99//887d+48+c3j7/ZjmX/8+zt37vwK/vunx3ec/3915+/uBHwZ3z/AMcLP1Tg6i+rVxMq2/f6CWXsqHGo+f+VDc+u3/qPn1LLv+L9eRb5ZEF619jf1D2fRX99T3hztbVk/XCT+5deZV2dUQH19mvjmO+6iT0X003bot2vFd41ExL5o7Px68/CqHdsWz9v+b7Zafz6LrRL9I/+33s5/D4ilQKm0dz908p/PQw/iFXNnlRz8ubKxTNZ07yPu8o/Kg2X6uORfFd5/4H//HXnWjW6Il+/o3/5r/PkZ5RHfviZ/99vMy3Nhlzp9RX/7LfP+B+3JTuVcWvw3+v2P1uOn9jN2cVH+04/6wzX9mbT8QP/xT/Lymt7lVtYrfx4Q3z/Kn6lr68X/eJf+bll/VfJs5H54Ff9m2Xjb3lsTLy9Sv1vSL4+DG+rbXuA3G/U/NLxr8uAk9Ju18g/98EP6rBv8ztv64dC7plw0vN+FTv+Q39wunivL98WrAdSsMdBXFvnLS255q3wuPXho/fAyseBtvFYfLCsfBuSip/JCXN2q/tALLIR7Z9nFrcaPXf/CQfcZcX+//++Hm9/Hn50S9wO9H4+2frffu+BW/a0/1te/i56+pFf3Oh8KD79NnF2wD3fbV/nV79MXb/lVX+Nd/tH3xMVbYXWnMbBWF6jBe3F5vfCusvF9/OUHY/WhPmh6fx89+2CuLiuDtn8h8uIP1uqS8LoXXIycftBXltGgF1qMvbhESw+0d529xeiL9/LSkvzu9GAx1H+nLC8rl6eRe8H+e311SXz3PHpvr3Opr94XL89i93bbl9bDJfHtWWJhp3WV |