Skip to content

Instantly share code, notes, and snippets.

@npearce
npearce / install-docker.md
Last active May 9, 2024 18:42
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

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/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
more readable format
pragma solidity ^0.4.24;
interface FoMo3DlongInterface {
function airDropTracker_() external returns (uint256);
function airDropPot_() external returns (uint256);
function withdraw() external;
}
@p0n1
p0n1 / badERC20Token.txt
Created June 8, 2018 12:21
This table is only intended for DAPP developer's reference, please pay attention to all the smart contracts listed and try your best to avoid the incompatibility, especially if you are working with one of them.
## badERC20 Token with code from etherum-org
0xcc2ae7ad8f32ea3bd38d0192d20e465503ae698d_TokenERC20.sol
0x5fe56bfa37217bd8a2879c15c85ed7a894edf5a6_esportz.sol
0x7E42c72DFbE07Cde83a6BaD535A1A97496Df1531_TokenERC20.sol
0xf175C958aFdBF91a0c1981FF0510fCAA87D71899_GeneticHealthToken.sol
0x0d9a3739f7e072e7562f6e2440f37ad9bee68c4a_TokenERC20.sol
0x6e77c68404cb4b86b1cf7ae4ade8d260b4f9d5ce_UlordToken.sol
0xbeebcfe2fbb3c72884341be2b73ae0fc6559b8fc_Q1SToken.sol
0x9d5e22b6599c426b453de4a43df8a0cb4de061b1_YAKcoinERC20.sol
@decanus
decanus / Issue.md
Last active September 5, 2019 18:01

With Solidity 0.4.23 a require statement seemingly fail if a contract called has a returndatasize of less than 32. This issue was found when wrapping a transferFrom function call, which doesn't return anything, in a require.

Older contracts that use STOP to return control flow place 1 on the stack through the return of CALL and so RETURNDATASIZE is set to 0. The new require seems to enforce that at least 32 bytes must be returned by the child contract (with RETURNDATASIZE >= 0x20) which seems to break old contracts that simply check whether the return of CALL itself was 1.

The token contract used is Adex.

This issue indicates that any token transfered without a return will fail, affecting any contract using tokens transfers that are wrapped in a require as of solidity v0.4.23

To ensure this really is an issue, we have tried running the code with 2 solidity versions. Essentially wrapping

@devtdeng
devtdeng / verify_certificate.go
Last active April 28, 2022 13:45
Verify a certificate with chain with golang crypto library
package main
import (
"crypto/x509"
"encoding/pem"
"io/ioutil"
"log"
"os"
)
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
@reachlin
reachlin / prometheus.yml
Created April 19, 2017 07:06
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace
echo-server-epoll
echo-server-poll
talk
talk.dSYM
@muuki88
muuki88 / jenkins-sbt.groovy
Created November 2, 2016 17:03
Jenkins 2.0 SBT build pipeline
node {
stage('Git') {
git 'https://github.com/muuki88/activator-play-cluster-sample.git'
}
stage('Build') {
def builds = [:]
builds['scala'] = {
// assumes you have the sbt plugin installed and created an sbt installation named 'sbt-0.13.13'
sh "${tool name: 'sbt-0.13.13', type: 'org.jvnet.hudson.plugins.SbtPluginBuilder$SbtInstallation'}/bin/sbt compile test"
}