Skip to content

Instantly share code, notes, and snippets.

Dennis T Kaplan robotamer

View GitHub Profile
@robotamer
robotamer / Raspberry_Pi.md
Last active Apr 15, 2019 — forked from hofmannsven/README.md
Raspberry Pi Cheatsheet
View Raspberry_Pi.md

Raspberry Pi

Setup

Find all available devices arp -a

Locate Raspberry (b8:27:eb) in Network: Pi Finder

SSH

  • Connect to device via SSH + Name: ssh pi@rasperrypi
@robotamer
robotamer / autocert-server.go
Created Aug 4, 2018 — forked from samthor/autocert-server.go
Demo autocert server in Go
View autocert-server.go
package main
import (
"crypto/tls"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/user"
@robotamer
robotamer / he-dns-update.sh
Created Jun 15, 2018 — forked from joemiller/he-dns-update.sh
script for updating dynamic DNS records on he.net (hurricane electric)
View he-dns-update.sh
#!/bin/bash
#
# Script for updating DNS records on Hurricane Electirc's DNS system (https://dns.he.net).
#
# The record will be updated with the IP address that originates the request.
#
# Usage
# -----
#
# Create config file `/etc/he-dns-update.conf`:
View keybase.md

Keybase proof

I hereby claim:

  • I am robotamer on github.
  • I am robotamer (https://keybase.io/robotamer) on keybase.
  • I have a public key ASAT0EwqG94zaiBfwYQs_8pgGxTXBARdRb1o12lDsgyUKwo

To claim this, I am signing this object:

@robotamer
robotamer / countries.js
Last active Aug 29, 2015
Countries json js
View countries.js
var countries = [
{
"name": "Afghanistan",
"code": "AF"
},
{
"name": "Aland Islands",
"code": "AX"
},
{
View countries.json
[
{
"name": "Afghanistan",
"code": "AF"
},
{
"name": "Åland Islands",
"code": "AX"
},
{
@robotamer
robotamer / earthporn.sh
Created Jan 13, 2015
Randomly picks one of the amazing photos at http://imgur.com/r/earthporn
View earthporn.sh
#!/bin/bash
# Usage: earthporn [+format] [-time] [logfile]
# Dependencies: bash, wget, mktemp... and well, date and sleep
imgfile=~/.earthporn
# Help and version functions
help () {
echo "Randomly picks one of the amazing photos at http://imgur.com/r/earthporn"
echo "and sets it as the background image."
@robotamer
robotamer / logrotate.sh
Last active Dec 30, 2015
Log file rotate bash script
View logrotate.sh
#!/bin/bash
MAXSIZE=90000
LOGDIR=/var/www/log/
cd $LOGDIR
for FILENAME in *.log; do
SIZE=$(du -b $FILENAME | cut -f 1)
@robotamer
robotamer / get_php_files_in_dir.php
Created Jul 13, 2012
Get php files in dir with recursive lambda callback function
View get_php_files_in_dir.php
<?php
/**
*
* @param string $dir
* @return array
*/
function get_php_files_in_dir($dir)
{
$bin = array ();
@robotamer
robotamer / 1test.php
Created Jul 1, 2012
SplClassLoader Implementation
View 1test.php
<?php
# Adds your library to the beginning of the php include path
addInclude('~/code/libs', FALSE);
$loader = new SplClassLoader();
# adds the php include path to the class
$loader->setIncludePathLookup(true);
$loader->add('Zend');
You can’t perform that action at this time.