Skip to content

Instantly share code, notes, and snippets.


Max Masnick masnick

View GitHub Profile
masnick / Web Confidential to KeePassX.rb
Created Jun 28, 2010
Web Confidential to KeePassX
View Web Confidential to KeePassX.rb
#!/usr/bin/env ruby
# Usage:
# 1) Save as something.rb on Desktop. Optionally update the date on the line
# that beings with "time = " if you want the creation date to be correct in
# KeePassX.
# 2) Run in Terminal: chmod 777 ~/Desktop/something.rb
# 3) Run in Terminal: ~/Desktop/something.rb web_confidential_export.txt
# 4) Import the resulting export.xml into KeePassX
# 5) Use the "srm" command to delete the plaintext files containing passwords
View gist:456304
# Put this in your ~/.bash_profile file
# To reload the .bash_profile without restarting Terminal, run "source ~/.bash_profile"
function ff { osascript -e 'tell application "Finder"'\
-e "if (${1-1} <= (count Finder windows)) then"\
-e "get POSIX path of (target of window ${1-1} as alias)"\
-e 'else' -e 'get POSIX path of (desktop as alias)'\
-e 'end if' -e 'end tell'; };\
View gist:463836
# test.rb
require 'rubygems'
require 'active_record'
require 'classifier'
masnick / gist:475541
Created Jul 14, 2010
Add favicons to Basecamp
View gist:475541
// ==UserScript==
// @name Basecamp Favicons
// @namespace
// @description Adds a favicon to Basecamp
// @include http://**
// @include https://**
// ==/UserScript==
var favicon_link_html = document.createElement('link');
favicon_link_html.rel = 'icon';
masnick / gist:508569
Created Aug 4, 2010
Run shell script from Finder
View gist:508569
tell application "Finder"
set theWindow to window 1
set thePath to (POSIX path of (target of theWindow as alias))
tell application "Terminal"
do script "cd " & thePath & " && ./"
end tell
end tell
masnick / gist:568688
Created Sep 7, 2010
Translate into multiple languages
View gist:568688
require "rubygems"
require "rsay"
[Language::ARABIC, Language::CHINESE, Language::CHINESE_SIMPLIFIED, Language::CHINESE_TRADITIONAL, Language::DUTCH, Language::FRENCH, Language::GERMAN, Language::GREEK, Language::ITALIAN, Language::JAPANESE, Language::KOREAN, Language::PORTUGUESE, Language::RUSSIAN, Language::SPANISH, Language::SWEDISH].each do |out|
puts Translate.t('words', Language::ENGLISH, out)
masnick / main.css
Created Nov 12, 2010
Modification of h4x0r Adium message theme default CSS
View main.css
/* textonly by Mark Fickett, 2004. Poke/edit/maul, but leave credit - think GPL */
/* Generally: Adium-related: */
/* Modified by phrenzy, 2005 - */
/* Further modified by Max Masnick, 2010 - */
body {
background: #fff;
font-weight: normal;
View gist:873256
  1. Create Linode

    1. Record root password:
  2. Boot

  3. SSH in as root

    1. Install security updates:

    sudo apt-get update sudo apt-get upgrade --show-upgraded