Skip to main content

Posts

Automate "Loop Mount" Installation Disk on Linux

 Today I encounter an interesting task about system administration: Configure your system to automatically loop-mount the ISO of the installation disk on the directory /repo. Configure your system to remove this loop-mounted ISO as the only repository that is used for installation. Do not register your system with subscription-manager, and remove all reference to external repositories that may already exist. This is a common issue when you set up the VM: After you finish installing Linux, you want to boot the Linux normally, rather than running into the installation disk again. So when you install Linux, you attach the iso image. Later detach the iso so that Linux can boot normally. This could be easily done from virtualization software such as VirtualBox, VMWare Workstation, thanks to their user-friendly UI. However, this task asks you to do it through automation. In system admin books, this is barely mentioned. But it's still worth digging: in the scenario where you're settin...

Case Study: AWS Infrastructure Design for Web Application

In this article, you'll learn the basic components to spin up a web application in AWS. The first step is to draw an architecture graph. It's important to communicate the design with team members.  LucidChart is a great free tool to do this.  https://www.lucidchart.com/  They have libraries to support the AWS components. Please refer to the graph below. Click to zoom in for details Work in progress :)

AWS in Action - Deploy Static Website

Work in progress :) Two main components are: 1. S3 service It offers static web hosting. If your website doesn't need back-end processing, S3 is your place to go. It's cheap because you don't pay for computing resources but only pay for storage resources. 2. CloudFront CDN service for caching Dependencies Cloud Services Amazon Web Services S3 - Resource hosting and deployments AWS CloudFront - CDN for SPA AWS EKS - Backend API AWS DynamoDB - Persistent Datastore AWS Cognito - User Authentication Performance Tracking and DevOps Tools: AWS CloudWatch - Performance and Health checks Sentry - Bug Reporting Alternates: TBD Google Analytics - Usage Reporting Alternates: Mixpanel Travis (CI/CD) Frameworks: Ionic (Javascript) (Frontend) Node.js (Javascript) (Backend)

AWS services in a nutshell

AWS is a very powerful platform for your enterprise application. Do you wonder how to navigate through it? I've learned a wide range of topics and I just made it simple for you. Let's dive in. Fundamentals EC2: your physical server on the cloud. EBS : your physical hard drive attached to EC2. VPC : your private network in the cloud. A VPC spans all availability zones in a region. Lambda : Execution tool triggered by the event, the "compute power". Elastic Beanstalk : an orchestration service to deploy a web application in one click. Storage & Content delivery S3 : Storage/File system for objects. S3 Glacier : Cheaper storage solution for infrequently accessed files, e.g. log file. DynamoDB : NoSQL DB with flexibility and scalability. RDS : Relational DB management. Redshift : Data warehouse for Big data, usually stores historical data. e.g. Redshift stores orders in the last 10 years. RDS stores orders within 1 year. It leverages machine learning to...

Managing software packages with yum on RHEL 8

1. Register Red Hat Enterprise server for support To gain tech support and full access to the repositories on Red Hat Network(RHN), you will register your server under your Red Hat account. One Red Hat account can associate with multiple servers, depending on the number of licenses you have. Your server will need the entitlement/subscription to access the software repositories on RHN. You can subscribe from either purchasing a subscription for RHEL, or Red Hat Developer program and its subscription Reference:  https://developers.redhat.com/articles/getting-red-hat-developer-subscription-what-rhel-users-need-know/ The subscription-manager tool is used to manage the subscription, the common usage includes: Register the server with Red Hat account: subscription-manager register List available subscription subscription-manager list --available Attach a subscription to the server subscription-manager attach --auto This will attach all the subscriptio...

Configuring Network on RHEL 8

1. Validate Network Configuration 2. Configure Network Networking is managed by a service called NetworkManager. It reads the network card configuration scripts located at /etc/sysconfig/network-scripts.  Each network card can have one or many connections. The commands to configure network are nmtui and nmcli . Another way is a GUI tool called nm-connection-editor . nmtui is text based UI with limited options. nmcli has rich features and you don't need to memorize. Here are nice ways to check it out. man -1 nm-settings  : to check user command man -5 nm-settings  : to check file formats and conventions man nmcil-examples : to find examples Example: nmcli con show|add|mod|up... nmcli dev show... 3. Set up Hostname and Name Resolution To view or change the hostname, a few options are: Use nmtui Use hostnamectl hostnamectl status hostnamectl set-hostname Edit /etc/hostname To set hostname resolution, you can use DNS and edit /etc/hosts....

Manage Advance Permission

1. SUID A user would write to the /etc/shadow file to change password, but he doesn't have root permission to do it. [root@hnl ~]# ls -l /etc/shadow ----------. 1 root root 1184 Apr 30 16:54 /etc/shadow SUID solves the problem by giving temporary root permission to the user. [root@hnl ~]# ls -l /usr/bin/passwd -rwsr-xr-x. 1 root root 32680 Jan 28 2010 /usr/bin/passwd      ---> use s to replace user execute permissions 2. SGID Both Linda and Lori work at the accounting group. When Linda creates a file, the file's group ownership is her primary group: Linda. Lori cannot access this file. SGID is used to make the directory tree (i.e. files and subdirectories)shared among the accounting group. Both users have accounting as their secondary group. Linda's file is shared with Lori with the help of SGID. [root@hnl data]# ls -ld account drwxr-sr-x. 2 root account 4096 Apr 30 21:28 account       ---> use s to replace gro...