Skip to content

Instantly share code, notes, and snippets.

pragma solidity ^0.4.0;
contract OrderBookLUXBTC {
enum OrderType { BUY, SELL }
event OrderPlaced(uint64 id,OrderType t, uint64 price, uint64 quantity);
event OrderMatched(uint64 id);
mapping(address => uint) deposits;
@xotonic
xotonic / python.md
Created March 29, 2019 23:01
py python

Set breakpoint

import pdb; pdb.set_trace()
@xotonic
xotonic / quarry.lua
Created February 17, 2019 19:52
Computercraft script for turtle to make a quarry-like mine. Tags: minecraft computercraft
function Set(list)
local set = {}
for _, l in ipairs(list)
do set[l] = true end
return set
end
trash = Set {
"minecraft:dirt",
"minecraft:cobblestone"
OrderId COrder::ComputeId()
{
if (cachedOrderId == 0) {
std::vector<unsigned char> vchId;
vchId.resize(256);
auto it = vchId.begin();
*it = base == "LUX" ? 0 : 1;
it++;
@xotonic
xotonic / gdb-tricks.md
Last active January 30, 2019 14:54
gdb cgdb

Disable "repeats n times" abbreviations

set print repeats 0

Run script on gdb startup:

gdb -x <script-name>
@xotonic
xotonic / healthcheck.sh
Created November 8, 2018 20:44
Setting up Telegram bot to check alive status for LUX masternode
#!/bin/bash
# Setup:
# sudo apt-get install python3-pip python3-setuputils
# sudo pip3 install --upgrade pip
# sudo pip3 install telegram-send
# telegram-send --configure
# Follow instuctions to create bot
# Place this file to $HOME(now it is /home/luxadmin) and replace IP var with your this masternode address
# crontab -e
pragma solidity ^0.4.10;
contract StringHolder {
string savedString;
function setString( string newString ) public {
savedString = newString;
}
function getString() public constant returns( string ) {
@xotonic
xotonic / snmp.sh
Last active August 8, 2018 11:06
snmp
# discovery
snmpget -v2c -c public 172.17.0.2 1.3.6.1.2.1.1.5.0 1.3.6.1.2.1.1.2.0
docker run -it -v /home/xotonic/docker-snmpd:/conf polinux/snmpd -V -Lo -c /conf/snmpd.conf
# snmpd.conf
exec 1.3.6.1.2.1.1.5.0 sysName /bin/echo "dockjer"
@xotonic
xotonic / Vagrant.md
Last active August 22, 2018 02:07
vagrant

Troubleshooting

VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage --version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.

solve with sudo /etc/init.d/vboxdrv setup

@xotonic
xotonic / mongo.md
Last active May 31, 2017 09:10
mongo

User for mongobackup and mongorestore in 2.4

rs1:PRIMARY> db.addUser({ user: "pcrfems", pwd: "123", roles: [ 'read', 'userAdmin']})
{
	"user" : "pcrfems",
	"pwd" : "cd4ccf44c3f7fe667fc05ae38396a94b",
	"roles" : [
		"readWrite",
 "userAdmin"