• For multi-homed VMs secondary interfaces (ones for which the default gateway is not defined) can only be accessed on the same network. This is because the return packets will be sent out via the default gateway.

    The following script is based off this article: http://serverfault.com/questions/584374/reply-on-the-same-interface-as-incoming-with-dnated-ip

    Please note that these rules could cause a security issue on your server and assume that you have some level of firewall protection either via the local iptables rules or at a network layer.

     

    Script:

    #!/bin/bash

    # the first interface
    iface_int1=eth0

    # the second interface
    iface_int2=eth2

    # the IP of the second internal iface
    ip_int2=`ifconfig $iface_int2 | grep addr: | cut -d: -f2 | awk ‘{print $1}’`

    # the IP of the first internal iface
    ip_int1=`ifconfig $iface_int1 | grep addr: | cut -d: -f2 | awk ‘{print $1}’`

    # the netmask of the second interface
    netmask_int2=`ifconfig $iface_int2 | grep addr: | cut -d: -f4`

    # the IP of the default gateway for the second internal iface
    # assume gateway is the first host on the network.
    ip_gw2=`ipcalc -n $ip_int2 $netmask_int2 | cut -d= -f2 | sed ‘s/0$/1/’`
    iptables -t nat -A PREROUTING -i $iface_int2 -d $ip_int2 -j DNAT –to $ip_int1
    iptables -t mangle -A OUTPUT -m conntrack –ctstate DNAT –ctorigdst $ip_int2 -j MARK –set-mark 0x75

    ip rule add prio 10 fwmark 0x75 table 100

    ip route add default via $ip_gw2 table 100

    grep -q “^net.ipv4.conf.$iface_int2.rp_filter=2” /etc/sysctl.conf || echo “net.ipv4.conf.$iface_int2.rp_filter=2” >> /etc/sysctl.conf
    sysctl -p >/dev/null 2>&1

  • Linux 22.03.2016 No Comments

    /bin/bash /sbin/dracut –force –add-drivers vmxnet3 vmw_pvscsi vmxnet /boot/initramfs-2.6.32-504.36.1.el6.x86_64.img 2.6.32-504.36.1.el6.x86_64

  • HEADS UP 09.03.2016 No Comments

    Often we get work orders in .doc and .docx files, but wish to parse out the text from tables without having to open each one manually and copy/paste.

    A solution I’ve found is to save the document files as ‘.doc’, then transfer them to my linux destop and run ‘antiword’ on them. Works very well. It will format the output of tables with each cell surrounded by the pipe “|” symbol.

    On ubuntu you can just ‘apt-get install antiword’ otherwise a google search finds it easily.

  • HEADS UP, Solaris 03.09.2015 Comments Off on Get Primary LDOM from withing Guest LDOM

    virtinfo -a

     

  • Spiritual 11.03.2015 Comments Off on My love song to my two boys.

    This is one of my favorite songs. It describes so eloquently the love of a father for his children. I’ve heard it said that we should prepare our children for the road not prepare the road for our children. As much as I love my two boys with every fiber of my being, they will come upon difficult times. “Just hold my hand, and I’ll lead you home” and “I am right here, just call out my name” are the assurances I wish for them to have that my love and presence will help in difficult times. Assurance that the waters will not sweep over, nor the fire consume them.

    I’m unsure of the author, but this song is on the BJU Singers and Orchestra CD “Beyond All Praising”. Here is a link to that CD.

    Be not afraid, for I have redeemed you.
    Be not afraid, I’ve called you by name.
    My love for you is everlasting,
    My love for you shall have no end.
    When you pass through the waters, I will surround you.
    When you pass through the floods, they will not sweep o’er.
    When you walk through the fire, you will not be consumed.
    You are my child, You are my child, you are so precious to me.

    Be not afraid, for I have redeemed you.
    Be not afraid, I’ve called you by name.
    My love for you is everlasting,
    My love for you shall have no end.
    When you pass through the waters, I will surround you.
    When you pass through the floods, they will not sweep o’er.
    When you walk through the fire, you will not be consumed.
    You are my child, You are my child, you are so precious to me.

    You are my child, and I’ll love you always.
    Just hold my hand, and I’ll lead you home.
    When you feel lost, always remember:
    I am right here, just call out my name.

    When you pass through the waters, I will surround you.
    When you pass through the floods, they will not sweep o’er.
    When you walk through the fire, you will not be consumed.
    You are my child, You are my child, you are so precious to me.

  • Enterprise Manager 30.01.2015 Comments Off on How to rename the LVM volume group for a root disk on RHEL6 systems.


    # change these as necessary
    CURRNAME='system'
    NEWNAME='systemvg'

    cd /boot/grub
    /bin/cp -f grub.conf grub.conf.before_vgrename
    perl -i -pe ‘s/=${CURRNAME}/=${NEWNAME}/g’ grub.conf
    perl -i -pe ‘s//${CURRNAME}-//${NEWNAME}-/g’ grub.conf

    cd /etc/
    /bin/cp -f fstab fstab.before_vgrename
    perl -i -pe ‘s//${CURRNAME}-//${NEWNAME}-/g’ fstab

    cd /boot

    dracut -f initrd-$(uname -r).img $(uname -r)
    vgrename ${CURRNAME} ${NEWNAME}

    reboot

  • Spiritual 24.11.2014 Comments Off on Come to the Light!

    An amazing song of invitation to the believer to enjoy the presence of our Lord. A video of the presentation is on youtube here

     Like a sunrise slowly spreading
    to illumine all the sky,
    Comes the Christ into the shadows
    Of a world condemned to die.
    Great the light that shines in darkness,
    Gracious Dayspring after night:
    Christ the Gospel truth revealing;
    Drawing sinners to the Light.

    Darkened soul, behold His glory;
    Blinded eyes recieve your sight.
    Sinner, leave your seat of darkness;
    Rise and come to the Light!
    Rise and come to the Light!

    Like the dawn that follows starlight
    Christ fulfills the prophets’ word.
    Ancient promises shine clearly
    In the person of our Lord.
    Pure the radiance of His glory,
    Like the cloudless light of day,
    Christ, the hearts of men exposing,
    Bids us wash our sins away.

    Darkened soul, behold his glory;
    Blinded eyes recieve your sight.
    Sinner, leave your seat of darkness;
    Rise and come to the Light!
    Rise and come to the Light!

    Like the sun that beams at noonday,
    Shedding warmeth with every ray,
    Christ invites us to embrace Him,
    In his love forever stay.
    Bright the promise for the future:
    Oh what joy he had to give!
    Kindness for eternal age
    Come into the Light and live!

    Darkened Soul, behold His glory,
    Blinded eyes recieve your sight.
    Sinner, leave your seat of darkness;
    Rise and come to the Light!
    Rise and come to the Light!
    Come to the Light!

  • HEADS UP 26.09.2014 Comments Off on

    This scriptlet will extract RAC logs for a specific date and hour. There are bunches of these logs, so this can come in handy

    export LOG_LOC=/some/where # set this to the clusterware loggin point

    TMPDIR=`mktemp -d /tmp/raclogs.XXXX`

    cd $LOG_LOC

    for i in `find . -type d -maxdepth 1`; do cd $i; file=`ls -tar|grep log|tail -1`; if [ -f $file ]; then egrep -A2 ‘2014-09-25.17:‘ $file > $TMP_DIR/$file; fi; cd $LOG_LOC; done

  • Stuff 01.09.2014 Comments Off on

    This weekend we took a road trip. Somehow the conversation got around to deer and we began making up funny riddles having to do with deer.

    Here are some of the best (or worst, depending on your taste):

    . What is the leader of a pack of young deer called? MudDEER

    . What is the leader of a pack of grown deer called? CommanDEER

    . The US military has trained a special deer to be aboard their long range bombers. What is it called? BombaDEER.

    . What do you call a deer with no eyes? No IDEER

    . What was the car driven by the first deer ever to get a drivers license? HonDEER

    . A special deer was selected to pioneer the raising of cattle by wild deer. What is its name? MOO DEER

    . What happens to deer when they watch sad movies? They get all DEERy eyed

    . Why did Thomas Edison move into Menlo Park? He wanted to get more big IDEERS

    There were quite a few others, but too horrible to mention!

  • Enterprise Manager 29.07.2014 Comments Off on Calculating how much space to add to a volume to reach a certain target percentage useage.

    How much space do you need to add to a 750G NFS volume which is 73% utilized to bring its use percentage down to 65%?

     

    Hmm. You could do trial and error, but I was faced with this problem for about a dozen shares. Some simple math (which I managed to make difficult for myself) provides the following formula:

    ( [Current Size]*[Current Percent Used] – [Current Size]*[Target Percent Used]  ) / [Target Percent Used]

     

    Perform the subtration first.

     

 
WP_Modern_Notepad

Recent Comments