CCCPaste

Python Interact with Firefox

#install
sudo aptitude install firefoxdriver python-selenium

#useage
from selenium import webdriver

Tab Completion in Python

#enable auto tab completion in Python
Create a file .pythonrc

# ~/.pythonrc
# enable syntax completion

Get User Input String

#include <stdio.h>

int main(){
/* A nice long string */
char string[256];

Adding Columns with AWK

#example File1
bob smith 100
tim zim 123
ted fred 450
bob hill 543

Raspberry Pi GPS Radio Power Meter

#!/bin/bash

dir=/home/pi/output/
mkdir -p "$dir"

Find all Bootable Partitions

#displays partition info with * in second colonum for boot partition
sudo fdisk -l

#Just greping for * does not work
sudo fdisk -l |grep '*' #quotes need around *

Split file by string with AWK

awk '/YOUR_TEXT_HERE/{n++}{print >"out" n ".txt" }' final.txt

-------------------example--------------
wget "http://pastebin.com/raw.php?i=nCVVCsE8" -O original.lst
awk '/:/{n++}{print >"out" n ".txt" }' original.lst

List all open files

find /proc/*/fd -xtype f -printf "%l\n" 2>/dev/null |grep -v " (deleted)$"| sort -u

Busybox file upload cgi script

#!/bin/sh

# POST upload format:
# -----------------------------29995809218093749221856446032^M
# Content-Disposition: form-data; name="file1"; filename="..."^M

Bootstrap Scroll Animation

$('html, body').animate({scrollTop: $('#contact').offset().top -100 }, 'slow');