Checking your password expiration date – the foremind

While logging into one of the Linux jump boxes at work today, it occurred to me that while I recently got notified about my password expiration from our Active Directory farm, I had no idea when my Linux password would expire or what the password life was.

To find out this information you can easily use the chage command.

Here is what the output looks like:

[code language=”bash”][[email protected] ~]$ chage -l user Last password change : Apr 09, 2015 Password expires : Jul 08, 2015 Password inactive : never Account expires : never Minimum number of days between password change : 1 Maximum number of days between password change : 90 Number of days of warning before password expires : 7

[/code]

It may seem like such a simple thing to do, but knowing when your password expires can be a lifesaver on occasion.

Solaris Tip of the Week: a better du experience – the foremind

cli_img-1821214

In my day job as a Systems Engineer I frequently find myself switching between different UNIX and Linux distributions.  While many of the commands exist on both sides of the aisle, I often find vast differences in the command line parameters that can be consumed by a given command when used in, for example, Linux vs Solaris.

Recently I came upon this again with the need to easily ferret out the majority consumer of drive space on a Solaris 10 system.  While we did have the xpg4 specification support available, the du command was still missing my favorite option “max-depth”.

In Linux I use this to limit the output to only the current directory level so that I don’t have to face to possibility of wading through a tremendously large listing of sub-directories to find the largest directory in the level I am in.  Unfortunately, in Solaris, even with xpg4, the du command doesn’t have this option, so my solution was to pipe the results through egrep and use that to filter out the sub-directories.

Here is some example output from a RedHat Linux 5.11 server:

[code language=”bash” gutter=”false”]
[[email protected] var]# du -h 8.0K ./games 8.0K ./run/saslauthd 8.0K ./run/lvm 8.0K ./run/setrans 8.0K ./run/ppp 8.0K ./run/snmpd 4.0K ./run/mysqld 8.0K ./run/pm 8.0K ./run/dbus 8.0K ./run/nscd 8.0K ./run/console 8.0K ./run/sudo 8.0K ./run/netreport 176K ./run 8.0K ./yp/binding 24K ./yp 8.0K ./lib/games 8.0K ./lib/mysql 4.0K ./lib/nfs/statd/sm.bak 8.0K ./lib/nfs/statd/sm 24K ./lib/nfs/statd 8.0K ./lib/nfs/v4recovery 0 ./lib/nfs/rpc_pipefs/statd 0 ./lib/nfs/rpc_pipefs/portmap 0 ./lib/nfs/rpc_pipefs/nfs/clntf 0 ./lib/nfs/rpc_pipefs/nfs/clnt5 0 ./lib/nfs/rpc_pipefs/nfs/clnt0 0 ./lib/nfs/rpc_pipefs/nfs 0 ./lib/nfs/rpc_pipefs/mount 0 ./lib/nfs/rpc_pipefs/lockd 0 ./lib/nfs/rpc_pipefs 40K ./lib/nfs 8.0K ./lib/dhclient 8.0K ./lib/iscsi/isns

[/code]

Here is the same example ouput from the RedHat server using the max-depth option:

[code language=”bash” gutter=”false”]
[[email protected] var]# du -h –max-depth=1 8.0K ./games 176K ./run 24K ./yp 22M ./lib 32K ./empty 1.5G ./log 12K ./account 236K ./opt 24K ./db 8.0K ./nis 2.9M ./tmp 8.0K ./tmp-webmanagement 40K ./lock 8.0K ./preserve 8.0K ./racoon 16K ./lost+found 1.4M ./spool 8.0K ./net-snmp 83M ./cache 8.0K ./local 1.6G .

[/code]

Here is the command example run without my egrep mod in Solaris 10:

[code language=”bash” gutter=”false”]
[[email protected] log]# /usr/xpg4/bin/du -h 25K ./webconsole/console 26K ./webconsole 1K ./pool 1K ./swupas 2K ./ilomconfig 1K ./current/ras1_sfsuperbatchb 1K ./current/od1_atl4sfsuperbatchb 4.3G ./current/ras1_atl4sfsbatchb 2.1G ./current/od1_atl4sfsbatchb 560K ./current/avs 2K ./current/ebaps/output 9.3M ./current/ebaps 4.0M ./current/psh 3.1M ./current/autoresponder 5K ./current/fdms_download 29K ./current/fdms_server 109K ./current/fmt 5K ./current/paris/output 653K ./current/paris 1K ./current/od1_sfsuperbatchb 28K ./current/ccTemplateLoader 633K ./current/ccTemplateLoaderLegacy 15M ./current/whinvoices 1K ./current/appmonitor.prod.netsol.com 132M ./current/chase 6.6G ./current 160K ./archive/ccTemplateLoader 1K ./archive/od1_atl4sfsuperbatchb 4.9M ./archive/avs 1K ./archive/ebaps/output 26M ./archive/ebaps 881M ./archive/psh 1014M ./archive/autoresponder 1K ./archive/fdms_download 6.8M ./archive/fdms_server 21M ./archive/paris 1K ./archive/ccTemplateLoaderLegacy 4.1G ./archive/ras1_atl4sfsbatchb 3.1G ./archive/od1_atl4sfsbatchb 5.9G ./archive/chase 102M ./archive/whinvoices 15G ./archive 22G .

[/code]

And here is the improved command output using my egrep mod on the same Solaris server:

[code language=”bash” gutter=”false”]
[[email protected] log]# /usr/xpg4/bin/du -hx | egrep -v ‘.*/.*/.*’ 26K ./webconsole 1K ./pool 1K ./swupas 2K ./ilomconfig 6.6G ./current 15G ./archive 22G .

[/code]

October 2015 – the foremind

October 5, 2015 by Andrew Fore

One of the tools that I use on a regular basis to test network connectivity updates is the “z” option of netcat.  Apparently when RedHat rolled out the latest version of their distribution of RedHat Enterprise Linux (RHEL) they decided to move to using the nmap-ncat package instead of the nc package.  The command options a very different.

So when attempting to test single port like I would have under previous releases I now use the following syntax:

# echo | nc -w1 $host $port >/dev/null 2>&1 ;echo $?

If the result that is returned is a zero then you have successfully connected to the remote host on the desired port. This also applies to CentOS 7 since it is a “clone” or copyleft port of the RHEL7 binaries.

Categories Uncategorized Tags CentOS, Linux, Tips n Tricks, Uncategorized 1 Comment January 8, 2017October 4, 2015 by Andrew Fore

Editorial Note: Apparently Comcast really would prefer that people not use the term data cap when referring to the limitations being placed on their customers data usage and would much rather prefer that we use the term data usage plan or data threshold, however, I don’t really care. 🙂

Dear Comcast,

I would like to go on record as saying that you suck.  I recognize that you are a for profit company and that you would like to make a profit on the services that you provide.  I even think that having your company make a profit is a good thing because that enables you to pay your employees so that they can put food on their tables and afford to pay the fees for their children to participate in Little League baseball and other such childhood activities.

Your data usage cap system is bogus.  According to the data available on your own website you have eight (8) different trial markets where you have rolled out data caps since 2012:

  • August 1, 2012: Nashville, Tennessee – 300GB cap
  • October 1, 2012: Tucson, Arizona – 3 tiers (300GB, 350GB, 600GB)
  • August 22, 2013: Fresno, California – Economy Plus option added
  • September 1, 2013: Savannah, Georgia; Central Kentucky; Jackson, Mississippi – 300GB
  • October 1, 2013: Mobile, Alabama; Knoxville, Tennessee.
  • November 1, 2013: Huntsville, Alabama; Augusta, Georgia; Tupelo, Mississippi; Charleston, South Carolina; Memphis, Tennessee – 300GB cap
  • December 1, 2013: Atlanta, Georgia; Maine – 300GB cap
  • October 1, 2015: Fort Lauderdale, the Keys and Miami, Florida – 300GB cap plus $30 option for increasing to  unlimited

In fact, your page on this even refers to these as “trial start dates” which to a reasonably minded person would imply that they have an end date as well, however to the best of my knowledge (as well as the comments made by a customer support representative) there is no plan to end these trials OR any plan to actually collapse them into a single cohesive plan that applies to your entire service.

Read moreDear Comcast: You Suck

Categories Uncategorized Tags comcast, General, Personal, Uncategorized, usage cap 2 Comments

March 2, 2015 – the foremind

March 2, 2015 by Andrew Fore

If you are a Safari user then you are likely used to the “reader mode” which disables all the extra graphical stuff and focuses the view on the content of the article.  Thanks to a tip from Google Plus user Francois Beaufort, here’s how to enable it on the desktop (in Windows at the very least, I haven’t tried in any other OS).

If you’re on desktop, playing with it is as easy as running chrome with the –enable-dom-distiller switch. Once it’s done, you’ll notice a new “Distill page” menu item.

Hopefully this will make it to mainstream with a nice icon.

Categories Uncategorized Tags Google, Tips n Tricks, Uncategorized Leave a comment

October 5, 2015 – the foremind

October 5, 2015 by Andrew Fore

One of the tools that I use on a regular basis to test network connectivity updates is the “z” option of netcat.  Apparently when RedHat rolled out the latest version of their distribution of RedHat Enterprise Linux (RHEL) they decided to move to using the nmap-ncat package instead of the nc package.  The command options a very different.

So when attempting to test single port like I would have under previous releases I now use the following syntax:

# echo | nc -w1 $host $port >/dev/null 2>&1 ;echo $?

If the result that is returned is a zero then you have successfully connected to the remote host on the desired port. This also applies to CentOS 7 since it is a “clone” or copyleft port of the RHEL7 binaries.

Categories Uncategorized Tags CentOS, Linux, Tips n Tricks, Uncategorized 1 Comment

Sort JIRA Widget by two columns – the foremind

At work we use Atlassian JIRA as our  ticket system internally between the various teams.  I have various widget setup to watch predefined JIRA filters on my dashboard, however I wanted to be able to sort the widget content by multiple columns.

By default the filter only sorts on a single column, however you can add a second sort by using Atlassian query language syntax like so:

assignee = afore AND resolution = Unresolved ORDER BY priority DESC, updatedDate DESC

jira-filter-jql-sort_20180918_162625-8354860 example of the filter after applying the new sort order

March 18, 2015 – the foremind

January 8, 2017March 18, 2015 by Andrew Fore password-5446569

In many cases your enterprise Active Directory will not involve too many domains, in fact it is quite common for an Active Directory implementation to only include one domain.  In some cases, however, when you have the unfortunate situation of having a username in multliple domains with differing policies on password expiration it is useful to be able to know when your password, or that of another user will expire.  Here is an easy way to accomplish this from the command line.

For the current active user

[code language=”bash”] net user /domain

[/code]

For a different user

[code language=”bash”] net user /domain _username_here_

[/code]

Here is an example of the output:

[code language=”bash”] User name afore Full Name Andrew Fore Comment User’s comment Country code 000 (System Default) Account active Yes

Account expires Never

Password last set 1/29/2015 4:38:37 PM Password expires 4/29/2015 4:38:37 PM Password changeable 1/29/2015 4:38:37 PM Password required Yes

User may change password Yes

Workstations allowed All Logon script User profile Home directory

Last logon 3/18/2015 3:27:55 PM

Logon hours allowed All

Local Group Memberships Global Group memberships *VMWare Admins *Domain Users *Staff

[/code]

If you notice there is a lot of useful information regarding the user account here, but of particular interest in my situation was the value of Password expires since I was trying to ensure that I got my password reset prior to the policy setting so that I would not find myself locked out over the weekend that I went on call when the Helpdesk would be closed.

Categories Uncategorized Tags Security, Uncategorized, Windows Leave a comment

August 2016 – the foremind

January 8, 2017August 28, 2016 by Andrew Fore password-8419960

As part of the rebuild on my Plex Media Server using CentOS 7, I had intended to configure Google Authenticator but hadn’t gotten around to doing it yet.  As I got into the process recently I discovered that many of the steps that I had used when configuring my CentOS 6 Digital Ocean droplet were out of date to the point of uselessness.

I also discovered that most of the guides that I found either relied on the older 1.0 code release which was also outdated or used a unknown RPM repo.  As such I decided to write up the process that I followed to use the code downloaded from the official GitHub repository.

NOTE: If you are doing this in an enterprise setting, it is likely that your company has particular settings and restrictions that you may need to adhere to (e.g., not running things as the root user). Also, please note that all of my examples use the CentOS defaults unless specifically noted.

Read moreConfigure Google Authenticator on CentOS 7

Categories Uncategorized Tags 2FA, CentOS, Google, Security, Tips n Tricks, Uncategorized Leave a comment

October 4, 2015 – the foremind

January 8, 2017October 4, 2015 by Andrew Fore

Editorial Note: Apparently Comcast really would prefer that people not use the term data cap when referring to the limitations being placed on their customers data usage and would much rather prefer that we use the term data usage plan or data threshold, however, I don’t really care. 🙂

Dear Comcast,

I would like to go on record as saying that you suck.  I recognize that you are a for profit company and that you would like to make a profit on the services that you provide.  I even think that having your company make a profit is a good thing because that enables you to pay your employees so that they can put food on their tables and afford to pay the fees for their children to participate in Little League baseball and other such childhood activities.

Your data usage cap system is bogus.  According to the data available on your own website you have eight (8) different trial markets where you have rolled out data caps since 2012:

  • August 1, 2012: Nashville, Tennessee – 300GB cap
  • October 1, 2012: Tucson, Arizona – 3 tiers (300GB, 350GB, 600GB)
  • August 22, 2013: Fresno, California – Economy Plus option added
  • September 1, 2013: Savannah, Georgia; Central Kentucky; Jackson, Mississippi – 300GB
  • October 1, 2013: Mobile, Alabama; Knoxville, Tennessee.
  • November 1, 2013: Huntsville, Alabama; Augusta, Georgia; Tupelo, Mississippi; Charleston, South Carolina; Memphis, Tennessee – 300GB cap
  • December 1, 2013: Atlanta, Georgia; Maine – 300GB cap
  • October 1, 2015: Fort Lauderdale, the Keys and Miami, Florida – 300GB cap plus $30 option for increasing to  unlimited

In fact, your page on this even refers to these as “trial start dates” which to a reasonably minded person would imply that they have an end date as well, however to the best of my knowledge (as well as the comments made by a customer support representative) there is no plan to end these trials OR any plan to actually collapse them into a single cohesive plan that applies to your entire service.

Read moreDear Comcast: You Suck

Categories Uncategorized Tags comcast, General, Personal, Uncategorized, usage cap 2 Comments

February 2016 – the foremind

6722541653_98d7b2b922_m-6216638There is an adage that you should vote with your wallet when you are unhappy with a particular business or their practices.  Do we do this as much as we should?  Probably not.

Taking this to heart,  I have decided that I will try to apply this to the usage of my electronics and gadget stuff.  So the first thing I chose to do was to switch my domain registration from using NameCheap to using Hover.  There were several usage reasons, like support for the TOTP/HOTP system for two-factor authentication instead of relying on SMS messages.

But there are some other reasons, like the support for causes that I feel are worthwhile.  Here are just a few that Hover is a patron of:

  • She++
  • Ladies Learning Code
  • Revision Path

So if you own a domain or two, or you work somewhere that does, think about switching your registration to Hover and help support not only your account’s security but also some great organizations.

Gratuitous Recommendation Link: https://hover.com/Ems0HmPv

Full disclosure: I work at Web.com and they are the parent company of Register.com and Networksolutions.com, two really large domain registration companies, but I still prefer Hover.