Skip to content

Instantly share code, notes, and snippets.

View cocoastorm's full-sized avatar
😤
Doing my best to be unphased

Khoa Nguyen cocoastorm

😤
Doing my best to be unphased
  • Surrey, BC, Canada
View GitHub Profile
@cocoastorm
cocoastorm / README.md
Last active March 8, 2024 09:23
rexray/s3fs Docker Plugin Install with Minio

Getting Started

Make sure Docker is installed!

Get your Minio endpoint url, accesskey, and secretkey ready!

Install Docker Plugin

docker plugin install rexray/s3fs \
@cocoastorm
cocoastorm / pre-push
Last active January 3, 2019 20:42
PHP_CodeSniffer Docker Git Hook
#!/bin/sh
# replace the docker image, if you want
PHPCS_IMAGE=khoanguyent/codesniff
if [ -f "phpcs.xml" ]; then
echo "Running PHPCS in Docker\n"
docker run --rm -v $PWD:/data/src \
${PHPCS_IMAGE} \
@cocoastorm
cocoastorm / httpHealthCheck.ino
Last active May 18, 2019 03:42
ESP8266 HTTP HealthCheck
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
// on board small LED
// #define BOARD_LED 6
// death counter
int ded = 0;
// green led on gpio 14
@cocoastorm
cocoastorm / README.md
Last active August 12, 2019 21:48
Script to Search /usr/lib Files

check.py

Given a needed.txt file with required dependencies, search thorough these given directories for them:

  • /usr/lib
  • /usr/lib32
  • /usr/lib64

Following this stackoverflow post:

@cocoastorm
cocoastorm / README.md
Last active August 29, 2019 18:25
Parse Search String

Parse Search String

Given a search string like (eg. Github Issue Search):

subject: hi bye text: yes no

Parse it:

@cocoastorm
cocoastorm / .rtorrent.rc
Created September 13, 2019 16:17
rtorrent xmlrpc nginx proxy
network.scgi.open_local = /var/run/user/.rtorrent.sock
schedule2 = chmod_scgi_socket, 0, 0, "execute2=chmod,\"g+w,o=\",/var/run/user/.rtorrent.sock"
@cocoastorm
cocoastorm / rtake
Created October 9, 2019 21:26
Random Take
rtake () {
dirname=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
dirname="$(date +%Y-%m-%d)_$1_$dirname"
fulldir="$HOME/junk/$dirname"
echo $fulldir
mkdir -p "$fulldir"
cd "$fulldir"
}
@cocoastorm
cocoastorm / better.go
Last active November 9, 2019 00:10
Dumb Golang Month "Parse"
package main
import (
"fmt"
"time"
)
func main() {
const (
input = "November 2019"
@cocoastorm
cocoastorm / .gitignore
Last active April 1, 2020 23:24
Toast UI Editor Widget (Test) Example
.cache/
dist/
node_modules/
@cocoastorm
cocoastorm / humble-download-list.js
Created April 9, 2021 05:44
humble bundle export download links to a list
// ==UserScript==
// @name humble export downloads as a text file
// @version 1
// @match https://www.humblebundle.com/downloads*
// @grant none
// @require https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.0/FileSaver.min.js
// ==/UserScript==
(function() {
'use strict';