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
server { | |
listen 80; | |
listen [::]:80 default_server ipv6only=on; | |
root /path/to/sfproject/web; | |
# Make site accessible from http://localhost/ | |
server_name sf.cc localhost; | |
error_log /var/log/nginx/sf.error.log; |
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
#!/bin/bash | |
#prepare for php5.5 | |
sudo apt-get install -y python-software-properties | |
#sudo add-apt-repository ppa:ondrej/php5 | |
sudo add-apt-repository -y ppa:zanfur/php5.5 | |
sudo apt-get update -y | |
#sudo apt-get upgrade -y | |
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
#!/bin/bash | |
# from http://cnodejs.org/topic/510b4923df9e9fcc58f74c44 | |
nowtime=`date +%Y-%m-%d` | |
echo "============= backup start ${nowtime}=============" | |
parentpath=/opt/mongodbbackup |
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
#安装ppa-purge | |
sudo apt-get install ppa-purge | |
#移除源 | |
ppa-purge ppa:zanfur/php5 | |
# clean up os first | |
apt-get -y purge apache2_* bind9-* xinetd samba-* nscd-* portmap sendmail-* sasl2-bin | |
apt-get -y purge lynx memtester unixodbc python-* odbcinst-* tff-* | |
apt-get autoremove && apt-get clean |
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
import socket, ssl, json, struct | |
import binascii | |
# device token returned when the iPhone application | |
# registers to receive alerts | |
deviceToken = 'f435d683eb9d7e5680938c363ea6e38eba36a553e9b23ddd57f9a345c0da0a0e' | |
thePayLoad = { | |
'aps': { | |
'alert':'Oh no! Server\'s Down!', |
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
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev | |
git clone https://github.com/joyent/node.git | |
cd node | |
# 'git tag' shows all available versions: select the latest stable. | |
git checkout enter-a-version | |
# Configure seems not to find libssl by default so we give it an explicit pointer. | |
# Optionally: you can isolate node by adding --prefix=/opt/node |
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 bash | |
# Pre-requisites | |
sudo apt-get -y update | |
sudo apt-get --no-install-recommends -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev vim | |
# Download and compile Ruby 2.0.0-p0 | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz | |
tar -xvzf ruby-2.0.0-p0.tar.gz |
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
#!/bin/bash | |
#for php56 | |
sudo rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm | |
sudo yum update -y |
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
#/etc/profile | |
ORACLE_HOME=/usr/lib/oracle/12.1/client64 | |
TNS_ADMIN=/usr/lib/oracle/12.1/client64 | |
LD_LIBRARY_PATH=$ORACLE_HOME/lib | |
#NLS_LANG=american_america.utf8 | |
NLS_LANG=ZHS16GBK | |
export ORACLE_HOME LD_LIBRARY_PATH NLS_LANG | |
export C_INCLUDE_PATH=/usr/include/oracle/12.1/client |
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
server { | |
listen 80; | |
server_name xxx.com; | |
root /var/www/xxx/; | |
error_log /var/log/nginx/xxx.error.log; | |
access_log /var/log/nginx/xxx.access.log; | |
location / { | |
index index.php; | |
try_files $uri $uri/ @rewriteapp; |