Skip to content

Instantly share code, notes, and snippets.

View fliphess's full-sized avatar

Flip Hess fliphess

View GitHub Profile
@fliphess
fliphess / .vimrc
Last active January 18, 2024 11:17
Vim config
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" Load plugin manager
""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Download vim-plug if not already installed
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall | source $MYVIMRC
@fliphess
fliphess / 10-nginx.conf
Last active May 23, 2021 13:29
Custom error pages for nginx ingress controller
################################################################################
## Custom headers forwarded by the nginx ingress controller ##
## ##
## X-Code HTTP status code retuned by the request ##
## X-Format Value of the Accept header sent by the client ##
## X-Original-URI URI that caused the error ##
## X-Namespace Namespace where the backend Service is located ##
## X-Ingress-Name Name of the Ingress where the backend is defined ##
## X-Service-Name Name of the Service backing the backend ##
## X-Service-Port Port number of the Service backing the backend ##
@fliphess
fliphess / git-browse
Last active February 19, 2020 13:24
Easy visiting gitlab urls from your commandline on Mac OSX
#!/usr/bin/env bash
function usage() {
cat <<EOF
Open current git repo in your browser
Arguments:
--pipe - Show pipeline
--cr - Show container registry
--mr - Show merge requests
@fliphess
fliphess / with-creds
Last active October 29, 2019 17:16
util to set aws credentials in your environment for a specific command
#!/usr/bin/env python3
import argparse
import configparser
import subprocess
import os
import sys
CONFIG = os.path.expanduser("~/.aws/credentials")
@fliphess
fliphess / beautiful_idiomatic_python.md
Created April 10, 2019 11:09 — forked from 0x4D31/beautiful_idiomatic_python.md
[Beautiful Idiomatic Python] Transforming Code into Beautiful, Idiomatic Python #python

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@fliphess
fliphess / sricam.md
Created March 9, 2019 16:14 — forked from herrfeder/sricam.md
Offensive IOT Blog - This blog post has been created for completing the requirements of the SecurityTube Offensive Internet of Things course. http://www.securitytube-training.com/online-courses/offensive-internet-of-things-exploitation/index.html

Student ID: IoTE-775

This Blog/Gist will be very detailed with a lot of additional listings to see the process and methodology of Examination.

Sricam SP009 Hardware and Software Examination

In this gist I will try to examine and exploit the Sricam SP009. I purchased it from Attify with the IOT Exploitation Kit.

  1. First Recon
  • doing Research on Manufacturer Details
@fliphess
fliphess / raspi_headless_setup.md
Created August 28, 2018 17:56
Setup a raspberry pi without screen attached

Headless setup raspberry pi

Get the image

Get the latest image and save it to disk:

# Desktop version
wget -O ~/raspbian.zip https://downloads.raspberrypi.org/raspbian_latest
@fliphess
fliphess / dst.py
Created May 17, 2018 18:09
Home assistant DST binary sensor
import time
from homeassistant.components.binary_sensor import BinarySensorDevice
def setup_platform(hass, config, add_devices, discovery_info=None):
add_devices([DSTBinarySensor()])
class DSTBinarySensor(BinarySensorDevice):
@fliphess
fliphess / varnish-modules.md
Last active January 21, 2020 06:36
Install varnish modules on ubuntu 16.04 xenial

Install varnish-modules on ubuntu 16.04 xenial

  1. Backup current configuration
mkdir -p /root/varnish && cp -rv /etc/varnish /root/varnish && cp /etc/default/varnish /root/varnish/varnish-default
  1. Install varnish key and repo from packagecloud:
@fliphess
fliphess / syntax_checks.md
Last active December 6, 2018 10:04
Syntax checks for several daemons