Skip to content

Instantly share code, notes, and snippets.

@shichao-an
shichao-an / common-account
Created February 4, 2015 00:06
/etc/pam.d/common-account
#
# /etc/pam.d/common-account - authorization settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authorization modules that define
# the central access policy for use on the system. The default is to
# only deny service to users whose accounts are expired in /etc/shadow.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
@shichao-an
shichao-an / common-session
Created February 4, 2015 00:06
/etc/pam.d/common-session
#
# /etc/pam.d/common-session - session-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define tasks to be performed
# at the start and end of sessions of *any* kind (both interactive and
# non-interactive).
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
@shichao-an
shichao-an / common-password
Created February 4, 2015 00:07
/etc/pam.d/common-password
#
# /etc/pam.d/common-password - password-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define the services to be
# used to change user passwords. The default is pam_unix.
# Explanation of pam_unix options:
#
# The "sha512" option enables salted SHA512 passwords. Without this option,
@shichao-an
shichao-an / common-session-noninteractive
Created February 4, 2015 00:13
/etc/pam.d/common-session-noninteractive
#
# /etc/pam.d/common-session-noninteractive - session-related modules
# common to all non-interactive services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define tasks to be performed
# at the start and end of all non-interactive sessions.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
@shichao-an
shichao-an / sshd
Created February 4, 2015 00:15
/etc/pam.d/sshd
# PAM configuration for the Secure Shell service
# Standard Un*x authentication.
@include common-auth
# Disallow non-root logins when /etc/nologin exists.
account required pam_nologin.so
# Uncomment and edit /etc/security/access.conf if you need to set complex
# access limits that are hard to express in sshd_config.
#!/bin/bash
set -e
device=${1:-/dev/xvdf}
apt-get install -y xfsprogs
mkfs -t xfs $device
mkdir /vol
echo "$device /vol xfs defaults,noatime 0 0" >> /etc/fstab
mount -a
Kaguya was once a princess of the Lunarians, a race of people living on the Moon. She was exiled to Earth over a thousand years ago for the crime of using the forbidden Hourai Elixir to make herself immortal. Arriving on Earth one day, she was found by a bamboo cutter and dwelt among the humans she had once despised. Though the Lunarians looked upon humans with contempt, Kaguya came to love her new home. Tales of her unearthly beauty led men from all across the land to seek her hand in marriage, Fujiwara no Mokou's father being one of them, but none could successfully complete her trial of the Five Impossible Requests.
The first was to bring her the stone begging bowl of the Buddha from India. The second was to retrieve a jewelled branch from the island of Mount Hourai. The third was to seek the legendary robe of the fire-rat of China. The fourth was to retrieve a colored jewel from a dragon's neck. The final task was to find the legendary Cowry treasure of the swallows. These potent treasures were eventually
@shichao-an
shichao-an / install-docker-ufw.sh
Last active August 29, 2015 14:15
Install Docker on Ubuntu 14.04 with UFW
#!/bin/bash
set -e
apt-get update
# Install iptables-persistent
apt-get install -y iptables-persistent
# Enable UFW forwarding and open TCP port 2375
ufw enable
sed -i 's/\(DEFAULT_FORWARD_POLICY\)="DROP"/\1="ACCEPT"/g' /etc/default/ufw
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
body, table, form, input, td, th, p, textarea, select {
font-family: "Open Sans", Verdana, Helvetica !important;
}
@shichao-an
shichao-an / install-docker.sh
Last active August 29, 2015 14:15
Install docker without UFW on Ubuntu 14.04
#!/bin/sh
[ -e /usr/lib/apt/methods/https ] || {
apt-get update
apt-get install apt-transport-https
}
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
curl -sSL https://get.docker.com/ubuntu/ | sh