Skip to content

Instantly share code, notes, and snippets.

View brownman's full-sized avatar

brownman brownman

  • self
  • israel
View GitHub Profile
alert(document.cookie)
@brownman
brownman / winusb.sh
Last active September 7, 2015 10:06
Script creates bootable usb from windows iso, tested on Ubuntu 15.04 with Windows 8 and Windows 10 iso files on BIOS and UEFI machines.
#!/bin/sh
# Requirements:
# parted - to make gpt and partion
# sfdisk - to make mbr and partition over gpt
# blkid - to get UUID of partition for grub
# grub-pc-bin - files to install grub from UEFI-booted machines to MBR
usb="/dev/sdX" # path to usb device file (without number at end) sudo fdisk -l
iso="/path/to/windows.iso" # path to windows iso
#!/usr/bin/env python
"""
Use byzanz to create a GIF screencast of a specific window.
Required tools:
sudo apt-get install byzanz x11-utils xdotool
A tip: use an extra-long duration (-d 100), record your shot, and use
gimp to shorten the duration of the last frame. You need to rename the layer
from "Frame 123 (100000 ms) (combine)" to "Frame 123 (1000 ms) (combine)".
#!/bin/bash
# Copyright (c) 2014-Present, Scott Cagno
# All rights reserved. [BSD License]
# ------------------------------------------
# THIS BASH SCRIPT UPLOADS A CORPUS FILE TO
# THE CMU ONLINE LANGUAGE MODELING GENERATOR.
# IT WILL RETURN AND STAGE THE GENERATED
# LANGUAGE MODEL AND DICTIONARY FILES IN THE
# SPECIFIED DIRECTORY (LANGDIR).
@brownman
brownman / gist:d2c2905fb24b8591a7cc
Last active August 29, 2015 14:02 — forked from cloudsben/gist:4490135
download_entire_website.sh
# -p parameter tells wget to include all files, including images.
# -e robots=off you don't want wget to obey by the robots.txt file
# -U mozilla as your browsers identity.
# --random-wait to let wget chose a random number of seconds to wait, avoid get into black list.
# Other Useful wget Parameters:
# --limit-rate=20k limits the rate at which it downloads files.
# -b continues wget after logging out.
# -o $HOME/wget_log.txt logs the output
wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com
#!/bin/bash
HOSTNAME="apollo"
USERNAME="paretech"
TIMEZONE="US/Eastern"
LANGUAGE="en_US.UTF-8"
DRIVE=/dev/sda
MOUNT_PATH=/mnt
USERSHELL=/bin/bash
#!/bin/sh
# Arch Linux Bootstrap Script
#
# See comments below for running
#
# Partition all of main drive
echo "n
p
@brownman
brownman / dd_progressbar_pv.sh
Last active May 11, 2020 22:01 — forked from rriemann/gist:1406035
dd + progress bar
##########################################
# ofer shaham (c)
# 5-2014
# to: towards more generic usage
# from: a forked gist
##########################################
#dd command + pipe the progress using: pv
#depend_package: dd pv
##########################################
set -o nounset
@brownman
brownman / game_of_life.js
Created April 3, 2012 10:22 — forked from jszmajda/game_of_life.js
Game of Life in Backbone.js
var stepTime = 1;
var col = undefined;
var Cell = Backbone.Model.extend({
x: -1,
y: -1,
alive: false,
nextAlive: false,
initialize: function() {
@brownman
brownman / tracks_controller.rb
Created November 30, 2011 13:31 — forked from adomokos/tracks_controller.rb
This code is to demonstrate how I use test doubles for Rails.
class TracksController < ApplicationController
def index
signed_in_user
end
def new
@track = Track.new
end
def create