Skip to content

Instantly share code, notes, and snippets.

@rwmotivation
rwmotivation / gist:e23978073ccd8014239f61f1248d77f6
Created February 6, 2020 16:49 — forked from jefferyhsu/gist:3094428
Intro to Ruby: Quiz 1 (from Jeff Hsu)
# Write a program that tells you the following:
#
# Hours in a year. How many hours are in a year? - 6pts
# Minutes in a decade. How many minutes are in a decade? - 6pts
# Your age in seconds. How many seconds old are you? - 6pts
#
# Define at least the following methods to accomplish these tasks:
#
# seconds_in_minutes(1) #=> 60 - 3pts
# minutes_in_hours(1) #=> 60 - 3pts
@rwmotivation
rwmotivation / Bigger Better Favorite Number
Last active February 6, 2020 18:25 — forked from Dgrady3/Bigger Better Favorite Number
Basic ruby program that asks for your favorite number, then tells you a better number
puts "What is your favorite number?"
num = gets.chomp
better = num.to_i + 1
puts "Your favorite number is okay, here is a bigger, better favorite number: " + better.to_s + '.'
@rwmotivation
rwmotivation / delete_iam_user.sh
Created March 20, 2020 18:39 — forked from kgmoore431/delete_iam_user.sh
Delete an IAM user with AWS CLI
#!/bin/bash
user_name="$1"
echo "Removing user: ${user_name}"
echo "Deleting Access Keys:"
keys=("$(aws iam list-access-keys --user-name "${user_name}" | jq -r '.AccessKeyMetadata[] | .AccessKeyId')")
if [[ "${#keys}" -gt "0" ]]; then
# shellcheck disable=SC2068
@rwmotivation
rwmotivation / README.md
Created March 30, 2020 20:35 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@rwmotivation
rwmotivation / sources.list
Created September 4, 2020 19:01 — forked from ishad0w/sources.list
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@rwmotivation
rwmotivation / ubuntu.sh
Created September 8, 2020 13:35
Ubuntu 20.04 Stuff
cd ~/Downloads
# Install curl to get GPG keys
sudo apt install -y curl
# Install deb apps
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
wget https://zoom.us/client/latest/zoom_amd64.deb
sudo apt install -y ./*.deb
# Install snap apps
@rwmotivation
rwmotivation / linux-networking-tools.md
Created November 9, 2020 12:35 — forked from miglen/linux-networking-tools.md
Linux networking tools

List of Linux networking tools

netstat (ss)

Displays contents of /proc/net files. It works with the Linux Network Subsystem, it will tell you what the status of ports are ie. open, closed, waiting, masquerade connections. It will also display various other things. It has many different options. Netstat (Network Statistic) command display connection info, routing table information etc. To displays routing table information use option as -r.

Sample output:

Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)    
tcp4 0 0 127.0.0.1.62132 127.0.0.1.http ESTABLISHED
@rwmotivation
rwmotivation / certrenew.sh
Created December 4, 2020 08:35 — forked from ntotten/certrenew.sh
Script to renew Let's Encrypt certificate and then replace certificate on OpenVPN server
#!/bin/bash
(
DOMAIN="vpn.example.com"
set -eu
certbot renew -q
/usr/local/openvpn_as/scripts/sacli stop
@rwmotivation
rwmotivation / web-servers.md
Created February 3, 2021 18:21 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@rwmotivation
rwmotivation / rvm-amazon-linux.bash
Created February 27, 2021 16:31 — forked from kainam00/rvm-amazon-linux.bash
Install RVM on Amazon Linux
#!/bin/bash
# Install prerequisites
yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel ruby-devel gcc-c++ jq git
# Import key
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
# Install RVM
curl -sSL https://get.rvm.io | bash -s stable --ruby