Skip to content

Instantly share code, notes, and snippets.

@jakebathman
jakebathman / logslaravel.sh
Created August 19, 2018 00:06
Tail Laravel logs and filter out the stack traces
tail -f -n 450 storage/logs/laravel*.log \
| grep -i -E \
"^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \
--color
@jakebathman
jakebathman / provision_irc_server.sh
Last active September 19, 2021 16:53
IRC server setup on CentOS 7
#!/bin/bash
# This sets the variable $IPADDR to the IP address the new Linode receives.
IPADDR=$(/sbin/ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://')
sudo yum update -y
sudo yum install nginx wget git -y
cd ~
@jakebathman
jakebathman / scrape_ign_fortnite_map_tiles.php
Created May 10, 2018 13:57
Scrape the IGN Fortnite map tiles and re-construct a large map image
<?php
/*****
If you have PHP installed, run this from the command line:
php scrape_ign_fortnite_map_tiles.php
**/
ini_set('memory_limit','2048M');
@jakebathman
jakebathman / random.sh
Created April 25, 2018 21:11
Random string generator
# Use these on the command line to generate random strings
# Tested in CentOS and macOS
# All printable characters
head /dev/urandom | LC_CTYPE=C tr -dc "[:print:]" | head -c 32
# Only A-Za-z0-9
head /dev/urandom | LC_CTYPE=C tr -dc "A-Za-z0-9" | head -c 32
# Alphanum with some special characters
@jakebathman
jakebathman / gfu.sh
Last active April 20, 2018 20:23
Update a repo fork with the original (upstream)
#!/bin/zsh
# sync a fork using the upstream branch
gfu(){
BRANCH="$1"
if [ -z "$1" ]; then
BRANCH="master"
fi
@jakebathman
jakebathman / remove_laravel_comments.php
Last active February 19, 2024 10:28
Remove comments from fresh Laravel files
<?php
/*
|--------------------------------------------------------------------------
| Remove Laravel Comments
|--------------------------------------------------------------------------
|
| Just made a new Laravel project, but don't want all those big
| comment blocks? Put this in the root of your project and run
| "php remove_laravel_comments.php"
|
@jakebathman
jakebathman / is_backblaze_uploading.sh
Created February 15, 2018 20:25
Determine if Backblaze is currently backing up files on macOS
#!/bin/sh
# This will look at the overviewstatus.xml file and
# determine if Backblaze is currently transmitting a file.
#
# Developed against:
# macOS 10.13.3
# Backblaze 5.2.0.172
BBSTATUS='/Library/Backblaze.bzpkg/bzdata/overviewstatus.xml'
@jakebathman
jakebathman / .tmux.conf
Last active December 14, 2017 17:16
Customizing tmux
# Many of these customizations are from
# http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
@jakebathman
jakebathman / shell_commands.sh
Last active January 6, 2018 02:37
Various shell commands that I always have to look up
# Delete files based on a pattern
# The example below removes PDF files in nested directories, such as ./50/round_2/foo.pdf
# but would NOT remove the file ./50/packages/foo.pdf
find . -regextype posix-extended -regex ".*/round.*\.pdf" -exec rm {} +
# Delete a history item by its ID
history # get the ID (left-hand number) for the item you want to remove
history -d item_number
# Delete keys in redis matching some pattern, atomically
@jakebathman
jakebathman / readme.md
Last active September 6, 2017 21:41
A list of HH QRP agencies in exempted counties from Hurricane Harvey

Hurricane Harvey QRS Exemptions

The list below (in three different formats) are for Home Health Agencies whose ZIP code intersects with one of the exempted counties or parishes in Texas and Louisians, as determined by CMS.

Full information about the exemption is here: https://www.cms.gov/Medicare/Quality-Initiatives-Patient-Assessment-Instruments/Hospice-Quality-Reporting/Downloads/2017-121-IP-Quality-Program-Exemptions-for-FEMA-Texas-Louisiana-Provider.pdf

Additional updates on Hurricane-related exemptions is being posted by CMS here: https://www.cms.gov/About-CMS/Agency-Information/Emergency/Hurricanes.html

The agency data was pulled on September 6th, 2017 from the CMS website here: https://data.medicare.gov/Home-Health-Compare/Home-Health-Care-Agencies/6jpm-sxkc