Skip to content

Instantly share code, notes, and snippets.

View castironclay's full-sized avatar

castironclay castironclay

View GitHub Profile
@castironclay
castironclay / setup.sh
Last active May 21, 2021 20:59
Raspberry pi waveshare gsm/gprs/gnss/bluetooth
# Pi Setup
apt update -y
apt upgrade -y
## Install Dependencies
apt install gpsd gpsd-clients wget curl screen vim wireguard
## Modify /etc/default/gpsd
DEVICES="/dev/ttyUSB0"
FROM debian:stable-slim
MAINTAINER castironclay
ARG TERRAFORM=1.0.0
ARG CLOUDFLARED=2021.5.10
# Backports
RUN echo 'deb http://deb.debian.org/debian buster-backports main contrib non-free' > /etc/apt/sources.list.d/buster-backports.list
# Install deps and Wireguard
#!/bin/bash
##
# Color Variables
##
green='\e[32m'
blue='\e[34m'
clear='\e[0m'
##
@castironclay
castironclay / commands.txt
Last active August 26, 2021 21:26
GL-MiFi commands
# Get admin token
SERVER_IP=X.X.X.X
PASS=root_password
TARGET_NUMBER=number_without_country_code
WIREGUARD_SERVER=Home
TOKEN=$(curl -s -k -X POST --data-binary pwd=${PASS} "https://${SERVER_IP}/cgi-bin/api/router/login" | jq -r .token)
echo $TOKEN
# List messages
@castironclay
castironclay / files
Last active December 13, 2022 02:29
5 containers split between networks
## .env
IMAGE=debian:buster
## docker-compose.yml
services:
container1:
image: $IMAGE
command: /bin/bash -c "while true; do echo 'alive' && sleep 60; done"
networks:
network1:
@castironclay
castironclay / ansible_MCT.txt
Created January 15, 2023 03:43
ansibe hosts using master control sockets
- name: Add frontend host
hosts: localhost
tasks:
- name: Create master control socket
shell:
cmd: "sshpass -p '{{ backend_password }}' ssh -fN -M -S /tmp/{{ backend_ip }} {{ backend_username }}@{{ backend_ip }}"
executable: /bin/bash
- name: Add frontend
add_host: