Those pesky CPanel backups

How to create backup of Individual cPanel Account via SSH?

Step 1: Log-in to the SSH as Root user.

Step 2: Enter the following command string on the command line interface:

/scripts/pkgacct username

[Note: The account backup will be created in the current directory you are in.]

How to Restore the Individual cPanel Account via SSH?

Step 1: To restore the cPanel account backups, enter the following command

/scripts/restorepkg username

[Note: In order to restore the data, you need to be in the directory where the backup file is stored.]

This is the easiest way to backup and restore individual cPanel web hosting accounts via command line interface.

JS for iconifying menu tiems

    $('li.menu-item.icon').each(function(){
    	var cont = $(this);
		var list = $(this).attr('class').split(/\s+/);
        var link = $(this).find('a');
        console.log(list);
        $.each(list, function(index, item) {
        	console.log(item);
            if (item.match(/fa-(.*)/)) {
                //do something
                link.addClass('fa');
                link.find('span').addClass('screen-reader-text');
                link.addClass(item);
                cont.removeClass(item);
            }
        });
	});

URL change 301 RegEx

If you do decide to get rid of dates in your permalink structure, you can add the following redirect to your .htaccess file (if you’re on Apache) to ensure that the old URL (/yyyy/mm/dd/%postname%/) points to the new one:

RedirectMatch 301 /d{4}/d{2}/d{2}/(.*) https://yoast.com/$1

For Nginx, you can use the following snippet in your site configuration:

location ~ /d{4}/d{2}/d{2}/(.*) {
rewrite ^(.*)$ https://yoast.com/$1 permanent;
}

from https://yoast.com/wordpress-seo-url-permalink/

Permissions

To change all the directories to 755 (drwxr-xr-x):

find . -type d -exec chmod 755 {} \;

To change all the files to 644 (-rw-r–r–):

find . -type f -exec chmod 644 {} \;

UL/OL with different colored bullets

  ol,ul{
    margin-left: 3.2em;
    ol,ul{
      margin-bottom: 0;
    }
  }
  ol{
    counter-reset: item; 
    li{
      list-style-type: none;
      &:before{
        margin-left: -1.2em;
        content: counter(item,decimal) ". ";
        counter-increment: item;
        color: @orange;
      }
    }
    ol{
      li{
        &:before{
          content: counter(item,lower-alpha) ". ";
        }
      }
    }
  }
  ul{    
    counter-reset: item; 
    li{
      list-style-type: none;    
      &:before{
        margin-left: -1.2em;
        margin-right: 0.5em;
        line-height: 0;
        content: "\26AB ";
        color: @orange;
      }
    }
    ul{
      li{
        &:before{
          content:"\25CB ";
        }
      }
    }
  }

Grayscale via CSS

http://thenewcode.com/532/Convert-Images-To-Black-And-White-With-CSS

tl;dr:

img.desaturate{
	-webkit-filter: grayscale(1);
	-webkit-filter: grayscale(100%);
	filter: gray;
	filter: grayscale(100%);
	filter: url(desaturate.svg#greyscale);
}

And the SVG File:

<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
	<filter id="greyscale">
	<feColorMatrix type="matrix" values="0.3333 0.3333 0.3333 0 0
		0.3333 0.3333 0.3333 0 0
		0.3333 0.3333 0.3333 0 0
		0 0 0 1 0" />
	</filter>
</svg>

Or, inline the SVG and do it all in one place:

img.desaturate {
	-webkit-filter: grayscale(100%);
	filter: grayscale(100%);
	filter: gray;
	filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale");
}

Style test page

This is a block of body copy. This block of body copy is here to give an idea of what body copy might look like with regards to texture and style. This is the primary style for the website copy, and all other copy is a variable from this style. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Just so that we have a baseline, this is what some italic text would look like inline. This is how we will style bold text. And there are rare instances where we may include both bold and italic on one element. We will also want to link some pages to other pages. I don’t know why, but some people still have a fondness for underlining content. I find this odd.

This is a content H1 tag

H1 tags are useful for SEO maintenance, but should be used very sparingly. The primary H1 tag on any page should be the title, generated by WordPress.

This is a content H2 tag

Likewise, H2 tags should be used sparingly in copy. The primary H2 tag for any page should be the subtitle and/or the site title. However, there are times when content copy hold a major import and should be drawn out both visually and for SEO.

This is a content H3 tag

This is a content H4 tag

The H3 & H4 tags are your primary ways to differentiate body copy as important without overriding the SEO goodness built by your page title and subtitle. Use with gusto and good judgement.

This is a content H5 tag
This is a content H6 tag

The last two heading types, H5 & H6 are good fall-back differentiators. Often, H5 resembles bolded content and H6 resembles plain content. Keep in mind that both are block elements (they will go on their own line) and that they are informative to SEO.

Preformatted content is rarely used except in situations of documentation. It is primarily for setting
aside things like code to be executed and/or commands to be typed. Unlike standard content, it will not
automatically "break" at a certain line length and <strong>must</strong> have explicit line breaks inserted.

Blockquotes are a great way to set very specific content out as either a “pull” from the primary content or as a quote from a specific individual. These can be useful for both hierarchical and design reasons.

– Catherine OBrien

Sometimes it is useful to create a bullet list:

  • For brief information
    • And the sub-items of that information
  • For a visual break
  • To outline basics before going more in-depth
  • For an actual list of items

Sometimes, an ordered list is more appropriate:

  1. To outline specific steps to take in process
  2. Defining items in order of importance
  3. To create an old-school content outline
    1. In which case you may have subitems
  4. As a table of contents

As you can see, there are many options to consider when styling body content in WordPress, and many options to use.

Here is an export file to use to import this page into a WordPress install so that you don’t have to write all this up. It includes some fields that are specific to my code, but otherwise, you might find it useful.

Goddamn hackers

find . -name '*.php' -print > badfile.txt
vi badfile.txt
:s%/.\//rm -f .\/

grep -H -r -l '\$sF\=' /path/to/dir/to/check/ > badfile.txt

Meteor Deploy Notes

First need an Ubuntu server

Setup with Ubuntu:

curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -

Then install with Ubuntu:

sudo apt-get install --yes nodejs

Optional: install build tools

To compile and install native addons from npm you may also need to install build tools:

apt-get install --yes build-essential

1. Installing Meteor-Up.

Meteor-Up can be easily installed with NPM. Don’t forget the

-g

to make the package global.

npm install mup

You should now be able to display every MUP command with:

mup —help

If that’s all ok, then we can init a project:

mup init