DevOps by Default Blog

Latest Articles

Updated: Terraform 101 Tutorial

(96 words, 1 mins) - Updated: Terraform 101 Tutorial We’ve updated our Terraform 101 Tutorial to work with the latest stable version, which at the time of writing is Terraform 0.14.6. If you are just starting out on your Cloud journey and would like to have a go at Infrastructure As Code on AWS then feel free to give it a whirl. Over 5 steps the tutorial begins with a simple “Hello World” example that just prints the string in your shell, but also covers rolling out simple serverless and … read more

Delete AWS IAM users virtual MFA

(127 words, 1 mins) - Delete AWS IAM user’s virtual MFA device There seems to be some kind of bug in the AWS web console around users assigning MFA tokens. If a user starts the process then get cold feet and back-out, it still creates an unassigned token, blocking their completion of the process during futute attempts. The only way around this seems to be using the AWS CLI to find the token and delete it. Firstly, to find the token use the following command. Unassigned MFA devices are listed at the top, so you … read more

Mounting raw disk images on Linux

(317 words, 2 mins) - Mounting raw disk images on Linux From time to time you may have a raw disk image that you have made with the dd tool, or something similar. If it’s a backup of a single partition then it can be mounted in Linux using the loopback feature pretty easily, so long as you know the filesystem type, such as ext4, vfat or ntfs for example: $ sudo mkdir -p /mnt/loop $ mount -t ntfs -o loop /path_to_disk_image.img /mnt/loop $ ls -lart /mnt/loop $ sudo umount /mnt/loop Partition table in the image … read more

Change AWS IAM User password from the CLI

(135 words, 1 mins) - Change IAM password from the CLI Sometimes it’s handy to be able to quickly change the password of an existing IAM user without having to login at the AWS Console to do it. I generally set a long random password using a tool called apg, although I’ve found that AWS don’t like certain characters so I’ve added a few exclusions with the -E option. First, make sure you have the awscli installed, then: aws iam update-login-profile --user-name $IAM_USERNAME … read more

Yum downgrade packages

(723 words, 4 mins) - Yum downgrade packages If you upgrade RPMs with yum upgrade and then later wish you hadn’t done, then it is pretty simple to downgrade them using yum downgrade. Consider our example below, upgrading systemd: [vagrant@localhost ~]$ sudo yum upgrade systemd Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: * extras: * updates: Resolving Dependencies --> Running transaction check ---> Package … read more