Thursday, August 25, 2011

my little perl script to uncomment the mirrorlist

so am a perl newbie and i want to start writing little utilities that make it easy for me to do stuff. i have just written a little script that lets me uncomment the Servers in mirrorlist contained in /etc/pacman.d/mirrorlist and its working pretty good. its not the best but hey, it works for me:

#!/usr/bin/perl
#
use strict;
use warnings;

open MIRRORS, "/home/me/mirrorlist";
my $i = 0;
while () {
if (/(Server.*)/) {
print "$1\n";
}
}
close MIRRORS;
i then ./mirrors.pl > mymirrorlist
and rankmirrors -n 6 mymirrorlist > mirrorlist
tada!

[EDIT]
this can even run better like this, i just learnt to do subs, so
#!/usr/bin/perl
#
use strict;
use warnings;

open MIRRORS, "/home/tehpwnz/perl/mirrorlist";
open MYLIST, ">/home/tehpwnz/perl/list";
my $i = 0;
while () {
#if(/[#]Server.*(http|ftp)/) {
# print "found";
#}
if (/(Server.*)/) {
s/#//;
print MYLIST;
}
}
close MIRRORS;
close MYLIST;

Wednesday, January 19, 2011

nothing like you and me...on the beach

okay so there was a time when i thot this would never happen to me, but it did.I fell for someone, her name, am not saying, but she's the most beautiful thing ever...i took her to the beach once and i had the night of my life...from different backgrounds with different interests...but still...we clicked....there's nothing like you and me..on the beach...out of reach and there never will be anything like it...EVER!!!