perl one-liner: how to convert file or stream to upper or lower case

So you want to convert a file/stream to upper or lower case in Linux? piece of cake, there are thousands of ways to do that. Usually I leverage tr

convert to upper case:

cat filename | tr "[:lower:]" "[:upper:]"

convert to lower case:

cat filename | tr "[:upper:]" "[:lower:]"

I am sort of tired of tr and was looking for way to use perl, here is my hack:

convert to upper case:

perl -wpl -e 's/^.*$/\U$&/g;' filename

convert to lower case:

perl -wpl -e 's/^.*$/\U$&/g;' filename

It basically match anything (*) in between the beginning (^) and the end ($), substitute (/s) just the same string by applying the modifier, \L (lower case) and \U (upper case). Not necessarily easier than using tr, just an attempt with perl oneliner. Remember TMTOWTDI? Yeah, "There's more than one way to do it".

offensive security - new free metasploit online course

I just ran across this new free training course offered by offensive security, named "metasploit unleashed". You can check it out at http://www.offensive-security.com/metasploit-unleashed/

My quick glimpse at the materials are :this is a very nice set of materials, instructions are easy to follow. I have been using metasploit for a few years, and I am amazed at how much I picked up in this course. Speculation about this course will soon become non-free, and it is likely they will charge $250 USD. So, you know what to do...

Metasploit: acquired by Rapid 7

HD moore, who is a world class hacker and the lead developer of metasploit, announced this news today, metasploit has been acquired by Rapid 7. HD moore said in his email to the framework mailing list:

"Rapid7 was the right company for Metasploit for a number of reasons. First and foremost, they understand the value of the community have seen the benefits that funding a project like Metasploit can provide since our first conversation. Second, the management team at Rapid7 is made up of some brilliant folks. They may not be exploit developers, but they understand business and how to make a marriage with Metasploit increase their own bottom line without destroying the value of project in the process. Third, Rapid7 has an amazing technical staff and a solid vulnerability management product. There are only a few companies in the world that understand how much work is involved in doing vulnerability assessments right, and this team has been doing it for over 9 years. Lastly, Rapid7 has an enormous QA lab, with the ability to perform regression testing across a massive array of operating systems and patch levels. The combination of their staff and technical resources will allow the Metasploit Framework to make a huge leap ahead in the comingmonths."

While this is definitely great news for the metasploit project and HD's team, with the resources available inside Rapid 7, I am sure metasploit will go into a new stage. My personal hope is the project won't become another commercial project and continue to be the best open source vulnerability platform.

How to: Enable contact information and remove anonymous

It annoys me that drupal display anonymous as commentor's name and no persoanl info is required. I spent some time on hacking this up, here is how:

  • Go to the content type you desire to enable comments, locate comment settings and choose " Anonymous posters must leave their contact information". This will translate the comment form into a full-blown form with "Your name", "E-mail", "homepage" and
    "comment". Nice! However, your name still uses anonymous. Our goal is to get rid of it.
  • Piece of cake with jQuery. shuvuu posted a nice solution on http://drupal.org/node/240610, basically apply the following code which finds the edit-name then clear its value.
       
       

    Inject the above code into page.tpl.php, you are all set.

^ Top of Page