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
"""Expression parser based on some templater | |
Pros: | |
- it is not a new language | |
- it has very strict api, so atleast we can try to guarantee its stability | |
- complex abstract logic can be hidden in simple python methods | |
Stements will be expressed in the form of: | |
api.cluster_status == 'operational' | |
api.role_in_deployment('ceph-osd') |
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 python | |
""" | |
Q/A | |
1. What is operation? | |
Solar client/api action | |
2. What is rule? | |
Condition, based on which we produce operations. | |
Condition should work only with local data, passing correct data will | |
be responsibility of fuel or solar |
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
pragma solidity 0.4.21; | |
import './ecrecovery.sol'; | |
contract Payments { | |
event LogExit(address recepient, uint256 value, uint id); | |
struct Exit { | |
address recipient; |
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
2069 sudo sysctl -w net.ipv4.neigh.default.gc_thresh1=1024 | |
2071 sudo sysctl -w net.ipv4.neigh.default.gc_thresh2=4096 | |
2072 sudo sysctl -w net.ipv4.neigh.default.gc_thresh3=8192 |
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 ( | |
"bytes" | |
"crypto/ecdsa" | |
"fmt" | |
"math/rand" | |
"net" | |
"time" |
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 ( | |
"bytes" | |
"crypto/rand" | |
"math/big" | |
"strings" | |
"github.com/ethereum/go-ethereum/accounts/abi" | |
"github.com/ethereum/go-ethereum/common" |
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
pragma solidity ^0.4.21; | |
contract TestHash { | |
bytes32 public result; | |
constructor() public {} | |
function generate(bytes input) public { | |
result = keccak256(input); |
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 ( | |
"bytes" | |
"crypto/rand" | |
"fmt" | |
"github.com/ethereum/go-ethereum/crypto/sha3" | |
) |
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 ( | |
"crypto/elliptic" | |
"crypto/rand" | |
"fmt" | |
"github.com/ethereum/go-ethereum/common/hexutil" | |
"github.com/ethereum/go-ethereum/crypto" | |
"github.com/ethereum/go-ethereum/crypto/ecies" |
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
const crypto = require('crypto'); | |
alice = crypto.createECDH('secp256k1') | |
alice.setPrivateKey('ce9873239e8c1126c1bb92086ab22e3f7c519afd530315f9b5ef92323bbddee3', 'hex') | |
bob = Buffer.from([4, 202, 191, 42, 27, 135, 133, 122, 201, 194, 207, 107, 136, 190, 242, 52, 229, 224, 20, 254, 233, 138, 194, 101, 9, 202, 37, 122, 237, 103, 143, 62, 28, 204, 159, 213, 185, 168, 60, 253, 145, 112, 153, 7, 2, 154, 113, 137, 71, 231, 53, 146, 209, 203, 219, 219, 142, 22, 115, 192, 199, 3, 24, 217, 152, 144, 176, 254, 186, 178, 137, 31, 37, 168, 176, 34, 18, 252, 177, 60, 231, 185, 53, 7, 76, 133, 215, 149, 78, 204, 137, 113, 171, 193, 181, 232, 224, 70, 214, 141, 213, 188, 22, 223, 49, 250, 199, 181, 200, 49, 115, 26, 26, 109, 174, 78, 124, 88]) | |
alice.computeSecret(bob.slice(0, 65)) |
OlderNewer