Skip to content

Instantly share code, notes, and snippets.

@ibrahima
ibrahima / .bashrc
Created June 14, 2012 00:58
My .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
# encoding: utf-8
class ImageUploader < CarrierWave::Uploader::Base
attr_reader :file
include CarrierWave::RMagick
include Magick
storage :file
@ibrahima
ibrahima / spamclasses.rb
Created March 5, 2012 23:11
A script that creates a bunch of classes for testing pagination
for k in 0..99
c = Course.new
c.term = "Spring"
c.year = 2012
c.title = "EECS 1" + sprintf("%02d", k)
c.description = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
c.save
cm = CourseMembership.new
cm.user = User.first
cm.course = c
crw-rw-rw- root root 5, 0 2004-12-31 16:06 tty
crw-rw---- root system 4, 0 2004-12-31 16:06 tty0
crw------- root root 4, 1 2004-12-31 16:06 tty1
crw------- root root 4, 10 2004-12-31 16:06 tty10
crw------- root root 4, 11 2004-12-31 16:06 tty11
@ibrahima
ibrahima / gist:1495429
Created December 19, 2011 04:43
MoveArmGoal for left arm
planning_scene_diff:
robot_state:
joint_state:
header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: ''
name: []
@ibrahima
ibrahima / gitsnippets.sh
Created August 30, 2011 08:14
Random git snipets (how meta)
#The thing you do to make grafts permanent
git filter-branch --tag-name-filter cat -- --all
#Move everything from a subdirectory to the root
git filter-branch --subdirectory-filter subdir/ -- --all
@ibrahima
ibrahima / rosco.bash
Created August 18, 2011 22:22
Rosco.bash - my ros.org checkout tool
#!/usr/bin/env bash
URI=$(roslocate uri $1)
VCS=$(roslocate vcs $1)
echo $VCS $URI
case $VCS in
'svn')
svn co $URI
;;
@ibrahima
ibrahima / make-eclipse-projects.bash
Created July 22, 2011 05:53
Bash script to generate eclipse projects for all ROS projects in the current directory
#!/usr/bin/env bash
echo "Generating eclipse projects for all ROS projects in this directory"
for MKFILE in `find $PWD -name Makefile`; do
DIR=`dirname $MKFILE`
echo $DIR
cd $DIR
make eclipse-project
done
@ibrahima
ibrahima / dev
Created June 6, 2011 02:22
ls -l /dev
crw------- 1 root root 10, 243 Jun 3 17:37 HPD
crw------- 1 root root 10, 131 Jun 3 17:37 adc
crw-rw-r-- 1 system radio 10, 57 Jun 3 17:37 alarm
crw-rw---- 1 adb adb 10, 59 Jun 3 17:37 android_adb
crw-rw---- 1 adb adb 10, 60 Jun 3 17:37 android_adb_enable
crw------- 1 root root 10, 134 Jun 3 17:37 apm_bios
crw-rw-rw- 1 root root 10, 61 Jun 3 17:37 ashmem
crw------- 1 root root 10, 40 Jun 3 17:37 backlightnotification
crw-rw-rw- 1 root root 10, 54 Jun 3 17:37 binder
drwxr-xr-x 3 root root 2320 Jun 4 14:51 block
@ibrahima
ibrahima / err.txt
Created April 24, 2011 22:36
Errors
mknod: /dev/loop5: File exists
losetup: /dev/block/loop5
mount: mounting /dev/block/loop5 on /data/local/ubuntu failed: No such device
mount: mounting devpts on /data/local/ubuntu/dev/pts failed: No such file or directory
mount: mounting proc on /data/local/ubuntu/proc failed: No such file or directory
mount: mounting sysfs on /data/local/ubuntu/sys failed: No such file or directory
./bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
./bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
./bootubuntu: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
chroot: can't execute '/bin/bash': No such file or directory