I hereby claim:
- I am mrinalwadhwa on github.
- I am mrinalwadhwa (https://keybase.io/mrinalwadhwa) on keybase.
- I have a public key ASCPMxSM9YAbqvODLF8K_n54VAt7bdiQJGlCyriSdn0tQAo
To claim this, I am signing this object:
| #!/usr/bin/env python3 | |
| # The below code is an attemt to understand Elliptic Curve Cryptography | |
| # by implementing Elliptic Curve Diffie-Hellman key exchange from scratch. | |
| # DON'T USE THIS CODE IN YOUR APP!! | |
| # It is not safe and is intended only as a learning tool. | |
| import secrets |
| curl -0 -v -X POST http://wemo:49153/upnp/control/basicevent1 -H 'SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"' -H 'Content-Type: text/xml; charset=utf-8' -d @- << EOF | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <s:Envelope | |
| xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" | |
| s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> | |
| <s:Body> | |
| <u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1" /> | |
| </s:Body> | |
| </s:Envelope> | |
| EOF |
I hereby claim:
To claim this, I am signing this object:
| def utc_iso8601_milli(time) | |
| time.utc.strftime '%FT%T.%LZ' | |
| end | |
| utc_iso8601_milli Time.now | |
| # => "2016-09-02T07:06:18.134Z" | |
| utc_iso8601_milli Time.new(2002, 10, 31, 2, 2, 2, "+05:00") | |
| # => "2002-10-30T21:02:02.000Z" |
| #!/usr/bin/env bash | |
| ## | |
| ## Usage: usage [command|path] | |
| ## Assuming that a command script file starts with a block of usage info | |
| ## where each line in the block starts with two '##' characters. This script | |
| ## extracts and displays that block of usage info. | |
| ## | |
| ## Example: | |
| ## Given a file a_command with the following contents: | |
| ## |
| #!/usr/bin/env bash | |
| sudo lsof -i -P | grep -i "listen" | |
| # REFERENCES | |
| # http://apple.stackexchange.com/a/117648 |
| #!/usr/bin/env bash | |
| ## | |
| ## Usage: ip | |
| ## Display external IP using OpenDNS. | |
| ## | |
| dig +short myip.opendns.com @resolver1.opendns.com | |
| # REFERENCES | |
| # http://www.commandlinefu.com/commands/view/5253/get-your-outgoing-ip-address |
| #!/usr/bin/env bash | |
| ## | |
| ## Usage: afk | |
| ## Lock Screen on MacOS | |
| ## | |
| /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend |
| #!/usr/bin/env bash | |
| ## | |
| ## Usage: random-string [length] [lines] [pattern] | |
| ## Generates a random string using /dev/urandom | |
| ## | |
| ## Default: | |
| ## length: 32 | |
| ## lines: 1 | |
| ## pattern: 'a-zA-Z0-9' | |
| ## |
| function prompt_color(){ | |
| case $# in | |
| 3) echo -en "\[\033[$2\]\[\033[$3\]\[$1\033[0m\]";; | |
| 2) echo -en "\[\033[$2\]$1\[\033[0m\]";; | |
| 1) echo -en "$1";; | |
| *) echo -en "";; | |
| esac | |
| } | |
| function git_branch(){ |