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 | |
require 'open-uri' | |
uri = "http://localhost/nginx_status" | |
lines = nil | |
open(uri) do |f| | |
lines = f.read.split("\n") | |
end |
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 | |
# Xen | |
#mac = [0x00, 0x16, 0x3e, Random.rand(0x7f), Random.rand(0xff), Random.rand(0xff)] | |
# QEMU or KVM | |
mac = [0x52, 0x42, 0x00, Random.rand(0x7f), Random.rand(0xff), Random.rand(0xff)] | |
puts (["%02x"] * 6).join(":") % mac |
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 | |
require 'socket' | |
def get_name(addr) | |
info = Socket.getnameinfo(Socket.sockaddr_in('80', addr)) | |
info[0] | |
end | |
ADDR_REG_EXP = /\b((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\b/ |
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
diff --git create-mailbox.php create-mailbox.php | |
index c8ec29a..66d6147 100644 | |
--- create-mailbox.php | |
+++ create-mailbox.php | |
@@ -131,6 +131,16 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") | |
} | |
} | |
+ $min_length = $CONF['min_password_length']; | |
+ if($min_length > 0 && strlen($fPassword) < $min_length) { |
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
# | |
# This is the main Apache server configuration file. It contains the | |
# configuration directives that give the server its instructions. | |
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information. | |
# In particular, see | |
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html> | |
# for a discussion of each configuration directive. | |
# | |
# | |
# Do NOT simply read the instructions in here without understanding |
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/php | |
<?php | |
function create_salt(){ | |
$salt_source = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
$num = strlen($salt_source)-1; | |
$salt = ""; | |
for($i=0; $i<22; $i++){ | |
$index = mt_rand(0, $num); |
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
usage: doveadm [-Dv] [-f <formatter>] <command> [<args>] | |
altmove [-u <user>|-A] [-S <socket_path>] <search query> | |
auth [-a <auth socket path>] [-x <auth info>] <user> [<password>] | |
config [doveconf parameters] | |
director add|flush|map|remove|status | |
dump [-t <type>] <path> | |
expunge [-u <user>|-A] [-S <socket_path>] <search query> | |
fetch [-u <user>|-A] [-S <socket_path>] <fields> <search query> | |
force-resync [-u <user>|-A] [-S <socket_path>] <mailbox> |
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
class DateTime | |
class << self | |
alias org_new new | |
def new(year = -4712, mon = 1, mday = 1, hour = 0, min = 0, sec = 0, offset = 0, start = Date::ITALY) | |
if year == 0 | |
nil | |
else | |
org_new(year, mon, mday, hour, min, sec, offset, start) | |
end |
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
You're running a version of ruby with no Readline support | |
Please `gem install rb-readline` or recompile ruby --with-readline. |
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
;; PATH | |
(setq exec-path (cons "/opt/local/bin" exec-path)) | |
(setenv "PATH" | |
(concat '"/opt/local/bin:" (getenv "PATH"))) | |
;; load-path | |
(add-to-list 'load-path "~/.emacs.d/") | |
(add-to-list 'load-path "~/.emacs.d/share/emacs/site-lisp/") | |
(add-to-list 'load-path "~/.emacs.d/ruby/") |
NewerOlder