For excessively paranoid client authentication.
Organization & Common Name: Some human identifier for this server CA.
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
#!/usr/bin/perl | |
### check_backup.pl | |
# By Nathan Vonnahme, Sept 2011 | |
# An example for "Writing Custom Nagios Plugins in Perl" at the Nagios | |
# World Conference North America 2011. | |
# I. Prologue |
#!/usr/bin/env python2 | |
import re, sys, os, urllib | |
re_songs = re.compile(r'\'sid\': \'(.+?)\', \'sname\': \'(.+?)\'') | |
re_name = re.compile(r'\\&.+?;') | |
template_wgets = 'wget -nv -c -O "%s" %s' | |
durl = 'http://yinyueyun.baidu.com/data/cloud/downloadsongfile\?songIds\=%s\&rate\=320' | |
def modified_sname(sname): | |
sname = sname.replace('\\'', '\'') |
curl --socks5 127.0.0.1:7070 http://cn.nytimes.com/ 2>/dev/null | grep -o '<a href="[^"]\+" title="[^"]\+"' | sed -e 's/<a href="//g' | sed -e 's/" title="/ /g' | sed -e 's/"//g' | while read url title | |
do if [[ ${url:0:5} != "http:" ]] | |
then | |
url="http://cn.nytimes.com$url" | |
fi | |
echo $url | mail -s "$title" [email protected] | |
done |
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software. | |
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module | |
# This module "secure-link" helps you to protect links from stealing away. | |
# | |
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg | |
cd /usr/src | |
wget http://nginx.org/download/nginx-1.5.13.tar.gz | |
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz |
package main | |
import ( | |
"crypto/tls" | |
"crypto/x509" | |
"flag" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) |
/** | |
* HipChat client for Google Apps Script. | |
* This code is based on node-hipchat https://github.com/nkohari/node-hipchat/blob/master/lib/hipchat.js | |
*/ | |
(function(global) { | |
var HipChatClient = (function () { | |
HipChatClient.prototype.host = 'api.hipchat.com'; | |
function HipChatClient(apikey) { |
package main | |
import ( | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"io" | |
"log" | |
) |
# swith to sudo | |
sudo -i | |
# create swap | |
touch /2GiB.swap | |
chattr +C /2GiB.swap | |
fallocate -l 2048m /2GiB.swap | |
chmod 600 /2GiB.swap | |
mkswap /2GiB.swap |
For excessively paranoid client authentication.
Organization & Common Name: Some human identifier for this server CA.
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf | |
server { | |
listen 80; | |
server_name jira.example.com; | |
access_log off; | |
return 301 https://$server_name$request_uri; | |
} | |
# /etc/nginx/conf.d/jira.conf | |
server { |