Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh J. grafikchaos

View GitHub Profile
@grafikchaos
grafikchaos / gist:2720827
Created May 17, 2012 — forked from petemcw/gist:2719758
Commands to clean a Ubuntu install for smaller Vagrant packages
View gist:2720827
# Remove items used for building, since they aren't needed anymore
sudo apt-get clean
sudo apt-get -y remove linux-headers-$(uname -r) build-essential
sudo apt-get -y autoremove
# Zero out the free space to save space in the final image:
suod dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
# Removing leftover leases and persistent rules
View Rails 3 asset pipeline production
# == Precompile assets
#
# precompiles all CSS/JS assets in the app/assets b/c I'm lazy
# and I don't want to freaking update this every time we add/use
# sass or coffeescript files
#
# This strategy excludes the other default asset directories
# (lib/assets, vendor/assets) as well as any assets located
# in gems (which is okay b/c they can be called with an @import
# command or a manifest file)
@grafikchaos
grafikchaos / SVN wipeout
Created Jul 10, 2012
SVN wipe out the repo
View SVN wipeout
see http://stackoverflow.com/a/1462886
svn checkout --depth immediates http://myrepo.com/svn/myrepo myworking_copy
cd myworking_copy
svn rm *
svn ci -m "Deleting all"
@grafikchaos
grafikchaos / git-create-branch alias
Created Jul 12, 2012
git create and track remote branch
View git-create-branch alias
# in your aliases
# make sure your git-create-branch.sh is executable -> chmod +x path/to/your/git-create-branch.sh
alias gcb='path/to/your/git-create-branch.sh'
@grafikchaos
grafikchaos / git-destroy-branch alias
Created Jul 12, 2012
git destroy the remote and local version of the branch
View git-destroy-branch alias
# in your aliases
# (make sure your git-destroy-branch.sh is executable -> chmod +x path/to/your/git-destroy-branch.sh)
alias git-delete-branch='path/to/your/git-destroy-branch.sh'
@grafikchaos
grafikchaos / gist:3185895
Created Jul 27, 2012 — forked from olistik/gist:2627011
Ubuntu 12.04 setup (rbenv, janus, postgres)
View gist:3185895

Basic pre-requisites

  • Some utilities:
sudo apt-get install vim tmux git
  • Copy/paste from the command line:
sudo apt-get install xclip
@grafikchaos
grafikchaos / InstallingGitUsingYum.md
Created Oct 17, 2012 — forked from eddarmitage/InstallingGitUsingYum.md
Installing git on CentOS 5 using yum
View InstallingGitUsingYum.md

Installing git on CentOS 5 using yum

Since you're using CentOS 5, the default package manager is yum, not apt-get. To install a program using it, you'd normally use the following command:

$ sudo yum install <packagename>

However, when trying to install git this way, you'll encounter the following error on CentOS 5:

@grafikchaos
grafikchaos / aliases.zsh
Created Feb 7, 2013
oh-my-zsh aliases plugin for common aliases I use
View aliases.zsh
# ~/.oh-my-zsh/custom/aliases.zsh
# At the end of the file you can add the aliases from above
# or any other ones you find useful
alias ..='cd ..'
alias ll='ls -alGhF'
alias install='sudo apt-get install'
alias upgrade='sudo apt-get upgrade'
alias update='sudo apt-get update'
alias search='sudo apt-cache search -n'
@grafikchaos
grafikchaos / drupal7_search-api_geosearch-schema-3.6.xml
Last active Dec 13, 2015
Enable geosearching in Apache Solr and Drupal 7 search_api_solr module (http://drupal.org/project/search_api_solr) You'll need to copy/symlink both of these files to their respective filenames (i.e, schema.xml and solrconfig.xml)
View drupal7_search-api_geosearch-schema-3.6.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This is the Solr schema file. This file should be named "schema.xml" and
should be in the conf directory under the solr home
(i.e. ./solr/conf/schema.xml by default)
or located where the classloader for the Solr webapp can find it.
For more information, on how to customize this file, please see
http://wiki.apache.org/solr/SchemaXml
@grafikchaos
grafikchaos / gist:4957527
Created Feb 14, 2013
Example of clearing data from an Apache Solr multicore installation
View gist:4957527
curl http://localhost:8484/solr/core0/update\?commit\=true -d '<delete><query>*:*</query></delete>'