pip install --user ansible
https://galaxy.ansible.com/galaxyproject/postgresql
ansible-playbook -i dev, postgresql.yml
migrate to https://galaxy.ansible.com/geerlingguy/postgresql
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
pip install --user ansible | |
ansible-playbook -i inventory --connection=local postgresql.yml |
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/ruby | |
require 'net/smtp' | |
email = '' | |
passwd = '' | |
subject = $*[0] || "Ring Ring" | |
text = $*[1] || "An alarm has been triggered." | |
message = <<MESSAGE_END | |
From: Ringer <#{email}> |
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 apt-get update -qq | |
sudo apt-get install -qq software-properties-common | |
sudo apt-add-repository -y ppa:brightbox/ruby-ng | |
sudo apt-get update -qq | |
sudo apt-get install -qq build-essential ruby2.6{,-dev} zlib1g-dev libsqlite3-dev | |
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ | |
# cat >> ~/.gemrc <<EOF |
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
require 'test/unit' | |
require './tiny_frp.rb' | |
module TinyFRP | |
module UnitTest | |
module Util | |
def lift(&proc) | |
TinyFRP::Lift.new(&proc) | |
end |
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
# | |
# - install jdk8 from oracle | |
# | |
add-apt-repository -y ppa:webupd8team/java | |
apt-get update | |
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections | |
apt-get install -y oracle-java8-installer | |
apt-get install oracle-java8-set-default |
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
# |kw| as keyword | |
sites = | |
neubt: "//neubt.com/search.php?mod=forum&searchid=23034&orderby=lastpost&ascdesc=desc&searchsubmit=yes&kw=|kw|" | |
byrbt: "//bt.byr.cn/torrents.php?incldead=0&spstate=0&inclbookmarked=0&search=|kw|&search_area=0&search_mode=0" | |
ptbt: "//pt.sjtu.edu.cn/torrents.php?incldead=0&spstate=0&inclbookmarked=0&picktype=0&search=|kw|&search_area=0&search_mode=0" | |
search = (keyword) -> | |
window.open v.replace '|kw|', keyword for _, v of sites | |
return |
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 | |
cd `dirname $0` | |
F=`pwd |sed -e "s#$HOME/\?##"` | |
for P in * | |
do | |
# skip setup | |
if [ "$P" = "setup.sh" ]; then continue; 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
nodemailer = require "nodemailer" | |
smtpTransport = nodemailer.createTransport "SMTP", | |
service: "Gmail" | |
auth: | |
user: | |
pass: | |
mail = | |
from: "" |
NewerOlder