Skip to content

Instantly share code, notes, and snippets.

```
joker stream
curl -s --url "http://127.0.0.1:7782" --data "{\"userpass\":\"1d8b27b21efabcd96571cd56f91a40fb9aa4cc623d273c63bf9223dc6f8cd81f\",\"method\":\"streamerqadd\",\"data\":\"$hex2\",\"seqid\":$i}"
```
@imylomylo
imylomylo / gist:0a5936e88ed8bbf6220005f3e39e37fc
Created October 23, 2018 10:20
Docker komodo from emmanuel dragon riders
Discord #developer channel
FROM ubuntu:16.04
ENV BUILD_PACKAGES="build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev curl wget bsdmainutils automake libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libqt4-dev libqrencode-dev libdb++-dev"
RUN apt update && \
apt install -y $BUILD_PACKAGES
Setting up a table
#############
https://github.com/smk762/kmd_pulp/blob/master/Staked/dice/dice_table.sh#L176
We can see here that to setup a table we use the `dicefund` command which gives us a `rawtransaction` to broadcast on the network at https://github.com/smk762/kmd_pulp/blob/master/Staked/dice/dice_table.sh#L180
We go into a loop to check that the `dicefund` (table setup) transaction has been confirmed https://github.com/smk762/kmd_pulp/blob/master/Staked/dice/dice_table.sh#L191
When confirmed, doing a `dicelist` gives us a list of tables https://github.com/smk762/kmd_pulp/blob/master/Staked/dice/dice_table.sh#L195
https://medium.com/@nickdenardis/working-with-vuepress-v0-10-and-tailwind-css-v0-6-f9a928fbae98
@imylomylo
imylomylo / gist:7e2fc21c855b130b4c28ef095d208f16
Last active December 5, 2018 09:11
rate limit bad miners
-N BADMINER creates a new iptables chain called "BADMINER"
-A INPUT appends to the "INPUT" chain this rule, which searches for the string "authorize" on tcp/4646 and then jumps (-j) to the rules of chain BADMINER (-j BADMINER)
-A BADMINER has the rate limit of 10/min and logs to syslog
iptables -N BADMINER
iptables -A BADMINER -m limit --limit 10/min -j LOG --log-prefix "BADMINER DROP: "
iptables -A BADMINER -m comment --comment "Rate limit exceeded, reject" -j REJECT
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 4646 -m string --string "authorize" --algo bm -m comment --comment "Catch BADMINER" -j BADMINER
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
komodod -regtest -ac_name=REGTESTKMDICE -pubkey=03511aab41ccdef8586a79460765c1f260b6082a52772dfb80054ba17c74652f81 -ac_cc=2 -ac_supply=5000
@imylomylo
imylomylo / docker-install-ubuntu1804.md
Last active June 20, 2019 10:11
docker-install-ubuntu-18.04
   sudo apt update
   sudo apt install apt-transport-https ca-certificates curl software-properties-common
   curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
   sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
   sudo apt update
   apt-cache policy docker-ce
   sudo apt install docker-ce
   sudo systemctl status docker
 sudo usermod -aG docker ${USER}
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests
sudo systemctl restart apache2
<VirtualHost *:443>
SSLEngine on
RequestHeader set X-Forwarded-Proto 'https'
docker exec -it mediawiki /bin/bash
# Disable reading by anonymous users
$wgGroupPermissions['*']['read'] = false;
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;
# Prevent new user registrations except by sysops