{"id":2155,"date":"2014-02-28T14:50:04","date_gmt":"2014-02-28T14:50:04","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=2155"},"modified":"2014-02-28T14:55:09","modified_gmt":"2014-02-28T14:55:09","slug":"wordpress-ssh-backups-jquery-week-3","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/wordpress-ssh-backups-jquery-week-3\/","title":{"rendered":"WordPress, SSH, Backups &#038; jQuery | Week #3"},"content":{"rendered":"<h3>Animated GIFs are way easier for simple screen capture<\/h3>\n<p>Until a couple weeks ago, I had been using Camtasia Studio to create simple 20 second screen captures to demonstrate a simple 4 or 5 step process.<\/p>\n<p>Then, I discovered LICEcap, which basically does the same thing, only exports to an animated GIF file. I was actually amazed at how small the files were.<\/p>\n<p>These turned out to be a great solution to create a bandwidth-friendly knowledge base, complete with short screencasts on how to accomplish various tasks.<\/p>\n<p>LICEcap:\u00a0<a href=\"http:\/\/www.cockos.com\/licecap\/\">http:\/\/www.cockos.com\/licecap\/<\/a><\/p>\n<h3>Progressive JPEGs &#8211; are you accepting them?<\/h3>\n<p>It appears that some IE browsers (I haven&#8217;t narrowed down the version), upload progressive jpegs under the MIME type\u00a0image\/pjpeg. This may be the technically correct MIME type, but it can throw off your server-side validation if you have specific MIME type checks.<\/p>\n<p>Long story short, add image\/pjpeg to your list of accepted MIME types if you have a photo upload feature on your website.<\/p>\n<h3>Putty for Windows &#8211; fix that annoying dark blue font color<\/h3>\n<p>This has irked me for years! And I finally found the time to figure out how to change it. I know many web devs that use <a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\">Putty<\/a> (it is free after all), so this will no doubt be a handy tip.<\/p>\n<ol>\n<li><strong>Change Settings -&gt; Window -&gt; Colours<\/strong><\/li>\n<li><strong><\/strong>Choose\u00a0<strong>ANSI Blue<\/strong>\u00a0in the\u00a0<strong>Select a colour<br \/>\n<\/strong>change\u00a0to\u00a0<strong>Red:80 Green:80 Blue:255<\/strong>.<\/li>\n<li>Choose<strong> ANSI Blue Bold<\/strong>\u00a0in the <strong>Select a colour<\/strong><br \/>\nchange to\u00a0<strong>Red:192 Green:192 Blue:255<\/strong>.<\/li>\n<\/ol>\n<h3>Lazy Loading Images jQuery Plugin<\/h3>\n<p>I rarely find the time to hyper-optimize any of my sites, this includes lazy loading images that aren&#8217;t seen above the fold.<\/p>\n<p>This plugin has an incredibly simple usage syntax and really takes the sweat out of lazy loading your images:<\/p>\n<p><a href=\"http:\/\/www.appelsiini.net\/projects\/lazyload\">http:\/\/www.appelsiini.net\/projects\/lazyload<\/a><\/p>\n<p><strong>Example<\/strong><\/p>\n<pre>$(function() {\r\n    $(\"img.lazy\").lazyload();\r\n});<\/pre>\n<h3>Keep it relative, WordPress<\/h3>\n<p>One of the most annoying things about WordPress development is that the &#8220;site root&#8221; is specified in the database as an absolute URL that all of your WordPress pages and posts will be relative to.<\/p>\n<p>This, naturally, does not make for easy development on a staging site, unless you setup a complete separate database (which makes sense sometimes).<\/p>\n<p>I just found this <a href=\"http:\/\/wordpress.org\/plugins\/root-relative-urls\/\">plugin<\/a>, which converts all URLs in WordPress to relative URLs. Life saver!<\/p>\n<h3>Enhancing my backup policy<\/h3>\n<p>Three weeks after helping one of my clients to restore one of their dedicated servers, I&#8217;m still shaken by it&#8217;s occurrence. To recap from last weeks post, not only did their single hard suffer mechanical failure, but all backups were corrupted from the drive being corrupted for a few days before the failure.<\/p>\n<p>This forced me to reevaluate my own backup policy. My latest addition is to FTP upload complete database backups for an entire week before they are overwritten. Example:<\/p>\n<pre class=\"prettyprint\"><code>#!\/bin\/sh\r\nUSERNAME=\"nice\"\r\nPASSWORD=\"try\"\r\nSERVER=\"someserver.com\"\r\n\r\n# local directory to pickup *.tar.gz backup file\r\nFILE=\"\/home\/backup\"\r\n\r\n# remote server directory to upload backup\r\nBACKUPDIR=\"\/mybackup\"\r\n\r\nDAYOFWEEK=\"$(date +'%A')\"\r\n\r\n# login to remote server\r\nftp -n -i $SERVER &lt;&lt;EOF\r\nuser $USERNAME $PASSWORD\r\nbinary\r\nput $FILE\/mysql.gz $BACKUPDIR\/mysql-$DAYOFWEEK.gz\r\n\r\nquit\r\nEOF<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Web developers &#8211; do you need to reevaluate your backup policy? Lazy loading images, SSH &#038; Putty tip, HTML file uploads and more in this Web Dev Week.<\/p>\n","protected":false},"author":1,"featured_media":2171,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[276],"tags":[189,280,86,128,279],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/2155"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=2155"}],"version-history":[{"count":12,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/2155\/revisions"}],"predecessor-version":[{"id":2173,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/2155\/revisions\/2173"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media\/2171"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=2155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=2155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=2155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}