Thursday, August 6, 2015

How to get a list of folders only to be used in a batch file

I have been asked a few times "How do I get a list of folder names only to be used in a windows batch file?"

There a likely several ways to accomplish this depending on your intended use but for a simple list of folders found in a particular directory you can run the command below

dir /B /A:D-H-S

This command will display a list of folder names only without any time stamps or file sizes. It will not show Hidden or System folders.
This can be used if you wanted to loop through these folders in a batch file and perform another action on each folder.

The /B switch is for "bare format"
The /A:D-H-S shows only Directories (D) and does not show Hidden(-H) or System(-S) files

You can also pipe this to a text file if you wanted as well by using

dir /B /A:D-H-S > directory-listing.txt
To read more about the dir command options you can also type the following from a windows command prompt.

dir /?

Hope this helps.

Tuesday, August 4, 2015

How to install older version of Android apps

Ran into a problem with an automatic update on my Android phone (Galaxy S5)
An update caused the app to force close on every attempt to open it.

If this has happened to you you know how frustrating it can be if you have to wait for the developer to fix and update the app again.

If you can't wait there may be an option for you to save some sanity.

Please use this at your own risk.

Android app are sent to your phone in a formate called and APK file.

There is a site called APK Mirror that has downloadable versions of many Android apps all sorted by date. It does not have every Android app but does have many of the most popular such as Facebook and Google Chrome etc...

Im my case I downloaded the prior version apk file of the app in question to my phone.

NOTE that you may need to change a setting on your phone that allows you to install apps from third parties.  As there are too many phone to give details on this you will have to search for specific instructions to enable this on your phone.  However many phone have this setting listed under SETTINGS then SECURITY.  Look for the checkbox for the setting.

Again please use this at your own risk but It Fixed it for me.

Monday, August 3, 2015

Two useful Linux commands

I came across a couple of Linux commands that I have not used before and wanted to share them in case anyone else find them useful. I used them to determin who was on a linux server as well as when the server last rebooted for troubleshooting a web server problem.

The command are 
From the man page:

       last, lastb - show listing of last logged in users

       last  [-R] [-num] [ -n num ] [-adFiowx] [ -f file ] [ -t YYYYMMDDHHMMSS
       ] [name...]  [tty...]
       lastb [-R] [-num] [ -n num ] [ -f file ] [-adFiowx] [name...]  [tty...]

       Last searches back through the file /var/log/wtmp (or the  file  desig‐
       nated  by  the -f flag) and displays a list of all users logged in (and
       out) since that file was created.  Names of  users  and  tty's  can  be
       given,  in  which  case  last will show only those entries matching the
       arguments.  Names of ttys can be abbreviated, thus last 0 is  the  same
       as last tty0.

The other is a variation of the first and shows a list of reboots on the pc or server.

last reboot
From the man page:
      The pseudo user reboot logs in each time the system is rebooted.   Thus
       last  reboot will show a log of all reboots since the log file was cre‐

Hope this helps.