Skip to content

Instantly share code, notes, and snippets.

git config --global pager.log false
git config --global pager.branch false
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
# tar before encrypting
tar -cf archive.tar -C /path/to/directory file1 file2
# encrypt
openssl enc -aes-256-cbc -salt -in <input file> -out <output file>
# decrypt
openssl enc -d -aes-256-cbc -in <encrypted file> -out <decrypted file>
pragma solidity ^0.4.17;
contract Auction {
// Data
//Structure to hold details of the item
struct Item {
uint itemId; // id of the item
uint[] itemTokens; //tokens bid in favor of the item
}

Current strategy

$  ./zenbot.sh trade gdax.eth-USD --trend_ema 20 -period 7m --max_slippage_pct 0.48 --poll_trades 6000 --order_poll_time 6000 --order_adjust_time 6000 --oversold_rsi_periods=1000 --oversold_rsi=1000 --rsi_periods=1100 --neutral_rate=0.1 --max_sell_loss_pct=0.85 --max_buy_loss_pct=5 --buy_pct=100 --sell_pct=100 --selector gdax.eth-usd  --markup_sell_pct 0.25  --markdown_buy_pct 0.00  --reset-profit

The role of buy & sell percentages (PCT)

@brianunlam
brianunlam / authenticator.js
Created January 30, 2020 18:02 — forked from peterhughesdev/authenticator.js
Diffusion Authenticator example
let session = await diffusion.connect({
host: <host>,
principal: <admin username>,
credentials: <admin password>
});
let authenticator = {
authenticate(principal, credentials, sessionProperties, proposedProperties, callback) {
console.log('Auth:', principal, proposedProperties);
@brianunlam
brianunlam / sh
Created September 5, 2019 21:20
login to remote server without entering your pass every time.
# 1. Create an SSH Key. If you already have one (for sure you have) skip this step.
# Use the ssh-keygen command to create an SSH key. Accept all the defaults by pressing ENTER at every prompt. You’ll want to leave the passphrase empty.
ssh-keygen
# 2. Copy the SSH Public Key to the Remote Host
ssh-copy-id user_for_remote_server@remote_server
@brianunlam
brianunlam / tmux.md
Last active May 31, 2019 15:23 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@brianunlam
brianunlam / manpath-wrong
Created April 26, 2019 22:32 — forked from zeroc0d3/manpath-wrong
Fix: "manpath: can't set the locale; make sure $LC_* and $LANG are correct"
## Problem
When login in, the shell prints:
```
manpath: can't set the locale; make sure $LC_* and $LANG are correct
```
## Solution
```
sudo locale-gen "en_US.UTF-8"
sudo dpkg-reconfigure locales
@brianunlam
brianunlam / manpath-wrong
Created April 26, 2019 22:15 — forked from seafooler/manpath-wrong
Fix: "manpath: can't set the locale; make sure $LC_* and $LANG are correct"
## Problem
When login in, the shell prints:
```
manpath: can't set the locale; make sure $LC_* and $LANG are correct
```
## Solution
```
sudo locale-gen "en_US.UTF-8"
sudo dpkg-reconfigure locales
@brianunlam
brianunlam / iterm2.md
Created March 25, 2019 18:31 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)