sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
#!/usr/bin/env bash | |
# Reference: https://stackoverflow.com/questions/18215389/how-do-i-measure-request-and-response-times-at-once-using-curl | |
curl_format="\ | |
%{time_namelookup}:\ | |
%{time_connect}:%{time_appconnect}:\ | |
%{time_pretransfer}:%{time_redirect}:\ | |
%{time_starttransfer}:%{time_total}" | |
curl_result=$(echo "$curl_format" | curl -s -o /dev/null -w @- $@) | |
IFS=':' read -r -a array <<< "$curl_result" |
from itertools import product | |
from functools import reduce | |
class Number(): | |
def __init__(self): | |
self.num = 0 | |
def succ(self): | |
self.num += 1 | |
return self |
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker
now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start
PASSWORD1 # Replace literal string 'PASSWORD1' with '***REMOVED***' (default) | |
PASSWORD2==>examplePass # replace with 'examplePass' instead | |
PASSWORD3==> # replace with the empty string | |
regex:password=\w+==>password= # Replace, using a regex | |
regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines |
Find the Discord channel in which you would like to send commits and other updates
In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe!
@@ -55,7 +55,21 @@ | |
After login, make `client` and `client_in` instance | |
to communicate with LINE server | |
""" | |
- raise Exception("Code is removed because of the request of LINE corporation") | |
+ | |
+ self.transport = THttpClient.THttpClient(self.LINE_HTTP_URL) | |
+ self.transport_in = THttpClient.THttpClient(self.LINE_HTTP_IN_URL) | |
+ | |
+ self.transport.setCustomHeaders(self._headers) |
There are several common ways to do rsync backups of hosts over ssh:
Here is another option t
// 4 spaces to 2 spaces | |
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g | |
// Tab to 2 spaces | |
:%s/\t/ /g |
# useful for running ssl server on localhost | |
# which in turn is useful for working with WebSocket Secure (wss) | |
# copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/ |