Thursday, January 17, 2013

Computer Maintenance for the "Normal" person

If you are a regular computer user, you most likely have been impacted by a computer virus and/or computer failure.  So what should you be doing to prevent that?  The two things that will help the most are keeping your computer updated and backing your computer up.

Backup is the most troubling for me personally on desktop machines.  On computers I manage at work, we use Acronis imaging software, and I am partial to that.  Of course, that software isn't free.  I now use cloud services like Google Drive and Dropbox for my personal any docs and spreadsheets I utilize outside of work, but that leaves a gaping hole for other types of data that doesn't easily fit in free cloud services.  The things I worry about are Pictures, Music, and eBooks.  For these, I manually back them up periodically, but even I have gotten burned on not remembering to do that often enough.

For software updates, there is a slightly better story.  My recommendations are mutli-pronged:

Make sure you have Windows automatic updates enabled to install new updates when needed.  Also that Microsoft Updates are checked, to update any other Microsoft products you are using.

The other major component is  Ninite allows you to select various programs and do a single silent install for all of them.  While that is pretty cool by itself, it is even cooler for updates because you just keep the installer you create and every couple of weeks doubleclick on it, it will then install any updates for those pieces of software.

The Windows Update/Ninite combination will take care of about 90+% of software updates that the normal person needs to run.

Monday, January 14, 2013

Sometimes you just need an easy way to get what your external dynamic IP address is from the commandline, possibly to utilize in a script.  I have used a variety of websites that have provided this information but today I looked at and it impressed me.  Not only does it provide some nice information in the default view, it provides alternate URLs for specific information.  Do you want your IP as plaintext, no html, well `curl`

Saturday, January 5, 2013

Wordpress JetPack Carousel Comments Cause Load

While the Wordpress Jetpack Carousel looks awesome, it just killed my site. Digging into things, the issue was caused by changing formerly static cached pages into pages that made AJAX calls to PHP to see if there were comments available.

I posted on the issues forum for Wordpress and didn't meet with much success. You can see the one response I got here.

 The AJAX calls are actually generated by javascript from the file ./wp-content/plugins/jetpack/modules/carousel/jetpack-carousel.js. The easiest way to disable comments from causing server load is to edit the file by finding the lines:
                getComments: function( args ) {
                        if ( 'object' != typeof args )
and change them to
                getComments: function( args ) {
                        if ( 'object' != typeof args )
which effectively disables the getComments function.

Friday, January 4, 2013

Bash Completion and ssh

The bash tab completions I use most are the ssh suite of completions, primarily hostname expansion. I also use other tab completions based off of the ssh suite, such as ping, telnet, etc. Hostname completion is primarily accomplished by reading the users ~/.ssh/known_hosts, but this is hampered by the current default configuration of the .ssh client, specifically hostnames are masked because the 'HashKnownHosts' option is set to yes. The default for 'HashKnownHosts' is set to yes to limit the usefulness of a compromised shell. A list of hosts that a particular use connects to can be utilized to exploit further machines that allow key based login or similar passwords. To change the default, edit ~/.ssh/config and add the following line:
HashKnownHosts no
This will not convert host entries to have plaintext hostnames, you may need to delete out entries and recreate them. To delete these individually, 'ssh-keygen' can be used:
ssh-keygen -f ~/.ssh/known_hosts -R <hostname>