Skip to content

Instantly share code, notes, and snippets.

View fiersk17's full-sized avatar
💭
I may be slow to respond.

FIERDAUS MUSTAFA fiersk17

💭
I may be slow to respond.
View GitHub Profile
@fiersk17
fiersk17 / gov.my_hostnames.csv
Created June 4, 2020 03:30 — forked from keithrozario/gov.my_hostnames.csv
Government Hostnames on Gov-TLS-Audit
domain hostname ip
1govnet 1govserv.1govnet.gov.my 203.12.220.140
1malaysia 1malaysia.com.my 52.84.225.176
mygeoportal 1malaysiamap.mygeoportal.gov.my 103.8.160.33
kpkt 1myc.kpkt.gov.my 103.8.145.205
treasury 1pp.treasury.gov.my 103.8.144.196
akmal 2u.akmal.gov.my 43.252.232.178
jkr 3ps.jkr.gov.my 43.252.232.157
rurallink aardo19.rurallink.gov.my 150.242.181.32
met abt.met.gov.my 175.28.14.115
@fiersk17
fiersk17 / Random generator
Created July 12, 2019 21:42 — forked from alexvandesande/Random generator
A very simple random generator. A miner can influence the number by not publishing a block with an unwanted outcome, and forfeiting the 5 block reward.
contract random {
/* Generates a random number from 0 to 100 based on the last block hash */
function randomGen(uint seed) constant returns (uint randomNumber) {
return(uint(sha3(block.blockhash(block.number-1), seed ))%100);
}
/* generates a number from 0 to 2^n based on the last n blocks */
function multiBlockRandomGen(uint seed, uint size) constant returns (uint randomNumber) {
uint n = 0;
for (uint i = 0; i < size; i++){
@fiersk17
fiersk17 / App.js
Created July 12, 2019 21:21 — forked from ryanjyost/App.js
Import SimpleStorage
import React, { Component } from "react";
import logo from "./logo.svg";
import "./App.css";
import SimpleStorage from "react-simple-storage";
class App extends Component {
//... etc.
@fiersk17
fiersk17 / ecverify.sol
Created July 5, 2019 12:15 — forked from axic/ecverify.sol
Ethereum ECVerify
//
// The new assembly support in Solidity makes writing helpers easy.
// Many have complained how complex it is to use `ecrecover`, especially in conjunction
// with the `eth_sign` RPC call. Here is a helper, which makes that a matter of a single call.
//
// Sample input parameters:
// (with v=0)
// "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad",
// "0xaca7da997ad177f040240cdccf6905b71ab16b74434388c3a72f34fd25d6439346b2bac274ff29b48b3ea6e2d04c1336eaceafda3c53ab483fc3ff12fac3ebf200",
// "0x0e5cb767cce09a7f3ca594df118aa519be5e2b5a"
@fiersk17
fiersk17 / ercevocer.js
Created July 5, 2019 12:04
Use solidity ecrecover with signature calculated with eth_sign
// Change accountToSignWith to the address of your account.
var Web3 = require('web3');
var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));
var accountToSignWith = '0xbedcf417ff2752d996d2ade98b97a6f0bef4beb9';
var message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Tubulum fuisse, qua illum, cuius is condemnatus est rogatione, P. Eaedem res maneant alio modo.'
@fiersk17
fiersk17 / configure_android_sdk.sh
Created July 2, 2019 01:37 — forked from kristopherjohnson/configure_android_sdk.sh
Bash script to set up ANDROID_SDK_ROOT and PATH for Android tools on Mac OS X with ADT bundle installed
# Setup for use of Android SDK tools from command line
# Set ANDROID_SDK_ROOT to point to the root of the SDK installation
export ANDROID_SDK_ROOT='/Applications/adt-bundle-mac-x86_64-20130729/sdk'
export PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools/lib/x86_64