Skip to content

Instantly share code, notes, and snippets.

View MikeFoden's full-sized avatar

Mike Foden MikeFoden

View GitHub Profile
@MikeFoden
MikeFoden / upgrade.sh
Created November 10, 2023 22:45
Upgrade Portainer CE Commands
docker stop portainer
docker rm portainer
docker pull portainer/portainer-ce:latest
docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
@MikeFoden
MikeFoden / restart-sql.ps1
Created July 21, 2023 00:10
Restart SQL Services using Powershell
Write-Output "Restarting SQL Services..."
stop-service -name "MSSQLSERVER" -Force -PassThru
stop-service -name "SQLSERVERAGENT" -Force -PassThru
start-service -name "MSSQLSERVER" -PassThru
start-service -name "SQLSERVERAGENT" -PassThru
Write-Output " "
Write-Output "SQL Services Successfully restarted."
@MikeFoden
MikeFoden / DefaultKeyBinding.dict
Created August 4, 2022 03:44
Keybindings for Home/End Keys
{
/* Remap Home / End keys */
/* Home Button*/
"\UF729" = "moveToBeginningOfLine:";
/* End Button */
"\UF72B" = "moveToEndOfLine:";
/* Shift + Home Button */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
/* Shift + End Button */
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
@MikeFoden
MikeFoden / posh-theme.omp.json
Created March 16, 2022 00:25
Oh My Posh Theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#ffe9aa",
"foreground": "#100e23",
"powerline_symbol": "\ue0b0",
@MikeFoden
MikeFoden / repo-grabber.py
Created December 16, 2021 06:21
Bitbucket Repository Scrapper
username = ""
password = ""
team = ""
import subprocess
import json
cmd = "curl -u {}:{} https://api.bitbucket.org/2.0/repositories/{}".format(username, password, team)
cmd = cmd.split()
@MikeFoden
MikeFoden / setup-aliases.sh
Created November 4, 2021 22:18
Git Aliases
#!/bin/sh
# Easily amend a commit (and to not screw up when misspelling)
git config --global alias.amend = commit --amend --no-edit
git config --global alias.ammend = commit --amend --no-edit
# Remove untracked files
git config --global alias.scrub = clean -fx
git config --global alias.ajax = clean -fx
@MikeFoden
MikeFoden / gist:b4caf312446430914df5b8377d74e516
Created September 3, 2019 00:08
Git Branch Cleanup Commands
git fetch origin --prune
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d
@MikeFoden
MikeFoden / postal-codes.json
Created July 17, 2018 03:55 — forked from matthewbednarski/postal-codes.json
Global postal codes regex formats
[{ "Note": "The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). Afghanistan Postal code lookup", "Country": "Afghanistan", "ISO": "AF", "Format": "NNNN", "Regex": "^\\d{4}$" }, { "Note": "With Finland, first two numbers are 22.", "Country": "Åland Islands", "ISO": "AX", "Format": "NNNNN", "Regex": "^\\d{5}$" }, { "Note": "Introduced in 2006, gradually implemented throughout 2007.", "Country": "Albania", "ISO": "AL", "Format": "NNNN", "Regex": "^\\d{4}$" }, { "Note": "First two as in ISO 3166-2:DZ", "Country": "Algeria", "ISO": "DZ", "Format": "NNNNN", "Regex": "^\\d{5}$" }, { "Note": "U.S. ZIP codes (range 96799)", "Country": "American Samoa", "ISO": "AS", "Format": "NNNNN (optionally NNNNN-NNNN or NNNNN-NNNNNN)", "Regex": "^\\d{5}(-{1}\\d{4,6})$" }, { "Note":