Friday, October 28, 2011

Financial Websites

This is a good list of financial websites that I use:

  • www.ycharts.com:  Provides charts, historical data, and good explanations for various terms
  • finance.yahoo.com:  Simple layout of stocks/mutual funds; good for PEG ratio and dividend history
  • moneycentral.msn.com:  Simple layout of stocks/mutual funds;  most useful info is on the front page
  • jubakpicks.com:  Jim Jubak's picks for various stocks; note that it's a free signup, but that they were stupid on the authentication and send your password as cleartext in email
  • www.fool.com:  Motley Fools website;  good source for info and pay newsletters

Monday, September 26, 2011

MySQL Add Users to Database

#
# Connect to the local database server as user root
# You will be prompted for a password.
#
mysql -h localhost -u root -p

#
# Now we see the 'mysql>' prompt and we can run
# the following to create a new database called dummydb.
#
mysql> create database dummydb;
Query OK, 1 row affected (0.00 sec)

#
# Now we create the user dummyuser and give him full
# permissions on the new database
mysql> grant CREATE,INSERT,DELETE,UPDATE,SELECT on dummydb.* to
dummyuser@localhost;
Query OK, 0 rows affected (0.00 sec) 

or

mysql> grant ALL PRIVILEGES on dummydb.* to dummyuser@localhost;
Query OK, 0 rows affected (0.00 sec) 

#
# Next we set a password for this new user
#
mysql> set password for dummyuser@localhost = password('mysecretpassword');
Query OK, 0 rows affected (0.00 sec)

#
# Cleanup and ext
mysql> flush privileges;
mysql> exit;

Monday, July 25, 2011

Let me Google that for you

Tired of answering questions that people should be Google'ing themselves?  Just go to the following website and type in your query and then send them the corresponding link.

http://lmgtfy.com/

Friday, July 22, 2011

Fixing Cisco Callmanager Replication

Cisco Callmanagers consistently have random problems with replication.  Here's what works for me.
  1.  Sacrifice a chicken and egg … never know what comes first
  2.  Ssh to your primary callmanager and your secondary callmanager
  3.  Run the following:  show perf query class "Number of Replicates Created and State of Replication"
  4.  If Replication state shows 2 on both, you should be good
  5.  If Replication state shows 3 on both, you’re jacked (proceed to step 7)
  6.  If Replication state shows 0 on either, it’s initializing … don’t jack with (proceed to step 7)
  7.  For simplicity, reboot any firewalls in between ... the cause is often either a firewall or access control list blocking traffic
  8.  Wait 10 minutes and continue to run:  show perf query class "Number of Replicates Created and State of Replication"
  9.  If the status changes to 2, you’re good
  10.  If the status doesn’t change to 2, run:  utils dbreplication reset all
  11.  Wait 10 minutes and continue to run:  show perf query class "Number of Replicates Created and State of Replication"
  12.  If this still doesn’t work, I don’t know


NOTE:  Don’t reboot the callmanagers unless the Replication state shows 2

Thursday, July 14, 2011

LDAP with AD setup on Linux

REMOVE SSSD:

If you're on RHEL 6 or CentOS 6, you should first remove sssd. 

yum remove sssd
yum remove sssd-client


LINUX SETUP:


authconfig --enableldap --enableldapauth --enablelocauthorize --ldapserver=ldapserver1,ldapserver2,ldapserver3 --ldapbasedn="ou=blah,dc=example,dc=com" --update

OR

authconfig-tui




CONFIRM NSSWITCH.CONF:


/etc/nsswitch.conf:

    passwd:     files ldap
    shadow:     files ldap
    group:      files ldap



If it reads anything other than "files ldap", you did something wrong.






FINAL CONFIGURATION:

/etc/pam_ldap.conf or /etc/ldap.conf (depending on version):
   
    host ldapserver1 ldapserver2 ldapserver3
    base ou=blah,dc=example,dc=com
    binddn username@example.com  ... this is a non-privileged user ... not an admin
    bindpw type_username's_password
    timelimit 120
    bind_timelimit 120
    bind_policy soft
   

    # RFC 2307 (AD) mappings
    nss_map_objectclass posixAccount user
    nss_map_objectclass shadowAccount user
    nss_map_attribute uid sAMAccountName
    nss_map_attribute homeDirectory unixHomeDirectory
    nss_map_attribute shadowLastChange pwdLastSet
    nss_map_objectclass posixGroup group
    nss_map_attribute uniqueMember member
    pam_login_attribute sAMAccountName
    pam_filter objectclass=User
    pam_password md5


Comment out the lines below in the file:

    uri ldap://ldapserver1/ ldap://ldapserver2/ ldap://ldapserver3/ (not needed)
    ssl no (not needed)
    tls_cacertdir /etc/openldap/cacerts (not needed)






Final note, others have edited the file /etc/sysconfig/authconfig and modified the FORCELEGACY to yes, but I didn't need to.

Tuesday, July 5, 2011

Oatmeal Raisin Cookies

INGREDIENTS

1 cup Buttered Crisco
1 cup brown sugar
1 cup white sugar
2 eggs
1 teaspoon vanilla
1 1/2 cups flour
1 teaspoon salt
1 teaspoon Arm and Hammer baking soda
1 1/2 cups Quaker Oats
1 teaspoon cinnamon
1-2 cups of raisins
1/2 teaspoon nutmeg
PAM cooking spray

RECIPE

  1. Sift one and a half cups of flour - leave in sifter
  2. Put one teaspoon of baking soda into sifter
  3. Put one teaspoon of salt into sifter
  4. Put one teaspoon of cinnamon into sifter
  5. Put a half teaspoon of nutmeg into sifter
  6. Sift everything together
  7. Put one cup of white sugar into mixing bowl
  8. Put one cup of brown sugar into mixing bowl
  9. Put one cup of Buttered Crisco into bowl
  10. Start mixer ... only white sugar, brown sugar, buttered crisco in at this point
  11. Put 2 eggs into mixer - one at a time - remove white
  12. Add mixed flour/etc. from steps 1-6
  13. Mix
  14. Add one and a half cups of Quaker Oats into mixing bowl
  15. Mix
  16. Add one teaspoon of Vanilla Extract into mixing bowl
  17. Mix
  18. Add one cup of raisins into mixing bowl (personally I'd add a cup and a half to two cups)
  19. Mix
  20. Spray cookie sheet with PAM
  21. Put cookies on cookie sheet in little balls
  22. Cook for roughly 15 minutes ... every oven is going to cook differently
  23. Take off of cookie tray while still warm

    Strawberry Cake

    INGREDIENTS
    1    box yellow cake mix
    1    box strawberry jello
    1    package frozen strawberries (12 oz.) - SAVE ½ CUP FOR ICING
    ¼    cup water
    ¾    cup Wesson vegetable oil
    4    eggs - ADD ONE AT A TIME
    3    tablespoons of flour
    1    cube melted butter
    1    box (bag) of powdered sugar (2 lbs.)
    1    PAM Spray

    CAKE MIX
    Take butterstick out and let it get soft
    Soak frozen strawberries in warm water
    Pour out yellow cake mix
    Create hole in middle of cake mix
    Pour jello in hole in middle
    Save 6oz. strawberries for icing - IN REFRIGERATOR
    Put 3 tablespoons of flour into cake mix in middle
    Put ¾ cup of Wesson oil into cake mix
    Pour in ¼ cup of water
    Use beater
    Add 6oz. strawberries
    Use beater
    Add 1 egg to mix - beat - continue until all 4 eggs are in mix
    Spray PAM on cooking pans
    Put butter into oven
    Bake as directed on cake box
    Take out butter
    Bake at 350 degrees
    CHECK COOKING OF CAKES 5 - 10 MINUTES EARLY
    Stick toothpick in - if it comes out clean, the cake is done
    Let cake cool

    ICING
    Put melted butter into a large bowl
    Add 2 cups of powdered/sifted sugar
    Sift & add 1 cup powdered sugar
    Stir
    Sift & add 1¼ cups of powdered sugar
    Stir
    Add few strawberries
    Stir
    Add few strawberries
    Stir
    Add ¾ cup of powdered/sifted sugar
    Stir
    Add rest of strawberries
    Stir
    Add ¾ cup of powdered/sifted sugar
    Stir
    Add 1 cup of powdered/sifted sugar
    Stir
    Add ¾ cup of powdered/sifted sugar
    Stir
    Add ¾ cup of powdered/sifted sugar
    Stir
    Add ¾ cup of powdered/sifted sugar
    Stir
    Add ¼ cup of powdered/sifted sugar
    Stir
    Add ¼ cup of powdered/sifted sugar
    Stir
    Add ? cup of powdered/sifted sugar
    Stir
    This should be enough sugar, but if icing is not extremely difficult to stir - add more
    Add icing AFTER CAKES HAVE COOLED
    Put icing between each layer

    From 2 lb. bag of powdered sugar, only about ½ cup is left

    Lemon Icebox Pie

    INGREDIENTS

    1 can (6 ounces) frozen lemonade concentrate - yellow
    1 tub (8 ounces) whipped topping, thawed - Cool Whip
    1 can (14 ounces) sweetened condensed milk
    1 graham cracker pie shell, purchased or homemade, 9-inch

    RECIPE

    Mix lemonade, Cool Whip, and condensed milk with mixer until all the bumps are out.
    Pour into pie crust and freeze.
    That's it!

    Tuesday, June 28, 2011

    Apache create wildcard cert and convert to Windows

    A good conversion site is:  https://www.sslshopper.com/ssl-converter.html


    Make the Apache cert:

    1.  cd /etc/httpd/conf/ssl/
    2. openssl genrsa -out wildcard.com.key 2048
      1. This generates a 2048-bit key with no password
    3. openssl req -new -key wildcard.com.key -out wildcard.com.csr
      1. Make sure your Common Name is:  *.wildcard.com
      2. Don't put a password in the extra attributes
    4. Buy the wildcard cert from a Certificate authority and use the contents of the wildcard.com.csr file to get your cert ... make sure it shows *.wildcard.com before you buy
    5. The Certificate authority will provide a zip file with the wildcard.com.crt and any intermediate certs (gd_bundle.crt)

    Create the PEM file:

    1. cat wildcard.com.key > wildcard.com.bundle.pem
    2. cat wildcard.com.crt >> wildcard.com.bundle.pem
    3. cat gd_bundle.crt >> wildcard.com.bundle.pem
    4. You now have a .pem file by the name of wildcard.com.bundle.pem

    Create a Windows usable certificate:

    1. openssl pkcs12 -export -in wildcard.com.bundle.pem -out wildcard com.bundle.p12 -name *.wildcard.com
    2. NOTE:  make sure not to put an export password
    3. You now have a wildcard.com.bundle.p12 file

    Import certificate into Windows:

    1. Login to Windows as an Administrator
    2. At the run prompt, type:  mmc
    3. File --> Add/remove add-ins
    4. Choose Certificates --> Local computer
    5. Go to the Personal --> Certificates directory
    6. Right click the Certificates directory and choose import
    7. Import the wildcard.com.bundle.p12 file (you'll need to modify the selection to see it)
    8. Mark the Certificate as Exportable
    9. Use Extended Attributes IF asked
    10. Once the import is complete, you can now go to your individual IIS sites and use the *.wildcard.com certificate