Skip to content

Instantly share code, notes, and snippets.

View KellyLSB's full-sized avatar

Kelly Becker-Neuding KellyLSB

View GitHub Profile
@ilpianista
ilpianista / gobinet.patch
Last active August 29, 2015 14:19 — forked from ivoronin/gobinet.patch
GobiNet patch to build with Linux 4.0.0
diff -Naur GobiNet.old/GobiUSBNet.c GobiNet/GobiUSBNet.c
--- GobiNet.old/GobiUSBNet.c 2015-04-22 19:45:17.553791454 +0200
+++ GobiNet/GobiUSBNet.c 2015-04-22 19:46:29.299686755 +0200
@@ -66,11 +66,15 @@
#define DRIVER_AUTHOR "Qualcomm Innovation Center"
#define DRIVER_DESC "GobiNet"
+#ifdef bool
+#undef bool
+#endif
@KellyLSB
KellyLSB / parallels_clone_update_mac.sh
Created November 26, 2012 07:08
Updates a cloned Parallels Ubuntu VM network interface configuration with the proper mac address
#!/usr/bin/env sh
#
# Change the MAC Address on an Ubuntu Parallels Cloned VM
# Author: Kelly Becker (KellyLSB)
# Check for sudo access
SUDO=`sudo -n uptime 2>&1|grep "load"|wc -l`
if [ $SUDO -lt 1 ]
then
echo "You need to have sudo priveleges!"
@dimaulupov
dimaulupov / install-cloud9.sh
Created July 10, 2012 05:29
Ruby 1.9.3 installer for Cloud9 workspaces
#!/bin/bash
# This script downloads and installs Ruby 1.9.3-p194 into Cloud9 workspace.
# It makes possible to use Ruby 1.9 for running apps there instead of default Ruby 1.8.7
# Create this file in a root of your workspace.
# Run in command line: chmod +x install-cloud9.sh
# And: ./install-cloud9.sh
# It will take some time to download and compile libyaml and ruby.
# Adjust ruby version paths according to your needs.
@devilankur18
devilankur18 / Ubuntu12-04
Created June 4, 2012 15:01
Graylog Setup in ubuntu 12.04
*Elastic Search*
Grab the deb packages for Elasticsearch from http://www.elasticsearch.org/download/ and both the Graylog2 server and web interface from http://graylog2.org/download.
#install the elastic search from debian
dpkg -i elasticsearch-0.19.3.deb
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active July 26, 2024 01:29
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@jlecour
jlecour / README.md
Created October 10, 2011 20:33
Identify paperclip attachment files that are not attached to any record

Let's say you have a model, with an files attached, using Paperclip. You have a couple millions of those files and you're not sure that every one of them (and all its thumbnails) are still used by a database record.

You could use this rake task to recursively scan all the directories and check if the files need to be kept or destroyed.

In this example, the model is called Picture, the attachment is image and the path is partitioned like images/001/412/497/actual_file.jpg

The task is going down the path. Each time the path ends with 3 triplets of digits ("001/412/497" for example) it looks for a record with the ID 1412497. If such a record doesn't exist, the whole directory is moved to a parallel images_deleted directory. At the end you can delete the files if you like, or move them to an archive location.

You can use the "dry run" mode : to print which files would be removed

@mdp
mdp / cleanup.sh
Created September 30, 2011 23:36
Git branch cleanup
# This must be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
# Remove local fully merged branches
git branch --merged master | grep -v 'master$' | xargs git branch -d
# Show remote fully merged branches
echo "The following remote branches are fully merged and will be removed:"
git branch -r --merged master | sed 's/ *origin\///' | grep -v 'master$'
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000