Skip to content

Instantly share code, notes, and snippets.

@rgo
rgo / kernel_module.sh
Created November 4, 2017 22:34 — forked from probonopd/kernel_module.sh
Trying to compile kernel module for Ralink 3070 chipset
#
# Trying to compile kernel module for Ralink 3070 chipset
# with patch described on
# http://www.geekamole.com/2013/rt2800usb-fix-for-ralinkmediatek-3070-gentoo-linux/
#
apt-get install linux-headers-3.7-trunk-686-pae # This is on Kali Linux; 3 MB
apt-get install linux-source-3.7 # http://ftp.halifax.rwth-aachen.de/kali/pool/main/l/linux-kali/linux-source-3.7_3.7.2-0+kali8_all.deb # 82 MB
tar xfj /usr/src/linux-source-3.7.tar.bz2
cd linux-*
@rgo
rgo / gist:7e1847d7c10ee43fa5de012d5a268a48
Created September 22, 2016 11:54 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@rgo
rgo / .vimrc
Created September 22, 2016 10:46 — forked from fxn/.vimrc
function! s:EnableRelativeNumber()
set nonumber
set relativenumber
endfunction
function! s:DisableRelativeNumber()
set norelativenumber
set number
endfunction
@rgo
rgo / sshd_config
Created September 5, 2013 09:15 — forked from knoopx/sshd_config
# This prevents capistrano from hanging when executing long tasks
# /etc/ssh/sshd_config
TCPKeepAlive yes
ClientAliveInterval 15
ClientAliveCountMax 5
# Restart sshd
@rgo
rgo / gist:1173243
Created August 26, 2011 11:36 — forked from diecrf/gist:1170410
Delete unused images in a rails project
images = Dir.glob('public/images/*')
images.each do |image|
unless File.directory?(image)
puts "Checking #{image}..."
if IO.popen("ack-grep -1 -G '(app|public)' --ruby --html --css #{File.basename(image)}").eof?
IO.popen("svn delete #{image}")
puts " Deleted"
end
end
/path/to/rails_apps/*/log/*.log {
daily
missingok
rotate 30
compress
delaycompress
sharedscripts
postrotate
find /path/to/rails_apps/* -name tmp -maxdepth 1 -type d -exec touch {}/restart.txt \;
endscript
@rgo
rgo / .irbrc.rb
Created January 11, 2011 11:14 — forked from diecrf/.irbrc.rb
# IRBRC file by Iain Hecker, http://iain.nl
# put all this in your ~/.irbrc
require 'rubygems'
require 'yaml'
alias q exit
class Object
def local_methods
(methods - Object.instance_methods).sort
@rgo
rgo / Gemfile
Created May 23, 2010 01:31 — forked from indirect/Gemfile
# include at least one source and the rails gem
source :gemcutter
gem 'rails', '~> 2.3.5', :require => nil
gem 'sqlite3-ruby', :require => 'sqlite3'
# Devise 1.0.2 is not a valid gem plugin for Rails, so use git until 1.0.3
# gem 'devise', :git => 'git://github.com/plataformatec/devise.git', :ref => 'v1.0'
group :development do
# bundler requires these gems in development
@rgo
rgo / font faces
Created March 30, 2010 11:42 — forked from javier/font faces
embedding true type fonts in your css
/* Font face generator needed to IE family
* http://www.fontsquirrel.com/fontface/generator
*/
@font-face {
font-family: 'Essays1743Italic';
src: url('Essays1743-Italic.eot');
src: local('☺'), url('Essays1743-Italic.ttf') format('truetype');
}
@rgo
rgo / hide_flash_messages_automagically.js
Created March 15, 2010 15:26 — forked from leehambley/gist:332857
Snippet to hide flash messages automagically with jQuery
<%# From pretty_flash by rpheath (improved by pacoguzman) %>
<% if flash.any? -%>
<script type="text/javascript">
$(function() {
setTimeout(hideFlashes, 5000);
});
var hideFlashes = function() {
$("[id^='flash_']").fadeOut(1500);