Skip to content

Instantly share code, notes, and snippets.

View fliphess's full-sized avatar

Flip Hess fliphess

View GitHub Profile
@fliphess
fliphess / build-ubuntu-package.sh
Created May 9, 2015 01:53
Build ubuntu package
#!/bin/bash
set -e
echo "Building package"
git-buildpackage --git-pbuilder --git-ignore-branch --git-dist=trusty --git-arch=amd64
@fliphess
fliphess / create-ubuntu-build-environment.sh
Last active January 27, 2020 21:40
Setup an ubuntu build environment with git-pbuilder
#!/bin/bash
# This script installs a basic build environment for debian/ubuntu
ACTION="${1}"
ARGS="${#}"
UBUNTU_VERSION="trusty"
INSTALL_PACKAGES=(
apt-file
cdebootstrap
@fliphess
fliphess / speedtest.sh
Created February 14, 2017 16:03
Test websites using curl
#!/bin/bash
URL="$1"
if [ "x${URL}" == "x" ] || [[ ! "${URL}" =~ "http" ]] ; then
echo "Usage: $0 <url>"
exit 1
fi
curl -L -so /dev/null -w "\n[Info]\n\nStatus Code:\t%{http_code}\nHTTP Version:\t%{http_version}\nRemote IP:\t%{remote_ip}\n\n[Timing]\n\nConnect:\t%{time_connect}\tseconds\nPre-Transfer:\t%{time_pretransfer}\tseconds\nRedirect Time:\t%{time_redirect}\tseconds\nTransfer:\t%{time_starttransfer}\tseconds\nDNS Lookup:\t%{time_namelookup}\tseconds\nTotal Time:\t%{time_total}\tseconds\n\n[Size]\n\nDownload Size:\t%{size_download}\tbytes\nHeader Size:\t%{size_header}\tbytes\nRequest Size:\t%{size_request}\tbytes\n" $URL ; echo
@fliphess
fliphess / debbuild.py
Created April 5, 2017 18:05 — forked from mkouhei/debbuild.py
build package with cowbuilder or git-buildpackage on Jenkins
#!/usr/bin/python
# -*- coding: utf-8 -*-
''' debbuild_wrapper.py
The debian package build wrapper on Jenkins.
This script support three way of building debian package.
1-1. Backport from source package with cowbuilder.
1-2. Pre-build and Backport from source package with cowbuilder.
2. Build original package with git-buildpackage.
@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 / 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 / syntax_checks.md
Last active December 6, 2018 10:04
Syntax checks for several daemons
@fliphess
fliphess / update-dns.py
Created June 23, 2017 19:04
Add dynamic DNS records to bind using nsupdate
#!/usr/bin/env python
from __future__ import print_function, absolute_import
import argparse
import os
import socket
import subprocess
import sys
KEY_FILE = "/etc/bind/update_dns.private"