Skip to content

Instantly share code, notes, and snippets.

View fire9's full-sized avatar
🏠
Working from home

fire9 fire9

🏠
Working from home
View GitHub Profile
$ wget http://download.savannah.gnu.org/releases/libunwind/libunwind-1.0.1.tar.gz
$ wget http://gperftools.googlecode.com/files/gperftools-2.0.tar.gz
$ tar zxvf libunwind-1.0.1.tar.gz && cd libunwind-1.0.1
$ CFLAGS=-fPIC ./configure
$ make CFLAGS=-fPIC
$ sudo make CFLAGS=-fPIC install
$ cd ..
$ tar zxvf gperftools-2.0.tar.gz
# First commit
echo "hello" | git hash-object -w --stdin
git update-index --add --cacheinfo 100644 ce013625030ba8dba906f756967f9e9ca394464a hello.txt
git write-tree
git commit-tree aaa96c -m "First commit"
git update-ref refs/heads/master 30b060d9a7b5e93c158642b2b6f64b2b758da40d
# Second commit
# First commit
echo "hello" | git hash-object -w --stdin
git update-index --add --cacheinfo 100644 ce013625030ba8dba906f756967f9e9ca394464a hello.txt
git write-tree
git commit-tree aaa96c -m "First commit"
git update-ref refs/heads/master 30b060d9a7b5e93c158642b2b6f64b2b758da40d
# Second commit
# --------------------------------------------
# General
# --------------------------------------------
set :shared_children, %w(cache logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments.
set :application, "domain.com" # Application name
set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ...
# --------------------------------------------
# Server
# --------------------------------------------
require "net/https"
require "uri"
require 'json'
uri = URI.parse("https://www.howsmyssl.com/a/check")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
resp = JSON.parse(http.request(Net::HTTP::Get.new(uri.request_uri)).body)
puts JSON.pretty_generate(resp)
@fire9
fire9 / proxy.conf
Last active December 21, 2017 12:19
proxy forward direction for nginx
server {
resolver 8.8.8.8;
resolver_timeout 5s;
listen 8080;
access_log /var/logs/nginx/proxy.access.log;
error_log /var/logs/nginx/proxy.error.log;
@fire9
fire9 / fabfile.py
Created December 21, 2017 12:29
fabric file template
from __future__ import with_statement
import os
from time import time
from StringIO import StringIO
from tempfile import NameTemporaryFile
from fabric.api import local, env, run, cd, get
from fabric.decorators import task
from fabric.contrib.files import exists, upload_template
@fire9
fire9 / centos_lnmp.md
Created December 24, 2017 16:28
centOS_LNMP环境安装

lnmp环境安装

CentOS Version Only.

关闭Selinux

# setenforce 0

setup CentOS epel repo

@fire9
fire9 / vim_install_ubuntu.md
Created December 24, 2017 16:32
Vim install for ubuntu

Install vim for ubuntu

sudo apt-get install tig
sudo apt-get remove vim-tiny
apt-get update
apt-get install vim
add-apt-repository http://klen.github.io/python-mode/deb main
apt-get update
apt-get install vim-python-mode