Monday, November 16, 2015

Camtasia Studio Evaluation Extension Hack

Don't you hate it when you need to record screens and you find that your Camtasia Studio 8 screen capture tool has expired.  Grant yourself another 30 days by using this old registry hack.  Applies to Camtasia Studio 8, Tested with CS 8.5.  We wrote a great blog entry about how to do this on our main website.  Happy Hacking!

  • Start Menu --> Run --> regedit.exe
  • Go to  HKEY_LOCAL_MACHINE ------>  SOFTWARE ------- >Classes ------- > dromjmfile
  • The "dromjmfile" contains a REG_SZ value such as 7e5d0812
  • Delete the "dromjmfile" key.
  • Make new empty "dromjmfile" key.
  • Start camtasia Studio.
This is what you will see if you have done it right

The dromjfile registry key.  must be empty to start 30 day trial
If you want to use Camtasia Studio 9, our Islamic friend "Jihadi Johnson" has shared some registry info:
Copy the code.

[RegistrationInfo]
ValidationData3=1
RegistrationKey=BBCUVUVDRCM8C5SCHMX72M3A5
RegisteredTo=YR-Invasion
ValidationData1=V7L+Ex2/T==OV:BE
ValidationData2=1


This is a registry key that is created after activation. You just need to insert it.

Friday, October 23, 2015

Mozilla Firefox Full Download for Offline Installation

Where Can I Download Old Versions of FireFox


Get the Most Current Versions
https://www.mozilla.org/en-US/firefox/all/

Download Past Versions
https://ftp.mozilla.org/pub/firefox/releases/

A Very Stable Enterprise ESR Version
https://ftp.mozilla.org/pub/firefox/releases/52.5.0esr/win64/en-US/

If you see this message:  "Gah. Your Tab Just Crashed" You may need to use the ESR version.

Sunday, August 2, 2015

Magento Cookbook - Teaching Old Dogs New Tricks, Easy Hacks to Make Magento Work Right

Magento Tricks and Hacks For Developers

In this posting, we will show you some cool and interesting hacks for developers.  These all require SSH access and R/W access to the Magento PHP code.  We have been developing custom templates and shopping carts and this is how we do it.   Magento pricing for standard carts is available here.

1) Dump Session Variables into your Magento 1column view (Magento 1.9 Trick) Put this into your 1-column phtml template file.
...
<div class="col-main">
      <pre> <?php var_dump($_SESSION); ?> </pre>
      <?php echo $this->getChildHtml('global_messages') ?>
      <?php echo $this->getChildHtml('content') ?>
</div>

...
...
<pre> <?php var_dump($_SESSION["checkout"]); ?> </pre>
<hr>
<pre> <?php var_dump($_SESSION["core"]["messages"]); ?> </pre>
<hr>
<pre> <?php var_dump($_SESSION); ?> </pre>
<hr>
<?php
   $session =  Mage::getSingleton("core/session"); 

   var_dump($session);
   Mage::register('messages_collection', 
     Mage::getSingleton('adminhtml/session')->getMessages(true));
    $_messages = Mage::registry('messages_collection');
    $_messages = $_messages->getItems();
    $_messagesData = array();
        foreach ($_messages as $_message) {
        $_messagesData[] = array(
          'type' => $_message->getType(),
          'text' => $_message->getText()
        );
        echo $_message->getText();
    }
?>


2) The following is a cheap work-around hack to fix Magento's broken user feedback mechanism.  Getting the checkout and shopping cart messages out and showing them. Use this with Magento 1.9 and it's broken messaging system.  getGroupedHTML() does not work at all, furthermore  $this->getChildHtml ('global_messages') does not work either.

<hr>
<?php echo $this->getMessagesBlock()->getGroupedHtml(); ?>
<hr>
<pre> <?php var_dump($_SESSION["checkout"]); ?> </pre>
<hr>
<pre> <?php var_dump($_SESSION["checkout"]["messages"]); ?> </pre>
<hr>
<?php
      $mess = new Mage_Core_Model_Message_Collection;
      $msgobj = new Mage_Core_Model_Message_Collection();
      $msgobj = $_SESSION["checkout"]["messages"];
      $lastmsg= $msgobj->getLastAddedMessage();
      echo var_dump($lastmsg);
      echo $lastmsg->getCode();
?>

Output looks like this, and is purely for debugging:
object(Mage_Core_Model_Message_Error)#90 (6) { ["_type":protected]=> string(5) "error" ["_code":protected]=> string(33) "Coupon code "ppppp" is not valid." ["_class":protected]=> string(0) "" ["_method":protected]=> string(0) "" ["_identifier":protected]=> NULL ["_isSticky":protected]=> bool(false) } Coupon code "ppppp" is not valid.


Tuesday, July 28, 2015

Rename a Microsoft CRM 2011 Server and it's MSSQL Server

Step1: Edit the MS CRM Config Registry

Step A: Change this registry key
HKLM\SOFTWARE\MICROSOFT\MSCRM\configdb
change:
Data Source=VCRM1;Initial Catalog=MSCRM_CONFIG;Integrated Security=SSPI
to:
Data Source=VCRM2;Initial Catalog=MSCRM_CONFIG;Integrated Security=SSPI

Step B: Change this other registry key
HKLM\SOFTWARE\MICROSOFT\MSCRM\ServerUrl
change:
http://VCRM1/MSCRMServices
to:
http://VCRM2/MSCRMServices

Step 2: Edit the MSCONFIG database ( example VCRM1 to VCRM4 )
use MSCRM_CONFIG;
update dbo.Server set name='VCRM4' where NAME='VCRM1';
update dbo.ConfigSettings set HelpServerUrl='http://VCRM4/' where HelpServerUrl='http://VCRM1/';
update dbo.DeploymentProperties set NVarCharColumn='http://VCRM4.homeslice.net:80' where NVarCharColumn LIKE '%VCRM1:80';
update dbo.Organization set ConnectionString='Data Source=VCRM4;Initial Catalog=HomesliceInsurance_MSCRM;Connection Timeout=60;Integrated Security=SSPI';
update dbo.Organization set SrsUrl='http://VCRM4/reportserver' where SrsUrl='http://VCRM1/reportserver';
update dbo.Organization set SqlServerName='VCRM4';
go



Sunday, July 26, 2015

Bourne Shell Cookbook

Bourne Shell Scripting Cookbook for the masses
1) Numeric for loop
#!/bin/bash
N=10
for (( c=$N; c>0; c-- ))
do
    echo "Counting $c times"
done

Friday, July 10, 2015

Debricking the Western Digital Mybook Live - with a new WD Red Disk

Sometimes it happens, your Western Digital Mybook Live dies and you are left with a blinking blue/green light.  Perhaps it's internal hard disk is making the famous click of death sound.  Rebuild it by purchasing a new 3TB WD Red Drive. Here's how to prepare the new disk, using Ubuntu linux.  I have copied the highlights of the famous debrick script.  Remove the disk from the WD MBL housing, and toss into a landfill or drop into your favourite ocean. Insert new disk in your favourite desktop PC's SATA port, boot with Ubuntu USB drive, and then prepare the new WD disk using these steps.

You should boot from a Live CD or Live bootable USB, so that your disk is /dev/sda.
Assuming that your new disk is /dev/sda

parted /dev/sda --align optimal <<EOP
mklabel gpt
mkpart primary 528M  2576M
mkpart primary 2576M 4624M
mkpart primary 16M 528M
mkpart primary 4624M -1M
set 1 raid on
set 2 raid on
quit
EOP
sync

reboot 

...
mdadm --create /dev/md0 --verbose --metadata=0.9 --raid-devices=2 --level=raid1 --run /dev/sda1 missing
mdadm /dev/md0 --add --verbose /dev/sda2
mdadm --wait /dev/md0
sync
mkdir /mnt/raid1
mount /dev/md0 /mnt/raid1

umount /mnt/raid1
dd if=firmware/rootfs_010507.img of=/dev/md0
mount /mnt/raid1
cp /mnt/raid1/usr/local/share/bootmd0.scr /mnt/raid1/boot/boot.scr
more /mnt/raid1/etc/nas/service_startup/ssh
echo "enabled" > /mnt/raid1/etc/nas/service_startup/ssh
 


mdadm --stop /dev/md0
/root/swap.x /dev/sda1
/root/swap.x /dev/sda2


sync

 

At this point, you may insert the new WD back into the original WD Live chassis.

The Live edition has an onboard JTAG and UART port. Until now I don't know the pinout of the JTAG so be warned to overwrite data in the NAND.
The Pinout of the UART Port "J8" is as follows:
Pin 1 = +3.3V
Pin 2 = URX
Pin 3 = UTX
Pin 4 = GND
Warning: do not connect directly to a serial Port, you will need a ttl level shifter like the "Max233" or "FT232R". Otherwise you risk to break the hardware.
wd_mybook_live_UART.jpg
The UART Port will give you access to the console and during the booting to U-boot.
You will be able to change U-boot parameters, this will allow you to boot anything you want.
I would recommand that you backup the parameters before playing arround.
Baudrate is configured to: 115200
http://mybookworld.wikidot.com/wd-mybook-live-uart

Thursday, July 2, 2015

The WMI Cookbook

WMI Filters to Select Computers to which to apply group policy:

Target Win 7 32 bit machines:
select * from Win32_OperatingSystem WHERE Version like "6.1%" AND ProductType="1" AND NOT OSArchitecture = "64-bit"

Target Win 7 64Bit machines:
select * from Win32_OperatingSystem WHERE Version like "6.1%" AND ProductType="1" AND OSArchitecture = "64-bit"

Target any 32 bit OS;
SELECT AddressWidth FROM Win32_Processor WHERE AddressWidth ='32'

Target any 64Bit OS:
SELECT AddressWidth FROM Win32_Processor WHERE AddressWidth ='64'

Sunday, June 28, 2015

The processing of Group Policy failed: One way to fix it

Group Policy Replication Errors

C:\Users\Biff>gpupdate /force
Updating Policy...

User Policy update has completed successfully.
Computer policy could not be updated successfully. The following errors were encountered:

The processing of Group Policy failed. Windows attempted to read the file \\homeslice.net\SysVol\homeslice.net\Policies\{2B44EB00-32DD-42E3-8C83-9B6C6CA6D
6D6}\gpt.ini from a domain controller and was not successful. Group Policy settings may not be applied until this event is resolved. This issue may be transient and could be caused by one or more of the following:
a) Name Resolution/Network Connectivity to the current domain controller.
b) File Replication Service Latency (a file created on another domain controller
 has not replicated to the current domain controller).
c) The Distributed File System (DFS) client has been disabled.

To diagnose the failure, review the event log or run GPRESULT /H GPReport.html from the command line to access information about Group Policy results.


To fix:  on the domain controllers of your windows domain, perform these steps:
1) Check network connectivity to all domain controllers, turn off IPV6 if neccessary, perform nslookup of each DC and make sure each can be found by their IPV4 addresses
2) Check time settings of each DC, if running a virtualilzed environment, make sure all VM hosts are connected to NTP and are able to reach pool.ntp.org

repadmin /syncall
to perform a syncronization...

repadmin /replsummary

... output from repadmin /replsummary
Destination DSA     largest delta    fails/total %%   error
 PDC1                       :22s    0 /  12    0
 BDC1                01h:41m:12s    9 /  16   56  (2148074274) The target principal name is incorrect.
 BDC2                01h:53m:53s    9 /  16   56  (2148074274) The target principal name is incorrect.
 VMS-DC1           58d.02h:35m:57s    9 /   9  100  (5) Access is denied.

If you see the following message "The target principal name is incorrect." Then you may need to reset your machine passwords on your domain controllers.  First step is to disable and turn off KDC.
On the domain controller, disable the Kerberos Key Distribution Center service (KDC).
the reboot, after rebooting, use the netdom command to reset the password, then renable to KDC, then reboot.

netdom resetpwd /server:server_name /userd:domain_name\administrator /passwordd:administrator_password

for example: ( for a DC called DC1 on a domain called homeslice, where the Administrator password was Sn00pD0g&Cat  You will need to quote your password in double quotes, if you have non alpha in it.
on a cmd.exe dos prompt:

netdom resetpwd /server:DC1 /userd:homeslice\administrator /passwordd:"Sn00pD0g&Cat"
output looks like: 

The machine account password for the local machine has been successfully reset.
The command completed successfully.


Thursday, June 25, 2015

tcpdump cookbook

Use the tcpdump command on linux to monitor network traffic. Here are some of my favourite recipies for tcpdump success.

1) Monitor web service traffic on an apache server. given that your server has an eth0 network port. If your web client device is at 192.168.99.10, this following command will monitor all traffic from that device that enter eth0 on port 80.

tcpdump -i eth0 -vvv tcp port 80 and src 192.168.99.10

Options:  -vvv       Verbose dump of network headers
                -i           network interface selector
                -A         Display all cleartext packet details. (optional)



Tuesday, June 16, 2015

Suddenly it happens ... OWA error Rights management operation failed it says...

Suddenly it happens, you start seeing this message in your exchange 2010 OWA

When they try to open an e-mail with outlook web acces. They get the following error message Rights management operation failed.

OWA error Rights management operation failed

Ouch! What to do?

Open exchange powershell
 First step is to figure out that IRM is enabled in your exchange 2010
Next step is to figure out what your identity is: in this case the full identit is EXCHANGE2010\owa (Default Web Site)
Final step is to turn off the doggone IRM!
 Using the identity located in step 2.
 
1. Log on to the exchange server and open (as Administrator) the Exchange Management Shell (EMS)
2. Run "Get-OWAVirtualDirectory | FL" and search for IRM; you'll probably see that it's enabled.
3. Run "Set-OWAVirtualDirectory -IRMEnabled $false"
or you could provide the name of the identity using the -Identity "<identity goes here>"
for example:
[PS] C:\Windows\system32>Set-OWAVirtualDirectory -IRMEnabled $false -Identity "EX2010\owa (Default Web Site)"
[PS] C:\Windows\system32>


4. visit owa (Default Web Site) in your IE
Now reset IIS and try OWA again.

Wednesday, May 6, 2015

Shoretel IP Phone Mute Codes

Shoretel Mute Codes

Below are a list of the "Mute" Codes for Shoretel IP Phones.  These codes will perform some common Shoretel tasks without physically power cycling the phone.  On IP210 and IP230 phones, press the mute button, then enter the code, then press the # key. On the IP655 and newer phones, press the * key, then code, then # key.

Note: If you have a G series shoretel phone such as a IP655 or IP480G and you see the message "no ethernet" on your screen, it usually means that you have connected the phone to a 10/100 network, and these phones do not work on 10/100 networks, only gigabit ethernet will do.

To Clear Cached Values<Mute> + CLEAR (25327) #
To Reset A Phone
<Mute> + RESET (73728) #  RESET may also be 73738
To Enter Setup
<Mute> + SETUP (73887) #
View Current Configuration Settings
<Mute> + INFO (4636) #
Ping From Phone
<Mute> + PING (7464) #
Factory Reset A Phone
<Mute> + RRAMOS (772667) #       *this will prompt you to enter 1234 as the password before reset.
Diag Phone
Press the Mute key followed by DIAG (3424) # 

About Eleven Dimensions Technologies

Eleven Dimensions Technologies is a Shoretel dealer, installer and servicer in Southern California.  We sell pre-owned/grey-market parts and software from systems that have been pulled out of service, we also sell pre-owned licences at a discount, we can sell system licences with a matching ethernet card as well as component licenses such as softphone and workgroup supervisor or any other kind of license.  We have retired and obsoleted many systems over the years and replaced with them with cloud hosted voip systems or have bought out shoretel systems from closed out businesses.  We will also help you with system tuning such as voicemail to email, or you can read the instructions below.  Furthermore, we have developed a custom reporting application that will blow the socks off anything that Shoretel or its partners have built.  Don't waste your money on new equipment, when you can get perfectly good refurbished equipment, software and licences at a fraction of the price. See our great story on shoretel history.

Sunday, May 3, 2015

Exchange 2010 Public Folders Will Not Mount

You see this message in the Windows Application Log:
(PID 7644, Thread 26) Task Mount-Database writing error when processing record of index 0. Error: System.InvalidOperationException: Couldn't mount the database that you specified. Specified database: Public Folder Database 1998117930; Error code: An Active Manager operation failed. Error: The database action failed. Error: Operation failed with message: MapiExceptionJetErrorMissingLogFile: Unable to mount database. (hr=0x80004005, ec=-528)
 [Database: Public Folder Database 1998117930, Server: Exchange2010.homeslice.net]. ---> Microsoft.Exchange.Cluster.Replay.AmDbActionWrapperException: An Active Manager operation failed. Error: The database action failed. Error: Operation failed with message: MapiExceptionJetErrorMissingLogFile: Unable to mount database. (hr=0x80004005, ec=-528)
 ---> Microsoft.Exchange.Data.Storage.AmOperationFailedException: An Active Manager operation failed. Error: Operation failed with message: MapiExceptionJetErrorMissingLogFile: Unable to mount database. (hr=0x80004005, ec=-528)
 ---> Microsoft.Mapi.MapiExceptionJetErrorMissingLogFile: MapiExceptionJetErrorMissingLogFile: Unable to mount database. (hr=0x80004005, ec=-528)
And find that you cannot mount the public folders anymore. Do'h.  Conclusion is that your public folders are shot, and you need to rebuild them from scratch.  You can try running eseutil to recover them, or you could use eseutil to replay the logs. None of that will work out in the end. My Advice: rebuild them from scratch, by deleteting the .EDB file and the log files, remounting and allowing exchange to create new fresh databases.
My Solution:
– Dismounted the public folder database, if already mounted,
– Renamed/moved its files (ebd+log) - move public folder's .EDB files and .Log files to another folder
– Mount the database, in the exchange console and answer “yes” to the recreate warning.
– Use Stellar Pheonix Exchange Mailbox Recovery to open the former public folder .EDB file, and then convert the contents to .PST file, then finally copy the contents back into public folders using Outlook.






Wednesday, March 11, 2015

MySQL Database Cookbook

-- MYSQL Cookbook. Make databases and tables, create a user, set his password
-- the password shown here "PutYourFavePasswordHere" should be changed to your
-- preferred password, before running these scripts.
-- Instructions:
-- SSH into your MYsql server or open a dos prompt on your server
-- use this command to logon to mysql as the root user:   mysql -u root -p
-- Copy & paste these scriptlets into the window, or save them to a file, and use
-- this command to run them:  source afile.sql;
-- that's all.
--
-- MAKE A DATABASE FOR MAGENTO CE EDITION

DROP database magento_ce;
CREATE DATABASE magento_ce;
USE magento_ce;
GRANT ALL ON magento_ce.* TO magentosql@localhost IDENTIFIED BY 'PutYourFavePasswordHere';
FLUSH PRIVILEGES;


-- ADD AN ISAM TABLE FOR STORE LOCATIONS 

CREATE TABLE IF NOT EXISTS `location` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`lat` varchar(256) NOT NULL,
`lan` varchar(256) NOT NULL,
`name` varchar(128) NOT NULL,
PRIMARY KEY (`id`) )
ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;


-- CREATE A DATABASE FOR FRANCHISE MANAGEMENT STUFF 

drop database franchise_management;
create database franchise_management;
use franchise_management;
GRANT ALL ON franchise_management.* TO drs@localhost IDENTIFIED BY 'PutYourFavePasswordHere';
GRANT ALL ON franchise_management.* TO amirul@localhost IDENTIFIED BY 'PutYourFavePasswordHere';
FLUSH PRIVILEGES;

--
-- Table structure for table `storelocations`
--
 

DROP TABLE IF EXISTS `storelocations`;
CREATE TABLE `storelocations` (
  `id` int(10) NOT NULL auto_increment,
  `region` varchar(32) NOT NULL,
  `locationstr` varchar(128) NOT NULL,
  `latitude` float default NULL,
  `longitude` float default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=329 DEFAULT CHARSET=utf8 COMMENT='Store Locations Table';

-- MAKE A DATABASE FOR MAGENTO CE EDITION

DROP database sonarqube;
CREATE DATABASE sonarqube;
USE sonarqube;
GRANT ALL ON sonarqube.* TO sonar@localhost IDENTIFIED BY 'PutYourFavePasswordHere';
FLUSH PRIVILEGES;


Sunday, February 15, 2015

My Silly Quotes and Stupid Jokes Collection

--------------------- Feb 15, 2015 -------------------------------
My Building Permit:
Some have asked what I've been doing in retirement.
Well, I applied for a building permit for a new house.
It was going to be 100 ft tall and 400 ft wide,
With 12 gun turrets at various heights, and windows
All over the place and a loud outside entertainment sound system.
It would have parking for 200 cars, and I was going to paint it
Snot green with pink trim. The City Council told me
“Forget it...AIN'T GONNA HAPPEN!”
So, I sent in the application again, but this time I called it a "Mosque."
Work starts on Monday. And here is the best part, it's going to be tax exempt! I love this country.
It’s the government that scares the shit out of me.


-------------------- Feb 23, 2015 --------------------------------
We had a guy walking his Magellanic penguin down the side walk in town.   When the police chief saw him, he told him not to walk the penguin there, but take it to the zoo.  The next day the police chief sees the guy walking his penguin down the same side walk.   The chief stops and yells at the guy: “I told you yesterday to take that penguin to the zoo!” The guy said: “I did.   Today we are going to the park to watch the Little League games.  ” 

-------------------- Feb 23, 2015 --------------------------------
man and a dog walk into a bar.   man asks bartender for a beer.   bartender says can't have animals in here.  man says i'm blind,and this is my seeing eye dog, bartender says o.k.  then that is acceptable.  man takes his beer and takes a seat at a table.  few minutes later,another guy and his dog walk into the bar.  and as they are walking past the first man,the first man whispers .  to the second man.  .  they don't allow dogs in here, but if you tell him you are blind, and that is your seeing eye dog, he'll let you stay; second man says thanks and walks up to the bar and orders a beer.  bartender says no animals allowed in the bar, second man says but I am blind and this is my seeing eye dog.  bartender says since when did they start training Chihuahuas to to be seeing eye dogs? second man says, "they gave me a Chihuahua? " 

--------------------- March 6, 2015 ------------------------------
Jesus can walk on water
Cucumbers are 98% water
I can walk on cucumbers
Therfore, i am 98% Jesus.

Jesus can walk on water
Ice is 100% water
I can walk on ice
Therefore, i am 100% Jesus
 

-------------------- May 11, 2015 --------------------------------
Want some more Palindrome Sentences
1. Sir, I demand, I am a maid named Iris
2. Noel sees Leon
3. Too hot to hoot
4. Sex at noon taxes
5. Stella won no wallets
6. Dennis sinned
7. Senile felines
8. Was it a bar or a bat I saw?
9. Eva, can I stab bats in a cave?
10. Step on no pets !


----------------------- August 18, 2015 -------------------------------------------------


India has made huge strides in space exploration.,
However The Peoples Republic of North Korea, under the Dear Leader Kim Jung Un, has already topped India's achievement, with the first manned landing on the Sun.
Utilizing the massive two stage Brilliant Flash rocket, they have achieved what western scientists said could not be done.
Though not without it's difficulties, the pilot Noh Not Mi, had to swerve to avoid several large solar flares, to find a place where he could land the final stage of the huge rocket.
A grainy video of Mr. Mi, was beamed back to Earth, and it clearly shows, Pilot Mi, standing on the surface of the moon, applying a generous amount of sunscreen, and roasting a chicken.
Upon his triumphant return, Pilot Mi, standing alongside Chairman/President Un, was asked questions by the North Korean Truthful News, anchor, Li, Un. Shu " Mr. Mi, members of the western press have said that you did not land on the sun and return, what do you say?"
Mr. Mi responded that, "while it was warm, because of the Deal Leader's great insight, our scientists realized the one factor every other scientist in the western world, had not realized".
"It would be foolish to attempt to land on the Sun, with it's blazing mid day heat", so he decided that we would land at night.
It is that kind of forward thinking that will keep the PRNC at the top of the scientific community.
Thanks for your patience
opj
---------------------------------------------------------------------
Sept 9, 2015
Observations from the older generation:
There are two sides to every divorce: Yours and dipshit's.
The closest I ever got to a 4.0 in college was my blood alcohol content.
I live in my own little world, but it's OK. Everyone knows me here.
I saw a very large woman wearing a sweatshirt with "Guess" on it. I said, "Left Tackle?”
I don't do drugs. I find I get the same effect just by standing up really fast.
I don't like political jokes. I've seen too many get elected.
The most precious thing we have is life, yet it has absolutely no trade-in value.
If life deals you lemons, make lemonade. If life deals you tomatoes, make Bloody Mary’s.
Shopping tip: You can get shoes for a buck at bowling alleys.
Every day I beat my previous record of consecutive days I've stayed alive.
No one ever says, "It's only a game!" when their team's winning.
Ever notice that people who spend money on beer, cigarettes and lottery tickets are always complaining about being broke and not feeling well?
Isn't having a smoking section in a restaurant like having a peeing section in a swimming pool?
Marriage changes passion . . . suddenly you're in bed with a relative.
Why is it that most nudists are people you don't want to see naked?
Snowmen fall from Heaven unassembled.
Now that food has replaced sex in my life, I can't even get into my own pants.
I signed up for an exercise class and was told to wear loose fitting clothing. If I HAD any loose fitting clothing, I wouldn't need the freakin' class!
Don't argue with an idiot; people watching may not be able to tell the difference.
Wouldn't you know it! Brain cells come and brain cells go, but FAT cells live forever.
Why is it that our children can't read a Bible in school, but they can in prison?

----- 7-October 2015 ----
A small zoo in North Carolina obtained a very rare species of gorilla. Within a few weeks the gorilla, a female, became very difficult to handle. Upon examination, the veterinarian determined the problem. The gorilla was in heat. To make matters worse, there was no male gorilla available.
Thinking about their problem, the Zoo Keeper thought of Bobby Lee Walton, a redneck part-time worker responsible for cleaning the animal cages. Bobby Lee, like most rednecks, had little sense but possessed ample ability to satisfy a female of any species. The Zoo Keeper thought they might have a solution.
Bobby Lee was approached with a proposition. Would he be willing to mate with the gorilla for $500.00? Bobby Lee showed some interest, but said he would have to think the matter over carefully. The following day, he announced that he would accept their offer, but only under five conditions:
"First" , Bobby Lee said, "I ain't gonna kiss her on the lips.” The Keeper quickly agreed to this condition.
"Second" , he said, "She must wear a 'Dale Earnhardt Forever' T-Shirt.” The keeper again readily agreed to this condition.
"Third" , he said, "you can't never tell nobody about this." The keeper again readily agreed to this condition.
"Fourth" , Bobby Lee said, "I want all the children raised Southern Baptist." Once again it was agreed.
And last ," Bobby Lee said, "I'm gonna need another week to come up with the $500.00.
Don't you just love Red Necks?

Thursday, February 5, 2015

The Magento Cookbook and Tricks Bag

Stupid tricks that you can do using PHP in the Magento CE backend:

1) Search the Product Catalog
function getProductIdsBySearch($searchstring, $storeId = '') {
     $ids = array();     

     // Code to Search Product by $searchstring and get Product IDs
     $product_collection = Mage::getResourceModel('catalog/product_collection')
        ->addAttributeToSelect('*')
        ->addAttributeToFilter('name', array('like' => '%'.$searchstring.'%'))
        ->load();

     foreach ($product_collection as $product) {
         $ids[] = $product->getId();
     }
    //return array of product ids
    return $ids;
}
Magento 1.7+ Source: StackOverflow


2) Find an image in a product

3) Automatic Color Swatches for Products with different colors, each being their own product
Search the product catalog for items with the exact same name, find the image called 'swatch' then show the color swatches in a little div in the product page. Put this code in your theme's view.phtml page:
in:  "./app/design/frontend/default/<theme folder>/template/catalog/product/view.phtml"
If you have multiple products called "Panties" and each are a different color, and each has an image called "swatch" which is a color swatch, then this code would locate all of the swatches.

<?php
      $ids = array();
      $swatches = array();
      $urls = array();
      $titles = array();
      $searchstring=$_product->getMetaTitle();
      $product_collection = Mage::getResourceModel('catalog/product_collection')
          ->addAttributeToSelect('*')
          ->addAttributeToFilter('name', array('like' => '%'.$searchstring.'%'))
          ->load();
      echo "\n<!-- SWATCH FIND RESULTS \n";
      echo $_product->getMetaTitle();
      echo "\n";
      foreach ($product_collection as $product) {
          echo "Found Item: ".$product->getName()."\n";
          echo "MetaTitle: ".$product->getMetaTitle()."\n";
          echo "ID: ".$product->getId()." ";
          echo "URL: ".$product->getProductUrl()."\n";
          $_xprod = Mage::getModel('catalog/product')->load($product->getId());
          echo "\n";
          foreach ($_xprod->getMediaGalleryImages() as $_image) {
               echo $_image->getLabel()."\n";
               echo $_image->getUrl()."\n";
               echo "\n";
               if ((preg_match("/swatch/i", $_image->getLabel())) &&
                   ($searchstring == $product->getMetaTitle())) {
                    $swatches[] = $_image->getUrl();
                    $urls[] = $product->getProductUrl();
                    $titles[] = $product->getName();
               }
          }
          $ids[] = $product->getId();
   }
   echo "There are: ".count($ids);
   echo "-->\n";
?>


Using the results of the above code: in the same view.phtml file: "./app/design/frontend/default/<theme folder>/template/catalog/product/view.phtml"

<div class="swatch-box">
     <ul>
     <?php
        for ($ix=0; $ix<count($swatches); $ix++) {
             echo "<li><a href=\"".$urls[$ix]."\"><img src=\"".$swatches[$ix]."\" height=\"32\" title=\"".$titles[$ix]."\"></a></li>\n";
        }
     ?>
     </ul>
</div>

Source: blog

4) Store a Hidden Gallery in your Magento Product Pages, and use it in your jquery code to quickly retreive hidden images.

<div class="hidden-gallery" id="hidden-gallery1" style="display:none;">
    <?php foreach ($this->getGalleryImages() as $_image): ?>
        <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()); ?>"
           title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"
           alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>">
    <?php endforeach; ?>
</div>


Be Careful with Magento

There are many hacks out there.
https://www.exploit-db.com/exploits/37977

Friday, January 16, 2015

Avocent DSR 4020 Configuration Guide - Using the Serial Port like a boss

How to Configure The Avocent DSR 4020

The Avocent DSR 4020 is a legacy/old skool keyboard video, mouse (KVM) server with a network management interface, and a DB9 serial port based management interface. It has 16 ports.  The bank of RJ45 jacks on the back are NOT network jacks, instead you need to use DSIQ dongles to connect them to video and USB ports on your servers.   You can also get DSIQ dongles with PS/2 connectors.  Both network and serial interfaces can be used to configure the KVM.  The serial interface is a closely guarded secret.  If you bought a used KVM from ebay, you can use Serial to reset and wipe out the password.  The Avocent manuals do not explain this port.  We will explain how to use it.  If you need assistance with your Avocent, call us, we can help.
Rear ports of the Avocent DSR 4020
The serial port is located above the modem port on the DSR 4020.  Connect a straight thru serial cable to it, it has a male DB9 connector.  Open Le Putty, and create a new connection profile for COM1, if you have a COM1, make it a serial connection, and set the baud rate at 9600.  Hit connect.

DSR 4020 Serial interface
When connected, startup the DSR, and you will see this screen in putty.  You may configure the network interface here. The screen below is what you will see.
DSR Automatic Network Settings
When configured for DHCP, your DHCP server will assign the network address.

This tech tidbit was brought to you by your Southern California IT pros at Eleven Dimensions Technologies.  See our new website for more tech tidbits.   See our tech blogs too.

Tuesday, January 6, 2015

MSSQL+CRM2011 FUD: The instance name must be the same as computer name

while installing MS CRM 2011 or 2013 you get this stupid message and all activtiy grinds to a halt:

"The instance name must be the same as computer name"

it happened because you took a virtual machine template and cloned it, and renamed it, and then started to use it immediately without any consideration of the SQL server within.

You have to rename the MSSQL server.

use these commands one by one: in the master database

to query the binds 
SELECT @@Servername

to drop the invalid name 
Sp_dropserver 'OLD_SERVERNAME'

to add the correct machine name 
Sp_addserver 'ACTUAL_MACHINE_NAME',local 

These command are case sensitive, so be careful.  Finally, restart the MSSQL services, and close and reopen the MSSQL studio.
This KB tidbit applies to MSSQL 2008 R2 Enterprise, Windows Server 2008, MS CRM 2011