Skip to content

Instantly share code, notes, and snippets.

Joshua Canfield jcanfield

Block or report user

Report or block jcanfield

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jcanfield
jcanfield / racadm-reset-pwd.sh
Last active Dec 27, 2017
Reset Password for integrated Dell remote access controller (iDRAC6)
View racadm-reset-pwd.sh
#!/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 / README.md
Created Dec 27, 2017 — forked from jxson/README.md
README.md template
View README.md

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@jcanfield
jcanfield / new-macos-setup.sh
Created Nov 25, 2017 — forked from intfrr/new-macos-setup.sh
Things to setup/install on a new macOS
View new-macos-setup.sh
#!/bin/bash
# change default shell to zsh (asks for password)
chsh -s /bin/zsh
# install xcode command line tools
xcode-select --install
# download my custom .zshrc
curl https://gist.githubusercontent.com/simonhaenisch/382eab0cfa3435dad7e177a49fe198fc/raw/.zshrc > ~/.zshrc
@jcanfield
jcanfield / .bash_profile
Created Nov 25, 2017 — forked from stephenll/.bash_profile
.bash_profile file on Mac OS X
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases.
# Much of this was originally copied from:
# http://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
View colors.conf
color_0 = ffff ffff ffff
color_1 = 4949 4848 3e3e
color_2 = 6666 d9d9 efef
color_3 = 6b6b c7c7 2b2b
color_4 = fdfd 9797 1f1f
color_5 = f9f9 2626 7272
color_6 = 94bc 5925 ffff
color_7 = 7575 7171 5e5e
color_8 = e6e6 dbdb 7474
color_9 = a6a6 e2e2 2e2e
@jcanfield
jcanfield / sweep-20170617.log
Created Jun 16, 2017
Sophos CLI `sweep` on MacOS Sierra (Segmentation fault: 11)
View sweep-20170617.log
$ sudo sweep -di -dn /
Password:
Sophos Anti-Virus
Version 9.6.1 [Darwin/AMD64]
Virus data version 5.40, May 2017
Includes detection for 13427651 viruses, trojans and worms
Copyright (c) 1989-2017 Sophos Limited. All rights reserved.
System time 13:08:55, System date 16 June 2017
Command line qualifiers are: -di -dn
@jcanfield
jcanfield / googl.sh
Created Jun 11, 2017 — forked from trentm/googl.sh
Bash function to use the goo.gl URL shortener on stdin. See <https://developers.google.com/url-shortener/v1/getting_started> TODO: pbcopy it too if that command is available
View googl.sh
# echo URL | googl
function googl {
local url=$(cat <&0)
(
set -e pipefail;
echo "{}" \
| json -e "this.longUrl='$url'" \
| curl -sf https://www.googleapis.com/urlshortener/v1/url \
-H 'Content-Type: application/json' -d@- \
| json id
@jcanfield
jcanfield / goo.gl.sh
Created Jun 11, 2017 — forked from wafflesnatcha/goo.gl.sh
Bash: goo.gl # Shorten a URL using the Google URL Shortener service (http://goo.gl).
View goo.gl.sh
#!/usr/bin/env bash
# Usage: goo.gl [URL]
#
# Shorten a URL using the Google URL Shortener service (http://goo.gl).
goo.gl() {
[[ ! $1 ]] && { echo -e "Usage: goo.gl [URL]\n\nShorten a URL using the Google URL Shortener service (http://goo.gl)."; return; }
curl -qsSL -m10 --connect-timeout 10 \
'https://www.googleapis.com/urlshortener/v1/url' \
-H 'Content-Type: application/json' \
-d '{"longUrl":"'${1//\"/\\\"}'"}' |
@jcanfield
jcanfield / .bash_aliases
Created Jun 11, 2017
Bash Aliases for HTPC Linux
View .bash_aliases
### List of Bash Aliases
## Hard Drive and Directory space commands
alias ls-space='echo "Displaying Disk space used per directory..." && du -slh * | sort -h'
alias ls-hdspace='echo "Displaying Hard Drive space used and available" && df -H && echo "Script complete. Press Enter to continue"'
@jcanfield
jcanfield / rename-files_to-folder.sh
Last active Jun 11, 2017
Rename files in a folder to match folder name (useful for htpc usage)
View rename-files_to-folder.sh
#!/bin/bash
# SYPOPSIS: Rename files in folder to match folder.
# CREDIT: Unamed user on superuser or superadmin. If you find this, let me know and I will add you to the credits.
# UPCOMING: Allow for secondary input such as `rename-files-to-folder $MOVIENAME` so not to rename all movies in directory just one or two.
find * -type f -maxdepth 1 | while read file
do
dirname="$(dirname "$file")"
new_name="${dirname##*/}"
file_ext=${file##*.}
You can’t perform that action at this time.