How Do You Find which IAM Roles Your EC-2 User Account Has?

Problem scenario
You want to see what IAM permissions a given Linux user on an EC-2 instance has. You tried going to the web console for AWS. You were unable to find the user (e.g., ec2-user or ubuntu). How do you determine which roles the user is a member of?

Solution
From the OS, run this command:
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/s3access

How Do You Solve “env: ‘python’: Permission denied”?

Problem scenario
You are running a script and you receive env: “‘python’: Permission denied”

Solution
Run this: sudo ls -lhd $(which python)

Look at the permissions, file owner and group associated with the results. Consider the user that brings about the original error. You may need to change the permissions of the file.

Is the file link pointing to a directory?

How Do You Find and Delete Azure Services (e.g., Disks) That Cause You an Expense?

Problem scenario
In Azure’s “Cost analysis” (in the Cost Management + Billing section), you see expenses associated with storage. How do you find “standard * managed disks” in your account for the purpose of deleting them?

Solution
1. Go here: https://portal.azure.com/#blade/HubsExtension/BrowseAll
2. Sort by “Type”.
3. Find “Disk” and click on the radio buttons near those and click on “Delete”

How Do You Modify Vertical Blocks of Text on a WordPress Web Page?

Problem scenario
There are vertical blocks of text that are common to every posting of your WordPress site. (Or you want to add advertisement banners to your website.) How do you modify the text in those?

Solution

  1. Log into the WordPress web UI
  2. Go to “Dashboard”
  3. Click on “Manage widgets” or “Appearance” (either will work)
  4. To the left of “Available Widgets”,

How Do You Find the File That Gives Mozilla Thunderbird Its Settings to Start Over with Thunderbird?

Problem scenario
You have uninstalled and reinstalled Thunderbird. You used CCleaner to eliminate traces of a previous configuration of Thunderbird. You want to have no vestiges of the old data and older email account. How do you get clean start with Thunderbird (like an installation on a new workstation that has never had it)?

Solution
1. Open Thunderbird
2. Right click on an email username on the left (e.g.,

How Do You Install Erlang on CentOS/RHEL/Fedora?

Problem scenario
You are using a Red Hat derivative of Linux. You want to install Erlang (e.g., for development, or to use RabbitMQ or Chef Server). What do you do?

Solution
Run this script with the “sudo” command (e.g., sudo bash /tmp/erlang.sh)

# Written by www.continualintegration.com
#/bin/bash
# We suggest calling this script erlang.sh and placing this file in /tmp/

yum -y install ncurses-devel gtk2-devel
curl -Ls https://github.com/wxWidgets/wxWidgets/releases/download/v3.0.4/wxWidgets-3.0.4.tar.bz2 /tmp/wxWidgets-3.0.4.tar.bz2
cp /tmp/wxWidgets-3.0.4.tar.bz2 /bin/
cd /bin/
bzip2 /tmp/wxWidgets-3.0.4.tar.bz2
tar -xf wxWidgets-3.0.4.tar
cd wxWidgets-3.0.4
./configure
cd /bin/
git clone https://github.com/erlang/otp.git
cd otp
./otp_build autoconf
./configure
echo “This next portion may take 15 minutes”
date /tmp/datetime.txt
yum -y groupinstall “Development Tools”
make
make install
ln -s /usr/local/lib/erlang/bin/erl /usr/bin/erl
ln -s /usr/local/bin/erlc /usr/bin/erlc
yum -y install python3*
ln -s /etc/alternatives/python3 /usr/bin/python
echo “Script run completed.”
echo ” ”
echo “Many errors above may be ignorable”
echo “try the ‘erl’ command with no quotes to see if Erlang was installed”
echo ‘If you get to a carrot prompt, …

What Are Some Ways to Prevent MITM Attacks or Other Session Exploitative Attacks with a Web Page That Uses JavaScript?

Problem scenario
You know that sessions of a JavaScript can be exploited in today’s world. This category of vulnerability is related to imperfections in authentication and is listed as the #2 biggest web application security risk as of June of 2020 (according to OWASP). What are some techniques to stop such attacks from happening when designing a website that uses JavaScript?

Possible Solution #1
Ensure cookie information is passed using connections that leverage HTTPS (as paraphrased from page 23 of Node.js Security by Liran Tal).

How Do You Install and Configure OWASP ZAP?

Problem scenario
You want to install OWASP ZAP (aka Open Web Application Security Project’s Zed Attack Proxy). You want to test it out. How do you do this on Linux?

Solution
Note: It is advisable to only install ZAP on OSes that have JREs that have up-to-date patches with regular maintenance. If you need assistance installing the JRE, see this posting.