Skip to content

Instantly share code, notes, and snippets.

View jasonehines's full-sized avatar

Jason Hines jasonehines

View GitHub Profile
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@jasonehines
jasonehines / find between dates.sh
Last active March 5, 2016 22:02
find file in current directory between two dates
find . -newermt "2016-03-02 11:00:00" ! -newermt "2016-03-02 11:45:00"
@jasonehines
jasonehines / re
Created April 3, 2016 17:57
Find and rename file
# find file in current directory and rename some_file_name to end in .old
find . -iname *some_file_name* -exec mv {} {}.old \;
# find file in directory starting with rc and rename to end in .old
find .rc* -iname *some_file_name* -exec mv {} {}.old \;
GNU nano 2.5.3 File: /usr/local/bin/greeting.py
#!/usr/bin/python
from websocket import create_connection
ws = create_connection("ws://localhost:8000/events/ws")
ws.send('{"message_type": "speak", "context": null, "metadata": {"utterance": "Welcome back Jason"}}')
result = ws.recv()
ws.close()
#how to install tinc
sudo eopkg install -c system.devel
sudo eopkg install lzo-devel git
mkdir Source
cd Source
git clone https://github.com/gsliepen/tinc.git
cd tinc
autoreconf --install
./configure
sudo make install

Solus packaging cheat sheet

Setup

Install required packages

  • sudo eopkg install -c system.devel
  • sudo eopkg install git solbuild
  • sudo eopkg install solbuild-config-unstable

Create repository directory

  • mkdir ~/repository
@jasonehines
jasonehines / DO_s3fs_example.txt
Last active November 28, 2022 08:21
Digital Ocean Spaces s3fs example
s3fs hinesnetwork /mnt/hinesnetwork.nyc3.digitaloceanspaces.com -o passwd_file=/etc/passwd-s3fs -o url=https://nyc3.digitaloceanspaces.com -o endpoint=nyc3 -d -d -f -o f2 -o curldbg
@jasonehines
jasonehines / .s3cfg
Last active March 9, 2020 20:46
Digital Ocean Spaces s3cmd configuration example
[default]
access_key = #replace with your DO key
access_token =
add_encoding_exts =
add_headers =
bucket_location = nyc3
ca_certs_file =
cache_file =
check_ssl_certificate = True
check_ssl_hostname = True
@jasonehines
jasonehines / README.md
Last active February 6, 2023 23:02 — forked from Jachimo/README.md
Using ZeroTier to route between two UniFi USG LANs

Routing between two UniFi USG based LANs with ZeroTier

Intro

This is a quick explanation of how to configure both ZeroTier and two Ubiquiti UniFi USGs to allow routing between two IPv4 networks. Both networks are in private (RFC1918) address space and each one has its own DHCP service. There is no need for NAT between them, only IP routing.

The two networks are 192.168.1.0/24 (call this the "left" network) and 192.168.10.0/24 (the "right" network) but they can be anything. Also, you can have multiple CIDR blocks on one side or the other of the ZeroTier route; if you do, you just have to create more routing table entries.

@jasonehines
jasonehines / remove_duplicate_lines.sh
Created June 3, 2019 20:12
Remove duplicate lines preserving order #awk #shell
# https://iridakos.com/how-to/2019/05/16/remove-duplicate-lines-preserving-order-linux.html
awk '!visited[$0]++' your_file > deduplicated_file