Linux Tutorial | Matt Cooper - Open Source Support
Linux Tutorial | Matt Cooper - Open Source Support
Amazon Linux

Find largest directories Linux

du -a /directory | sort -n -r | head -n 5

*Replace directory with e.g. / to search the entire disk. Or /root for root only etc.

November 15, 2019by Matt Cooper
FacebookTwitterPinterestGoogle +Stumbleupon
Amazon Linux

Install sbt on Amazon Linux

curl https://bintray.com/sbt/rpm/rpm | sudo tee /etc/yum.repos.d/bintray-sbt-rpm.repo
sudo yum install sbt

November 23, 2018by Matt Cooper
FacebookTwitterPinterestGoogle +Stumbleupon
Amazon AWS, Amazon Linux, letsencrypt

ImportError: No module named interface from zope.interface

The following fixed the issue on AWS EC2:

unset PYTHON_INSTALL_LAYOUT

/root/.local/share/letsencrypt/bin/pip install --upgrade certbot
April 11, 2018by Matt Cooper
FacebookTwitterPinterestGoogle +Stumbleupon
Amazon Linux, Command line Tutorial

Find file with the latest modified date

find /path -printf '%T+ %p\n' | sort -r | head

March 8, 2018by Matt Cooper
FacebookTwitterPinterestGoogle +Stumbleupon
Amazon AWS, Amazon Linux, EC2

Export list of Amazon EC2 Instances to CSV

Install awscli locally. In this case with brew on a mac:

brew install awscli

Configure the cli:

aws configure

AWS Access Key ID: IAM credential with necessary access
AWS Secret Access Key: IAM credential with necessary access
Default region name: e.g. eu-west-1
Default output format [None]: Leave as none

Now export all instances in this region to csv file:

aws ec2 describe-instances --output text --query 'Reservations[*].Instances[*].[InstanceId, InstanceType, ImageId, State.Name, LaunchTime, Placement.AvailabilityZone, Placement.Tenancy, PrivateIpAddress, PrivateDnsName, PublicDnsName, [Tags[?Key==`Name`].Value] [0][0], [Tags[?Key==`purpose`].Value] [0][0], [Tags[?Key==`environment`].Value] [0][0], [Tags[?Key==`team`].Value] [0][0] ]' > instances.csv
March 5, 2018by Matt Cooper
FacebookTwitterPinterestGoogle +Stumbleupon
Page 1 of 212»

About me

Hi, I'm Matt Cooper. I started this blog to pretty much act as a brain dump area for things I learn from day to day. You can contact me at: matt@linuxtutorial.co.uk

Recent Comments

  • Andrew on Export list of Amazon EC2 Instances to CSV
  • Matt Cooper on Proxmox – add a second hard drive to node for Backups
  • karis on Proxmox – add a second hard drive to node for Backups
  • Matt Cooper on Remote MySQL Database – Slow Connection
  • Matt Cooper on Bash script to send public IP address to Email

Categories

  • AdvancedTomato
  • Amazon AWS
  • Amazon Linux
  • Amazon S3
  • Apache
  • Apache Kafka
  • Backup Tutorial
  • Bash Scripting
  • Centos Tutorial
  • CloudFlare
  • Command line Tutorial
  • CPanel Troubleshooting
  • CPanel Tutorial
  • Debian Troubleshooting
  • Debian Tutorial
  • DKIM
  • Docker
  • EC2
  • ESXi
  • Faildows
  • Google Adwords
  • Google Analytics
  • Google Chromebook
  • Google Mail
  • graylog
  • IAM
  • imapsync
  • iRedmail Tutorial
  • ISPConfig3 Tutorial
  • Java
  • ldap
  • letsencrypt
  • MyDNS
  • MySQL Troubleshooting
  • MySQL Tutorial
  • Nest Install
  • Netbeans
  • Nginx
  • Nginx Troubleshooting
  • openssl
  • PCI Compliance
  • Percona
  • PHP
  • Plex Media Server Tutorial
  • Postfix
  • Proxmox Tutorial
  • Pure FTPd
  • Resourcespace Tutorial
  • Route 53
  • Rsync Tutorial
  • Security
  • Smoothwall Troubleshooting
  • Smoothwall Tutorial
  • SSH
  • tcpdump
  • Thunderbird
  • Tomcat Troubleshooting
  • Ubuntu Tutorial
  • Uncategorized
  • Unison
  • vmware
  • vzdump
  • WHM
  • Wireshark
  • Wordpress Troubleshooting
  • WordPress Tutorial

“See, you not only have to be a good coder to create a system like Linux, you have to be a sneaky bastard too." Linus Torvalds

© 2017 copyright www.linuxtutorial.co.uk // All rights reserved