Skip to content

Instantly share code, notes, and snippets.

View satishv's full-sized avatar

satish viswanatham satishv

  • Second Genome
  • San Francisco, CA
  • X @satish_
View GitHub Profile
@siran
siran / aws-mfa-cli.sh
Last active February 6, 2020 02:27
Script to authenticate the CLI with MFA, adds AWS environment variables.
#!/bin/bash
set -e
# specify your MFA_DEVICE_ARN
MFA_DEVICE_ARN=YOUR_MFA_ARN
if [ MFA_DEVICE_ARN=YOUR_MFA_ARN ]; then
echo "Please specify the MFA_DEVICE_ARN"
exit 1
fi
@wyllie
wyllie / parse_ini.sh
Created July 22, 2018 17:04
Parse aws credentials file in bash
#!/usr/bin/env bash
INI_FILE=~/.aws/credentials
while IFS=' = ' read key value
do
if [[ $key == \[*] ]]; then
section=$key
elif [[ $value ]] && [[ $section == '[default]' ]]; then
if [[ $key == 'aws_access_key_id' ]]; then
@monkut
monkut / serving-sphinx-docs-on-s3.md
Created May 8, 2018 05:35
Serving Sphinx Documentation on s3

Build your sphinx document

Assumes you already have a sphinx project installed and a project created

make html

By default this command will build documentation to _build/html

@res0nat0r
res0nat0r / mfa.md
Last active July 15, 2020 01:42
Enable MFA for s3 bucket
aws s3api put-bucket-versioning \
	--bucket bucket \
	--versioning-configuration '{"MFADelete":"Enabled","Status":"Enabled"}' \
	--mfa 'arn:aws:iam::aws_account_id:mfa/root-account-mfa-device passcode'
aws s3api get-bucket-versioning --bucket bucket
@Amuhar
Amuhar / gsoc2017.md
Last active August 31, 2018 09:51
final gsoc 2017 submission

Server-to-Server Stream Management Support for ejabberd

During GSoC 2017 I worked on implementation of server-to-server part of XEP-0198 protocol. This extension improve reliability of server-to-server communication and make the whole XMPP network more robust.

I implemented mod_stream_mgmt_s2s module for ejabberd. This module adds support for server-to-server stream management. To view commit history follow link:

https://github.com/Amuhar/ejabberd/commits/xep_0198_s2s?author=amuhar

@TomRyan-321
TomRyan-321 / security-group-cleanup.py
Last active October 10, 2022 09:38 — forked from lingmann/security-group-cleanup.py
Security Group Cleanup using boto3 with RDS check fixed
#!/usr/bin/env python
import boto3
import argparse
def lookup_by_id(sgid):
sg = ec2.get_all_security_groups(group_ids=sgid)
return sg[0].name
@jaeddy
jaeddy / rstudio_ami_guide.md
Last active May 6, 2024 09:13
steps for creating and configuring a new AMI with RStudio Server

Building a new RStudio Server AMI

The steps below can be followed to create a new AMI for use with Amazon EC2 instances that includes the latest versions of R, RStudio, and RStudio Server. The idea is inspired by the work of Louis Aslett, who creates and hosts his own public AMIs for RStudio. My own goal was to create an AMI with RStudio v1.0.0 or higher, such that I could use the recent R Notebooks feature. However, the instructions should generally apply for whenever you might be impatient accessing the latest version of R-related software on AWS (via an interactive browser interface...).

Getting started

  1. Create a new EC2 instance with the latest Ubuntu AMI (should be fine to do with Spot); based on Louis Aslett's AMI, I opted to include a general purpose SSD EBS volume with 10GB of storage space
  2. SSH into the instance

Downloading/installing RStudio Server

@wojteklu
wojteklu / clean_code.md
Last active July 3, 2024 08:35
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active June 5, 2024 21:05
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@csabapalfi
csabapalfi / aws-well-architected.md
Last active November 16, 2021 11:02
AWS Well-architected Framework

5 pillars

Security

  • protect information, systems, and assets while delivering business value
  • utilising risk assessments and mitigation strategies

Reliability

  • ability to recover from infrastructure or service failures