Linux

Add new harddisk to linux without reboot

This is a short post on how you can add a new SATA og SCSI harddisk in your running/live linux machine without a reboot. The BIOS of the machine is not aware of new hardware being added, but you can ask the disk controllers to rescan and become aware of new harddisks. This is how […]

Read More
Linux

Another way to randomize filenames

This post describes an easier way to randomize filenames using the command openssl compared to my previous post named Randomize filenames. #!/bin/bash for filename in *.JPG do mv “$filename” $(echo “$filename” | openssl rand -hex 3).JPG done After running this script the filenames can look something like this 26333c.JPG a8c7a0.JPG b16b22.JPG d69a67.JPG … The rand […]

Read More
Network

Transfer files fast between servers using netcat and tar

This is a short post on how you can transfer files unsecured but fast between linux servers. I prefer to use netcat (nc) to transfer large amounts of data between servers when I know the connection between them are secure, ie on my private LAN. The sender server should run the following command $ tar […]

Read More
Scripting

Create random filenames with random content

I wanted to test filesystem checking on a large XFS filesystem and needed to fill the filesystem. The task was to create files on random with different file size and names placed in different folders. The script I found on the Internet does exactly that #!/bin/bash # Created by Ben Okopnik on Wed Jul 16 […]

Read More
Linux

Give DD a progress bar

This is a short description on how you can get a progress bar to your dd command or other commands as well using the command pv. pv is a shell pipeline element to meter data passing through and can be installed using aptitude in Ubuntu. # aptitude install pv As an example I create a […]

Read More