Skip to content

Instantly share code, notes, and snippets.

View mindreframer's full-sized avatar
🎯
Focusing

Roman Heinrich mindreframer

🎯
Focusing
View GitHub Profile
@mindreframer
mindreframer / scriptreplay
Created April 9, 2012 14:29
scriptreplay for easy downloading
#!/usr/bin/perl -w
# "script -t" will output a typescript with timings
# this script "scriptreplay" replays it
# run pod2man on it to get a man page
=head1 NAME
scriptreplay - play back typescripts, using timing information
@mindreframer
mindreframer / gist:3023095
Created June 30, 2012 09:26
razor ubuntu 12.04 failing installation
I merged with repo
https://github.com/lynxbat/Razor/commit/e8aa65e8eafd54d81878eae0a2a07263635b622d (the last commit)
here the output:
730a8fe root 20 minutes ago Merge branch 'master', remote-tracking branch 'origin'
e8aa65e Nicholas Weaver 6 hours ago Fix for if OS Installer passes a partial Range value in Header. This is an invalid request but we must work around it to maintain compatibility
2637663 Nicholas Weaver 35 hours ago Wrong word in help text
cdf2229 Nicholas Weaver 2 days ago Removed active model
03fc1a5 Nicholas Weaver 2 days ago Brand new Active Model Slice
@mindreframer
mindreframer / razor_daemon.log
Created July 1, 2012 11:00
razor log output
ProjectRazor Image Service Web Server started and listening on:8026
Image root path: /opt/razor/image
{"@image_svc_host":"192.168.2.83","@persist_mode":"mongo","@persist_host":"127.0.0.1","@persist_port":27017,"@persist_timeout":10,"@admin_port":8025,"@api_port":8026,"@image_svc_port":8027,"@mk_tce_mirror_port":2157,"@mk_checkin_interval":60,"@mk_checkin_skew":5,"@mk_uri":"http://192.168.2.83:8026","@mk_register_path":"/razor/api/node/register","@mk_checkin_path":"/razor/api/node/checkin","@mk_fact_excl_pattern":"(^facter.*$)|(^id$)|(^kernel.*$)|(^memoryfree$)|(^operating.*$)|(^osfamily$)|(^path$)|(^ps$)|(^ruby.*$)|(^selinux$)|(^ssh.*$)|(^swap.*$)|(^timezone$)|(^uniqueid$)|(^uptime.*$)|(.*json_str$)","@mk_log_level":"Logger::ERROR","@mk_tce_mirror_uri":"http://localhost:2157/tinycorelinux","@mk_tce_install_list_uri":"http://localhost:2157/tinycorelinux/tce-install-list","@mk_kmod_install_list_uri":"http://localhost:2157/tinycorelinux/kmod-install-list","@image_svc_path":"/opt/razor/image","@register_timeout":
ProjectRazor Image Service Web Server started and listening on:8026
Image root path: /opt/razor/image
{"@image_svc_host":"192.168.2.83","@persist_mode":"mongo","@persist_host":"127.0.0.1","@persist_port":27017,"@persist_timeout":10,"@admin_port":8025,"@api_port":8026,"@image_svc_port":8027,"@mk_tce_mirror_port":2157,"@mk_checkin_interval":60,"@mk_checkin_skew":5,"@mk_uri":"http://192.168.2.83:8026","@mk_register_path":"/razor/api/node/register","@mk_checkin_path":"/razor/api/node/checkin","@mk_fact_excl_pattern":"(^facter.*$)|(^id$)|(^kernel.*$)|(^memoryfree$)|(^operating.*$)|(^osfamily$)|(^path$)|(^ps$)|(^ruby.*$)|(^selinux$)|(^ssh.*$)|(^swap.*$)|(^timezone$)|(^uniqueid$)|(^uptime.*$)|(.*json_str$)","@mk_log_level":"Logger::ERROR","@mk_tce_mirror_uri":"http://localhost:2157/tinycorelinux","@mk_tce_install_list_uri":"http://localhost:2157/tinycorelinux/tce-install-list","@mk_kmod_install_list_uri":"http://localhost:2157/tinycorelinux/kmod-install-list","@image_svc_path":"/opt/razor/image","@register_timeout":
@mindreframer
mindreframer / cleanup_rails_views.rb
Created July 26, 2012 01:13
Cleanup views with tidy (erb)
require 'tidy'
#Tidy.path = '/opt/local/lib/libtidy.dylib' # or where ever your tidylib resides
Tidy.path = '/usr/lib/libtidy.A.dylib'
def generate(files)
tidy = Tidy.open(:show_warnings=>true) do |tidy|
tidy.options.indent = 'auto'
tidy.options.show_body_only = true
tidy.options.output_xhtml = true
@mindreframer
mindreframer / gist:3181974
Created July 26, 2012 13:13
html/erb prettifying stuff
require 'timeout'
require 'htmlbeautifier'
def log(msg)
puts msg
end
view_files = Dir["app/**/**/**.erb"]
def beautify(file_name)
@mindreframer
mindreframer / gist:3187442
Created July 27, 2012 11:14
RBENV testing
https://github.com/jamis/rbenv-gemset/
Otherwise, clone rbenv-gemset to the `$HOME/.rbenv/plugins` directory:
$ mkdir -p ~/.rbenv/plugins
@mindreframer
mindreframer / import_active_record_schema.rb
Created July 27, 2012 12:52
Import active_record schema without rake tasks
### sometimes your migrations don't works without already pre-populated database and your need only something to bootstrap the shell, use this script to import schema.rb without Rake-tasks and Rails!
require 'active_record'
require 'mysql2'
ROOT = File.join(File.dirname(__FILE__), '..')
DB_NAME = 'your_db_name'
['/db'].each do |folder|
$:.unshift File.join(ROOT, folder)