{"id":2140,"date":"2014-02-17T21:12:59","date_gmt":"2014-02-17T21:12:59","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=2140"},"modified":"2014-02-17T21:23:39","modified_gmt":"2014-02-17T21:23:39","slug":"week-2","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/week-2\/","title":{"rendered":"CSS, Hosting, Webmasters &#038; Backups | Week #2"},"content":{"rendered":"<h3>CSS Word Spacing<\/h3>\n<p>Yup, CSS has long offered a word-spacing style for those pixel-perfect designs that require non-standard word spacing. It&#8217;s been around well before CSS3, I just hadn&#8217;t taken notice of it. I had a layout that actually had a &#8220;double space&#8221; between each word in the headings. My first thought, &#8220;crap, do I really need to use non-breaking spaces in the headings?&#8221;<\/p>\n<p>Then, I decided to check out the CSS spec. To my surprise, I had found the <a href=\"http:\/\/www.w3.org\/TR\/CSS2\/text.html#propdef-word-spacing\">word-spacing style<\/a> had been right under my nose for the past 10 years!<\/p>\n<h3>Do you really need arrow graphics for sorting?<\/h3>\n<p>The answer is very commonly <strong>no<\/strong>. While I used to use the old <a href=\"http:\/\/www.sitekickr.com\/blog\/replacing-icons-css\/\">triangle border trick<\/a>, and actually wrote a post on it, I&#8217;ve recently been on an HTML character entity hunt. My most recent discovery was this little gem (up and down sorting-style arrows):<\/p>\n<pre>&amp;#9652;\u00a0&amp;#9662;<\/pre>\n<p>\u25be \u25b4<\/p>\n<h3>Is Your Hosting Environment Reliable?<\/h3>\n<p>Last week, a client of mine experienced a detrimental hardware failure. Their server&#8217;s hard drive had failed suddenly, bringing their website to a halt.<\/p>\n<p>No problem, right? Grab those backups and get back up and running within an hour.<\/p>\n<p>I wish that were the case. It appears that the hard drive had actually been slowly failing for over a week. All files that were tarred and gzipped for external backup had actually been corrupted by the failing drive.<\/p>\n<p>Typically, you&#8217;d expect to keep multiple days of backups for safe measure. However, this website (with all of it&#8217;s files) was multiple gigabytes in size.<\/p>\n<p>This unfortunately left my client no choice but to send the hard drive to a data recovery company, which ended up costing them over $3,000 for the restore.<\/p>\n<p><strong>Lesson learned:<\/strong> Don&#8217;t rely on a single-hard-drive server. Get yourself some RAID redundancy or hop on cloud hosting.<\/p>\n<h3>Dropbox Free SSL Image Hosting for Email Newsletter<\/h3>\n<p>You have got to love dropbox! Just today I had a new client request that build them a quick e-newsletter. So, in usual fashion, I do my ancient HTML4 with tables song and dance to produce a cross-email-client friendly HTML newsletter. All the while, I had forgotten that this client did not possess a means to host secure images (at an https URL). With the popularity of web-based email, which is served via https, non-secure images isn&#8217;t an option anymore.<\/p>\n<p>Through some web searches I had discovered that <a href=\"https:\/\/www.dropbox.com\/home\">dropbox <\/a>does in-fact allow hosting of secure images for public consumption. Simply drop your images in your dropbox public folder and you&#8217;re golden!<\/p>\n<h3>Webmaster Toolkit<\/h3>\n<p>Sometime last week I had need to restart Apache, only to discover that there was some instance of it that was &#8220;defunct&#8221;. Since Apache spawns multiple processes, it wasn&#8217;t easy to figure out which one was the culprit. I discovered the linux killall command and was able to quickly kill all Apache processes and start the server again.<\/p>\n<pre>killall -9 httpd<\/pre>\n<h3>A new backup policy<\/h3>\n<p>I had a backup-policy epiphany this week. <strong>Wouldn&#8217;t it be easier to restore files if they were separated by website and database?<\/strong><\/p>\n<p>Putting that thought to practice, I have implemented the following scripts to tar and gzip my web files and databases in separate files:<\/p>\n<p><strong>MySQL<\/strong><\/p>\n<pre class=\"prettyprint\"><code>for dbName in $(mysql -u backup -pPASS -e 'show databases' -s --skip-column-names);\r\ndo\r\n  mysqldump -u backup -pPASSWORD $dbName | gzip &gt; \"\/home\/backup\/db\/$dbName.sql.gz\";\r\ndone<\/code><\/pre>\n<p><strong>Web Files<\/strong><\/p>\n<pre class=\"prettyprint\"><code>cd \/var\/www\/html\r\nfor file in *; do\r\n  tar zcvf \/home\/backup\/webdir\/\"${file}\".tar.gz \"${file}\"\r\ndone<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Week #2 closes with a couple handy CSS tricks, a quick e-newsletter tip and some good nuggets of web hosting wisdom.<\/p>\n","protected":false},"author":1,"featured_media":2153,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[276],"tags":[118,90,256,141,278],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/2140"}],"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=2140"}],"version-history":[{"count":12,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/2140\/revisions"}],"predecessor-version":[{"id":2154,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/2140\/revisions\/2154"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media\/2153"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=2140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=2140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=2140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}