Skip to content

Instantly share code, notes, and snippets.

@ckxng
ckxng / lm35_example.ino
Last active Aug 29, 2015
Arduino LM35 Temperature Example
View lm35_example.ino
/**
* GLOBAL CONFIGURATION VARIABLES
*/
int LM35PIN = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
@ckxng
ckxng / asyncBlink.h
Last active Aug 29, 2015
Asynchronous Arduino LED Blinking
View asyncBlink.h
@ckxng
ckxng / eventsAndSleep.ino
Last active Jan 18, 2018
Arduino Button Events and Sleep
View eventsAndSleep.ino
// set clock to 1MHz; 1 microsecond = 1 clock cycle
#define F_CPU 1000000L
#include <avr/sleep.h>
#include <avr/wdt.h>
// https://code.google.com/p/ebl-arduino/
#include <ButtonEvent.h>
#include <LedControl.h>
@ckxng
ckxng / EnjinAPI.java
Created May 21, 2015
A class to interface with Enjin
View EnjinAPI.java
/**
*
*/
package com.ckxng.enjinbenefits;
import java.net.*;
import java.util.HashMap;
import java.io.*;
import org.json.*;
@ckxng
ckxng / minecraft@.service
Created Jun 22, 2015
Minecraft SystemD Script
View minecraft@.service
[Unit]
Description=Minecraft Server %i
[Service]
WorkingDirectory=/home/minecraft/server-%i
User=minecraft
ExecStart=/usr/bin/screen -DmS mc-%i ./start.sh
ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "say ATTENTION ATTENTION ATTENTION."\\015'
@ckxng
ckxng / mcmyadmin.service
Created Jun 22, 2015
McMyAdmin SystemD Service
View mcmyadmin.service
[Unit]
Description=McMyAdmin
[Service]
WorkingDirectory=/home/minecraft/McMyAdmin
User=minecraft
ExecStart=/usr/bin/screen -DmS mc-mcma ./MCMA2_Linux_x86_64
ExecStop=/usr/bin/screen -p 0 -S mc-mcma -X eval 'stuff "/quit"\\015'
View bluesmirf_lcd_printer.ino
// set clock to 1MHz; 1 microsecond = 1 clock cycle
#define F_CPU 1000000L
#define DEBUG_ENABLED 0
#define DEBUG(x) if(DEBUG_ENABLED){Serial.print(x);}
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
#define LCD_SIZE_X 16
@ckxng
ckxng / myconfig.ovpn
Last active Jan 19, 2021
FreeBSD network settings for jails, one of which is on a VPN
View myconfig.ovpn
client
dev tun
proto udp
remote vpn-server.vpn-provider.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /usr/local/etc/openvpn/my-ca.crt
tls-client
@ckxng
ckxng / syncexclude.txt
Created Feb 25, 2016
Folders NOT to sync
View syncexclude.txt
/etc/rc.conf
/etc/fstab
/etc/ssh
/root/onlyhere
/usr/jails
/usr/local/tarsnap-cache
/dev
/proc
/sys
/tmp
@ckxng
ckxng / crontab
Created Feb 25, 2016
LetsEncrypt Nginx
View crontab
#min hr dom mo dow cmd
56 8 4 * * /root/renew-ssl.sh