Skip to content

Instantly share code, notes, and snippets.

@tmuskal
tmuskal / aitv-seinfeld.ipynb
Last active February 4, 2023 20:22
aitv-seinfeld.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <eosio/eosio.hpp>
using namespace eosio;
class [[eosio::contract]] testmeta : public contract {
public:
using contract::contract;
[[eosio::action]]
void hi( name user ) {
@tmuskal
tmuskal / ImmunityToken.cpp
Last active November 10, 2019 11:18
ImmunityToken
void ontransfer(...) {
/* Calls LiquidOracles to get unused CPU for this user */
auto idle_quota = get_user_idle_cpu(from);
auto memo = "thank you for keeping the chain healthy";
transfer(to, from, asset(idle_quota , TALBENI), memo);
transfer(to, from, amount, memo);
}
@tmuskal
tmuskal / killproducer.sh
Created October 16, 2018 04:46
wait till after your schedule and kill your BP
#!/bin/bash
PRODUCERS_ORDER=`cleos get schedule | head -n 24 | tail -n 21 | cut -d " " -f 5`
PID=`ps -a | grep nodeos | cut -f 1 -d " "`
MYPROD=$1
PASSED_BEFORE=0
# todo: handle case you are the last one in schedule, wait for first one in schedule to kill
while true
do
WHOISPRODUCING=`sudo timeout 1s strace -fp$PID -s9999 -e trace=write 2>&1 | grep -o '".\+[^"]"' | grep on_incoming_block | cut -d " " -f 25 | tail -n 1`

Keybase proof

I hereby claim:

  • I am tmuskal on github.
  • I am tmuskal (https://keybase.io/tmuskal) on keybase.
  • I have a public key ASCBYgkbgHA5OckR9An5D7yrmBtjHoKnwZCSD5XhnWkxHQo

To claim this, I am signing this object: