Skip to content

Instantly share code, notes, and snippets.

View phwelo's full-sized avatar
🌈

Daniel Agans phwelo

🌈
View GitHub Profile
@phwelo
phwelo / config
Created September 15, 2018 03:02
i3 config file
# i3 config file (v4)
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
#####################################
# Main Config
#
# Set mod key (Mod1=<Alt>, Mod4=<Super>)
set $mod Mod1
#
# Configure border style <normal|1pixel|pixel xx|none|pixel>
@phwelo
phwelo / config.py
Created September 15, 2018 03:05
qutebrowser config
# First day config with qutebrowser
config.load_autoconfig()
# Define Aliases
aliases = {
"q": "quit",
"tabopen": "open -t",
"w": "session-save",
"wq": "quit --save",
"close": "tab-close",
@phwelo
phwelo / config.py
Created September 15, 2018 03:06
qutebrowser config
# First day config with qutebrowser
config.load_autoconfig()
# Define Aliases
aliases = {
"q": "quit",
"tabopen": "open -t",
"w": "session-save",
"wq": "quit --save",
"close": "tab-close",
@phwelo
phwelo / website.py
Created January 16, 2019 14:35
python website runner template
#!/usr/bin/python3
from subprocess import call
website = 'WEBSITE'
call(["xdg-open", website])
@phwelo
phwelo / convert_sg_to_hcl.py
Created May 24, 2019 16:37
Python script to describe a Security Group from AWS and convert it into HCL markup. Not the entire file, but the rules only
#!/usr/bin/python3
# Purpose of script:
# Convert a security group to HCL
import boto3
client = boto3.client('ec2')
def describe_sg(security_group):
@phwelo
phwelo / jifi.py
Last active June 15, 2024 09:26
jifi rofi jira menu
#!/usr/bin/python3
from jira import JIRA
from rofi import Rofi
from subprocess import Popen, DEVNULL
r = Rofi()
browser_path = "vivaldi-stable"
jira_uri = 'https://company.atlassian.net'
api_token = 'https://id.atlassian.com/manage/api-tokens' # go here and generate one
@phwelo
phwelo / sec_grp_scan.py
Last active July 28, 2019 01:09
Search which Security groups have 0.0.0.0/0 incoming, and figure out which instances use them
#!/usr/bin/python3
import boto3
ec2_client = boto3.client('ec2')
def find_in_sg(ip_address):
sg = ec2_client.describe_security_groups()
security_groups = []
for group in sg['SecurityGroups']:
@phwelo
phwelo / speedtest.py
Created August 16, 2019 13:36
Speedtest fork with args pulled out and halo used for progress indication
#!/usr/bin/env python
import os
import re
import csv
import sys
import math
import errno
import signal
import socket
@phwelo
phwelo / ECS_DD_AGENT.yml
Last active August 22, 2019 20:00
ECS Datadog Agent Yaml Config (For dev)
#########################
## Basic Configuration ##
#########################
site: datadoghq.com
skip_ssl_validation: false
# force_tls_12: false
tags:
- environment:dev
- dd_agent:true
@phwelo
phwelo / weathericon.py
Created August 23, 2019 16:45
Pulls geolocation then weatherdata and returns icon and temperature
#!/usr/bin/env python3
import requests
import json
import pyowm
geolocation_api_uri = "http://ip-api.com/json/?fields=49344"
def get_coord():
r = requests.get(geolocation_api_uri)