Skip to content

Instantly share code, notes, and snippets.

@jwthanh
jwthanh / Open-source-iOS-apps.md
Last active September 16, 2015 09:32 — forked from Angles/Open-source-iOS-apps.md
real iOS apps with GitHub open source repos
@jwthanh
jwthanh / new_gist_file.sh
Created November 22, 2015 14:51 — forked from un1ko85/new_gist_file.sh
Starting and stopping NginX / MySQL / PHP-FPM on Mac OS X
#! /bin/bash
MYSQL="/opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper"
NGINX="/opt/local/sbin/nginx"
PHPFPM="/opt/local/sbin/php-fpm"
PIDPATH="/opt/local/var/run"
MEMCACHED="/opt/local/bin/memcached -m 24 -P /opt/local/var/run/memcached.pid -u root"
if [ $1 = "start" ]; then
sudo $MYSQL start
echo "Starting php-fpm ..."
@jwthanh
jwthanh / _service.md
Created February 22, 2016 17:33 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@jwthanh
jwthanh / GsonRequest.java
Created March 11, 2016 16:47 — forked from ficusk/GsonRequest.java
A Volley adapter for JSON requests that will be parsed into Java objects by Gson.
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
@jwthanh
jwthanh / OAuthClient.java
Created May 28, 2016 13:16 — forked from dzolnai/OAuthClient.java
Retrofit OAuth2 refreshing tokens without modifying all requests.
package com.example.yourapp;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.example.yourapp.AuthenticationModel;
import retrofit.client.Header;
import retrofit.client.OkClient;
@jwthanh
jwthanh / jwt.go
Created July 4, 2017 09:38 — forked from OdinsPlasmaRifle/jwt.go
JWT Tokens using jwt-go
package components
import (
"crypto/rsa"
jwt "github.com/dgrijalva/jwt-go"
"io/ioutil"
"log"
"time"
)
@jwthanh
jwthanh / nginx.conf
Created October 13, 2017 13:00 — forked from sergejmueller/nginx.conf
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Nginx
location ~* \.(txt|log|xml|css|js)$ {
add_header X-Robots-Tag noindex;
}
@jwthanh
jwthanh / nginx.conf
Created October 13, 2017 13:00 — forked from sergejmueller/nginx.conf
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Nginx
location ~* \.(txt|log|xml|css|js)$ {
add_header X-Robots-Tag noindex;
}
@jwthanh
jwthanh / ethminer_ubuntu_nvidia.md
Created October 24, 2017 16:38 — forked from johnstcn/ethminer_ubuntu_nvidia.md
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04

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