Skip to content

Instantly share code, notes, and snippets.

@rraallvv
rraallvv / JSON-compression.js
Created May 25, 2018 21:39
JSON compression
var lzma = require('lzma');
var data = {
'address': 'XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX',
'amount': 100,
'message': 'This is the long description that will be shown to the user once the user opens the requested transaction.\nThis is the long description that will be shown to the user once the user opens the requested transaction.\nThis is the long description that will be shown to the user once the user opens the requested transaction.\nThis is the long description that will be shown to the user once the user opens the requested transaction.',
'data': 'Data in the extended transaction',
'flags': 15
};
var Base64 = {
@rraallvv
rraallvv / git-ftp.md
Last active May 27, 2021 19:06
Working with git-ftp on macOS client and vsftpd on Linux server

Working with git-ftp on macOS client and vsftpd on Linux server

Generate SSL certificate and key

$ openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout ~/.ssh/vsftpd.key -out ~/.ssh/vsftpd.crt

Add the generated certificate to the Keychain Access app

@rraallvv
rraallvv / enable_tor.sh
Created September 28, 2018 17:58 — forked from enilsen16/enable_tor.sh
Enable/Disable Tor
#!/bin/bash
INTERFACE=Wi-Fi
networksetup -setsocksfirewallproxy $INTERFACE 127.0.0.1 9050 off
networksetup -setsocksfirewallproxystate $INTERFACE on
tor
networksetup -setsocksfirewallproxystate $INTERFACE off
@rraallvv
rraallvv / passenger.service
Last active October 3, 2018 17:40
systemd unit for Phusion Passenger
# systemd unit for Phusion Passenger
# /lib/systemd/system/peatio.service
[Unit]
Description=Peatio Service
After=network.target
StartLimitInterval=0
[Service]
Type=forking
@rraallvv
rraallvv / peatio-forking.service
Last active October 20, 2018 11:44
Peatio running with Puma as a service
# systemd unit for Puma server
# /lib/systemd/system/peatio.service
[Unit]
Description=Peatio Service
After=network.target mysqld.service
StartLimitInterval=0
[Service]
Type=forking
@rraallvv
rraallvv / peatio.service
Created October 20, 2018 11:43
Peatio running with puma as a service
[Unit]
Description=Peatio Service
After=network.target mysqld.service
StartLimitInterval=0
[Service]
Type=simple
User=deploy
Group=deploy
@rraallvv
rraallvv / nimiq.service
Created October 20, 2018 11:48
Nimiq JSON-RPC server service
[Unit]
Description=Nimiq JSONRPC daemon
After=network.target
[Service]
Type=simple
User=deploy
Group=deploy
WorkingDirectory=/home/deploy/nimiq-core
ExecStart=/usr/bin/node /home/deploy/nimiq-core/clients/nodejs/index.js --config=settings.conf
@rraallvv
rraallvv / bitcoin.conf
Created October 20, 2018 11:56
Bitcoin service
server=1
daemon=1
#debug=mempool
debug=rpc
# If run on the test network instead of the real bitcoin network
# testnet=1
# You must set rpcuser and rpcpassword to secure the JSON-RPC api
# Please make rpcpassword to something secure, `5gKAgrJv8CQr2CGUhjVbBFLSj29HnE6YGXvfykHJzS3k` for example.
@rraallvv
rraallvv / geth.service
Created October 20, 2018 12:01
Ethereum service
[Unit]
Description=The Ethereum Blockchain Command Line Interface
After=network.target
[Service]
User=deploy
Group=deploy
ExecStart=/usr/bin/geth --rpc --syncmode "light" --cache=512 --rpcport=8545 --rpcapi eth,personal,net,web3,db --datadir /home/deploy/.ethereum
[Install]
@rraallvv
rraallvv / twitter-tip-bot.service
Created October 20, 2018 12:24
Twitter Tip Bot service
[Unit]
Description=Twitter Tip Bot daemon
After=network.target nimiqd.service
[Service]
Type=simple
User=myuser
Group=myuser
Environment="TWITTER_USERNAME=twitter_username"