$ sudo /usr/bin/php /usr/lib/php/install-pear-nozlib.phar
$ cat >> ~/.bashrc <<'EOF'
alias pear="php /usr/lib/php/pear/pearcmd.php"
alias pecl="php /usr/lib/php/pear/peclcmd.php"
EOF
$ . ~/.bashrc
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/awk -f | |
BEGIN { | |
ARGV[1] = "/Users/mk/code/awk/tmp.txt"; | |
ARGC = 2; | |
FS=","; OFS=""; | |
FORMAT="%-30s%-10s%s\n"; | |
printf (FORMAT, "pre_key","counts","totalsize"); | |
printf (FORMAT, "=======","======","=========") | |
} | |
{ |
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
# | |
# Recommended minimum configuration: | |
# | |
acl manager proto cache_object | |
acl localhost src 127.0.0.1/32 ::1 | |
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 | |
# Example rule allowing access from your local networks. | |
# Adapt to list your (internal) IP networks from where browsing | |
# should be allowed |
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/env ruby | |
# == Simple Daemon | |
# | |
# A simple ruby daemon that you copy and change as needed. | |
# | |
# === How does it work? | |
# | |
# All this program does is fork the current process (creates a copy of | |
# itself) then exits, the fork (child process) then goes on to run your | |
# daemon code. In this example we are just running a while loop with a |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
typedef unsigned int u32; | |
typedef unsigned long long u64; | |
//------------------------------------------------------------------------- | |
// WorkArea | |
//------------------------------------------------------------------------- |
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/env ruby | |
# Ruby varnish purger | |
require 'net/http' | |
module Net | |
class HTTP::Purge < HTTPRequest | |
METHOD='PURGE' | |
REQUEST_HAS_BODY = false | |
RESPONSE_HAS_BODY = true |
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
/* | |
i get it from internet | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <curl/curl.h> | |
#include <time.h> | |
#include <libxml/parser.h> | |
#include <libxml/xmlmemory.h> | |
#include <libxml/xpath.h> |
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
/* | |
* gcc -lcurl libcurlpostxml.c -o libcurlpostxml | |
* ./libcurlpostxml | |
*/ | |
#include <stdio.h> | |
#include <curl/curl.h> | |
int main(void) | |
{ | |
CURL *curl; |
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
# Kickstart file automatically generated by anaconda. | |
install | |
url --url http://192.168.200.10/centos/ | |
lang en_US.UTF-8 | |
keyboard us | |
skipx | |
network --device eth0 --bootproto dhcp | |
rootpw --iscrypted $1$mPtrz4gJ$bNrGUu91/qhiuU4LZQlYv1 |
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/env ruby -wKU | |
require "rubygems" | |
require "appscript" | |
include Appscript | |
chrome = app("Google Chrome") | |
safari = app("Safari") | |
chrome_tab = chrome.windows[1].active_tab |