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
| #!/bin/sh | |
| NGINX=/usr/local/nginx/sbin/nginx | |
| CONFIG=/usr/local/nginx/conf/nginx.conf | |
| DESC=nginx | |
| COLOR_RESET="\033[0m" | |
| COLOR_GREEN="\033[32m" | |
| COLOR_RED="\033[31m" |
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
| from mailer import Message, Mailer | |
| m = Message() | |
| m.From=“Name <username@gmail.com>" | |
| m.To=“username+fans@gmail.com" | |
| m.BCC=[‘username@live.hk’,’username2@gmail.com'] | |
| m.Subject='Hello world testing' | |
| m.charset="UTF-8" | |
| m.Html = "Testing some things!” |
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
| #/bin/bash | |
| LOAD=$(awk '{print $1}' /proc/loadavg) | |
| if [ $(echo "$LOAD > 100" | bc) = 1 ]; then | |
| /etc/init.d/php-fpm restart | |
| fi |
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 | |
| $check = isset($_POST['check']) ? $_POST['check'] : array(); | |
| $types = array( | |
| 1 => '報紙', | |
| 2 => '雜誌', | |
| 3 => '其他' | |
| ); | |
| echo '<h3>',"Checked:",'</h3>'; |
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
| run: | |
| sed 's/"\([[:alnum:]]*\),\([[:alnum:]]*\)"/"\1:\2"/g' data/yo.csv > data/yo.sed.csv | |
| test: | |
| @echo "a,b,c,d,e,\"a,b\",f,g,\"h,i\",j,k\n1,2,3,4,5,\"6,7\",8,9,\"10,11\",12,13" | \ | |
| sed 's/"\([[:alnum:]]*\),\([[:alnum:]]*\)"/"\1:\2"/g' |
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
| git archive -o update.zip HEAD $(git diff --name-only HEAD^) |
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
| l = []; | |
| l.push('<body>'); | |
| if ($.a > $.b) { | |
| l.push('a > b'); | |
| }else{ | |
| l.push('a < b'); | |
| } | |
| l.push('</body>'); |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import mechanize | |
| from colorama import init | |
| from colorama import Fore, Back, Style | |
| init() | |
| def main(): |
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
| <div id="random-area">1</div> | |
| <script language="javascript"> | |
| var max_random = 100, | |
| random_area = document.getElementById("random-area"), | |
| origin_text = random_area.innerHTML; | |
| function random(max_random) { | |
| var arr = "0123456789".split(''); |
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
| sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000 | |
| sudo iptables-save |