Skip to content

Instantly share code, notes, and snippets.

@klodio
klodio / gist:b110c02d7bfe6562a619
Last active August 29, 2015 14:05
USB stick - Ubuntu - Mac

#How to make an Ubuntu USB stick on your Mac

This guide didn't work for me, so I tried something else, which was successful. I couldn't edit the wiki so I'm writing here.

  1. Plug your USB stick where everything will be deleted
  2. Open your Terminal (You'll find a Terminal application in your Launcher)
  3. Once there, type diskutil list
  4. Look for the name of your USB stick in the result, and find the associated drive:
  • Here's an example:
set t_Co=256
:colorscheme borland
:syntax on
set ruler
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set showmatch
set number
@klodio
klodio / gist:2958693
Created June 20, 2012 07:52
Use jsbeautifier to prettify your actual files, so you don't have to lose time making them beautiful.
#!/bin/bash
#relies on https://github.com/rickeyski/node-beautifier
for ARG in $*
do
filename="/tmp/jsbeautifile-"$RANDOM
node ~/node_modules/beautifier/bin/beautifier.js $ARG > filename
cat filename > $ARG
rm filename
@klodio
klodio / gist:2946939
Created June 18, 2012 05:07
Add this to your vimrc (or make it a vim plugin) if you use ImpactJS
"I know it's obvious, but those mappings require FileType (just remove "au FileType " if you don't have it)
"type igm tab to start a module
"I'd like to use zencoding instead of those hacks, but no time for now :)
au FileType javascript inoremap igm<Tab> ig.module(<CR>'game.entities.<C-R>=expand("%:t:r")<CR>'<CR>).requires(<CR>''<CR>).defines(function(){<CR><CR>});<Esc>3k$hi
au FileType javascript inoremap igc<Tab> =ig.Class.extend({<CR>init: function(){<CR><Tab><CR>}<CR>});<Esc>4kI
"will actually insert the filename there, so you won't go crazy figuring out what's missing (but I didn't replace dashes by caps, no time now!)
au FileType javascript inoremap ige<Tab> =ig.Entity.extend({<CR>type:ig.Entity.TYPE.NONE,<CR>checkAgainst:ig.Entity.TYPE.NONE,<CR>collides: ig.Entity.COLLIDES.NEVER,<CR><CR>size:{x:8,y:8},<CR><CR>animSheet: new ig.AnimationSheet( 'media/sprite<C-R>=expand("%:t:r")<CR>.png', 8, 8 ),<CR><CR>init: function(x,y,settings){<CR>this.parent( x, y, settings );<CR>this.addAnim( 'idle', 1, [0] );<CR
@klodio
klodio / gist:2426996
Created April 20, 2012 07:58
replace stuff in a file
def replace_in_file(options)
needles=options[:search_replace] #a hash like {"replace this"=>"with that"}
File.open(options[:file_path],"r+"){ |handle|
data=handle.read
needles.each { |key, value|
data.gsub!(key,value)
}
handle.rewind
handle.write(data)
}
gpg --keyserver keyserver.ubuntu.com --recv -keys 4BD736A82B5C1B00
gpg --export --armor 4BD736A82B5C1B00 | sudo apt-key add -
{mode, max}.
{duration, 1}.
{concurrent, 16}.
{code_paths, ["deps/basho_stats","deps/riakc","deps/protobuffs"]}.
{value_generator, {exponential_bin, 2048, 5012}}.
{driver, basho_bench_driver_riakc_pb}.
{riakc_pb_ips, [{10,160,138,236},{10,160,129,14},{10,160,47,210},{10,160,127,128},{10,160,46,31}]}.
{operations, [{put,4},{get,4},{delete,4}]}.
{key_generator, {int_to_bin, {uniform_int, 1000000}}}.
echo " deb http://essrc.hyogo-u.ac.jp/cran//bin/linux/ubuntu oneiric/" >> sudo /etc/apt/sources.list
apt-get update
apt-get install ruby1.9.1-full
apt-get install rubygems
apt-get install python3-all
apt-get install r-base
git clone git://github.com/basho/basho_bench.git
cd basho_bench
make
sed -i -e 's/bin\/env /bin/g' priv/summary.r
@klodio
klodio / ohnoes
Created March 15, 2012 08:36
salepd
echo "YAHOO"
@klodio
klodio / a
Created March 13, 2012 10:53
ohnoes
deb http://www.apache.org/dist/cassandra/debian 10x main
deb-src http://www.apache.org/dist/cassandra/debian 10x main