Perl scripts, simple yet powerful

Am I a Hacker? is that what I am? (we’ll see to that later). Anyway, every time I need to sort something out quick, I always use Perl.

I consider myself knowledgeable enough to create any sort of scripts when it comes down to it.

One of my early introduction to Perl was when I started to work on Unix workstations, this led me to learn vi which is the best editor if you want to work fast and quick (it is somehow considered more geeky than Emacs, which, to be honest has never been my Favourite), with vi I started to write c-shell scripts, mostly to automate mundane activities such as formatting floppy disks and other things like that, basically these scripts where extensively using switches, sed, awk and other echo commands (if I can recall).

When the web started to emerge, you could indeed use c-shell scripts to create applications for it (you still can), as a matter of fact I probably did, or worked on someone’s c-shell cgi-script. However Perl was always better for that as you had far more power to do things fast. You can condense Perl commands to a one liner if you’re prepared to optimise your code. A few years ago I managed to reduce a whole lot of Perl lines to one, single command, I was dead chuffed.

Anyway in the upcoming blogs I will recall some these scripts and show how these work.

Perl is great for Unix/Linux SysAdm too!

Anyway, I have though about it, I am not a hacker, I know too little about Perl to qualify. Still can write things that help me though. Some of them are actually profitable. So my examples may probably look “lame” for most Perl Experts as I adopt quite a loose attitude to TMTOWTDI.

How to create a bootable WIN7 USB flash disk?

  1. Connect the USB drive On a Win7 Machine
  2. Partition the USB disk drive NTFS, if the disk is large (i.e. 1TB, reduce active partition to say, 6GB, I used gparted on Linux ;-p)
  3. Run DISKPART in command line
  4. LIST DISK
  5. SELECT DISK n (n is the number matching the USB disk obtained above)
  6. CLEAN
  7. CREATE PARTITION PRIMARY
  8. then copy the content of the DVD with XCOPY e:\*.* /s /e /f j: (e: = CD drive, j: = USB drive)

The power of Twitter

Twitter, for me is a new thing that I found quite challenging to understand. Being a Web veteran is sometimes hard to grasp the latest crazes. So I think that the solution from now on is to just use what’s available to its best potential and “go with the flow”.

Not only that but…

I just found out that SEO wise, Twitter can be a very very powerful way to spread something quickly to a vast number of people. Create a web page and not 5 minutes later, a large number of hosts are requesting this new page. That takes SEO to a whole new Level.