Replace user with the name of the user you want to ssh as.
Replace the ip with the ip of the machine / host / vps you want to connect to.
cat ~/.ssh/id_rsa.pub | ssh user@ip "cat >> ~/.ssh/authorized_keys"| 'use strict'; | |
| const puppeteer = require('puppeteer'); | |
| (async () => { | |
| /* PRECONDITION: | |
| 0. download ublock, I used https://github.com/gorhill/uBlock/releases/download/1.14.19b5/uBlock0.chromium.zip | |
| 1. run $PATH_TO_CHROME --user-data-dir=/some/empty/directory --load-extension=/location/of/ublock | |
| 2. enable block lists you want to use | |
| */ |
| #!/usr/bin/env bash | |
| # | |
| # Description: Auto test download & I/O speed script | |
| # | |
| # Copyright (C) 2015 - 2016 Teddysun <[email protected]> | |
| # | |
| # Thanks: LookBack <[email protected]> | |
| # | |
| # URL: https://teddysun.com/444.html | |
| # |
| # 1. Install brew --> http://brew.sh/ | |
| # 2. run the following commands in your Terminal | |
| brew tap homebrew/dupes | |
| brew tap homebrew/versions | |
| brew tap homebrew/homebrew-php | |
| brew install --with-openssl curl | |
| brew install --with-homebrew-curl --with-apache php71 | |
| brew install php71-mcrypt php71-imagick | |
| # 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot. | |
| brew info php71 |
| brew update | |
| brew upgrade | |
| brew tap homebrew/dupes | |
| brew tap homebrew/versions | |
| brew tap homebrew/homebrew-php | |
| brew install php71 | |
| ## To use PHP7.1 on CLI, add this to .bash_profile |
| (defvar base-youdao-url "http://fanyi.youdao.com/openapi.do?keyfrom=emacs-yd-pub&key=527593631&type=data&doctype=json&version=1.1&q=") | |
| ;; Get yourself an API KEY here: http://fanyi.youdao.com/openapi?path=data-mode | |
| (defun youdao-fanyi () | |
| "Translate current word (en->cn, cn->en), prompt to input if no word here" | |
| (interactive) | |
| (let* ((word (or (thing-at-point 'word) (read-string "Translate> "))) | |
| (full-url (concat base-youdao-url word))) | |
| (with-current-buffer (url-retrieve-synchronously full-url) | |
| (unwind-protect | |
| (progn |
| #!/bin/bash | |
| # This script is based on https://gist.github.com/rehos/7856163 | |
| if [ -z "$1" ]; then | |
| echo | |
| echo "usage: $0 <project.xcodeproj> [<scheme>]" | |
| echo | |
| exit | |
| fi |
| # Install linux update, followed by GCC and Make | |
| sudo yum -y update | |
| sudo yum install -y gcc make | |
| # Install Nginx and php56-FPM | |
| sudo yum install -y nginx php56-fpm | |
| # Install php56 extensions | |
| sudo yum install -y php56-devel php-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap |
| class ConnectionPool(): | |
| """ | |
| Usage: | |
| conn_pool = nmi_mysql.ConnectionPool(config) | |
| db = conn_pool.get_connection() | |
| db.query('SELECT 1', []) | |
| conn_pool.return_connection(db) | |
| conn_pool.close() |