Skip to content

Instantly share code, notes, and snippets.

View vahiwe's full-sized avatar
💭
Ideas

Ahiwe Onyebuchi Valentine vahiwe

💭
Ideas
View GitHub Profile
@henhan
henhan / nginx_documentation.md
Last active September 5, 2024 01:21
Extend and override nginx config for Elastic Beanstalk Amazon Linux 2

Extend and override nginx config for Elastic Beanstalk Amazon Linux 2

Documentation on how to override or extend the default nginx config on Elastic Beanstalk running om Amazon Linux 2. Correct as of 2021-08-01. Also see the general documentation on how to extend linux servers.

All references to placing files refer to putting a file at this location in your application bundle. You should never modify a file directly at your Elastic Beanstalk server by ssh:ing to the server, since such a change will be wiped whenever your servers autoscale or if you rebuild your application completely.

Adding a new location block

The easiest extension is to add a new location block to the main server block. This can be done by placing a .conf file with a server block in the folder .platform/nginx/conf.d/elasticbeanstalk. Any such file is automatically included in the main server block.

Overriding the default location

@kdgregory
kdgregory / main.tf
Created November 9, 2020 12:14
Example of Terraform module to create an SQS queue.
##
## Main configuration: creates several SQS queues using a module, then
## combines their policies into an application role.
##
provider "aws" {}
module "notifications_queue" {
source = "./modules/sqs"
queue_name = "Notifications"
@vahiwe
vahiwe / structure-of-tweepy-status-object.json
Created September 29, 2019 21:00
the structure of the Status object of Tweepy
/* json.dumps(StatusObject._json) */
{
"created_at": "Thu Jul 28 00:08:39 +0000 2016",
"in_reply_to_status_id": null,
"id_str": "758454081656467456",
"retweeted": false,
"entities": {
"hashtags": [
{
@mikepfeiffer
mikepfeiffer / stress.sh
Created January 27, 2019 21:05
Install Stress Utility on Amazon Linux 2
sudo amazon-linux-extras install epel -y
sudo yum install stress -y
# Code adapted from Tensorflow Object Detection Framework
# https://github.com/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb
# Tensorflow Object Detection Detector
import numpy as np
import tensorflow as tf
import cv2
import time
@chris-garrett
chris-garrett / gist:8b9831ca2e2c05eacaa16b75f15213bf
Created December 13, 2017 00:40
initial nginx config for feathers.js
upstream app_server {
ip_hash;
server app_react:3000 max_fails=3 fail_timeout=30s;
}
upstream api_server {
ip_hash;
server api_feathers:3040 max_fails=3 fail_timeout=30s;
}
@JanTvrdik
JanTvrdik / README.md
Last active June 23, 2022 16:17
Papertrail S3 log downloader

Papertrail S3 log downloader

  1. Get Your Papertrail token from https://papertrailapp.com/account/profile
  2. Profit!
# download logs from last 30 days
PAPERTRAIL_TOKEN=9X4cddgwe53fAbbsYh4 papertrail-download-daily.sh 30

# download logs from last 30 days & filter each through ./filter.sh
From: http://redteams.net/bookshelf/
Techie
Unauthorised Access: Physical Penetration Testing For IT Security Teams by Wil Allsopp.
Social Engineering: The Art of Human Hacking by Christopher Hadnagy
Practical Lock Picking: A Physical Penetration Tester's Training Guide by Deviant Ollam
The Art of Deception: Controlling the Human Element of Security by Kevin Mitnick
Hacking: The Art of Exploitation by Jon Erickson and Hacking Exposed by Stuart McClure and others.
Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning by Fyodor
The Shellcoder's Handbook: Discovering and Exploiting Security Holes by several authors
@vickyqian
vickyqian / twitter crawler.txt
Last active May 11, 2024 16:19
A Python script to download all the tweets of a hashtag into a csv
import tweepy
import csv
import pandas as pd
####input your credentials here
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
@niraj-shah
niraj-shah / aws-security.sh
Last active February 13, 2023 23:52
Shell Script to update AWS EC2 Security Groups with Fixed and Current IPs for a given Port, using `aws ec2` command line
#!/bin/bash
# Shell Script to Update AWS EC2 Security Groups
# Note that existing IP rules will be deleted
# CONFIG - Only edit the below lines to setup the script
# ===============================
# AWS Profile Name
profile="name1"