Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

hack3r-0m

🎯
Focusing
View GitHub Profile
@mathben
mathben / archlinux_installation_ux370u_full_disk_encrypted.sh
Last active Jan 1, 2022
BASH - Installation Arch Linux on Asus ZenBook UX370U - Full disk single boot
View archlinux_installation_ux370u_full_disk_encrypted.sh
#!/usr/bin/env bash
# French Guide : https://github.com/FredBezies/arch-tuto-installation
# Install ARCH Linux with UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M status=progress && sync # on linux
@rhlsthrm
rhlsthrm / ReentrancyToken.sol
Created Oct 9, 2018
Fake ERC20 token that recreates reentrancy attack
View ReentrancyToken.sol
pragma solidity ^0.4.23;
import "./HumanStandardToken.sol";
import "../../LedgerChannel.sol";
contract ReentrancyToken is HumanStandardToken {
LedgerChannel ledgerChannel;
uint256 constant MAX_REENTRIES = 5;
uint256 numReentries = 0;
@whoisryosuke
whoisryosuke / api-form-submit.js
Created Oct 3, 2018
React - Handling forms and submitting POST data to API -- @see: https://reactjs.org/docs/forms.html
View api-form-submit.js
class NameForm extends React.Component {
constructor(props) {
super(props);
this.state = { name: '' };
}
handleChange = (event) => {
this.setState({[event.target.name]: event.target.value});
}
@jdrew1303
jdrew1303 / readme.md
Last active Jan 16, 2022
Market Order Matching Engine
View readme.md

Introduction

The computer driven markets for instruments like stocks and exchange traded stock options, have transformed finance and the flow of capital. These markets are enabled by order matching engines (and the infrastructure that supports this software). Before computer trading networks and matching engines, stocks where traded on cavernous exchange floors and transaction costs where high. When electronic trading fully matured, floor traders were a fading anachronism and transaction costs had been reduced to pennies a share in many cases. Electronic trading could not exist without advanced network infrastructure, but without the software matching engines no shares would change hands. The computer trading networks, the matching engine software has also created a concentrated nexus of potential failure. Failures in these systems have increased as the frequency and volume on the electronic networks has increased. The position of order matching engines in the trading infrastructure makes these systems o

@mfuzailzubari
mfuzailzubari / nginx.conf
Created Jun 27, 2018
NGINX RTMP Configurations
View nginx.conf
worker_processes auto;
events {
# Allows up to 1024 connections, can be adjusted
worker_connections 1024;
}
# RTMP configuration
rtmp {
server {
listen 1935; # Listen on standard RTMP port
View watchEtherTransfers.js
function watchEtherTransfers() {
// Instantiate web3 with WebSocket provider
const web3 = new Web3(new Web3.providers.WebsocketProvider('wss://rinkeby.infura.io/ws'))
// Instantiate subscription object
const subscription = web3.eth.subscribe('pendingTransactions')
// Subscribe to pending transactions
subscription.subscribe((error, result) => {
if (error) console.log(error)
@aarnone
aarnone / pbcopy-and-pbpaste-in-arch-linux.md
Created May 14, 2018
Get pbcopy and pbpaste in Arch Linux
View pbcopy-and-pbpaste-in-arch-linux.md

Get pbcopy and pbpaste in Arch Linux

First you need the 'xsel' package.

$> pacman -S xsel

Then create aliases.

alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'
@Dexaran
Dexaran / ERC20_token_standard_vulnerability_classification.md
Last active Oct 28, 2021
ERC20 token standard vulnerability classification.
View ERC20_token_standard_vulnerability_classification.md

Previously described at: ERC20 critical problems medium article.

Description.

ERC20 is the most common Ethereum token standard. It should be noted that it is also the first Ethereum's token standard as well.

It is also important that the original ERC20 proposal is a definition of token interface. EIP20 does not define a reference implementation for this token standard. Here is OpenZeppelin implementation of ERC20 token: https://github.com/OpenZeppelin/zeppelin-solidity/tree/master/contracts/token/ERC20

ERC20 token standard implementation assumes two ways of token transferring: (1) transfer function and (2) approve + transferFrom pattern.

View StringsAndBytes.sol
pragma solidity ^0.4.15;
contract StringsAndBytes {
/* --- public variables for storing tests results */
string public lastTestStringResult; //
bytes32 public lastTestBytes32Result; //
bytes public lastTestBytesResult; // bytes: dynamically-sized byte array
bool public lastTestBoolResult; //
@chriseth
chriseth / snarktest.solidity
Last active Jan 20, 2022
zkSNARKs test code
View snarktest.solidity
// This file is MIT Licensed.
//
// Copyright 2017 Christian Reitwiessner
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O