Category: Tech

Tech related posts.

List of Roles and Features – Windows 2012

Need a quick list of currently installed roles and features on your Windows 2012 server?  Open a PowerShell prompt and put in the following:

1
Get-WindowsFeature -ComputerName COMPUTERNAME | Where-Object InstallState -eq Installed > installed.txt

It’ll give you a list similar to this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Display Name                                            Name                       Install State
------------                                            ----                       -------------
[X] File and Storage Services                           FileAndStorage-Services        Installed
    [X] Storage Services                                Storage-Services               Installed
[X] Web Server (IIS)                                    Web-Server                     Installed
    [X] Web Server                                      Web-WebServer                  Installed
        [X] Common HTTP Features                        Web-Common-Http                Installed
            [X] Default Document                        Web-Default-Doc                Installed
            [X] Directory Browsing                      Web-Dir-Browsing               Installed
            [X] HTTP Errors                             Web-Http-Errors                Installed
            [X] Static Content                          Web-Static-Content             Installed
        [X] Health and Diagnostics                      Web-Health                     Installed
            [X] HTTP Logging                            Web-Http-Logging               Installed
        [X] Performance                                 Web-Performance                Installed
            [X] Static Content Compression              Web-Stat-Compression           Installed
        [X] Security                                    Web-Security                   Installed
            [X] Request Filtering                       Web-Filtering                  Installed
        [X] Application Development                     Web-App-Dev                    Installed
            [X] .NET Extensibility 4.5                  Web-Net-Ext45                  Installed
            [X] ASP.NET 4.5                             Web-Asp-Net45                  Installed
            [X] ISAPI Extensions                        Web-ISAPI-Ext                  Installed
            [X] ISAPI Filters                           Web-ISAPI-Filter               Installed
    [X] Management Tools                                Web-Mgmt-Tools                 Installed
        [X] IIS Management Console                      Web-Mgmt-Console               Installed
[X] .NET Framework 3.5 Features                         NET-Framework-Features         Installed
    [X] .NET Framework 3.5 (includes .NET 2.0 and 3.0)  NET-Framework-Core             Installed
[X] .NET Framework 4.5 Features                         NET-Framework-45-Fea...        Installed
    [X] .NET Framework 4.5                              NET-Framework-45-Core          Installed
    [X] ASP.NET 4.5                                     NET-Framework-45-ASPNET        Installed
    [X] WCF Services                                    NET-WCF-Services45             Installed
        [X] HTTP Activation                             NET-WCF-HTTP-Activat...        Installed
        [X] Message Queuing (MSMQ) Activation           NET-WCF-MSMQ-Activat...        Installed
        [X] Named Pipe Activation                       NET-WCF-Pipe-Activat...        Installed
        [X] TCP Activation                              NET-WCF-TCP-Activati...        Installed
        [X] TCP Port Sharing                            NET-WCF-TCP-PortShar...        Installed
[X] Enhanced Storage                                    EnhancedStorage                Installed
[X] Message Queuing                                     MSMQ                           Installed
    [X] Message Queuing Services                        MSMQ-Services                  Installed
        [X] Message Queuing Server                      MSMQ-Server                    Installed
[X] SMB 1.0/CIFS File Sharing Support                   FS-SMB1                        Installed
[X] User Interfaces and Infrastructure                  User-Interfaces-Infra          Installed
    [X] Graphical Management Tools and Infrastructure   Server-Gui-Mgmt-Infra          Installed
    [X] Server Graphical Shell                          Server-Gui-Shell               Installed
[X] Windows PowerShell                                  PowerShellRoot                 Installed
    [X] Windows PowerShell 4.0                          PowerShell                     Installed
    [X] Windows PowerShell 2.0 Engine                   PowerShell-V2                  Installed
    [X] Windows PowerShell ISE                          PowerShell-ISE                 Installed
[X] Windows Process Activation Service                  WAS                            Installed
    [X] Process Model                                   WAS-Process-Model              Installed
    [X] Configuration APIs                              WAS-Config-APIs                Installed
[X] WoW64 Support                                       WoW64-Support                  Installed

To view in the prompt rather than dumping to a txt, remove the

1
> installed.txt

Wherein the Young IT Guy becomes the Old IT Guy

I had installed and configured a trial of a web analytics package for my day job and had the server put through the wringer.  Among the issues found was a redirect buried deep in the code to cornify.com, “…the #1 unicorn and rainbow service worldwide, spreading sparkly happiness around the world.”  I added it to my list of concerns for the products developers and shipped it to them.  They responded that the cornify link was an “Easter Egg” put there by one of the coders  and wasn’t a security concern.

My immediate thought was this:  What if cornify becomes something else?  What if it stops being the #1 unicorn and rainbow service worldwide?  What if someone buys the name, or hijacks it, and it instead leads to an unsavory site?  How will you explain to your paying customers that you’re rushing out an update to the web app they’ve paid you handsomely for, and that their administrators need to burn their time updating it ASAP, because a redirect you added on a whim now points to something lawsuit inducing?  Less dramatically, and more likely, why would you want to deal with that inevitable customer  who gave you thousands of dollars for your product and doesn’t have a sense of humor?  The one who thinks it’s completely unprofessional and a poor reflection on them that your product did what you think is a lighthearted redirect?  Is being clever (and let’s be fair – it’s not all that clever) worth that risk?

And that’s when I realized I’d stopped being the Young IT Guy and I’d become the Old IT Guy.

 

WordPress and updating PHP beyond 5.3

My host finally set up the ability to upgrade PHP.  I’ve been running on 5.2 for roughly forever.  I host for clients, and most upgrades went without a hitch.  A couple, however, barfed a bit thanks to undeclared variables, generated errors the likes of:

Warning: Creating default object from empty value in \wp-content\themes\hybrid\library\functions\core.php on line 27

Thankfully, it’s a pretty easy fix: just declare the variable! for example,

1
2
if ( post_type_supports( $post->post_type, 'entry-views' ) ) {
$entry_views->post_id = get_queried_object_id();

In a library/extensions file generated a warning. To fix, I simply declared the variable $entry_views:

1
2
3
if ( post_type_supports( $post->post_type, 'entry-views' ) ) {
if (!is_object($entry_views)) {$entry_views = new stdClass; }
$entry_views->post_id = get_queried_object_id();

I had to do the same in a few other files as well.

Windows 8 – Classic Shell and the Auto Reboot Irritation

I’ve moved on to Windows 8 on my primary laptop and desktop because, well, time marches on. Microsoft did well with 7. 8, not so much. 9 will probably be better. But I have to admit that things seem peppier on 8, especially my virtualbox vms. That may just be the byproduct of a fresh build though.

Two things I absolutely have to do with a fresh 8 install are to wrest control of the UI from the poorly conceived desktop-for-a-tablet, and stop the damned thing from force rebooting after updates.

When it comes to the UI, Classic Shell is your savior. And it’s free! Can’t recommend it enough.

Stopping the auto-reboot is a simple reg hack. In the editor, head to:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU

Create the dword value NoAutoRebootWithLoggedOnUsers with a hexi value of 1. Or even easier, slap the below into a text file, rename it .reg and double click it to insert into the registry:

1
2
3
4
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]
"NoAutoRebootWithLoggedOnUsers"=dword:00000001

Toying with the SickBeard database – SQLite

I’m moving around a bunch of data managed by SickBeard because I’m running out of drive space.  While SickBeard nicely allows for mass changes, it isn’t so friendly when it comes to gleaning certain information, such as a list of shows that reside in a common path.  SQL to the rescue.

Currently SickBeard uses SQLite as its default database.  Head to SQLite’s download page and grab the appropriate copy of the command line shell (in my case, Precompiled Binaries for Windows).  Stick it in the install path for SickBeard, where sickbeard.db resides.  Because I like to be safe I made a copy of my database, which I named sickbeard_2.db, just in case I did something stupid and broke it.

In a CMD window, path to the aforementioned location and fire up SQLite:

1
SQLite3.exe

Open the database with

1
.open filename.db

01

You can list tables simply with

1
.tables

02

We’re after the information found in the tv_shows table. Want to see the columns in that table?

1
pragma table_info(tv_shows);

03

This simple query gets me what I am after, which is all the shows located in the Toons directory:

1
SELECT location, show_name FROM tv_shows WHERE location LIKE '%Toons%';

04

To dump the data to a file rather than to the screen:

1
2
3
4
.mode csv
.output FILE.csv
SELECT location, show_name FROM tv_shows WHERE location LIKE '%Toons%';
.output stdout

05

Find FILE.csv in the directory containing SQLite3 and the db.

Google Authenticator Application Passwords

I use Google Authenticator extensively, as I’m a big fan of multi-factor authentication.  In fact, I wish I could use it everywhere I’m required to input a password.

But when using it with your Google account it can get in the way of applications requiring access.  A thick mail client, for instance.  An app that publishes to YouTube.  An addon that syncs contacts.

They’ve solved this problem by allowing the creation of app specific passwords.  Works great.  But, as per usual with Google, finding the information you need can be problematic.  So, log into your Google account and head here:

https://security.google.com/settings/security/apppasswords

Windows 8.1 Clean install : We couldn’t find any drives. To get a storage driver, click Load Driver.

“We couldn’t find any drives. To get a storage driver, click Load Driver.”  That’s the message I got trying to install Windows 8.1 on a slightly used drive for my heavily used desktop.  Simply cleaning it in Diskpart solved the problem.

EDIT: LET ME CLARIFY.  Doing the following is preparing your drive for a CLEAN OS INSTALL.  This means you’re losing any data currently on the drive (technically you’re not erasing the drive, you’re just marking all the data as “gone” or “overwriteable,” so if you don’t continue and install an OS you can most likely recover it, but let’s just not go there).  Don’t do this to a drive that has data you want to keep!

  • Open an elevated CMD window
  • Diskpart
  • List disk – find the disk you want to clean
  • Select disk XX – where XX is that disk number
  • Clean

that’s it.

HP OfficeJet Pro Plus 8600 time date problems

I got this new printer/fax/scanner/toaster the other day.  It’s a cheap home version of an office multifunction copier.  So far it’s nifty enough for the price.  One giant complaint I found online is people being unable to accurately set the date/time on it, which effects time stamps for emails and faxes.  After fiddling I believe I’ve figured it out.  It is, perhaps unsurprisingly, completely unintuitive.

printerAbove is the time setup in the web config.  You can hit this with it on wireless – no need to have your computer physically plugged into the printer. Set the Current Device Time to actual GMT using the Date field and stupid drop downs for Time.   No, not the current time in your zone…. GMT.  Check the box for Use the same time zone set on this computer and Apply it. This should make the device subtract or add the correct amount of hours from the GMT setting to correctly time stamp correspondence sent from it.  When you return to this page the Current Time will continue to show GMT, not your zone’s time.  I know, I know, that’s stupid too.   An easy test to confirm things are set up correctly is to go into the scan/email set up and send a test page.