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
| # removes trailing slashes (prevents SEO duplicate content issues) | |
| if (!-d $request_filename) | |
| { | |
| rewrite ^/(.+)/$ /$1 permanent; | |
| } | |
| # removes trailing "index" from all controllers | |
| if ($request_uri ~* index/?$) | |
| { | |
| rewrite ^/(.*)/index/?$ /$1 permanent; |
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
| server { | |
| listen 80; | |
| client_max_body_size 20M; | |
| server_name _new_host_.cdu.edu.cn; | |
| charset UTF-8; | |
| index default.html default.htm default.php index.html index.htm index.php; | |
| set $root /var/www/_new_host_/wwwroot/public/www; |
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
| markdown_string = 'Markdown *String* ' | |
| uri = URI('https://api.github.com/markdown/raw') | |
| https = Net::HTTP.new(uri.host,uri.port) | |
| https.use_ssl = true | |
| req = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'text/plain'}) | |
| req.body = markdown_string | |
| res = https.request(req) |
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 | |
| template_name="Debian 7 Template" | |
| default_vlan=101 | |
| Usage() | |
| { | |
| echo "$0 new_vm_name [vlan_id]" | |
| echo " vlanid default 101" | |
| } |
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 | |
| echo "CPU temp :" | |
| sysctl -a |egrep -E "cpu\.[0-9]+\.temp" | |
| echo | |
| echo "HDD temp :" | |
| for i in $(sysctl -n kern.disks) | |
| do | |
| DevTemp=`smartctl -a /dev/$i | awk '/Temperature_Celsius/{print $0}' | awk '{print $10 "C"}'` | |
| DevSerNum=`smartctl -a /dev/$i | awk '/Serial Number:/{print $0}' | awk '{print $3}'` | |
| DevName=`smartctl -a /dev/$i | awk '/Device Model:/{print $0}' | awk '{print $3}'` |
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 | |
| # Script to install a debian wheezy template on xcp 1.1 and above, or | |
| # Citrix (TM) Xenserver 5.6 and above. | |
| # Copyright (C) 2012 Arne-Kristian Hingst - All Rights Reserved | |
| # Permission to copy and modify is granted under the eupl license | |
| # http://ec.europa.eu/idabc/servlets/Docbb6d.pdf?id=31979 | |
| # Last revised 04/04/2013 | |
| # | |
| # Add your favourite mirror here |