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
@jcanfield
jcanfield / rename-files_to-folder.sh
Last active June 11, 2017 00:23
Rename files in a folder to match folder name (useful for htpc usage)
#!/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##*.}
@jcanfield
jcanfield / move-show.sh
Created June 10, 2017 23:23
Move a TV Show or Movie directory to another folder or drive
#!/bin/bash
# SYNOPSIS: Move a TV Show or Movie directory to another folder or drive
# USAGE:
# NOTES: The Function cp_p was discovered on StackExchange at http://j.mp/1OOqAV1.
#cp_p()
#{
# strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \
# | awk '{
# count += $NF
@jcanfield
jcanfield / rename-movie-titles.sh
Created June 10, 2017 23:19
Use bash and linux tools to rename files in a folder, to the folder name.
#!/bin/bash
# SYNOPSIS: Rename all files in folder to match folder name.
# Testing 1
# rename -vn 's:(/[^/]*)/[^/]*$:$1$1.mkv:' folder/*/*.mkv
# Testing 2
#for f in folder/*/*.mkv;do dn="${f%/*}";echo mv -v "$f" "${dn}/${dn##*/}.mkv";done
# Testing #3
@jcanfield
jcanfield / dns_servers.md
Created June 4, 2017 05:15 — forked from roge/dns.md
Public DNS Servers

This is a list of trusted DNS servers put together by Rogue in order of priority.

Last Updated: 6/13/2014

Public DNS Servers (US, IPv4)

8.8.8.8         # Google Primary
8.8.4.4         # Google Secondary
4.2.2.1         # Level3 Main Primary
4.2.2.2         # Level3 Main Secondary
@jcanfield
jcanfield / public_dns_list
Created June 4, 2017 05:13 — forked from oldsharp/public_dns_list
public dns servers list
# google public dns
8.8.8.8
8.8.4.4
# opendns
208.67.222.222
208.67.220.220
# v2ex dns
199.91.73.222
@jcanfield
jcanfield / giganews-vpn-list_updated-May-2017.md
Created May 20, 2017 03:47
Giganews/VyperVPN Server Lists

Giganews VPN Server List

North America VPN Servers

VyprVPN Server Hostname


Los Angeles, CA us1.vpn.giganews.com

Washington, DC us2.vpn.giganews.com

@jcanfield
jcanfield / _generated_background_page.html
Created May 9, 2017 13:45
Google Chrome Extension: Honey (Refer Ext errors with: This extension failed to modify the request header "Referer" of a network request because the modification conflicted with another extension (Honey).)
<!DOCTYPE html>
<body>
<script src="h0.js"></script>
@jcanfield
jcanfield / sources.list
Created April 27, 2017 17:19
Ubuntu 16.10 Sources for APT
# Ubuntu Sources List Generator
>>> NEWS: Now available on SSL
>>> Replace your /etc/apt/sources.list with the following one. For adding GPG keys of new repos, see instruction (if available) in the sources.list below itself.
## curl https://repogen.simplylinux.ch/txt/yakkety/sources_dccbf34a40895c1d9b7a7e7d24ee21dbbbccc385.txt | sudo tee /etc/apt/sources.list
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
@jcanfield
jcanfield / index.html
Last active March 29, 2017 02:09
Testing for Joshua Canfield Portfolio
<body>
<div class="LI-profile-badge" data-version="v1" data-size="large" data-locale="en_US" data-type="vertical" data-theme="dark" data-vanity="joshgcanfield"><a class="LI-simple-link" href='https://www.linkedin.com/in/joshgcanfield?trk=profile-badge'>Joshua Canfield</a></div>
<script type="text/javascript" src="https://platform.linkedin.com/badges/js/profile.js" async defer></script>
</body>