Search This Blog


Windows 10 Hardware Temperature Monitoring Tools

Tool to monitor temperature of hardware components in Windows 10

Open Hardware Monitor - portable open source version of hwmonitor

Core Temp - more CPU measurement features


Terminal Ping Sweep

Result: List of IP addresses that respond to ping on the specified prefix
  1. Modify the prefix variable as necessary, and paste into terminal
  2. prefix="192.168.0."
  3. Copy and Paste the rest of the following script into the terminal application
  4. for i in {1..100}
            ping -c1 -W1 -i0.2 $prefix$i > /dev/null
            if [ $? -eq 0 ]
                    echo $prefix$i


Windows cmd ping sweep

Instead of installing a third party application which has the possibility to have spyware or other bad stuff in it. If you only need to do a ping sweep with no additional features it's probably easier just to do it in CMD.
  1. Open up cmd
  2. Run the following
  3. for /L %z in (1,1,254) do @ping 10.0.0.%z -w 10 -n 1 | find "Reply"


  • (1,1,254) indicates to test every address from 1-254
  • 10.0.0. is the network address prefix of addresses you want to test
  • %z is filled in with numbers from (1,1,254)
  • -w 10 - only waits 10ms before moving on
  • -n 1 - only tries once before moving on
  • find "Reply" looks for a succesful ping result and ignores unsuccessful


Scheduling Internet Speed Tests on Synology

SSH into the synology device

Download the following script to whichever directory you like


Allow execute permissions

chmod +x

Create a scheduled task via "Task Scheduler" section in control panel
Run Command should look similar to the following

/bin/python /path_to_script/

For some reason the output doesn't appear in the task scheduler window when the full output is displayed

However, the results are appearing properly in the email notification and when I reduce the amount of output by modifying the script a bit it displays properly as well
python --no-download --simple

You can automatically log the output of any script to a file as well in Task Scheduler.
This can be done by going to the Task Scheduler app, Settings, enabling output recording, and specifying a directory to store output.



Clean Console Log Output

To remove colour codes and redraw characters from console to make console logs more readable.

#!/usr/bin/env perl
while (<>) {
s/ \e[ #%()*+\-.\/]. |
(?:\e\[|\x9b) [ -?]* [@-~] | # CSI ... Cmd
(?:\e\]|\x9d) .*? (?:\e\\|[\a\x9c]) | # OSC ... (ST|BEL)
(?:\e[P^_]|[\x90\x9e\x9f]) .*? (?:\e\\|\x9c) | # (DCS|PM|APC) ... ST
\e.|[\x80-\x9f] //xg;


less /path/to/console.log | cleanLog | less


Limiting Bandwidth Using Robocopy

Robocopy does not have any built in bandwidth limiter by rate specifically.

But what you can do is use the inner packet gap switch /ipg:n to simulate a lower bandwidth by adding more delay between packets.

The equation to use to calculate is as follows:

D is the calculated latency or inner packet gap
Bd is the desired bandwidth you would like to transfer at
Ba is the available bandwidth to you

If my
Bd is 200kbps
Ba is 1000kbps


Therefore my /ipg:n will be /ipg:2048



Sourcing Files in Bash

I never quite understood why when you changed .bashrc you had to type the source command in order to make changes active.

Now I understand and it's fairly straight forward.

Your current bash environment is defined by a PID that can be found using

echo $$

Any newly spawned bash processes for scripts will fork off of that process and be given a new process ID.

All variables for that newly spawned process will be local to that newly forked process.

If you would like the variables that would typically be local to your forked script to be active in your current shell you can use the source command in order to make them local to your current shell.

This acts in the same way when you would like to make variables in the .bashrc script local to your current shell. When the computer boots it runs .bashrc and puts variables in your current shell. If you would like to make any variable changes to re-read into your current shell. Similarly to how you would make variables to a remote script available to your local shell by using the source command you can do the same for .bashrc



The above will make all variables in available to your local shell at echo $$

source .bashrc

The above will make all variables in script .bashrc available to your local shell at echo $$



Create Redhat Syncronized Repo with Reposync


  • Server registered with the appropriate version of RedHat
  • HTTP/FTP server to host repo files


Install required components for managing yum repositories and createrepo utility for building new repo indexes.

yum install yum-utils createrepo

Register with RedHat to gain access to their repos



subscription-manager register --username $username --password $password --auto-attach

Repos will be populated automatically upon registration and you can then list them using:

subscription-manager repos --list

Download the repos to a path of your chosing

reposync --gpgcheck -l --repoid=$repoid --download_path=$path

Create the repo against the directory where your rpm packages exist

cd $path
createrepo $path

Enable the local repo

vi /etc/yum.repos.d/rhel.repo

name=Red Hat Enterprise Linux 7 - x86_64

Ensure the repo works, this will likely build the index at the same time. I've seen elsewhere where cache is refreshed using yum makecache but I haven't run into a scenario where I have to do that yet.

yum repolist



Kickstart Drive Mapping

Ordering of Storage Devices Messing up install

A problem that occurs commonly in kickstart is that kickstart will detect storage devices in a different order that which you intend the OS to install in.

This most commonly happens with Dell devices and virtual disks.

The Dell device will name its first virtual device /dev/sda which will cause installation problems when you try to specify that you want your kickstart installation to install on /dev/sda which is likely going to be one of Dell's virtual media devices.

A way to get around this is to create a kickstart script that looks at some criteria of physical devices first and then determines which drive to install to.

Finding Drive Mapping

Interactive Pre-Install to Test

Example of My Partitioning Script

# Couldnt figure out how to make piping with while loop output work properly
# So I wrote to a temp file which seems to be the most compatible method of
# Performing while loop redirection in multiple shells
list-harddrives > /tmp/list-harddrives

# Loop to filter through attached HDDs and their sizes in MiB
# Will find the smallest disk larger than 15GB and set it as /
while read DISK DSIZE
DSIZE=$(echo "$DSIZE" | awk -F '.' '{print$1}')
if [ -z $rootDisk ]; then
echo "Root Disk was unset and is now: $rootDisk"

if [ $DSIZE -gt 143305 ]; then
if [ $DSIZE -lt $rootSize ]; then
echo "Root Disk overriden due to smaller disk that meets requirements: $rootDisk"
done < /tmp/list-harddrives # Echo result out to console for debug echo "Root Disk: $rootDisk" # Create another temp file to feed into the kickstart later # It will choose the root disk that was previously figured out as the primary disk cat << EOF >> /tmp/partitioning
# Specify the bootloader as required for RedHat automated installation (--location=mbr is default)
bootloader --driveorder=${rootDisk}
# Without the 'zerombr' option specified, uninitiated disks will require manual intervention
# To clear the existing partitions, use the clearpart option and include the --all parameter
clearpart --all --initlabel

# Create /boot partition (100MB is not large enough anymore so 500MB is used)
part /boot --size=500 --ondisk=${rootDisk}
# Create a pv to be used with LVM, start with 100MB partition and grow to the remaining size that is left on disk
# This will also ensure that we use the root disk we determined earlier specifically
part pv.01 --size=100 --grow --ondisk=${rootDisk}

# Add the previous pv to the volume group
volgroup VolGrp pv.01

# Carve out space in the volume group for /, swap, and /d2 (data)

# Root partition will always be 10GB
logvol / --vgname=VolGrp --size=10000 --name=Vol1
# Swap will be what is recommended by RedHat for each Distro (no guarantees on which disk)
logvol swap --vgname=VolGrp --recommended --name=Vol2 --fstype=swap
# d2 is the a data partition which will use any remaining space (no guarantees on which disk)
logvol /d2 --vgname=VolGrp --size=100 --name=Vol3 --grow

Reference for include scripts and multi-drive kickstart partitioning: