Skip to content

Instantly share code, notes, and snippets.

{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Chris Swanda",
"label": "DevOps Engineer at SelectQuote Insurance Services",
"picture": "",
"email": "chris.swanda@gmail.com",
"summary": "A consummate, battle-tested technical professional with over 20 years of industry experience, ranging across multiple diverse disciplines - from the laboratory, to the board room. I have the innate ability discover and realize new opportunities for revenue, cost reduction and invention for internal and external stakeholders; by using uncommon knowledge, to bring forth uncommon results.",
// Note that this is not the production code
pragma solidity 0.5.6;
import "./IERC20.sol";
contract Wallet {
address internal token = 0x123...<hot_wallet_addr>;
address internal hotWallet = 0x321...<hot_wallet_addr>;
constructor() public {
@luoqeng
luoqeng / client.c
Created January 8, 2020 04:07 — forked from Chion82/client.c
fake TCP test
#include <stdio.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <string.h>
#include "trans_packet.h"
void on_packet_recv(char* from_ip, uint16_t from_port, char* payload, int size, unsigned int seq) {
printf("Packet received from=%s:%d, seq=%d\n", from_ip, from_port, seq);
char* message = (char*)malloc(size);
memcpy(message, payload, size);
@luoqeng
luoqeng / ERC20.sol
Last active May 31, 2018 12:40 — forked from anonymous/ERC20.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
pragma solidity ^0.4.10;
interface ERC20 {
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
@luoqeng
luoqeng / wan_ssh
Created April 9, 2018 03:35 — forked from lynus/wan_ssh
openwrt:allow wan ssh into your wrt
by default,openwrt do not allow ssh access from wan, here are two method to change that:
1.login into your wrt from a lan host.issue the following command:
iptables -F
the command "flush away" all the firewall rules,including the one that rejects ssh request from wan.
now you can try ssh from anywhere.
aware that the firewall deactivation leads to highly security risk.and after the wrt restarts ,all default firewall configuration comes back.you hava to "flush" the rules once again.
@luoqeng
luoqeng / README.md
Created July 23, 2016 11:00 — forked from tnarihi/README.md
Emacs 24.4 installation on Ubuntu 14.04 without sudo

Installing Emacs 24.4 on Ubuntu 14.04 without sudo privilege

Just run:

sh ./ubuntu14.04-emacs-24.4-install.sh

This will install ncurses which is dependency of emacs24.4. It may requires another dependencies depending on your environment. Note that configure options in emacs installation are for disabling GUI features.

#include <vector>
#include <assert.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
typedef int32_t Score;
typedef int32_t UserId;
typedef int32_t Rank;
const Score kInvalidScore = -1;