Skip to content

Instantly share code, notes, and snippets.

View clarketm's full-sized avatar
🐍
Programming

Travis Clarke clarketm

🐍
Programming
View GitHub Profile
@clarketm
clarketm / socat_server.sh
Created June 23, 2017 21:05 — forked from CMCDragonkai/socat_server.sh
Socat: Simple HTTP Server
socat \
-v -d -d \
TCP-LISTEN:1234,crlf,reuseaddr,fork \
SYSTEM:"
echo HTTP/1.1 200 OK;
echo Content-Type\: text/plain;
echo;
echo \"Server: \$SOCAT_SOCKADDR:\$SOCAT_SOCKPORT\";
echo \"Client: \$SOCAT_PEERADDR:\$SOCAT_PEERPORT\";
"
@motomod
motomod / realtek-rtl8812au
Last active May 9, 2018 08:58
Raspberry Pi 3 + Realtek 802.11ac (rtl8812au)
#!/bin/bash
sudo apt update
sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update
sudo apt-get install bc git -y
rpi-source
git clone https://github.com/gnab/rtl8812au.git
cd rtl8812au
sed -i -e 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
sed -i -e 's/CONFIG_PLATFORM_ARM_RPI = n/CONFIG_PLATFORM_ARM_RPI = y/g' Makefile
@clarketm
clarketm / Effect.js
Created April 13, 2017 00:12 — forked from brentvatne/Effect.js
redux-saga alternative with async/await?
/**
* @providesModule Effects
* @flow
*/
import { Linking } from 'react-native';
import AppDataApi from 'AppDataApi';
import Actions from 'Actions';
import ActionTypes from 'ActionTypes';
@clarketm
clarketm / detectBrowserLanguage.js
Created April 4, 2017 16:14 — forked from leipert/detectBrowserLanguage.js
Detect browser language in javascript (utilizing lodash)
// These window.navigator contain language information
// 1. languages -> Array of preferred languages (eg ["en-US", "zh-CN", "ja-JP"]) Firefox^32, Chrome^32
// 2. language -> Preferred language as String (eg "en-US") Firefox^5, IE^11, Safari,
// Chrome sends Browser UI language
// 3. browserLanguage -> UI Language of IE
// 4. userLanguage -> Language of Windows Regional Options
// 5. systemLanguage -> UI Language of Windows
var browserLanguagePropertyKeys = ['languages', 'language', 'browserLanguage', 'userLanguage', 'systemLanguage'];
@clarketm
clarketm / index.html
Created April 3, 2017 02:04 — forked from jerome-labidurie/index.html
Synology SSO server login example
<html>
<head>
<!-- include Synology SSO js -->
<script src="http://ds:5000/webman/sso/synoSSO-1.0.0.js"></script>
</head>
<body>
<script>
/** Display login/logout button.
@clarketm
clarketm / README.md
Created March 6, 2017 20:10 — forked from hofmannsven/README.md
My simply Git Cheatsheet
.header on
.mode column
.nullvalue NULL
@clarketm
clarketm / apsw.md
Created March 3, 2017 09:10 — forked from scottstanfield/apsw.md
APSW: a better sqlite shell

APSW: A better Sqlite3 shell

If you use sqlite3 as a shell to manage SQLite databases, then you might want to consider using [APSW][1], "Another Python SQLite Wrapper".

When run through the Python interpreter, the APSW library has an interactive shell, much like the one included with sqlite3, but with some added functionality like .autoimport. A list of [what APSW does better][2] can be found in the docs.

@clarketm
clarketm / .tmux.conf
Created February 27, 2017 15:03 — forked from subfuzion/.tmux.conf
My .tmux.conf for tmux 2.1 (with fixes for mouse breakage)
# Inspirations:
# http://mutelight.org/practical-tmux
# http://zanshin.net/2013/09/05/my-tmux-configuration/
# http://files.floriancrouzat.net/dotfiles/.tmux.conf
# http://stackoverflow.com/questions/9628435/tmux-status-bar-configuration
# https://github.com/Lokaltog/powerline
# https://github.com/remiprev/teamocil
# http://superuser.com/questions/74492/whats-the-best-prefix-escape-sequence-for-screen-or-tmux
# http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
#
@clarketm
clarketm / sendmail_setup.md
Created February 26, 2017 07:19 — forked from kany/sendmail_setup.md
Setup SENDMAIL on Mac OSX Yosemite