Skip to content

Instantly share code, notes, and snippets.

View andysmithfal's full-sized avatar

Andy Smith andysmithfal

  • Falmouth University
  • Cornwall, UK
View GitHub Profile
@ranrotx
ranrotx / le-install.sh
Last active June 20, 2018 14:39 — forked from hisnameisjimmy/le-install.sh
Add Nginx and Letsencrypt to an existing Unifi installation
#!/bin/sh
#
# This script stands on the shoulders of giants.
#
# It has been tested on a t2.micro. For best results, run with something with more vCPUs when gennerating DH, then revert to
# t2.micro.
#
# It does the following:
# 1) Makes the Unifi/Certbot software available as a package
# 2) Uses Certbot to request a Lets Encrypt Certificate, and then installs it
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@sheharyarn
sheharyarn / mongo_backup.sh
Last active August 28, 2024 08:18
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
BACKUPS_DIR="/home/username/backups/$APP_NAME"
@takeshixx
takeshixx / hb-test.py
Last active November 6, 2024 06:58
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <[email protected]>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford ([email protected]).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser