Skip to content

Instantly share code, notes, and snippets.

💀
rogue.black

gregory nicholas gregorynicholas

💀
rogue.black
Block or report user

Report or block gregorynicholas

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
@gregorynicholas
gregorynicholas / ethminer_ubuntu_nvidia.md
Created Nov 19, 2018 — forked from johnstcn/ethminer_ubuntu_nvidia.md
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04
View ethminer_ubuntu_nvidia.md

Headless Ethminer (nVidia) Setup Guide

Cian Johnston, July 2017

A couple of weeks ago, I decided I should put my gaming rig to work crypto mining. I did not expect to make any significant profit on this, it was more of a fun project to set up. However, there were a large number of tutorials and guides already out there, and many were more than a year out of date.

This guide assumes the reader already has a crypto wallet set up, is comfortable with Linux and the command line, and knows how to use Google if they run into problems.

The end result is an Ubuntu 16.04 LTS headless server running CUDA ethminer via systemd.

Hardware

@gregorynicholas
gregorynicholas / _verify-repair-permissions-disk.md
Created Nov 19, 2018 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)
View _verify-repair-permissions-disk.md

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@gregorynicholas
gregorynicholas / com.apple.Boot.plist
Created Nov 17, 2018 — forked from tjluoma/com.apple.Boot.plist
Enable the "Apple MacBook Air SuperDrive" on any Mac
View com.apple.Boot.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Kernel Flags</key>
<string>mbasd=1</string>
</dict>
</plist>
View np_extractor.py
# coding=UTF-8
import nltk
from nltk.corpus import brown
# This is a fast and simple noun phrase extractor (based on NLTK)
# Feel free to use it, just keep a link back to this post
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/
# Create by Shlomi Babluki
# May, 2013
@gregorynicholas
gregorynicholas / example-advanced.html
Created Aug 8, 2018 — forked from dvnkshl/example-advanced.html
Commerce.js Checkout (Advanced)
View example-advanced.html
<!---
This is a advanced javascript checkout built with Commerce.js (http://commercejs.com).
Tutorial: Checkout Tutorial (Advanced) - http://commerce.js.com/docs/overview/checkout-tutorial-advanced/
!-->
<html>
<head>
<title>Checkout Tutorial (Advanced)</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.serializeJSON/2.7.2/jquery.serializejson.js"></script>
<script type="text/javascript" src="https://chec-cdn.s3.amazonaws.com/js/commerce.js"></script>
View Lists the files in your Google Drive folder.gs
// https://m.cafe.naver.com/eojji/302
// unit: msec
function timeCheck(startTime, needTime) {
var nowDate = new Date();
// remain = 6 min - ( now - start )
var remain = 360000 - (nowDate.getTime() - startTime);
if (remain < needTime) {
return false;
} else {
return true;
View doCopyFolder.gs
// https://m.cafe.naver.com/eojji/307
function setPageTokenProperty(value) {
PropertiesService.getUserProperties().setProperty('PAGE_TOKEN', value);
}
function getPageTokenProperty() {
var pageTokenProperty = PropertiesService.getUserProperties().getProperty('PAGE_TOKEN');
return pageTokenProperty;
}
View how-to-use-aws-elasticsearch.md

How to use Amazon AWS Elasticsearch

The good news: you can get it running on the free tier (with a tiny instance).

The bad news: it's stuck on Elasticsearch 1.5.2 and dynamic scripting (Groovy) is disabled.

http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-limits.html

Authentication: the safest option is to create a brand new IAM user (using the tool at https://console.aws.amazon.com/iam/home?region=us-east-1 ) with its own access key and secret key. Then when you create the Elasticsearch instance you can paste in the following IAM string:

@gregorynicholas
gregorynicholas / csv_example.py
Created Jun 19, 2018 — forked from simonw/csv_example.py
Here's how to use Python to output an Excel-compatible CSV (actually TSV) file from a command-line script. You can then use this pattern: "python csv_example.py | pbcopy" to copy the output to your clipboard, then just focus on a cell in Excel or Google Sheets and hit "paste" to copy the data into a bunch of cells.
View csv_example.py
import csv, sys
def fetch_data():
# Returning some example data - hit a JSON API or something here
return [{
"name": "Name 1",
"age": 32,
"description": "Look, we can use commas and\ttabs & stuff in here!",
}, {
"name": "Name 2",
@gregorynicholas
gregorynicholas / websse.py
Created Jun 19, 2018 — forked from werediver/websse.py
Simple demonstration of how to implement Server-sent events (SSE) in Python using Bottle micro web-framework. SSE require asynchronous request handling, but it's tricky with WSGI. One way to achieve that is to use gevent library as shown here.
View websse.py
"""
Simple demonstration of how to implement Server-sent events (SSE) in Python
using Bottle micro web-framework.
SSE require asynchronous request handling, but it's tricky with WSGI. One way
to achieve that is to use gevent library as shown here.
Usage: just start the script and open http://localhost:8080/ in your browser.
Based on:
You can’t perform that action at this time.