Skip to content

Instantly share code, notes, and snippets.

View caHarkness's full-sized avatar

Conner Harkness caHarkness

  • Denver, CO
  • 18:32 (UTC -05:00)
View GitHub Profile
@caHarkness
caHarkness / forward.sh
Last active May 7, 2024 14:55
Script for configuring Debian to act as a router (Internet and port forwarding)
#!/bin/bash
# Q: What is this?
# A: This is a script designed to make a Debian install (with networking and iptables) serve as a router. If the Debian install this is running on can talk with the Internet already, this script will configure iptables to perform NAT for the specified networks, allowing other devices to use this Debian installation as a gateway. This script can also configure port forwarding. See the examples below!
# How to use:
# 1. Update networks, interfaces, and rules below
# 2. Run once after updating on Debian systems
# Guarantee reloading on reboot:
@caHarkness
caHarkness / forward.pl
Last active May 23, 2022 16:03
port-forwarding
use warnings;
use strict;
use IO::Socket::INET;
use IO::Select;
my @allowed_ips = ('all', '10.10.10.5');
my $ioset = IO::Select->new;
my %socket_map;
@caHarkness
caHarkness / cifs-share
Last active March 25, 2022 16:05
An /etc/init.d script for automatically mounting Windows shares in Debian Linux
#! /bin/sh
### BEGIN INIT INFO
# Provides: cifs-share-x
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Automatically mount Windows shares in Debian Linux
### END INIT INFO
@caHarkness
caHarkness / MainActivity.kt
Created December 5, 2019 23:02
Single Activity Kotlin Example
package com.caharkness.demo.kotlin
import android.graphics.Canvas
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.TypedValue
import android.view.Gravity
import android.view.ViewGroup
import android.widget.Button
import android.widget.LinearLayout