Skip to content

Instantly share code, notes, and snippets.

View timbutler's full-sized avatar
🤓
Busy coding!

Tim Butler timbutler

🤓
Busy coding!
View GitHub Profile
@nileshtrivedi
nileshtrivedi / home-server.md
Last active January 10, 2024 06:30
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.

@istepanov
istepanov / Configuration.h
Last active July 26, 2023 16:45
Marlin Anet A8 config
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@christocracy
christocracy / BackgroundGeolocation-Ionic2.js
Last active September 6, 2018 15:31
Simple Cordova Background Geolocation Implementation for Ionic 2 / 3
/**
* How to implement cordova-background-geolocation with Ionic 2 / 3
* https://github.com/transistorsoft/cordova-background-geolocation-lt
* Chris Scott, Transistor Software <chris@transistorsoft.com>
*/
import { Component } from '@angular/core';
import { NavController, Platform } from 'ionic-angular';
@fchollet
fchollet / classifier_from_little_data_script_1.py
Last active November 28, 2023 07:12
Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
#!/usr/bin/env python
from influxdb import InfluxDBClusterClient
influx_host = "127.0.0.1"
influx_port = 8086
influx_user = "user"
influx_pass = "pass"
database = "example"
@mhausenblas
mhausenblas / README.md
Last active March 21, 2016 08:08
Kubernetes debugging session leveraging labels

That's our RC:

$ cat ws-rc.yaml
apiVersion: v1
kind: ReplicationController
metadata:
  name: webserver-rc
spec:
  replicas: 5

selector:

@derekconjar
derekconjar / wordpress-firebase.php
Last active April 25, 2024 15:21
An example of using Firebase and WordPress together. The idea is to use WP's custom post types and metaboxes to make content management easy, and sync with Firebase so that your websites have access to a real-time JSON feed of your custom data.
<?php
/**
* All custom functions should be defined in this class
* and tied to WP hooks/filters w/in the constructor method
*/
class Custom_Functions {
// Custom metaboxes and fields configuration
@cetanu
cetanu / dnsBlacklists.txt
Last active May 30, 2018 01:07
DNS Blacklists
b.barracudacentral.org
bl.deadbeef.com
bl.emailbasura.org
bl.spamcannibal.org
bl.spamcop.net
blackholes.five-ten-sg.com
blacklist.woody.ch
bogons.cymru.com
cbl.abuseat.org
cdl.anti-spam.org.cn
@elithrar
elithrar / ratelimit.go
Last active February 17, 2016 06:14
Quick and dirty HTTP request rate limiter (will eventually wrap this into a package!)
package main
import (
"errors"
"github.com/garyburd/redigo/redis"
"net/http"
"time"
)
type RateStore struct {
@frankrowe
frankrowe / shp2gj.py
Last active November 1, 2022 17:54
PyShp, shp to geojson in python
import shapefile
# read the shapefile
reader = shapefile.Reader("my.shp")
fields = reader.fields[1:]
field_names = [field[0] for field in fields]
buffer = []
for sr in reader.shapeRecords():
atr = dict(zip(field_names, sr.record))
geom = sr.shape.__geo_interface__
buffer.append(dict(type="Feature", \