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 at schatzbook in ~/.apps
$ curl -fsSL https://raw.githubusercontent.com/Falkor/dotfiles/master/install.sh | bash -s -- --all
=> About to install Falkor's dotfiles from /Users/jcanfield/.dotfiles.falkor.d
[WARNING] Are you sure you want to continue? [Y|n] Submodule '.submodules/Makefiles' (https://github.com/Falkor/Makefiles.git) registered for path '.submodules/Makefiles'
Submodule '.submodules/gitstats' (https://github.com/hoxu/gitstats.git) registered for path '.submodules/gitstats'
Submodule 'oh-my-zsh/custom/plugins/zsh-completions' (https://github.com/zsh-users/zsh-completions) registered for path 'oh-my-zsh/custom/plugins/zsh-completions'
Submodule 'oh-my-zsh/custom/themes/powerlevel9k' (https://github.com/bhilburn/powerlevel9k.git) registered for path 'oh-my-zsh/custom/themes/powerlevel9k'
Submodule 'tests/helpers/assertions' (https://github.com/jasonkarns/bats-assert) registered for path 'tests/helpers/assertions'
Cloning into '/Users/jcanfield/.dotfiles.falkor.d/.submodules/Makefiles'...
C
@jcanfield
jcanfield / update-media-perms.sh
Created November 21, 2016 19:05
Change Media Files & Folder Permissions/ACLs Recusively
#!/bin/bash
# Synopsis: The concept is to allow for a Bash $Variable to quickly name Harddrives & Folders where you store your Media. After re-installation or changes to your OS. sometimes permissions and ownership can be modified the wrong way.
find $1 -type f print0 | xargs -0 chmod -Rc 644 # Change all files recusively to 644
find $1 -type d -print0 | xargs -0 chmod-Rc 755 # Change all directories recursively to 755
chown $USER -R $1 # Change ownership to current user

Unix Command Line Notes

  • Command settings
    • .bashrc
      • Aliases - place the following on a new line in the .bashrc file
        • alias [alias-name]='[alias command(s)]
        • Ex:alias ls='ls -lh'
    • .profile or .bash_profile
  • Add folders to you path
@jcanfield
jcanfield / node-and-npm-in-30-seconds.sh
Created October 27, 2016 03:05 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@jcanfield
jcanfield / .bash_aliases
Created October 27, 2016 02:00 — forked from SimpleHomelab/.bash_aliases
bash_aliases for Ubuntu HTPC and Home Servers
# UPDATE AND UPGRADE
alias update='sudo apt-get update'
alias upgrade='sudo apt-get upgrade'
# PACKAGE MANAGEMENT
alias install='sudo apt-get install'
alias uninstall='sudo apt-get remove'
alias aptsearch='sudo apt-cache search'
alias addkey='sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com'
alias finstall='sudo apt-get -f install'
@jcanfield
jcanfield / devenv.sh
Created October 27, 2016 01:59
A small bashscript to setup an web-development environment with gulp, bower, nodejs in Ubuntu/Ubuntu-based distributions. !!! Be careful: I recommend to only use it on a fresh installed system, otherwise it could mess up something !!!
#!/bin/bash
# Echo to nowhere for a more beautiful console output
sudo echo > /dev/null
# Add nodejs and sublime text ppa
echo ':: adding ppas'
sudo add-apt-repository -y ppa:chris-lea/node.js > /dev/null 2>&1
sudo add-apt-repository -y ppa:webupd8team/sublime-text-3 > /dev/null 2>&1
@jcanfield
jcanfield / Ubuntu Fresh Install Script
Created October 27, 2016 01:58 — forked from mmstick/Ubuntu Fresh Install Script
After installing Ubuntu, simply run this script to configure a fresh installation.
#!/bin/bash
# Ubuntu 13.10 and 14.04 should work perfectly with this script.
# PPAS
## Essentials
sudo add-apt-repository -y "deb http://archive.canonical.com $(lsb_release -sc) partner"
sudo add-apt-repository -y ppa:mc3man/mpv-tests # MPV (ffmpeg version)
sudo add-apt-repository -y ppa:atareao/nautilus-extensions # Nautilus Image Extensions
sudo add-apt-repository -y ppa:ubuntu-wine/ppa # Updated Wine Packages from Wine Developers
sudo add-apt-repository -y ppa:webupd8team/y-ppa-manager # Namely for YAD
@jcanfield
jcanfield / dmesg.md
Last active October 25, 2016 23:26
Debugging and Fixing up an "old" HP Desktop turned headless-linux shell. Just, Repairing "old" HP Desktop which serves as a 'headless-linux' server for over 8 years now.

Re: Repairing "old" HP Desktop which serves as a 'headless-linux' server for over 8 years now

Pasted via Hastebin.com

[ 1264.077530] nouveau E[ PFIFO][0000:02:00.0] DMA_PUSHER - ch 4 [webbrowser-app[5933]] get 0x002005488c put 0x00200548a0 ib_get 0x0000014e ib_put 0x0000014f state 0x80000000 (err: INVALID_CMD) push 0x00400040

[ 1264.078772] nouveau E[ PGRAPH][0000:02:00.0] DATA_ERROR INVALID_ENUM

[ 1264.078791] nouveau E[ PGRAPH][0000:02:00.0] ch 4 [0x000f97f000 webbrowser-app[5933]] subc 3 class 0x8397 mthd 0x15dc data 0x00107b00

@jcanfield
jcanfield / .htaccess
Created August 17, 2016 09:07 — forked from jasperf/.htaccess
.htaccess boilerplate including expire headers, mod pagespeed, cache control headers, Gzip, Deflate #htaccess #seo
# BEGIN Expire headers
AddDefaultCharset UTF-8
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
@jcanfield
jcanfield / index.html
Created August 17, 2016 07:44 — forked from arkaitzgarro/index.html
HTML5 Boilerplate
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Plantilla HTML5</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/normalize.css">