Skip to content

Instantly share code, notes, and snippets.

Avatar

Mario Dian mariodian

View GitHub Profile
View gist:b3f0e837862e25633630
Verifying I am +mariodian on my passcard. https://onename.com/mariodian
View gist:0dc027ce5c0e13bbfc1d
### Keybase proof
I hereby claim:
* I am mariodian on github.
* I am mariodian (https://keybase.io/mariodian) on keybase.
* I have a public key ASC0J6i9yo6bj-yXWWv3J1y7Di3-EH4RBP4K_QTcbt92Hwo
To claim this, I am signing this object:
@mariodian
mariodian / openbazaar
Last active Dec 5, 2016
OpenBazaar sysv service
View openbazaar
#! /bin/bash
### BEGIN INIT INFO
# Provides: openbazaar
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop openbazaar server
# Description: Start the openbazaar server as a specified user
### END INIT INFO
@mariodian
mariodian / openbazaar.conf
Created Apr 11, 2016
OpenBazaar upstart service
View openbazaar.conf
# Startup script for OpenBazaar Server that will auto-restart if crashed
# Copy this script to /etc/init folder
# "chmod 644 openbazaar.conf"
# Change "chdir", "setuid" and "setgid" according to your system
# Usage: "sudo service openbazaar start"
description "OpenBazaar Server"
start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]
@mariodian
mariodian / obsetup.sh
Created May 8, 2016
OpenBazaar Server installation script for Ubuntu
View obsetup.sh
#!/bin/bash
# Run: "chmod u+x obsetup.sh" before running the script
user=$(whoami)
dir=$(pwd)
if [ $user = 'root' ]; then
echo "Please run this script as a regular user."
exit;
fi
@mariodian
mariodian / bitcoind.service
Created Jul 6, 2016
Bitcoind Systemd script
View bitcoind.service
[Unit]
Description=Bitcoin's distributed currency daemon
After=network.target
[Service]
User=pi
Group=pi
Type=forking
PIDFile=/var/lib/bitcoind/bitcoind.pid
@mariodian
mariodian / btc.sh
Last active Jul 17, 2016
The Bitcoin Script. Currently supporting ticker with various currencies.
View btc.sh
#!/bin/bash
if [ "$1" = "price" ]; then
currency=$([ "$2" = "" ] && echo "usd" || echo $2)
case $2 in
ltc)
pair="$2/usd"
;;
eur|*)
@mariodian
mariodian / agreement.md
Last active Jul 21, 2016 — forked from tyler-smith/agreement.md
OpenBazaar Moderation Agreement
View agreement.md

@mariodian OpenBazaar Moderation Agreement

Author Version Last Updated
Tyler Smith 0.1.0 2016-04-18
Mario Dian 0.1.1 2016-07-21

Based on the moderation policy of @serp.

Goal

@mariodian
mariodian / openbazaar.service
Created Aug 31, 2016
Debian Systemd OpenBazaar Service
View openbazaar.service
# Save as /lib/systemd/system/openbazaar.service
[Unit]
Description=OpenBazaar server
After=network.target auditd.service
[Service]
Type=forking
User=pi
Group=pi
PIDFile=/tmp/openbazaard.pid
@mariodian
mariodian / ob.sh
Last active Apr 12, 2017
Handle OB server daemon
View ob.sh
#!/bin/bash
ARGS="start -d -a 0.0.0.0"
cd /home/pi/source/OpenBazaar-Server
if [ "$1" = "start" ]; then
echo "OB Server starting..."
rm -rf /tmp/openbazaard.pid