Author Archives: admin

TinyMCE — stripping junk when pasting from word

This will strip all annoying extra nonsense when copy/pasting from Word: tinyMCE.init({ selector: “textarea”, menubar: false, plugins: “paste”, paste_as_text : true, paste_data_images: false, paste_word_valid_elements: “”, paste_webkit_styles: “”, paste_retain_style_properties : “”, toolbar: “insertfile | bold italic | bullist numlist”, height : … Continue reading

Posted in Uncategorized | Leave a comment

Handling Errors in MYSQL Procedures with Rollback

f you have mysql stored procedure that changes database tables — you probably want to enclose the whole procedure in a single transaction and add error handling to roll back the work if anything fails. Here is how to do … Continue reading

Posted in Uncategorized | Leave a comment

Resetting the MFC brother toner end of life message

My brother MFC 9440CN printer said something like Yellow toner end of life. I knew these high capacity toners should not be out of life. It is just like the car maintenance indicator. But my printer wouldn’t print! So I … Continue reading

Posted in Uncategorized | Leave a comment

Oracle – spool sql to file with on the fly gzip compression

To run SQL dumps through gzip compression on the fly 1) Create a named pipe to destination for the sql spool using this command: mknod output.pipe p 2) run a process in the background to compress any data sent to … Continue reading

Posted in Uncategorized | Leave a comment

Using rsync to backup windows files to linux server

I set up my fathers windows PC to backup his pictures to my linux server using the following steps: Download grsync for windows from here: http://sourceforge.net/projects/grsync-win/ From Command Prompt set up “public/private key pair” cd C:\Program Files\Grsync\bin ssh-keygen Just take … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Preventing caching in php

Sometimes when you have php programs that render data from databases, after updating the data from a webpage the server will cache the results from before the update effectively showing wrong data. We found this to be especially problematic with … Continue reading

Posted in Uncategorized | Leave a comment

MYSQL DEFINER

There are issues when you use mysqldump to dump a database and it contains DEFINER=root@x.x.x.x type references. THese are typically in the create procedures or trigger statements. The dump files contain the actual machine name even though the source .sql … Continue reading

Posted in Uncategorized | Leave a comment

Stop IE from prompting for passwords on download of excel

We finally came up with a solution for the IE prompts for PIN multiple times and passwrods.   The solution turned out to be adding a Content Header  to treat the xls files as “Attachements”  — this way IE doesn’t … Continue reading

Posted in Uncategorized | Leave a comment

esxi clone disk

Command to clone a disk from an esxi VM from command line. Make sure the VM is shut down. Then you can just: cd /vmfs/volumes/Datastore mkdir NEW_VM cd SOURCE_VM vmkfstools -i source.vmdk ../NEW_VM/new_vm.vmdk  

Posted in Uncategorized | Leave a comment

Using split to break up large file into smaller pieces

You can pipe output of tar to split command to make smaller chunks that are easier to transfer. tar czv /pathtofiles | split -b 1000M -d – “test.tar.gz.” Then to untarr you can use this command: cat test.tar.gz.* | tar … Continue reading

Posted in Uncategorized | Leave a comment