Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 = {

None of these answers give a full useable workflow, I want to git push, not send an email! Here's how to do it properly but there's a bit of setup required. Instructions are for OSX

#Publishing anonymously to github with tor+ssh

  1. Download tor browser bundle AND the tor command line proxy

     brew install tor
     brew cask install torbrowser
    

1.1 In tor browser, Create a new email address ( I used hmamail).

@rraallvv
rraallvv / pre-commit
Last active March 30, 2018 19:09
Git hook to convert hard tabs and remove spaces before line ending
#!/bin/sh
git diff --diff-filter=d --name-only --cached | grep -v "Resource.designer.cs" -E | grep -E "\.cs$|\.xml$|\.xaml$|\.axml$" | while read -r file; do
# Convert soft tabs to hard ones
perl -pi -e "s/\G {4}/\t/g" $file
# Remove additional spaces before the end of line
perl -pi -e "s/[ \t]$//g" $file
# Add newline before EOF if missing