Skip to content

Instantly share code, notes, and snippets.

View kfowlks's full-sized avatar

Kevin Fowlks kfowlks

  • me myself and I
  • slams.tiny.scare
View GitHub Profile
@jhamman
jhamman / LICENSE
Created January 26, 2023 21:37 — forked from nymous/README.md
Logging setup for FastAPI, Uvicorn and Structlog (with Datadog integration)
MIT License
Copyright (c) 2023 Thomas GAUDIN
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@maxkagamine
maxkagamine / backup_flash_and_appdata.sh
Last active June 28, 2023 01:34
Unraid user script to create backups of the flash drive and appdata on a schedule. An email is sent with the full command output if the cronjob fails.
#!/bin/bash
#name=Backup flash and appdata
#description=Creates tarballs of the flash drive and appdata share.
#argumentDescription=Backup directory
#argumentDefault=/mnt/user/Backup/Sovngarde
#arrayStarted=true
#noParity=true
#clearLog=true
set -eo pipefail
shopt -s extglob
@bockor
bockor / gist:ff2aef9f5be1ea98ac6fb927bb460d7d
Last active February 22, 2021 02:40
gunicorn-as-a-systemd-service with python3 and bottle framework
Gunicorn, or Green Unicorn, is a UNIX-compatible WSGI HTTP server that is commonly used to run Python applications.
Developed in 2010 by Benoit Chesneau, this open source project is similar to uWSGI, mod_wsgi, and CherryPy.
Gunicorn is often implemented with a reverse proxy server like NGINX, which typically handles requests for static resources and then passes on the requests to Gunicorn.
Gunicorn processes the dynamic portion of the request and returns a response to NGINX, which sends the response back to the client.
Gunicorn can be used to serve Python applications and is compatible with frameworks like Django, Flask and Bottle.
It’s easy to configure, lightweight, and only needs 4–12 worker processes to handle hundreds or thousands of requests per second.
# create python3 virtual environment
# ==================================
@stephenhouser
stephenhouser / Python-word-counter
Last active August 18, 2022 01:47
Python Word Frequency Analyzer
Simple Python Word Frequency Analyzer
@jkullick
jkullick / raspberry-pi-chroot-armv7-qemu.md
Last active March 24, 2024 14:36
Chroot into Raspberry Pi ARMv7 Image with Qemu
# install dependecies
apt-get install qemu qemu-user-static binfmt-support

# download raspbian image
wget https://downloads.raspberrypi.org/raspbian_latest

# extract raspbian image
unzip raspbian_latest
@juliojsb
juliojsb / Jboss configuration file
Created March 23, 2016 22:19
Enable remote debugging in Jboss
For Jboss 4,5,6 AS and 6.x EAP standalone mode, append to your JAVA_OPTS the following option:
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
For Jboss 7.x AS/EAP 6.x in domain mode, in host.xml add the corresponding jvm option in the server group you need to debug:
<server name="server-one" group="main-server-group">
<!-- Remote JPDA debugging for a specific server
<jvm name="default">
<jvm-options>
@gbaman
gbaman / HowToOTG.md
Last active May 2, 2024 01:27
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@gdamjan
gdamjan / qemu-arm.conf
Last active July 13, 2022 04:45
binfmt conf file to run arm elf files on x86 (with qemu-user-static installed)
# /etc/binfmt.d/qemu-arm.conf
:arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:
@ryane
ryane / five_minutes.yml
Created February 24, 2015 15:15
five_minutes.yml
---
- hosts: all
vars:
UBUNTU_COMMON_ROOT_PASSWORD: 'xxxxx'
UBUNTU_COMMON_DEPLOY_PASSWORD: 'xxxxx'
UBUNTU_COMMON_LOGWATCH_EMAIL: user@example.com
ubuntu_common_deploy_user_name: deploy
ubuntu_common_deploy_public_keys:
- ~/.ssh/id_rsa.pub
@adamgreig
adamgreig / icalcombine.py
Created October 22, 2014 14:13
Read multiple iCal / ICS files from URLs, then produce a merged output with all repeating events and all events that will end today or later.
#!/usr/bin/env python
"""
iCal Combine
./icalcombine.py <input URLs file> <output filename>
Read ICS (iCAL) URLs, one per line, from the <input URLs files>, then combine
into a single iCal which is written to <output filename>.
"""
import sys