Skip to content

Instantly share code, notes, and snippets.

@ibrahima
ibrahima / gist:174319
Created August 24, 2009 23:35
A command that will copy one directory into another but not overwrite any files.
cp -r -v -i --reply=no /path/to/source/* /path/to/target/
<HTML WEB="2.0">
<HEAD>
<TITLE>
xkcd - A Webcomic - Nachos - HOSTED BY GEOCITIES
</TITLE>
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="/atom.xml" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="/rss.xml" />
<link rel="icon" href="/static/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon" />
</HEAD>
#!/bin/bash
#This script simply splits up the reuters-21578 dataset into separate files for each article.
for f in reut2-*.sgm
do
echo $f
sed '1d' $f | csplit -ks -n 3 -f split/${f%.sgm} - '/<REUTERS/' {100000}
done
@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
@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 / 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 / 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 / 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 / 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: []
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