An entity composed of reality and pseudo-reality. Enjoys coding, news, history, photography.
A bit of Ruby, a bit of JavaScript, a bit of love...
1.03. Approve software only if they have a well-founded belief that it is safe, meets specifications, passes appropriate tests, and does not diminish quality of life, diminish privacy or harm the environment. The ultimate effect of the work should be to the public good.
I see why no one follows this thing...
abhi 12345 21595 99 17:56 ? 00:01:00 java -client -Djruby.memory.max=500m -Djruby.stack.max=1024k -Xmx500m -Xss1024k -Djna.boot.library.path=/home/abhi/jruby/lib/native/linux-amd64:/home/abhi/jruby/lib/native/linux-i386 -Djffi.boot.library.path=/home/abhi/jruby/lib/native/i386-Linux:/home/abhi/jruby/lib/native/s390x-Linux:/home/abhi/jruby/lib/native/x86_64-Linux -Xbootclasspath/a:/home/abhi/jruby/lib/jruby.jar:/home/abhi/jruby/lib/bsf.jar -classpath /home/abhi/jruby/lib/jruby.jar:/home/abhi/jruby/lib/profile.jar: -Djruby.home=/home/abhi/jruby -Djruby.lib=/home/abhi/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main /home/abhi/crawler/webhound.rb
/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i
I use JRuby a lot more than I use MRI Ruby. I just like the Java VM a lot more. Anyways, to setup a JRuby project you need to do a few different things. Gem install activerecord-jdbc-adapter and one of these based on the database you are going to be using.
1 activerecord-jdbcderby-adapter 2 activerecord-jdbch2-adapter 3 activerecord-jdbchsqldb-adapter 4 activerecord-jdbcmssql-adapter 5 activerecord-jdbcmysql-adapter 6 activerecord-jdbcpostgresql-adapter 7 activerecord-jdbcsqlite3-adapter
Then run:
1 ./script/generate jdbcEverything else should be the same.
I needed to limit access to Redis running on port 6379 to localhost on a Linux server. Here is the code to run that. It basically disallows anyone one who is not 127.0.0.1 from access to the server.
sudo iptables -A INPUT -i eth0 ! -s 127.0.0.1 -p tcp --destination-port 6379 -j DROPThis could be generalized to other services i.e MySQL, PostgresSQL, etc. but here it is.