Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cjerrington's full-sized avatar

Clayton Errington cjerrington

View GitHub Profile
@cjerrington
cjerrington / ConsoleView.ps1
Created January 31, 2024 02:44
Powershell function to show/hide the console window. I’ve used this format to start a process of a powershell GUI and hid the console after load. Can then be used to toggle the console as well.
function Show-Console
{
param ([Switch]$Show,[Switch]$Hide)
if (-not ("Console.Window" -as [type])) {
Add-Type -Name Window -Namespace Console -MemberDefinition '
[DllImport("Kernel32.dll")]
public static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll")]
@cjerrington
cjerrington / Keybase.md
Created September 17, 2023 03:56
Keybase claim

Keybase proof

I hereby claim:

  • I am cjerrington on github.
  • I am cjerrington (https://keybase.io/cjerrington) on keybase.
  • I have a public key ASCmzLyC__Ic3zd1WreR5woBrzm9zoTA6G4uoF8y3PbnKgo

To claim this, I am signing this object:

@cjerrington
cjerrington / openpgp.md
Created January 15, 2023 04:52
Verifying keyoxide

[Verifying my keyoxide cryptographic key: openpgp4fpr:22A87774A7342FE3DF25E15D08528E69B3B9CA3E]

@cjerrington
cjerrington / jellyfin-update.ps1
Created December 26, 2022 16:20
Jellyfin update check
# Setup of variables:
# Update server and port to your local values
$server = "localhost"
$port = 8096
$myinstall = (Invoke-WebRequest -UseBasicParsing http://$($server):$port/System/Info/Public).Content | ConvertFrom-Json
$latest = (Invoke-WebRequest -UseBasicParsing https://api.github.com/repos/jellyfin/jellyfin/releases/latest) | ConvertFrom-Json
if ( $myinstall.Version -eq $latest.name){
@cjerrington
cjerrington / install-jekyll.sh
Last active May 6, 2022 03:15
Simple way to install Jekyll on your Ubuntu based distro
#!/bin/bash
# Check if script is run as sudo/root
if [[ $EUID -ne 0 ]]; then
# https://www.linuxjournal.com/content/automatically-re-start-script-root-0
sudo -p 'Restarting as root, password: ' bash $0 "$@"
exit $?
#echo "Please rerun script with 'sudo ./serversetup.sh'"
#exit 1
fi
@cjerrington
cjerrington / simple_backup.sh
Created March 31, 2022 03:26
Simple Bash Backup
#!/bin/bash
####################################
#
# Backup to NFS mount script.
#
####################################
# What to backup.
backup_files="/home/username/Desktop"
@cjerrington
cjerrington / Install-NotepadPlusPlus.ps1
Last active March 15, 2024 14:29 — forked from dansmith65/Install-NotepadPlusPlus.ps1
Install latest version of Nodepad++ via PowerShell
#Requires –Version 3
# Set TLS support for Powershell and parse the JSON request
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$npp = Invoke-WebRequest -UseBasicParsing 'https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/releases/latest' | ConvertFrom-Json
# Get Hashes for Checksums
Invoke-WebRequest -UseBasicParsing $npp.assets[0].browser_download_url -OutFile $npp.assets[0].name
# Get the download URL from the JSON object per 32/64 bit
# Simple app start when "password" is correct
import tkinter as tk
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.create_widgets()

Group rules

  1. Section for faq and resources.
  2. Post gist / pastebin link to code excerpt and explain the problem and wanted outcome and what you’ve done or tried.
  3. Members are here to help not do all the work. Guidance is provided with some resources and possibly own help if commentor desires.
  4. Do some research first on Google, Stackoverflow, or other source.
  5. We’re all here to help and learn.
  6. If wanting to post a link to your own blog/site/work/video/tutorial ensure material is relevant and good to expand knowledge and understanding.
  7. Be kind and courteous to others, we were all beginners once.
@cjerrington
cjerrington / pyscript.py
Created October 6, 2019 15:31 — forked from n8henrie/pyscript.py
Python script template
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""pyscript.py
A simple python script template.
http://ajminich.com/2013/08/01/10-things-i-wish-every-python-script-did/
"""
import argparse