Skip to content

Instantly share code, notes, and snippets.

View bryaneaton's full-sized avatar
🏖️
Tis the season

Bryan Eaton bryaneaton

🏖️
Tis the season
  • Maryville, TN
View GitHub Profile
#!/bin/bash
export PGPASSWORD='SparklyBannana86' && psql -h gistnebula -p 5501 -d wstamp_staging -U worker -c "SELECT
pid,
now() - pg_stat_activity.query_start AS duration,
query,
state
FROM pg_stat_activity
WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes';
@bryaneaton
bryaneaton / perfect
Created May 28, 2021 13:03
Python Dockerfile
# using ubuntu LTS version
FROM ubuntu:20.04 AS builder-image
# avoid stuck build due to user prompt
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --no-install-recommends -y python3.9 python3.9-dev python3.9-venv python3-pip python3-wheel build-essential && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# create and activate virtual environment
#!/usr/bin/env bash
# ex: set fdm=marker
# usage {{{1
#/ Usage:
#/ ./build.sh [OPTIONS]
#/
#/ -t|--tag)
#/ the tag to assign the docker image
#/
#/ -n|--no-cache)
mnamer --test -rb --no-guess --no-overwrite --media=movie --movie-directory="/Movies/{name} ({year})" --movie-format="{name} ({year}){extension}" /Movies
@bryaneaton
bryaneaton / Vagrantfile
Created October 24, 2019 20:47
Centos Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@bryaneaton
bryaneaton / sshdoublebind
Created October 14, 2019 17:29
Double SSH -L example
ssh -L 11111:localhost:11111 user@loginserver -t ssh -L 11111:localhost:443 remoteserver
I connected to 03, tunneling 11111 to 11111, forcing TTY, connecting to 23, tunneling 11111 to 443. The web UI is working.
@bryaneaton
bryaneaton / sshbind.txt
Last active August 16, 2021 12:31
Bind Port to SSH
ssh -L 8112:localhost:8112 bryan@remotehost -p 22
@bryaneaton
bryaneaton / update.sql
Created September 26, 2019 22:08
update multiple tables - Postgres
WITH src AS (
UPDATE serial_rate
SET rate = 22.53, serial_key = '0002'
WHERE serial_key = '002' AND id = '01'
RETURNING *
)
UPDATE serial_table dst
SET serial_key = src.serial_key
FROM src
-- WHERE dst.id = src.id AND dst.serial_key = '002'
@bryaneaton
bryaneaton / bash_skeleton.sh
Created September 24, 2019 15:52 — forked from sempervent/bash_skeleton.sh
A skeleton for bash Scripts
#!/usr/bin/env bash
# usage {{{1 ------------------------------------------------------------------
#/ Usage:
#/ -h|-?|--help)
#/ show this help and exit
#/
# 1}}} ------------------------------------------------------------------------
# environment {{{1 ------------------------------------------------------------
# 1}}} ------------------------------------------------------------------------
# functions {{{1 --------------------------------------------------------------
@bryaneaton
bryaneaton / geoserver
Created September 13, 2019 13:11 — forked from dancingfrog/geoserver
Sample /etc/init.d script for running GeoServer as a service
#!/bin/sh
### BEGIN INIT INFO
# Provides: GeoServer
# 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: Starts and stops the GeoServer, which should be located at /usr/share/geoserver
### END INIT INFO