Skip to content

Instantly share code, notes, and snippets.

@Ttech
Ttech / update-letsencrypt.sh
Created December 12, 2015 06:41
The first revision of my Automated LetsEncrypt updater for ZNC and Friends using the letsencrypt tool
#!/bin/bash
domain_list="domains.txt"
# format is:
# domain1.abc.com,abc.com
# domain2.xyz.com,test.xyz.com,xyz.com
LEBIN="letsencrypt"
LE="$LEBIN --text certonly --agree-tos --renew-by-default --standalone --standalone-supported-challenges tls-sni-01 "
@Ttech
Ttech / iptabler.sh
Created October 14, 2012 05:48
IPTABLE script
#!/bin/bash
####################################
#### ####
#### 2012 Ttech ####
#### Bash Router Enabler ####
#### ####
####################################
# this should be the only part you need to modify
<?php
function curl_get_contents($url,$timeout=30,$settings_array=array())
{
$contents = false;
if(function_exists("curl_init")){
$curl_options = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => intval($timeout),
CURLOPT_HEADER => false
//GeoSn0w's Reverse Engineering Tutorial
//Use the code as you want, WTFPL
#include <string.h>
#include <stdio.h>
#include <time.h>
int main(int argc, char *argv[]) {
if(argc==2) {
printf("Preparing to check access key: %s\n", argv[1]);
int hex = 0;
<div id="raw_include_README_md"></div>
<footer>
Theme available on <a href="https://GitHub.com/Naereen/Nginx-Fancyindex-Theme">GitHub</a> by <a href="https://GitHub.com/Naereen">Naereen</a>, © 2015-18, released under <a href="https://lbesson.mit-license.org/">the MIT License</a>.
</footer>
<script type="text/javascript" src="/Nginx-Fancyindex-Theme-light/addNginxFancyIndexForm.js"></script>
<script type="text/javascript" src="/Nginx-Fancyindex-Theme-light/showdown.min.js"></script>
<script type="text/javascript" defer>
var converter = new showdown.Converter();
$( "#raw_include_HEADER_md" ).load( "HEADER.md", function (){
var elem = document.querySelector("#raw_include_HEADER_md");
@Ttech
Ttech / afpd.conf
Created June 28, 2012 04:19
Netatalk AFPd Configuration file for 3.0x
; Netatalk 3.x configuration file
;
; This creates two shares for you to use
; the first share is a "Dropbox" to use
; the second share is a Time Machine
[Global]
; Global server settings
hostname = "$h"
@Ttech
Ttech / info.sh
Last active February 14, 2018 22:45
#!/bin/bash
function dagd {
if [ $1 -eq '-6' ]; then
curl -m 2 -s "http://da.gd/$2"
else
curl -m 2 -s -4 "http://da.gd/$2?strip"
fi
}
function remote_network {
# set some magical temporary stuff
@Ttech
Ttech / lights.php
Created August 13, 2017 16:46
quickest automation page ever... and equally terrible
<?php
@$input = $_GET['light'];
@$command = $_GET['command'];
$c = 'off'; // 1 = on, 0 = off
switch($command){
case 'on':
$c = 'on';
break;
case 'off':
This is a fun little project you can probably complete in a single weekend (after all the parts arrive)!
All parts were purchased from either Adafruit, AliExpress, or Amazon, and I went with the cheapest parts available.
Your milage may vary, but if you want very reliable - just stick with all Adafruit parts!
Base:
Adafruit has some neat chips under the "Feather" label.
All of these parts should work with any Feather for the most part, with the exception of the SD Card Reader.
For my "mobile" station design I used an Adafruit Feather Huzzah!
For the "base" stations, I used the LoRA Feathers
@Ttech
Ttech / PythonChat.py
Created February 18, 2016 00:25
Basic Python Chat Client
import threading
import socket
import sys
from time import gmtime, strftime
from pprint import pprint
host = '' # server
port = 38002 # port
size = 1024 # packet size
s = None