Friday, July 29, 2011

Sonría, por favor

Ayer mi sobrina de cuatro años le preguntaba a su madre: "Mamá, ¿por qué la gente va por la calle enfadada? Van todos tan serios..."  Tanta sabiduría enmarcada en tan escasos años, aplastante y maravillosa en su lógica infantil que ya la quisiéramos los adultos en muchas ocasiones. Crecemos en edad, y así vamos aprendiendo a sumar preocupaciones, sarcasmo, rencor, estulticia, hipocresía, ... Y así salimos cada mañana al mundo, con la máscara de la seriedad por bandera, alienados de nuestra condición humana.  Lejos quedan los patios de juegos de nuestra infancia, adormecida la inocencia de esos primeros años donde sólo importaba el hoy y las inmensas posibilidades que nos esperaban tras cada hora. 

Solo tenemos que echar un vistazo a los plúmbeos noticiarios de cada día para comprobar lo necesario que es recuperar la sonrisa,  relacionarnos a través de ella, incorporar su magia a nuestra realiad cotidiana para acercar un poco más esa olvidada visión de la niñez. Y además todo son ventajas: es gratis, contagiosa, terapeútica y nos hace mucho más guapos a todos.

"Una sonrisa es más barata que la luz eléctrica, pero ilumina lo mismo". Abbé Pierre

Thursday, July 28, 2011

Greyhounds sufferings

FREE AT LAST

Racing days are over
Thought the pain would go away
But soon I learned a different fate
Was headed straight my way
He reached his hands into my cage
And pushed me out once more
I glanced at all my weary friends
As he led me out the door
It hurts to walk; it hurts to stand
Been through all I could endure
But all my pains are nothing that
Somebody's love could not cure
I'm pushed against a concrete wall
And know I've failed the test
He said I wasn't fast enough
And reached into his vest
I close my eyes and cower
As I shake, my senses dull
Then I feel the barrel of a gun
Against my skull
Isn't there a better way
To entertain a crowd?
But my thoughts are interrupted
By a noise so hard and loud
I'm just another failure
Racing to my final day
And sometimes all the winners
Will lose a race someday
They call it an "exciting sport"
They say that it's humane
But a sport that always ends in death
To me, is not a game

Copyright 2001 Lynn Kargol

BLOOD SPORT (A greyhound’s last words)

"I lie on my side. I am dying.
A female blue-brindle greyhound,
Living to run.
Speed was my gift from the gods.
The gift, a headlong dash to death.
Once I dreamed of running in an open field.
No muzzle, no pain, running freely.
I am in a field now.
Eighteen acres of death.
The bullet was meant for my brain.
To be a quick death. Painless.
The bullet entered my neck.
The pain rages… when will it end?
Will there be another bullet to speed my death?
No. Bullets are not to be wasted on dogs.
We were dollar signs
Hurtling down the track.
Together a flash of colors:
Brindle, blue, black, red, white, fawn.
I was too slow to last.
Too slow to make it to age two.
A throw-away life.
When death comes I will not be alone.
There are scores of us. Thousands.
Brindle, blue, black, red, white, fawn.
We, who never knew an open field,
Have found our own field.
It is soaked with our blood.
Once I dreamed of being held in someone’s arms.
Caressed, petted, loved.
All dreams are ended now in this field.
The darkness is taking me over.
Lime is thrown on my defeated, discarded body.
My heart howls out ...
Let my dying matter,
Let my dying be the last.
The light dims out.
Remember, remember, remember."

Copyright 2002 Juliet Law Packer

Taken from http://www.grey2kusaedu.org/education/poems.html

Wednesday, July 27, 2011

Windows XP schtasks command line utility

Windows XP includes a commandline admin utility named schtasks. Schtasks allows an administrator to create, delete, query, change, run and end scheduled tasks on a local or remote system.

Parameter List:

/Create : Creates a new scheduled task.

/Delete : Deletes the scheduled task(s).

/Query : Displays all scheduled tasks.

/Change : Changes the properties of scheduled task.

/Run : Runs the scheduled task immediately.

/End : Stops the currently running scheduled task.

/? : Displays this help/usage.

God Promises

Proverbs 3:5-6
New International Version (NIV)

5 Trust in the LORD with all your heart
   and lean not on your own understanding;
6 in all your ways submit to him,
   and he will make your paths straight.

Matthew 16:24-26
New International Version (NIV)

24 Then Jesus said to his disciples, “Whoever wants to be my disciple must deny themselves and take up their cross and follow me.
25 For whoever wants to save their life will lose it, but whoever loses their life for me will find it.
26 What good will it be for someone to gain the whole world, yet forfeit their soul? Or what can anyone give in exchange for their soul?

Isaiah 41:13
Romans 10:13

Phil 4:19
Psalm 121:7-8

Psalm 37:37
John 15:7

Psalm 119:9
Gal 6:9

Psalm 118:8
Eph 6:4

John 5:39
Rev 21:4

Luk 12:40
Prov 16:3

Matth 7:12
Pet 1 3:10

Psalm 40:4
Rom 6:23

Matth 6:34
Matth 5:6

Rom 5:1
Psalm 32:8

Matt 11:29
Cor 2 9:7

Prov 3:5
Matt 16:24

Luk 21:15
Deu 31:6

Jac 5:15
Isa 45:22

Tim 1 2:5
Psalm 135:6

Matthew 7:8
Matthew 5:10

Tim 2 4:7-8
Rev 3:5

Heb 12:11
John 1 5:15

Psalm 92:10
Lam 3:22-23

Num 6:26
Isa 1:18

John 3:16
Isa 40:29

Pro 10:9
Pro 28:10

John 14:6
Psalm 7:10

Rom 6:23
Psalm 40:4

John 8:36
Psalm 115:14

Psalm 18:32
1st John 2:28

Matt 7:12
1 Pet 3:10

Luk 21:15
Deut 31:6

Matt 11:28
Prov 11:24

Psalm 18:32
1 John 2:28

Psalm 37:3
Revelations 22:12

1 John 3:1
Psalm 23

Mark 10:45
Prov 10:29

Psalm 103:17
Ephes 6:3

Matthew 5:11
Matthew 7:11

Isa 59:1
John 14:27

Psalm 40:4
Rom 6:23

Isa 58:11
1 John 2:1

John 15:7
Psalm 37:37

Rev 3:20
John 5:24

Prov 4:23
Matthew 18:20

Jer 33:3
Matt 6:33

Psalm 37:25
Rev 22:21

1 John 2:17
Psalm 3:5

James 1:12
Ecles 11:1-8

Luke 12:27
Proverbs 11:21

Proverbs 11:24
Matthew 11:28

Hebrews 12;11
1 John 5:15

Isaiah 59:1
John 14:27

1 John 5:14
Hebrews 11:6

Revelations 3:12
Hebrews 8:12

2 Cor 5:21
Isaiah 51:12

Psalm 18:32
1 John 2:28

Psalm 125:1
2 Tes 3:3

1 John 2:17
Psalm 3:5

Psalm 121:7-8
Phil 4:19

Psalm 7:10
John 14:6

Deuteronomio 4:40
John 12:26

Revelations 3:5
2 Timo 7-8

Proverbs 11:24
Matthew 11:28

1 Tim 2:5
Psalm 135:6

Proverbs 3:5
Matthew 16:24

Hebrews 10:38
1 John 5:13

Ephesians 2:8
Psalm 67:1

Psalm 121 7:8
Philippians 4:19

Isaiah 51:12
2 Cor 5:21

Psalm 37:3
Revelations 22:12

Psalm 40:4
Rom 6:23

Psalm 2:8
2 Peter 3:13

1 Juan 4:12
Exodo 33:14

Matthew 6:34
Matthew 5:6

Mat 7:7
Mat 5:8

1 Tim 2:5
Porque hay un solo Dios, y un solo mediador entre Dios y los hombres, Jesucristo hombre,
Psalm 135:6
Todo lo que Jehová quiere, lo hace, En los cielos y en la tierra, en los mares y en todos los abismos.

John 14:23
Eph 5:14

Rev 3:20
John 5:24

1 John 2:28
Psalm 18:32

Mat 11:29
2 Cor 9:7

Gen 8:22
Heb 4:12

Isaiah 45:22
James 5:15

1 John 2:17
Psalm 3:5

Delete route in Fedora

route del -net 172.16.9.0 netmask 255.255.255.0 eth3

Tuesday, July 26, 2011

Using Windows Script for sending keys to an application

Open the calculator and show the About message for 3 seconds:


Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run("calc")
WScript.Sleep(100)
WshShell.AppActivate("Calculator")
WScript.Sleep(100)
WshShell.SendKeys("%H")
WScript.Sleep(500)
WshShell.SendKeys("{DOWN}")
WScript.Sleep(100)
WshShell.SendKeys("~")
WScript.Sleep(3000)
WshShell.SendKeys("{ESC}")

Close the Calculator:


Set WshShell = WScript.CreateObject("WScript.Shell")
Result = WshShell.AppActivate("Calculator")
WScript.Sleep(100)
If Result = True Then
WshShell.SendKeys "%{F4}"
End If

References:
http://technet.microsoft.com/en-us/library/ee156592.aspx
http://msdn.microsoft.com/en-us/library/8c6yea83(v=vs.85).aspx

Monday, July 25, 2011

Reading pcap files with Python

#!/usr/bin/python

import sys
import pcapy
from impacket import ImpactDecoder, ImpactPacket
import re

def main(argv):

        try:
                cap = pcapy.open_offline(argv[1])

                (header, payload) = cap.next()

                while header:
                        (seconds, micros) = header.getts()

                        # Parse the Ethernet packet
                        decoder = ImpactDecoder.EthDecoder()
                        ether = decoder.decode(payload)

                        # Parse the IP packet inside the Ethernet packet
                        iphdr = ether.child()

                        # Parse the TCP packet inside the IP packet
                        tcphdr = iphdr.child()

                        # Get the source and destination IP addresses
                        src_ip = iphdr.get_ip_src()
                        dst_ip = iphdr.get_ip_dst()

                        if tcphdr.child() <> None:
                                body = tcphdr.child().get_packet()

                                isFIX = re.match('8=FIX', body)
                                if isFIX <> None:
                                        print "%d.%06d %s" % (seconds, micros, body)

                        (header, payload) = cap.next()

        except pcapy.PcapError:
                pass

if __name__ == "__main__":
        main(sys.argv)

Wednesday, July 20, 2011

Date formatting in Perl

use Date::Format;
my $Time = time2str("%D", time());

Give something like 07/20/11

Package libtimedate-perl (in hardy, Ubuntu 8.04.3 LTS)

dpkg -S Date::Format

Sending a text file in the body of an email using Perl

In Perl there is a package called Mail::Sendmail that could be used to send a simple text message.

The package for the module is libtimedate-perl (in hardy, Ubuntu 8.04.3 LTS)

dpkg -S Mail::Sendmail

#!/usr/bin/perl

use strict;
use warnings;

use Mail::Sendmail;

# Read the file into a string to put it into the mail hash variable
open FH, 'file.txt' or
        die "Error reading file.txt file: $!\n";
my @Lines = ;
chomp @Lines;
close FH;
my $Lines = join "\n", @Lines;

my $Recipients = 'somebody@mail.example';

my $Subject = 'Testing mail in Perl';

my %mail = (
        To => $Recipients,
        From => 'testing@mail.example',
        Subject => $Subject,
        Message => $Lines
);

$mail{Smtp} = 'mail.example';

if (sendmail %mail) {
        print "Mail sent OK.\n"
} else {
        print "Error sending mail: $Mail::Sendmail::error \n"
}

print "\n\$Mail::Sendmail::log says:\n", $Mail::Sendmail::log;

__END__

Wednesday, July 13, 2011

Yum groups and repositories

Yum supports the group commands
  • grouplist
  • groupinfo
  • groupinstall
  • groupremove
  • groupupdate
Groups are read from the "group" xml metadata that is optionally available from each repository. If yum has no repositories which support groups then none of the group operations will work.
  • grouplist
    yum grouplist [hidden]
    
This will list the installed and available groups for your system in two separate lists. If you pass the optional 'hidden' argument then all of the groups which are set to 'no' in the group xml tag.
  • groupinfo
    yum groupinfo groupname
    
This will give you detailed information for each group including: description, mandatory, default and optional packages.
  • groupinstall, groupupdate
    yum groupinstall groupname
         yum groupupdate groupname
    
Despite their differing names both of these commands perform the same function. They will attempt to install/update all of the packages in the group that are of the types 'default' or 'mandatory' (by default). (To change this types of packages edit the value of the group_package_types option in yum.conf.) And they will install any additional dependencies needed by any of the installing/updating packages.
  • groupremove
    yum groupremove groupname
    
This will remove all packages, of any type, in the named group. It will also remove any package that depends on any of these packages.