Author Archives: mike632t

Count the number of sub-directories

Another one liner that just counts the number of sub directories. $ find ./*  -type d  | wc -l Note – Remember to use ./* if you don’t want to include the current directory itself in the total. Advertisements

Posted in Linux | Tagged | Leave a comment

List packages by install date

A handy ‘one liner’ that lists all the packages installed on a RedHat system by the install date. $ rpm -qa --qf $'%{INSTALLTIME}\t%{INSTALLTIME:date}\t%{NAME}\n' | sort -n -r -k1 | cut -f2,3 Sun 09 Jun 2019 17:26:04 BST systemd-sysv Sun 09 Jun 2019 17:26:04 BST systemd-libs Sun 09 Jun 2019 17:26:04 BST rsync   :   :   : Thu 02 Nov 2017 12:49:32 GMT bzip2-libs Thu 02 Nov 2017 12:49:13 GMT fontpackages-filesys Thu 02 Nov 2017 12:49:13 GMT basesystem $  This command uses format specifier … Continue reading

Posted in RedHat | Tagged | Leave a comment

Trouble with suspend/resume device

After restoring my laptop from a not so recent backup I found that it spent about 30 seconds waiting for the suspend/resume device.

Posted in Debian, Linux, Ubuntu | Tagged | Leave a comment

Script to set the MTU size in RedHat

The following script makes it easy to set the MTU size if you are using RedHat or CentOS 7.x, and has also been tested successfully on RedHat 6.x.

Posted in Linux, Networking, RedHat | Tagged | Leave a comment

Configure proxy settings for Git

If you are using git from behind a proxy then you will need to tell it what your proxy settings are.

Posted in Linux | Leave a comment

Determine MTU size using ping

Normally the MTU size should be set correctly using Path MTU discovery, but this may not always work.

Posted in Linux, Networking | Tagged , , , , | Leave a comment

Installing a firewall on Debian (Lenny)

OK, I do know that ‘ufw’ isn’t actually a firewall in itself but I do find it useful and as some of you may have spotted I’m still using Debian (Lenny) on my Alphaserver.

Posted in Debian, Security | Tagged , | 2 Comments

Get Debian version number

I use several different machines and while most of them run a flavour of Debian I can never remember exactly which version I’m running on which system.

Posted in Linux | Leave a comment

Listing all predefined values in GCC

If you need to check what built-in macros are already defined on the platform or version of GCC you are using you can use the following command to list all of them.

Posted in Linux | Tagged | Leave a comment

Finding the closest matching named colour in Python

I needed to work out the closest named colour to an arbitrary hex colour code – so I wrote the following script which compares the specified hex colour code to each named colour in turn to determine which one is … Continue reading

Posted in Uncategorized | Leave a comment