Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View patmigliaccio's full-sized avatar
🎧
jammin

Pat Migliaccio patmigliaccio

🎧
jammin
View GitHub Profile
@patmigliaccio
patmigliaccio / install-cf-gae-ssl.md
Last active March 25, 2024 18:01
Configuring Cloudflare SSL/TLS certificates on Google App Engine

Configuring Cloudflare SSL/TLS on Google App Engine

Implementing end-to-end HTTPS encryption with CloudFlare for Google App Engine applications.

Google App Engine - Custom Domains

Add Domains

Register the root domain with Google Cloud Platform at the following:

@patmigliaccio
patmigliaccio / fatsecret_export.py
Created May 10, 2023 02:49
A simple script for exporting all FatSecret weight history to CSV.
"""
# Export FatSecret Weight History CSV
A simple script for exporting all FatSecret weight history to CSV.
## Installation
*Install Dependencies*
```sh
@patmigliaccio
patmigliaccio / install-git.bat
Last active November 10, 2023 23:57
Quick install Git for Windows with batch script. Include the git*.exe install executable in the same directory as this script.
:: Copyright (C): 2017 Pat Migliaccio
:: pat@patmigliaccio.com
::
:: LICENSE: MIT
::
:: File: install-git.bat
::
:: Batch file for a quick install of Git for Windows
:: Include the git*.exe install executable
:: in the same directory as this script.
@patmigliaccio
patmigliaccio / purge-css-cloudflare.sh
Last active September 13, 2023 01:47
Executes cURL to purge the cache on Cloudflare for a specified set or all files (requires config)
#!/bin/sh
# Author: Pat Migliaccio <pat@patmigliaccio.com>
# License: MIT
EMAIL="<Acct_Email>"
ZONE="<Zone_ID>"
API_KEY="<API_Key>"
DATA="{ \"files\": [\"https://example.com/css/style.css\"] }"
@patmigliaccio
patmigliaccio / rdp.sh
Created December 30, 2017 17:04
bash script to rdp into windows server with rdesktop
#!/bin/sh
# Reference: https://stackoverflow.com/a/38860/5199198
SERVER=SERVER_NAME
USER=USER_NAME
DOMAIN=DOMAIN_NAME
/usr/bin/rdesktop -g 1152x864 \
-a 16 \
@patmigliaccio
patmigliaccio / lessons-ml-gcp-18.sh
Created October 29, 2019 15:43
patmigliaccio.com/lessons-ml-gcp 10/29/19
for node in $(kubectl get nodes -l cloud.google.com/gke-nodepool=default-pool -o=name); do
kubectl drain --force --ignore-daemonsets --delete-local-data --grace-period=10 "$node";
done
@patmigliaccio
patmigliaccio / rdp-azure.sh
Last active September 27, 2022 11:58
bash script to rdp into azure vm / windows server with freerdp
#!/bin/sh
# RDP into Azure VM / Windows machine using `xfreerdp`
#
# Reference: https://github.com/FreeRDP/FreeRDP/issues/2128#issuecomment-213505787
#
# Required dependency: http://www.freerdp.com/
#
# Preferred over `rdesktop` due to: https://github.com/rdesktop/rdesktop/issues/71
@patmigliaccio
patmigliaccio / postgres_queries_and_commands.sql
Created December 15, 2021 04:38 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@patmigliaccio
patmigliaccio / prettier-git-config.sh
Last active September 22, 2020 20:41
updates entire git repo history with prettier based on .prettierrc
#!/bin/sh
# Reference: https://medium.com/millennial-falcon-technology/reformatting-your-code-base-using-prettier-or-eslint-without-destroying-git-history-35052f3d853e
git filter-branch --tree-filter 'prettier --config ../../.prettierrc --write "src/{app,environments,assets}/**/*{.ts,.js,.json,.css,.scss}" || echo "formatting error"' -- --all
@patmigliaccio
patmigliaccio / docker-commands.md
Created August 1, 2020 13:40
A generic set of commands to reference when working with Docker

Docker Commands

A generic set of commands to reference when working with Docker

Containers

Create Container

$ sudo docker run --name mydb -e MYSQL_ROOT_PASSWORD=pass -d mysql:latest