On an Ubuntu 10.04 LTS Lucid server, I experienced weird behavior of my Ruby shell (pry in this case). Turned out, it's because of a bad version of libreadline.
Building on that Blog article, I tinkered a working solution:
No more modifications of spec-helper (spork) or recompilation of Ruby (zeus) required! Enjoy your fast specs - and especially generators, rake task etc.
Issues
Important: Remove require 'rspec/autorun' from spec-helper, otherwise, specs will run 2 times, 2nd time controller specs will fail:
12345
Failure/Error:get'welcome'NoMethodError:undefinedmethod`get' for #<RSpec::Core::ExampleGroup::Nested_4:0x007f64f3713b58> # ./spec/controllers/static_pages_controller_spec.rb:7:in `block(2levels)in<top(required)>' # <internal:prelude>:10:in `synchronize'
Fixing Test::Unit::Assertions when using Guard and Spring combined
On one project I had a strange issue, where some dependencies are not found when running guard with spring rspec:
123456789101112131415161718
/profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-rails-2.12.2/lib/rspec/rails/adapters.rb:82:in`assertion_method_names': uninitialized constant Test::Unit::Assertions (NameError) from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-rails-2.12.2/lib/rspec/rails/adapters.rb:88:in `define_assertion_delegators' from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-rails-2.12.2/lib/rspec/rails/adapters.rb:108:in `block in <module:TestUnitAssertionAdapter>'from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/concern.rb:119:in`class_eval' from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/concern.rb:119:in `append_features' from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/concern.rb:111:in `include'from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/concern.rb:111:in`block in append_features' from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/concern.rb:111:in `each' from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/concern.rb:111:in `append_features'from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:761:in`include' from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:761:in `safe_include' from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:755:in `block in configure_group'from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:753:in`each' from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:753:in `configure_group' from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-core-2.12.2/lib/rspec/core/world.rb:47:in `configure_group'from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:292:in`set_it_up' from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:243:in `subclass' from /profiles/swi/.rvm/gems/ruby-1.9.3-p374/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:230:in `describe'
Fixing: Do not preload spec_helper, only environment. Empty preload indicates only loading of Rails environment, which still gives a significant boost.
Several months ago, the webapp memrise.com left beta and went public.
Memrise is a platform for learning facts in form of online courses. Great about that is, there is limitation in scope, you can learn:
a lot of languages (as of Chinese, Spain, English, German, ....)
So, in contrast to learning websites that only favor one particular language, here you can mix your curriculum.
Gamification
Memrise presents you the facts in a nice way and often, several users already contributed "Mems" - which is Memrise's term for a mnemonic hook.
Later, you are tested on the facts and get points for correctly remembering facts. I really like the interface for answering, which can be 100% keyboard controlled. This way, it really feels more like playing a game.
That points are only for comparing your weekly/monthly activity with your friend's on the highscore. This can be really a motivation to get started again.
Another aspect is that you can create your own private or public courses in a blink. Like, I
created some courses for learning Chinese based on my text book and a
audio-only course of a regional Chinese dialect.
So, if you ever wanted to learn Spanish, or refresh your school French, that's a nice and fun way to help with vocabulary learning.
Scrolling through most (IT) job boards, there is a unisono of almost the same job-titles, a la: "senior developer $LANGUAGE $FRAMEWORK", which is kinda boring.
Fortunatly, there are some companies that overcome the temptation to join that old story and try something new. This unique job titles are guranteed to catch a lot of attention. Here are some examples from the Stackoverflow Job board:
Ridiculously Talented Ruby Developer
Want to build the automation framework of your dreams? SDETs wanted
Kick Ass PHP Entwickler zur Festanstellung (w/m)
Software Developer For a Very Fun Very Successful Startup in the Heart of NYC
Magician iOS developer (500.co Startup)
Ruby on Rails Extraordinaire
Creator of Interesting Things (a.k.a. Senior Rails Developer)
Engineering Omnivores - Full Stack
Developer who loves great food
Ultimate Agile Development Job
iOS/Android developer Junior/middleweight
Are you a Software Engineer with passion for Open Source? We want you!
Why do Server Side Java Engineers wear glasses...?
1337 .NET Developer
Ninja Programmer
Mostly Awesome Software Engineer
Surprisingly Simple Software Developer
Everything Web Engineer Extraordinaire (EWEE)
I really like the Everything Web Engineer Extraordinaire :)
Ah, and an old classic, the Code Warrior, experiences with duct tape and WD-40. :)
Dear HR, if your company's culture fits that kind of job title, plz! There is no excuse for yet another "Software developer".
Vor ein paar Tagen haben wir ein neues Feature am
Empfehlungsbund freigeschaltet: Bewerbung und
Lebenslaufgenerierung mit sozialen Netzwerken, namentlich Xing und Linkedin.
Dabei können sich Bewerber bei der Bewerbung auf Stellen aus ITsax.de,
ITmitte.de, MINTsax.de, ... mit ihrem Xing/Linkedin-Profil bewerben. Nach
Zustimmung generieren wir on-the-fly einen Lebenslauf und füllen das
Bewerbungsformular mit den Stammdaten aus.
Das Ganze ist auch ohne eine Bewerbung möglich. Unter empfehlungsbund.de/cv kann mit einem Klick der eigene Lebenslauf angezeigt werden. (Dabei speichern wir ausdrücklich keinerlei Daten des Lebenslaufs – erst Recht nicht das PDF selbst).
Warum das Ganze?
Wer kennt das nicht? In der Bewerbungsphase ist man damit beschäftigt, seinen Lebenslauf auf den neusten Stand zu bringen, möglicherweise das Ganze noch bei XING/Linkedin zu hinterlegen und schlussendlich individuelle Anschreiben zu erstellen.
Immer mehr Leute haben einen exzellent gepflegte Profile auf XING/Linkedin. Warum also die Daten nur da lassen? Bevor man anfängt nun per Copy-und-Paste das Ganze in einen eigenen Lebenslauf zu gießen, wäre es da nicht schöner, nur mit einem Knopfdruck den Lebenslauf zu generieren? Wir denke ja, mal sehen was die Bewerber so denken :).
Umsetzung
Die Bewerbung wird durch den Empfehlungsbund, eine Ruby-on-Rails-Anwendung realisiert.
Darum konnten wir die erstklassige Rails-Bibliothek Omniauth, mit xing und
linkedin-Plugins, benutzen. Man muss den Plugins nur die anzufordernden Rechte und ggf. zu holende Daten mit übergeben:
Wie man oben sehen kann, muss man beim Linkedin-Plugin mit angeben, welche Felder man benötigt. Insbesondere volunteer und recommendations bedurfte einiger Try-and-error's, da die Dokumentation in einigen Stellen vage blieb.
Xing war da deutlich pflegeleichter, allerdings ist hier die Anmeldung einer App komplizierter, da sie bei XING einen Freischaltprozess inklusive Zusendung eines Tokens per Post beinhaltet.
Beide Plugins senden nun Ihre Daten an eine gemeinsame URL, in dem ein Adapter die verschiedenen Profilfelder in ein einheitliches Format übersetzt. Danach wird mithilfe von WickedPDF und wkhtmltopdf ein PDF generiert.
Ausblick
Dank Omniauth können natürlich auch weitere soziale Netzwerke angebunden
werden. Wir hatten das Ganze auch für Facebook probiert. Allerdings gibt es
(für Normalnutzer) keine Möglichkeit, die Telefonnummer oder Adresse aus der
API abzufragen. Damit ist das Ganze für eine Bewerbung relativ witzlos.
Außer Linkedin und XING fielen uns auch keine (im deutschen Markt agierende) soziale Netzwerke ein, die genügend Daten für einen Lebenslauf erfassen. Vielleicht wird es in ferner Zukunft ja mal einen Weibo-CV geben ... :)
Unser Fazit
Insgesamt sind wir recht zufrieden mit dem aktuellen Lebenslauf-Export. Trotz stellenweise sehr unterschiedlichen Formaten wird ein einheitliches PDF generiert. Wenn man das Ganze während einer Bewerbung verwendet, so werden ebenfalls die Stammdaten ausgefüllt.
Jetzt bleibt nur abzuwarten, wie das Ganze bei Bewerbern und Personalern ankommt. Hauptziel ist natürlich eine Verbesserung der "Application-Experience" ;).
I just wanted to install newest Ruby via RVM, but got this error:
123456
ruby-1.9.3-p374 - #configuring
ruby-1.9.3-p374 - #compiling
ruby-1.9.3-p374 - #installing
Retrieving rubygems-1.8.25
There is no checksum for 'http://production.cf.rubygems.org/rubygems/rubygems-1.8.25.tgz' or 'rubygems-1.8.25.tgz', it's not possible to validate it.
If you wish to continue with unverified download add '--verify-downloads 1' after the command.
The network storage systems of QNAP (like TS-4XX) have a logging function, which can be enabled via the interface. Then, every file access is logged to a SQLite database, located in /mnt/HDA_ROOT/.logs/conn.log on the NAS filesystem (only accessible via SSH).
Using a part of Ruby on Rails, ActiveRecord, to query data, makes this very convenient and short in code:
123456789101112131415161718192021
# model.rbraise"NeedRuby1.9.3"ifRUBY_VERSION<"1.9.3"require"sqlite3"require"active_record"classQLog<ActiveRecord::Baseself.table_name="NASLOG_CONN"self.primary_key="conn_id"# all read on real filesscope:read,->{where("conn_action = 2 and conn_res != '---'")}defself.from_user(name)where(conn_user:name)endend# "nas" is here a SSH-Alias for the ... you guess NAS`scp nas:/mnt/HDA_ROOT/.logs/conn.log /tmp/conn.log`ActiveRecord::Base.establish_connectionadapter:"sqlite3",:database=>"/tmp/conn.log"
Now, this file can be loaded into an IRB/Pry session to play with the data, e.g.:
Gerade erreichte mich per XING ein Jobangebot. Etwas anderes dieses mal, ist es doch eine kleine Challenge:
123456789101112
Hi Stefan!
Löse das Rätsel – dann schick uns deinen CV!
Tipp: Die Lösung fängt mit "ZWQu bmVs aGF6 cmFi" an und alle Strings im Array werden genau einmal verwendet.
$a = array(array('ZWQu', 'bmVs', 'd3Vv'),
array('dG5h', 'QGVt', 'aGF6'),
array('eQ==', 'cmFi') );
Interessiert? Mehr Infos gibt es auf XXXX
Interessante Idee, auch wenn mich die Stelle (PHP-Entwickler) nicht wirklich interessiert.
Die Lösung ließ mit einen kurzen Ruby-Skript nicht lange auf sich warten :).
Ein recht bekanntes und sehr leicht zuzubereitendes chinesisches Gericht ist "Fan qie chao dan", Tomaten mit Rührei. Dazu sind nur die folgenden Zutaten notwendig:
Zutaten
2 Eier je Person
3 Tomaten je Person
Öl zum Braten
Optional noch:
Kräuter
Beilage, z.B. Reis
Kochgeschirr
Pfanne
Pfannenwender
Schüssel
Vorgehen
Eier in einer Schüssel zerrühren, Salz dazugeben
Tomaten kleinschneiden. Genaues Muster ist unerheblich, da sie sowieso zerkocht werden
Pfanne mit Öl erhitzen (ca. 1-2 Esslöffel)
Wenn heiß, dann Eier reingießen.
In kurzer Zeit sollte das Ei stocken (weiß + hart werden)
Mit einem Holzgerät (a.k.a. Pfannenwender) das Ei schön kleinteilig gestalten
nach max. ca. 5 Minuten sollte sich das Ei langsam verfärben und anfangen anzubraten
dann rausnehmen (wieder in die Schüssel aus 1. geben)
In dieselbe Pfanne wieder etwas Öl gießen
geschnittene Tomaten rein
Diese sollten nach wenigen Minuten zerkochen, also pampig werden
zerkocht: Herd aus, Eier rein
Finalisierung
Wenn Kräuter da, Kräuter rein
Probieren, mglw. noch Salz rein
Schmeckt wunderbar zu Reis, kann man aber auch als einzelnes Gericht ("Snack")
genießen. Überrascht hatte mich bei diesem Gericht, wie wenig Zutaten und
Kochgeschirr notwendig sind, um ein gutes Gericht zu zaubern. Hier stellen
nicht irgendwelche fancy Gewürze oder Geschmacksverstärker die Hauptrolle,
sondern das Ei. Probier es aus!
Hacker-Rezepte Eine neue Rubrik, in der ich einfach-zuzubereitende aber
trotzdem leckere und gesunde Speisen vorstellen möchte. Das Ganze in einer
(hoffentlich) sortierten logischen Aufbereitung :)
Bitlove is a nice FOSS service, for providing an interface for downloading a lot of podcasts/vodcasts. Having a server which do nothing almost always of the time, I had the idea to mirror some of the torrents.
Deluge is the most popular server-client for bittorrenting. Installation on Ubuntu/Debian is easy, unfortunatly my Ubuntu 10.03 only included a very old version. So setting up a custom ppa:
123456
vim /etc/apt/sources.list
# deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu jaunty main
apt-get update
apt-get install deluged deluge-console deluge-web
start deluged und deluge-web
12345
deluged
# returns, starts the daemondeluge-web
# stays open
Now you can open the UI on your browser: http://host:8112. The default password is "deluge". You can change this under settings. By the way, also change the download directory to something more useful than your home directory. Also increase the number of Active Torrents.
Single torrents can be added via the UI very easily.
Bulk adding torrents
Now, deluge-console can be used to add torrents from feeds. Without a plugin, deluge cannot understand feeds (There is a plugin, but I did not found good installation instructions).
So I used ruby to filter the feed and add each item to deluge:
123456789
# maybe have to install ruby nokogiri beforeapt-get install rubygems1.9
gem1.9 install nokogiri
curl -k --silent https://bitlove.org/c3d2/ds12/feed | \ ruby -e 'require "nokogiri";puts Nokogiri.XML(STDIN).search("enclosure").map{|i|i["url"].gsub("https","http") rescue nil}.compact' | \ xargs deluge-console add
# download the feed, search for xml-nodes enclosure, get url-attribute and# replace https to http (because deluge can't handle https
Done! Now keep watching the grass on the webui :)
Potentially, add a startup script to automatically start deluged and deluge-web:
123456789101112131415
# /etc/init/deluge.conf [root@h2039658]start on (filesystem and networking) or runlevel [2345]stop on runlevel [016]exec /usr/bin/deluged -d -c /home/user/.config/deluge
# /etc/init/deluge-web.conf [root@h2039658]start on started deluge
stop on stopping deluge
exec /usr/bin/deluge-web -c /home/user/.config/deluge
# usagestart deluge