Category Archives: ruby

ruby-coding

well …. why not?

2
Filed under coding, general, perl, ruby

I’m currently thinking about writing my own blog-software. Yes, I know that there are hundreds of projects out there and some of them (like wordpress, which I currently use) are really good and have huge communities. But that’s not the point.

The reason why I’d like to do that is that wordpress is too feature-rich, too bloated for me. I don’t need 90 % of the functions it has to offer. All I want and need is a simple listing of stuff I’m currently thinking about or working at. Of course, there should be a nice interface for me to insert new articles, but I actually don’t need the ‘comment’-function. If someone wants to tell me something, he could drop me a line via e-mail too …

So, that’s why I’m thinking about creating my own blogware. It would be a nice exercise anyway. If I really complete this project I guess I’ll publish it under an open source license for anyone who wants to use or modify it for his/her needs.

The only valid measurement …

2
Filed under amusing, coding, perl, ruby

… of code quality:

I laughed very, very loud :)

introducing another script: shift-cipher

1
Filed under coding, linux, perl, ruby

I was just surfing around in my script-directory and found another gem I scripted back in February. The main purpose was to decrypt a ciphered sentence. Although it would have only taken me a couple of seconds to decrypt it, I decided that it would be even more fun to script it :P .

This is the result: shift-cipher

There is also a version available in Ruby: shift-cipher-ruby

This script should work (as usual) on any current GNU/Linux Distribution or *BSD where Perl or Ruby is installed. It deals with one line of standard input, which means that you can simply pipe the output of a command-line tool into it. An example:

ap0calypse@shu:/home/ap0calypse/scripts> echo "x adkt hwxuixcv" | shift-cipher
shift by: 1 : y belu ixyvjydw
shift by: 2 : z cfmv jyzwkzex
shift by: 3 : a dgnw kzaxlafy
shift by: 4 : b ehox labymbgz
shift by: 5 : c fipy mbczncha
shift by: 6 : d gjqz ncdaodib
shift by: 7 : e hkra odebpejc
shift by: 8 : f ilsb pefcqfkd
shift by: 9 : g jmtc qfgdrgle
shift by: 10 : h knud rgheshmf
shift by: 11 : i love shifting
shift by: 12 : j mpwf tijgujoh
shift by: 13 : k nqxg ujkhvkpi
shift by: 14 : l oryh vkliwlqj
shift by: 15 : m pszi wlmjxmrk
shift by: 16 : n qtaj xmnkynsl
shift by: 17 : o rubk ynolzotm
shift by: 18 : p svcl zopmapun
shift by: 19 : q twdm apqnbqvo
shift by: 20 : r uxen bqrocrwp
shift by: 21 : s vyfo crspdsxq
shift by: 22 : t wzgp dstqetyr
shift by: 23 : u xahq eturfuzs
shift by: 24 : v ybir fuvsgvat
shift by: 25 : w zcjs gvwthwbu

As you can see, shifting this sentence by a value of 11 really starts making sense. This is a REALLY bad way to encrypt, but hey, it is still better than nothing.

NOTE: special characters (äöüß) are NOT supported. It works with a-z.