Let's say you want to host domains first.com
and second.com
.
Create folders for their files:
def is_valid_state(state): | |
# check if it is a valid solution | |
return True | |
def get_candidates(state): | |
return [] | |
def search(state, solutions): | |
if is_valid_state(state): | |
solutions.append(state.copy()) |
<?php | |
function get_combinations($arrays) { | |
$result = array(array()); | |
foreach ($arrays as $property => $property_values) { | |
$tmp = array(); | |
foreach ($result as $result_item) { | |
foreach ($property_values as $property_value) { | |
$tmp[] = array_merge($result_item, array($property => $property_value)); | |
} |
apt-get install python-pip
pip install shadowsocks
sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
Setting up an email server is a difficult process involving a number of different programs, each of which needs to be properly configured. The best approach is to install and configure each individual component one by one, ensuring that each one works, and gradually build your mail server.
This guide covers how to set up a mail server on Debian 8. Most of the steps also should work on Ubuntu 14.04 LTS, considering that Ubuntu 14.04 LTS does not use systemd.
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: supervisord | |
# Required-Start: $remote_fs | |
# Required-Stop: $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
Hi:
perl -e 'print "hello world!\n"'
A simple filter:
perl -ne 'print if /REGEX/'
Filter out blank lines (in place):
__author__ = "Shihang Zhang" | |
__status__ = "Prototype" | |
class TrieNode(object): | |
""" Trie Node Class | |
@attrs: | |
children: a dictionary contains all children nodes | |
count: an integer indicates the number of occurence of current word |
''' | |
Given a string, reverse all vowels. | |
''' | |
def solution(str): | |
if len(str) in (0, 1): | |
return str | |
vowels = set(['a', 'e', 'o', 'u', 'i']) | |
p, q = 0, len(str)-1 |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"