Skip to content

Instantly share code, notes, and snippets.

--[[
lvim is the global options object
Linters should be
filled in as strings with either
a global executable or a path to
an executable
]]
-- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
@MahmoudDolah
MahmoudDolah / find_unused_ebs_volumes.py
Last active September 22, 2022 20:57
Find unused EBS volumes in AWS
#! /usr/bin/env python3
import boto3
from pprint import pprint
import os
# load the environment variables
AWS_ACCESS_KEY_ID = "ACCESSKEY"
AWS_SECRET_ACCESS_KEY = "SECRETKEY"
AWS_REGION = "REGION"
@MahmoudDolah
MahmoudDolah / check_all_s3_buckets_for_key.py
Last active February 6, 2020 19:52
Checks every available S3 bucket for a given key
#! /usr/bin/env python3
import boto3
s3_client = boto3.client('s3')
s3 = boto3.resource('s3')
buckets_response = s3_client.list_buckets()
KEY = 'KEY_NAME'
for bucket_response in buckets_response['Buckets']:
@MahmoudDolah
MahmoudDolah / my_configs.vim
Last active September 3, 2019 19:24
Misc Vim configs
set so=999
imap jj <Esc>
set number
set relativenumber
set nohlsearch
" FZF
set rtp+=/usr/local/opt/fzf
" Clipboard
@MahmoudDolah
MahmoudDolah / jira_logbook.py
Last active February 1, 2022 16:58
A VERY quick and dirty Python script that creates a daily logbook entry from the open tickets in JIRA
#! /usr/bin/env python3
# from jira import JIRA
from pprint import pprint
import secrets
import subprocess
import json
import os
import datetime
#! /usr/bin/env python3
from ns1 import NS1
import pprint
import subprocess
import keyboard
NS1_API_KEY = "<INSERT API KEY>"
ZONE_NAME = '<INSERT ZONE NAME>'
@MahmoudDolah
MahmoudDolah / fbr.sh
Created October 26, 2018 19:34
Shell function to fuzzy search your branches (insert this into your bashrc / zshrc)
function fbr() {
git fetch
local branches branch
branches=$(git branch -a) &&
branch=$(echo "$branches" | fzf +s +m -e) &&
git checkout $(echo "$branch" | sed "s:.* remotes/origin/::" | sed "s:.* ::")
}
@MahmoudDolah
MahmoudDolah / copyright.sh
Created October 25, 2018 19:59
Bash script that will find copyright updates in upgrades and add them to be a single commit
#!/bin/bash
# Use this script to copy shared (libs) files to Apache/Lighttpd chrooted
# jail server.
# Set CHROOT directory name
BASE="/webroot"
if [ $# -eq 0 ]; then
echo "Syntax : $0 /path/to/executable"
echo "Example: $0 /usr/bin/php5-cgi"
exit 1
@MahmoudDolah
MahmoudDolah / customer.php
Last active April 16, 2019 15:18
A Magento shell script to mass delete customer accounts created by spam
<?php
require_once 'abstract.php';
class Mage_Shell_Customer extends Mage_Shell_Abstract
{
/**
* Run script
*