Skip to content

Instantly share code, notes, and snippets.

View jcanfield's full-sized avatar
💭
If I do not respond quickly, try me on Twitter at @creativeboulder.

Joshua Canfield jcanfield

💭
If I do not respond quickly, try me on Twitter at @creativeboulder.
View GitHub Profile
#!/bin/bash
# Favicon and Apple Touch Icon Generator
#
# This bash script takes an image as a parameter, and uses ImageMagick to convert it to several
# other formats used on modern websites. The following copies are generated:
#
# * apple-touch-icon-144x144-precomposed.png
# * apple-touch-icon-114x114-precomposed.png
# * apple-touch-icon-57x57-precomposed.png
@jcanfield
jcanfield / racadm-reset-pwd.sh
Last active August 21, 2023 15:33
Reset Password for integrated Dell remote access controller (iDRAC6)
#!/bin/bash
## Synopsis
# Reset the primary password on Dell PowerEdge or any device using iDRAC6
## Usage
# sudo ./racadm-reset-pwd.sh YOURPASS
## NOTE
# Resource- http://www.remotecto.net/2010/10/19/changing-a-drac-password-on-the-command-line-with-racadm/
sudo racadm config -g cfgUserAdmin -o cfgUserAdminPassword -i 2 $1
echo "Plase take note of your password"
@jcanfield
jcanfield / wp-modifydb.php
Created March 29, 2012 17:06
Serialized PHP Search and Replace
<?php
/**
*
* Safe Search and Replace on Database with Serialized Data v2.0.1
*
* This script is to solve the problem of doing database search and replace when
* developers have only gone and used the non-relational concept of serializing
* PHP arrays into single database columns. It will search for all matching
* data on the database and change it, even if it's within a serialized PHP
* array.
@jcanfield
jcanfield / Makefile
Created June 3, 2012 19:11
Create Hardlinks to Sync Folders with Google Drive
OUTPUT=hardlink
C_FILES=hardlink.c
all:
gcc ${C_FILES} -o ${OUTPUT}
clean:
rm ${OUTPUT}
install:
@jcanfield
jcanfield / .gitconfig
Created August 3, 2012 03:52
GIT Invoice
## GIT Configuration
## Local found at `~/.gitconfig`
## Installation: Add snippet to .gitconfig file
## Usage: `git invoice` to list recent commits in "pretty format"
## Credit: @svizion (http://twitter.com/svizion)
[alias]
invoice = log --pretty=format:'%ad - %s' --abbrev-commit --date=short
@jcanfield
jcanfield / dns-servers_updated-2017.md
Last active June 10, 2023 09:50
DNS Server List for 2015/2017 (courtesy of http://sos.smerwick.com.tw)

List of DNS Servers

'The following is a list of DNS Servers: both, Private and Public.'

DNS Servers

Why does DNS matter?

The Domain Name System (DNS) protocol is an important part of the web's infrastructure, serving as the Internet's phone book: every time you visit a website, your computer performs a DNS lookup. Complex pages often require multiple DNS lookups before they start loading, so your computer may be performing hundreds of lookups a day.

List of Public DNS Servers

@jcanfield
jcanfield / docker-compose.yml
Last active February 21, 2023 23:26
creativeboulder-com_testing
version: '3'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
@jcanfield
jcanfield / html5-shiv.js
Created May 20, 2012 21:41
HTML5 Shiv pre3.5
/*! HTML5 Shiv pre3.5 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
Uncompressed source: https://github.com/aFarkas/html5shiv */
(function(a,b){function h(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function i(){var a=l.elements;return typeof a=="string"?a.split(" "):a}function j(a){var b={},c=a.createElement,f=a.createDocumentFragment,g=f();a.createElement=function(a){l.shivMethods||c(a);var f;return b[a]?f=b[a].cloneNode():e.test(a)?f=(b[a]=c(a)).cloneNode():f=c(a),f.canHaveChildren&&!d.test(a)?g.appendChild(f):f},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+i().join().replace(/\w+/g,function(a){return b[a]=c(a),g.createElement(a),'c("'+a+'")'})+");return n}")(l,g)}function k(a){var b;return a.documentShived?a:(l.shivCSS&&!f&&(b=!!h(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,
@jcanfield
jcanfield / system_update.sh
Created February 14, 2023 02:44 — forked from bmatthewshea/system_update.sh
Ubuntu-Debian APT upgrade script
#!/bin/bash
#
# Brady Shea - 18SEP2020 - conversion of system_update alias to bash script
# https://www.holylinux.net/
#
# Place this script in "/usr/local/sbin/system_update" or similar location under your $PATH
# It needs root permissions (SUDO) to execute.
#
# Change these settings to your liking:
#################################
@jcanfield
jcanfield / webhook-mailer.php
Created June 3, 2012 05:24 — forked from boucher/webhook-mailer.php
Stripe Webhook PHP Example
<?php
// SETUP:
// 1. Customize all the settings (stripe api key, email settings, email text)
// 2. Put this code somewhere where it's accessible by a URL on your server.
// 3. Add the URL of that location to the settings at https://manage.stripe.com/#account/webhooks
// 4. Have fun!
// set your secret key: remember to change this to your live secret key in production
// see your keys here https://manage.stripe.com/account