Skip to content

Instantly share code, notes, and snippets.

View cjerrington's full-sized avatar

Clayton Errington cjerrington

View GitHub Profile
@cjerrington
cjerrington / copyright.php
Last active August 29, 2015 14:16
Copyright code in PHP
@cjerrington
cjerrington / WindowsUpdate.au3
Created August 8, 2016 15:04
Windows Update across OS releases
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.14.2
Author: Clayton Errington
Script Function:
Run windows update across Windows 7, Windows 8, and Windows 10
#ce ----------------------------------------------------------------------------
@echo off
xcopy C:\folder\to\copy D:\Backup\ /D /E /C /H /R /Y /K
rem /D Copies files changed on or after the specified date.
rem /E Copies any subfolder, even if it is empty.
rem /C Continues copying even if errors occur.
rem /H Copies hidden and system files.
rem /R Overwrites read-only files.
rem /Y Overwrites existing files without prompting you.
rem /K Copies attributes. Typical xcopy commands reset read-only attributes.
@cjerrington
cjerrington / bash_profile
Last active April 7, 2017 16:13
My bash profile on MacOS
#add some color
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
# Clear the screen
alias clr=clear
alias cls=clear
alias backup=$HOME/Documents/Utils/backup.sh
@cjerrington
cjerrington / pyscript.py
Created October 6, 2019 15:23 — forked from nhoffman/pyscript.py
Python script template
#!/usr/bin/env python
"""A simple python script template.
"""
from __future__ import print_function
import os
import sys
import argparse
@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
# 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 / 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-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