using find to get newer files into single tar

Use this:

find . -type f  -newer /last_time_file -print0 | tar -czvf backup.tar.gz -T – –null

It will:

deal with files with spaces, newlines, leading dashes, and other funniness
handle an unlimited number of files
won’t repeatedly overwrite your backup.tar.gz like using tar -c with xargs will do when you have a large number of files

Posted in Uncategorized | Leave a comment

closing jquery dialogs

We had problems with IE page minimizing when we called xajax server functions from dialogs that sent commands to close the dialogs.

To fix it I changed the way we sent the script to close the dialog from:

$(‘#notice_message’).dialog(‘close’);

with

$(‘#notice_message’).dialog(‘destroy’).remove();

Posted in Uncategorized | Leave a comment

Cross Cert Removal

If you get errors when clients are trying to access PKI restricted web pages similar to this:

[Thu Mar 14 09:19:58 2013] [error] [client 72.73.17.34] Certificate Verification: Error (20): unable to get local issuer certificate

It usually means a windows update has messed up the certificate chain in your internet explorer.

You can see this by going to

Tools -> Internet Options -> Content Tab
Certificates Button.

Select your certificate

Click View Button

Then Click Certificate Path Tab

IF this shows 6 entries — or more than 3 — this is causing your problem.

To fix it:
Run the attached program:
FBCA_crosscert_remover_v106.exe

Restart your browser and check to see that you now only have 3 entries in the train.

unclassified_fbca_crosscert_remover_v106

Posted in Uncategorized | Tagged | Leave a comment

Using Fading Div tag messages to show ajax call results without requiring click.

We use xajax calls to server functions to update databases or insert records from a web page. Usually when they finish they return javascript to close the dialog or div tag and show an alert — this can be maddening if you are trying to add a lot of data and have to click to acknowledge the alert each time.

So this solution works well to give visual confirmation that doesn’t require clicking.

// Normal close dialog and remove edit form div

$objResponse->script(” $(‘#edit_item’).dialog(‘close’);”);
$objResponse->remove(‘edit_item’);

 

// Replace table with new updated values and call jquery data table to make look good

$objResponse->assign(“table_content_div”,”innerHTML”, “$html”);
$objResponse->script(“$(‘#item_table’).dataTable( {
bJQueryUI: true,
bAutoWidth: false,
aoColumns: [{‘sWidth’:’10%’},{‘sWidth’:’30%’},{‘sWidth’:’60%’}],
sScrollY: ‘400px’,
bSort: false,
bScrollCollapse: true,
bProcessing: true,
bDeferRender: true,
iDisplayLength: ‘-1’,
aLengthMenu: [[10, 25, 50, 100, 500, -1], [10, 25, 50, 100, 500, ‘All’]]
}); “);

 

// create div tag with message

$objResponse->create(‘table_content_div’,’div’,’done_message’);
$html = “\”Save Save Complete”;
$objResponse->assign(‘done_message’,’innerHTML’,”$html”);

// jquery dialog
$objResponse->script(” $(‘#done_message’).dialog({
width: 300,
height: 100,
modal:true,
resizable: false,
draggable: false,
dialogClass: ‘done_message’
});”);
$objResponse->script(” $(‘#done_message’).closest(‘.ui-dialog’).find(‘.ui-dialog-titlebar’).hide();”);

 

// Fade away WITHOUT requiring a click — adjust numbers to effect speed
$objResponse->script( “setTimeout(function(){ $(‘#done_message’).fadeOut(300, function(){ $(this).remove();});}, 500);  “);

 

That’s It.

Posted in Uncategorized | Tagged , | Leave a comment

Security Invoker for MYSQL views

When moving mysql databases between machines. It is best if all stored procedures, functions, and views need to have the following line after their create statement:

DEFINER=CURRENT_USER SQL SECURITY INVOKER

Example:

CREATE OR REPLACE
DEFINER=CURRENT_USER SQL SECURITY INVOKER
VIEW
MYVIEW ( A, B, C) as select a,b,c from table

Posted in Uncategorized | Leave a comment

Using Handbrake to convert / combine videos from Samsung camcorder

I wanted to combine my snippets of video shot on our family vacation into one file for easy viewing on my mythtv frontend.

I tried to use mkvmerge, but it gave errors because of the heading / encodings.  so only the 1st video was visible when playing it back — the later files appended were blank.

I did a little testing with files converting them with handbrake re-encoding them and then it combined them nicely.  Files are also a little smaller after encoding too!
So here is the process.

  1. Put all the files in one directory.
  2. Open handbrake — Click Source button and choose the directory — it will scan the directory and list add all the files to the drop down.
  3. Select a different directory for the out put and click add all to queue from the menu (Queue -> Add all to Queue )
  4. Then open the queue and click start.

 

After they are all encoded, go into mkvmerge and click add to add the first file.  Then click append button and select other files.

 

Posted in Uncategorized | Leave a comment

success dialog message w/ xajax that fades away

Xajax:

   $objResponse->create(“content”, “div”, “done_message”);

$html = “\”Save Save Complete”;

$objResponse->assign(‘done_message’, ‘innerHTML’, “$html”);

$objResponse->script(” $(‘#done_message’).dialog({

width: 300, height: 130, modal:true, resizable: false, draggable: false, dialogClass: ‘done_message’ });

“);

$objResponse->script(” $(‘#done_message’).closest(‘.ui-dialog’).find(‘.ui-dialog-titlebar’).hide();”);

$objResponse->script( “setTimeout(function(){ $(‘#done_message’).fadeOut(300, function(){ $(this).remove();});}, 500);  “);

 

 

CSS:

.done_message {

text-align: center;

font-size: 15pt;

font-weight:bold;

}

Posted in Uncategorized | Leave a comment

Installing handbrake on ubuntu 12.04

This is what I did to install handbrake on ubuntu 12.04

sudo apt-add-repository ppa:stebbins/handbrake-snapshots

sudo apt-get update

sudo apt-get install handbrake-gtk

 

 

Posted in Uncategorized | Leave a comment

turning off greylisting with Plesk

Tried this command tonight to turn off greylisting.  Hopefully other spam filters will catch most spam so this will allow legitimate email through.

/usr/local/psa/bin/grey_listing --update-server -status off

To find info on greylisting use this:

/usr/local/psa/bin/grey_listing --info-server

Posted in Uncategorized | Leave a comment

plesk perl / cgi scripts — permissions!!!

This is a good instruction i found for pemissions

Directory permissions and ownership are important too.

The /var/log/httpd/suexec_log  is the place to look when regular error_log doesn’t show anything…

 

Firstly, make sure you upload the script into the cgi-bin in ASCII mode. This is a problem more oftern then you can imagine. chmod 755 the script. Check permissions are USERID:psacln (the directory should be USERID:psaserv). Of course check that the site has CGI support ticked. You can also verify the syntax of the script by running “perl -c SCRIPTNAME.CGI” and it should report syntax ok.
If you’re still having problems then check the logs. Check /home/httpd/vhosts/DOMAIN/statistics/logs/error_log (some installs my use /var/www/ as opposed to the plesk standard /home/httpd/vhosts) and look for errors. This log file will usually show the error message on the screen. You may also need to check /var/log/httpd/error_log. If you still don’t see the problem then check /var/log/httpd/suexec.log for any

Finally, check the correct suexec version is being used. do an “ls -la /usr/sbin/suexec” and compare that to /usr/local/psa/suexec/psa-suexec. If they are different then make a backup copy of /usr/sbin/suexec to something like /usr/sbin/suexec.orig. then either copy or make a symlink of /usr/local/psa/suexec/psa-suexec into the /usr/sbin directory.

Hopefully this has been helpful.

Posted in Uncategorized | Leave a comment