Skip to content

Instantly share code, notes, and snippets.

View si3mshady's full-sized avatar
🐍

Elliott Arnold si3mshady

🐍
View GitHub Profile
Hello World
@si3mshady
si3mshady / test.txt
Last active June 4, 2019 02:03
Gist #1
Hello World
@si3mshady
si3mshady / curl.md
Created August 17, 2020 09:33 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@si3mshady
si3mshady / Logger.js
Created January 21, 2021 22:15 — forked from mpyw/Logger.js
Send your browser console errors to AWS CloudWatch. Inspired by https://github.com/agea/console-cloud-watch
import React, { Component } from 'react'
import CloudWatchLogs from 'aws-sdk/clients/cloudwatchlogs'
import Fingerprint2 from 'fingerprintjs2'
import StackTrace from 'stacktrace-js'
import { promisify } from 'es6-promisify'
export default class Logger {
events = []
originalConsole = null
@si3mshady
si3mshady / selenium-webdriver-cheatsheet.md
Created February 21, 2021 18:37 — forked from siruguri/selenium-webdriver-cheatsheet.md
Selenium Webdriver CheatSheet

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
@si3mshady
si3mshady / user-data.yaml
Created June 18, 2021 05:28 — forked from jeffbrl/user-data.yaml
AWS CloudFormation UserData Example
# This example is from https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html.
UserData:
Fn::Base64:
!Sub |
#!/bin/bash -xe
yum update -y aws-cfn-bootstrap
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig --configsets wordpress_install --region ${AWS::Region}
/opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource WebServerGroup --region ${AWS::Region}
@si3mshady
si3mshady / remote-desktop.md
Created July 14, 2021 20:18 — forked from alfredodeza/remote-desktop.md
Remote k8s with docker-desktop using an SSH tunnel

Remote Kubernetes using SSH

My setup is using a Macmini with Docker for Desktop installed and with the Kubernetes option enabled. The main objective of the setup: use kubectl directly without any additional flags from my local computer, accessing/interacting the remote k8s instance

Ensure SSH is setup with key-based authentication

Copy public key to the remote authorized_keys file

cat ~/.ssh/id_rsa.pub | ssh admin@macmini-server 'umask 0077; mkdir -p .ssh; cat >> .ssh/authorized_keys'
@si3mshady
si3mshady / ec2-ansible.yml
Created July 19, 2021 21:40 — forked from initcron/ec2-ansible.yml
provision ec2 instance with ansible with user-data
# link: http://allandenot.com/devops/2015/01/31/provisioning-ec2-hosts-with-ansible.html
---
- name: Provision EC2 Box
local_action:
module: ec2
key_name: "{{ ec2_keypair }}"
group_id: "{{ ec2_security_group }}"
instance_type: "{{ ec2_instance_type }}"
image: "{{ ec2_image }}"
@si3mshady
si3mshady / route_table_data_to_excel.py
Created May 29, 2022 21:02
Fetch route table data from each vpc, format and write to excel sheet
from os import stat
import boto3, glob
from threading import Thread
import pandas as pd
REGION = 'us-east-1'
BUCKET_NAME = 'elliotts-arnolds-weekend-python-cohort'
ec2 = boto3.client('ec2', region_name=REGION)
FILE_NAME = 'output.xlsx'
@si3mshady
si3mshady / add_users_to_group_by_tag.py
Created May 29, 2022 21:13
#Weekend cohort script #2 add users to group by tag
import boto3
#create group - use IAC tool for this
#get all users
#check user tags
#switch to new group
REGION = 'us-east-1'
iam = boto3.client('iam', region_name=REGION)