Skip to content

Instantly share code, notes, and snippets.

View TravisMullen's full-sized avatar

Travis Mullen TravisMullen

View GitHub Profile
@TravisMullen
TravisMullen / grab_wallet.sh
Created May 4, 2018 20:05
Get PIVX wallet from USB (Linux)
#!/bin/sh -e
sudo mkdir -p /mnt/usb
sudo mount /dev/sda1 /mnt/usb
cd /mnt/usb
# find "pivx/wallet.dat"
mkdir -p $HOME/.pivx
sudo cp -f *pivx/*wallet.dat $HOME/.pivx/wallet.dat
sudo umount /dev/sda1
@TravisMullen
TravisMullen / getstakingstatus.sh
Created May 6, 2018 06:01
Is wallet staking status active.
#!/bin/bash -e
output=$(pivx-cli getstakingstatus | jq -r '.["staking status"]')
if [ "$output" == "true" ]; then
echo "staking is active"
exit 0
fi
echo "staking is NOT active"
exit 1
#!/usr/bin/env node
// node index.js '+1...' 'My Message.'
// `npm i plivo`
// create file: `.keys/index.js`
// and add:
// ```JS
// module.exports = {
// PLIVO_AUTH_ID: 'PLIVO_AUTH_ID',
@TravisMullen
TravisMullen / install_usb_drivers.sh
Created May 16, 2018 23:18
Raspian Disk Support Drivers
#!/bin/sh
# Add Apple OS X HFS+ read/write support
sudo apt-get install hfsutils hfsprogs hfsutils
# sudo mkfs.hfsplus /dev/sda1 -v untitled # format
# Add Windows/DOS FAT32 read/write support
sudo apt-get install dosfstools
# Add Windows NTFS read/write support
#!/bin/sh -e
# pivx-xli stop
sudo systemctl disable pivxd
sudo systemctl stop pivxd
cp ./.pivx/wallet.dat ./wallet.PIVXbootstrapBackup.dat
cp ./.pivx/pivx.conf ./pivx.PIVXbootstrapBackup.conf
wget -O- -O ./.pivx/tmpbootstrap.zip https://github.com/PIVX-Project/PIVX/releases/download/v3.0.5.1/pivx-chain-910000-bootstrap.dat.zip
unzip ./.pivx/tmpbootstrap.zip -d ./.pivx
@TravisMullen
TravisMullen / chainstate.backup.zip
Created May 26, 2018 18:13
zcoin chainstate and wallet backup
#!/bin/sh -e
sudo apt-get install zip unzip
# zcoin-cli stop
sudo systemctl disable zcoind
sudo systemctl stop zcoind
rm -f $HOME/chainstate.backup.zip
cp $HOME/.zcoin/wallet.dat $HOME/wallet.backup.dat
var service = {},
// unit model
// 'singular': 'USD 1 Millon',
// 'plural': 'USD 1 Millon',
// 'abbr': '$1M',
// // also can be true and template would assume to be `abbr`
// // (for sbackwards compat)
// 'prefix': '$',
// 'postfix': 'M'
@TravisMullen
TravisMullen / sortJawn.mjs
Last active June 3, 2018 07:12
The Good Sort.
/**
* The Good Sort. When your object attribute [values] are shady AF.
* @param {any} valueA
* @param {any} valueB
* @param {Boolean} descending - True for descending. Default is [false] ascending.
*/
export default function sortJawn (valueA, valueB, descending = false) {
// the same... carry on
if (valueA === valueB) {
return 0
@TravisMullen
TravisMullen / lit-element-repeat.html
Created June 8, 2018 22:04
Example: Lit Element's Repeat Method
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@next/webcomponents-loader.js"></script>
</head>
<body>
<!-- Works only on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 17 -->
<script type="module">
import { LitElement, html } from 'https://unpkg.com/@polymer/lit-element@latest/lit-element.js?module';
@TravisMullen
TravisMullen / hexGenerator.js
Created August 5, 2018 13:15
Generate a random hex value.
const hexGenerator = function(length = 16) {
let text = "";
const possible = "ABCDEFabcdef0123456789";
for(let i = 0; i < length; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}
// convert to random with parseInt(`0x${hexGenerator()}`, 16)