Linking my account jerry-sl on GitHub with my address 5CRtUCqUz2AYx8yp9K4jhHi66sTEVWPtq8TnF7MjCG5A69hc on Substrate in mycryptoprofile.io, and the challenge code is: cc3f0380fc9dc3fcacaecd06d1b2db78. #LitentryVerifyMyAddress
This file contains hidden or 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
#!/bin/bash | |
while true; do | |
pid=`ps -ef |grep binary_name |grep -v grep |awk '{print $2}'` | |
if [ -n "$pid" ]; then | |
kill -15 $pid | |
echo "The process is exiting, it may take some time, forcing the exit may cause damage to the database, please wait patiently..." | |
sleep 1 | |
else | |
echo "binary_name process killed successfully!" | |
break |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
This file contains hidden or 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
alias proxy="export ALL_PROXY=socks5://127.0.0.1:1080" | |
alias unproxy="unset ALL_PROXY" | |
alias ip="curl -i http://ip.cn" |
This file contains hidden or 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 config --global http.proxy 'socks5://127.0.0.1:1080' | |
git config --global https.proxy 'socks5://127.0.0.1:1080' | |
This file contains hidden or 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
// 删除所有已经停止的container | |
docker rm -v $(docker ps -aq -f status=exited) | |
// 从dockerhub下拉镜像 | |
docker pull redis | |
// 后台启动容器 | |
docker run --name myredis -d redis | |
// 启动另外一个容器并链接到myredis:redis容器 | |
docker run --rm -it --link myredis:redis redis /bin/bash |
This file contains hidden or 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
# Set variables in .bashrc file | |
# don't forget to change your path correctly! | |
export GOPATH=$HOME/golang | |
export GOROOT=/usr/local/opt/go/libexec | |
export PATH=$PATH:$GOPATH/bin | |
export PATH=$PATH:$GOROOT/bin |
This file contains hidden or 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
go get -u golang.org/x/crypto/bcrypt | |
go get -u golang.org/x/crypto/blowfish | |
go get -u golang.org/x/crypto/bn256 | |
go get -u golang.org/x/crypto/cast5 | |
go get -u golang.org/x/crypto/curve25519 | |
go get -u golang.org/x/crypto/hkdf | |
go get -u golang.org/x/crypto/md4 | |
go get -u golang.org/x/crypto/nacl/box | |
go get -u golang.org/x/crypto/nacl/secretbox | |
go get -u golang.org/x/crypto/ocsp |
This file contains hidden or 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
var fs = require('fs'); | |
var parse = require('csv-parse'); | |
var Web3 = require('web3'); | |
var abi = require('./abi.json'); | |
var _ = require('lodash'); | |
const Tx = require('ethereumjs-tx'); | |
var web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/scure_key")); | |
//var inputFile = 'data.csv'; |
Not all random values are created equal - for security-related code, you need a specific kind of random value.
A summary of this article, if you don't want to read the entire thing:
- Don't use
Math.random()
. There are extremely few cases whereMath.random()
is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case. - Don't use
crypto.getRandomBytes
directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable. - If you want to generate random tokens or API keys: Use
uuid
, specifically theuuid.v4()
method. Avoidnode-uuid
- it's not the same package, and doesn't produce reliably secure random values. - If you want to generate random numbers in a range: Use
random-number-csprng
.
You should seriously consider reading the entire article, though - it's
NewerOlder