command | description |
---|---|
ctrl + a | Goto BEGINNING of command line |
This file contains 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
package main | |
import ( | |
"bufio" | |
"log" | |
"net/rpc" | |
"os" | |
) | |
func main() { |
This file contains 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
# undo: reverts the last command, as long as there is a registered handler | |
# for it. | |
# | |
# Usage: | |
# | |
# $ undo | |
# | |
# There are no options. | |
# | |
# There are by default registered handlers for the following commands: |
This file contains 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
git clean -xfd | |
git submodule foreach --recursive git clean -xfd | |
git reset --hard | |
git submodule foreach --recursive git reset --hard | |
git submodule update --init --recursive |
This file contains 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/env bash | |
# Names of latest versions of each package | |
export VERSION_PCRE=pcre-8.39 | |
export VERSION_ZLIB=zlib-1.2.8 | |
export VERSION_LIBRESSL=libressl-2.4.2 | |
export VERSION_NGINX=nginx-1.11.3 | |
# URLs to the source directories | |
export SOURCE_LIBRESSL=http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ |
This file contains 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
# Make sure you grab the latest version | |
curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip | |
# Unzip | |
unzip protoc-3.5.1-linux-x86_64.zip -d protoc3 | |
# Move protoc to /usr/local/bin/ | |
sudo mv protoc3/bin/* /usr/local/bin/ | |
# Move protoc3/include to /usr/local/include/ |
This file contains 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
def train(X, Y, nn_architecture, epochs, learning_rate): | |
params_values = init_layers(nn_architecture, 2) | |
cost_history = [] | |
accuracy_history = [] | |
for i in range(epochs): | |
Y_hat, cashe = full_forward_propagation(X, params_values, nn_architecture) | |
cost = get_cost_value(Y_hat, Y) | |
cost_history.append(cost) | |
accuracy = get_accuracy_value(Y_hat, Y) |
This file contains 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
# 1. put frpc and frpc.ini under /usr/local/frpc/ | |
# 2. put this file (frpc.service) at /etc/systemd/system | |
# 3. run `sudo systemctl daemon-reload && sudo systemctl enable frpc && sudo systemctl start frpc` | |
# Then we can manage frpc with `sudo service frpc {start|stop|restart|status}` | |
# See also: https://nosame.net/use-frp-to-reverse-proxy-your-nas/ | |
# Alternative for server: | |
# - Offical: https://github.com/fatedier/frp/blob/a4cfab6/conf/systemd/frpc%40.service | |
[Unit] |
This file contains 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
# edit and save this file to /usr/lib/systemd/system/clash.service | |
[Unit] | |
Description=clash | |
After=network.target | |
[Service] | |
WorkingDirectory="your home directory"/.config/clash | |
ExecStart="your home directory"/.config/clash/start-clash.sh | |
ExecStop="your home directory"/.config/clash/stop-clash.sh | |
Environment="HOME=your home directory" |
OlderNewer