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
#!/usr/bin/env sh
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Post installation
Logo đã được crop lại thành hình vuông từ logo chuẩn mà học viện cung cấp
@vinhjaxt
vinhjaxt / KMACTF utilities
Last active August 1, 2020 10:45
KMACTF utilities
KMACTF utilities
@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;
@vinhjaxt
vinhjaxt / setDefaultNS.go
Created September 30, 2020 13:41 — forked from cs8425/setDefaultNS.go
DNS resolve workaround for android in pure go
package main
import (
"fmt"
"net"
"sync"
"time"
_ "unsafe"
)
@vinhjaxt
vinhjaxt / nak-nak-nak-nak
Created October 15, 2020 16:37
Nooo, you found me
I am anonymous, why you found me?
KCSC{forensic_is_fun!}
@vinhjaxt
vinhjaxt / Description.md
Last active February 5, 2021 07:11 — forked from juanje/Description.md
Limit Chrome from eating all the memory and CPU

I was tired of Chrome eating all my laptop resources so I decided to put some limit to it with cgroup.

As I was using Debian with support for cgroup, I installed the package cgroup-tools and add the following group to the file /etc/cgconfig.conf:

group browsers {
    cpu {
#       Set the relative share of CPU resources equal to 25%
        cpu.shares = "256";
 }