This file contains hidden or 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
/* | |
* Displays linux /proc/pid/stat in human-readable format | |
* | |
* Build: gcc -o procstat procstat.c | |
* Usage: procstat pid | |
* cat /proc/pid/stat | procstat | |
* | |
* Homepage: http://www.brokestream.com/procstat.html | |
* Version : 2009-03-05 | |
* |
This file contains hidden or 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
[root@testserver redis]# uname -a | |
Linux testserver 2.6.18-92.1.18.el5 #1 SMP Wed Nov 12 09:30:27 EST 2008 i686 i686 i386 GNU/Linux | |
[root@testserver redis]# cat /proc/cpuinfo | grep CPU | |
model name : Intel(R) Xeon(TM) CPU 3.06GHz | |
model name : Intel(R) Xeon(TM) CPU 3.06GHz | |
model name : Intel(R) Xeon(TM) CPU 3.06GHz | |
model name : Intel(R) Xeon(TM) CPU 3.06GHz | |
[root@testserver redis]# free -m |
This file contains hidden or 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
/* `Rounded Corners | |
----------------------------------------------------------------------------------------------------*/ | |
.round_all { | |
border-radius: 5px; | |
-moz-border-radius: 5px; | |
-webkit-border-radius: 5px; | |
} | |
.round_top { |
This file contains hidden or 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
ssh -f remote_user@remote_server -L 6378:remote_server:6379 -N | |
# -f -- backgrounds ssh right before execution of the command | |
# -L -- Forwards localhost:6378 to remote_server:6379 (encrypted and authenticated) | |
# -N -- Don't execute a remote command, just forward the port | |
# Start a redis server on remote_server on port 6379: | |
redis-server | |
# on the local machine telnet localhost 6378 |
This file contains hidden or 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
./configure \ | |
--prefix=/usr \ | |
--sbin-path=/usr/sbin/nginx \ | |
--conf-path=/etc/nginx/nginx.conf \ | |
--pid-path=/var/run/nginx.pid \ | |
--lock-path=/var/lock/nginx.lock \ | |
--error-log-path=/var/log/nginx/error.log \ | |
--http-log-path=/var/log/nginx/access.log \ | |
--http-client-body-temp-path=/var/lib/nginx/body \ | |
--http-proxy-temp-path=/var/lib/nginx/proxy \ |
This file contains hidden or 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
<?php | |
$link = mysqli_connect("localhost", "root", "123456", "spicacms"); | |
/* check connection */ | |
if (mysqli_connect_errno()) { | |
printf("Connect failed: %s\n", mysqli_connect_error()); | |
exit(); | |
} | |
/* Select queries return a resultset */ |
This file contains hidden or 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
-- Database schemas for SpicaCMS -- | |
DROP TABLE IF EXISTS categories; | |
CREATE TABLE categories ( | |
cat_id INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
cat_name VARCHAR(255) NOT NULL, | |
cat_left INT UNSIGNED NOT NULL, | |
cat_right INT UNSIGNED NOT NULL, | |
PRIMARY KEY (cat_id) | |
); | |
INSERT INTO categories VALUES (NULL, 'CEO', 1, 16); |
This file contains hidden or 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
svn co http://svn.php.net/repository/pecl/apc/trunk/ apc |
This file contains hidden or 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 _ajax_request(url, data, callback, type, method) { | |
if (jQuery.isFunction(data)) { | |
callback = data; | |
data = {}; | |
} | |
return jQuery.ajax({ | |
type: method, | |
url: url, | |
data: data, | |
success: callback, |