Skip to content

Instantly share code, notes, and snippets.

# Install GeckoDriver
cd /bin
url=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | python -c "import sys, json; print(next(item['browser_download_url'] for item in json.load(sys.stdin)['assets'] if 'linux64' in item.get('browser_download_url', '')))")
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install wget python-pip firefox
wget $url
tar -xvzf geckodriver-*-linux64.tar.gz
rm -rf geckodriver-*-linux64.tar.gz
chmod +x geckodriver
cp geckodriver wires

Change RHEL Hostname permanently

To Set hostname in RHEL 7.x

sudo hostnamectl set-hostname tux-OnPrem
export PS1="[\u@tux-OnPrem]\$ "

# \w Full Path
export PS1="\n\[\e[01;33m\]\u\[\e[0m\]\[\e[00;37m\]@\[\e[0m\]\[\e[01;36m\]\h\[\e[0m\]\[\e[00;37m\] \[\e[0m\]\[\e[01;35m\]\w\[\e[0m\]\[\e[01;37m\] \[\e[0m\]\n$ "

AWS Systems Manager lets you remotely and securely manage the configuration of your managed instances. It helps you automate management tasks.

  • Create IAM Role - Assign Permissions
  • Create EC2 & Assign IAM Role - "AmazonEC2RoleforSSM" role to an Amazon EC2 instance with "AmazonSSMFullAccess" Permissions
  • Bootstrap with SSM
  • Run Command

User-Data:

#!/bin/bash
cd /tmp
@miztiik
miztiik / reinvent.md
Created August 22, 2017 01:57 — forked from henrysher/reinvent.md
link for reinvent slides
@miztiik
miztiik / custom-inline-policy-example.md
Created July 31, 2017 15:28
Allows Read and Write Access to a Specific S3 Bucket, Programmatically and in the Console

Inline custom policy to restrict user

Allows Read and Write Access to a Specific S3 Bucket, Programmatically and in the Console Change <BUCKET-NAME> to suit your needs

{
   "Version": "2012-10-17",
   "Statement": [
     {
       "Effect": "Allow",
 "Action": [
@miztiik
miztiik / wordpress.json
Created July 24, 2017 07:19 — forked from geertj/wordpress.json
CloudFormation template for Wordpress
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Scalable Wordpress instance",
"Parameters": {
"InstanceType": {
"Type": "String",
"Description": "Instance type",
"Default": "t2.medium",
"AllowedValues": [ "t2.medium", "t2.large" ]
@miztiik
miztiik / install_virtualenv.sh
Last active July 10, 2017 18:24
Install Python(2.7) Virtual Environment
# http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/
### Install Python Virtual Environment package using `pip`
pip install virtualenv
### Start by making a new directory to work with:
### mkdir -p <path-to-env-directory>
mkdir -p /var/flask-app && cd /var/flask-app
@miztiik
miztiik / Readme.md
Created June 5, 2017 16:42
Install Latex2Edx in CentOS 7
# Install pip & Git
yum -y install epel-release
yum -y install python-pip git

# Install pre-requisites
yum -y install libxml2-python python-lxml

# Install latex2edx using pip
pip install -e git+https://github.com/mitocw/latex2edx.git#egg=latex2edx
@miztiik
miztiik / install-nodejs.md
Created May 4, 2017 14:18
Install Node Js on RHEL 7 running on AWS
@miztiik
miztiik / aws_sg_recipe.py
Created February 28, 2017 15:46 — forked from steder/aws_sg_recipe.py
Create and update AWS security groups using Python and Boto.
#!/usr/bin/env python
"""
Recipe for creating and updating security groups programmatically.
"""
import collections
import boto