Skip to content

Instantly share code, notes, and snippets.

Alastair McCann almccann

Block or report user

Report or block almccann

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am almccann on github.
  • I am almccann (https://keybase.io/almccann) on keybase.
  • I have a public key ASBrGEyfCeNmz2LYKr_d-ik-Ew9Fbrk0ueyB4Crdz7mFTQo

To claim this, I am signing this object:

@almccann
almccann / jsonstats
Created Nov 14, 2018
parse_statistics_inno
View jsonstats
[{'id': 1, 'STATUS': [{'Msg': 'CGMiner stats', 'When': 1542159818, 'Code': 70, 'STATUS': 'S', 'Description': 'sgminer 4.4.2'}], 'STATS': [{'09 HW errors': 17, '11 Temp': 0, '08 pllOptimal': False, 'Min': 99999999.0, '06 HW errors': 24, '07 PLL': 0, '02 nVol': 883, '10 Nonce ranges': 0, '11 Cooldown': 0, '04 Nonces found': 208, '02 Temp': 0, '01 Stales': 0, '07 Stales': 1, '03 HW errors': 16, '02 PLL': 0, '10 HW errors': 19, '00 Fail count': 0, '02 Nonce ranges': 0, 'Num active chips': 12, '04 Temp': 0, '09 Stales': 1, '10 Temp': 0, 'Elapsed': 79537, '08 Nonce ranges': 0, '05 pllOptimal': False, '09 PLL': 0, '10 Cooldown': 0, 'PLL': 354, '07 Fail reset': 32, 'Num cores': 384, '10 nVol': 899, '07 Temp': 0, '00 Stales': 0, '03 Fail reset': 32, '04 PLL': 0, '05 Temp': 0, '05 HW errors': 21, '04 Nonce ranges': 0, '11 pllOptimal': False, '03 pllOptimal': False, '06 Fail reset': 32, '09 Temp': 0, '03 Fail count': 3, '00 Temp': 0, '01 Nonces found': 217, '06 pllOptimal': False, '01 Fail count': 0, '00 PLL': 0, '07 Co
@almccann
almccann / output.txt
Last active Nov 12, 2018
cgminer `echo '{"command":"stats"}' | nc xx.xx.xx.xx 4028 >> ~/Desktop/output.txt`
View output.txt
{"STATUS":[{"STATUS":"S","When":1542065836,"Code":70,"Msg":"CGMiner stats","Description":"sgminer 4.4.2"}],"STATS":[{"STATS":0,"ID":"HLT0","Elapsed":3350,"Calls":0,"Wait":0.000000,"Max":0.000000,"Min":99999999.000000,"Chain ID":0,"Num chips":12,"Num cores":380,"Num active chips":12,"Chain skew":0,"Temp max":79.000000,"Temp min":55.000000,"Temp":65.000000,"Fan duty":25,"iVid":170,"PLL":354,"Voltage Max":903,"Voltage Min":873,"Voltage Avg":886,"VidOptimal":true,"pllOptimal":true,"VoltageBalanced":false,"Chain num":0,"MHS av":950000.000000,"Disabled":false,"Enabled chips":"fff","00 HW errors":2,"00 Stales":0,"00 Nonces found":7,"00 Nonce ranges":0,"00 Cooldown":0,"00 Fail count":0,"00 Fail reset":32,"00 Temp":0,"00 nVol":884,"00 PLL":0,"00 pllOptimal":false,"01 HW errors":0,"01 Stales":0,"01 Nonces found":9,"01 Nonce ranges":0,"01 Cooldown":0,"01 Fail count":0,"01 Fail reset":32,"01 Temp":0,"01 nVol":881,"01 PLL":0,"01 pllOptimal":false,"02 HW errors":2,"02 Stales":0,"02 Nonces found":14,"02 Nonce ranges":0,"02
View excel.md

Excel

Number every nth cell:
=MOD(ROW(),n) where n is a number

Fill down / right:
CTRL + D
CTRL + R

Show unique entries only:
=UNIQUE(A:B)

View rust.md

Rust

Rust setup

I'm using Atom (on a fairly speedy machine, VS Code has some solid plugin support too) with:

  • atom-beautify (with rustfmt installed, cargo install rustfmt) * language-rust * linter + linter-rust (using cargo check, cargo install cargo-check) * you-complete-me (but YCM is not fun to install, so I'd recommend the racer plugin, both require the Rust source cloned and installed somewhere)

1.\ You need to cargo install racer and add the bin to your path
2.\ Clone the Rust source of your version of Rust, and add that to your path
3.\ Install the plugin and set the paths in Atom

View rails.md

Rails

gem install bundler // install bundle
rvm osx-ssl-certs update all //Update RVM certifcates

Rails Routing Guide

HTTP Verb Path Controller#Action Used for
GET /photos photos#index display a list of all photos
GET /photos/new photos#new return an HTML form for creating a new photo
POST /photos photos#create create a new photo
View redis.md

Redis

redis-server // start redis
redis-cli // start redis CLI

View nginx.md

nginx

sudo service nginx restart // restart service

Configuration file: /etc/nginx/sites-available

Symlink conf file: ln -s /etc/nginx/sites-available/eg.conf /etc/nginx/sites-enabled/eg.conf

View haproxy.md

Haproxy

sudo nano /etc/haproxy/haproxy.cfg // edit configuration file
haproxy -f /etc/haproxy/haproxyconf.txt -c // check configuration
haproxy -f /etc/haproxy/haproxy.cfg // run

You can’t perform that action at this time.