Skip to content

Instantly share code, notes, and snippets.

View kimthostrup's full-sized avatar

Kim Thostrup kimthostrup

View GitHub Profile
@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created October 31, 2022 12:31
Simple bash script to create a Bootable ISO from macOS Ventura Install Image from Mac App Store
#!/usr/bin/env bash
#===========================================================================
# Works only with the official image available in the Mac App Store.
# Make sure you download the official installer before running this script.
#===========================================================================
# Change this at your desire. Sometimes this works out of the box, sometimes not.
# Default size: ~16 GB
DISK_SIZE="15361m"
@recklessop
recklessop / netplan-nic-cfg.py
Last active September 23, 2019 11:30
netplan-nic-cfg.py
#!/usr/bin/python3
import yaml
import psutil
# function to validate it an IP address is real, or NA to skip (used for NS2)
def validate_ip(s):
if s.upper() == "NA":
return True
a = s.split('.')
@AkdM
AkdM / Edit_Repack_ISO_tutorial.md
Last active October 10, 2024 12:05
Edit and repack .iso bootable image

On Linux

Installing mkisofs

apt-get install mkisofs

Editing ISO image

mkdir /tmp/custom_iso

#!/bin/env python3
from flask import Flask
import geoip2.database
app = Flask(__name__)
reader = geoip2.database.Reader('GeoLite2-City.mmdb')
@app.route("/")
def hello():
@touilleMan
touilleMan / SimpleHTTPServerWithUpload.py
Last active November 16, 2024 11:03 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@jasonruyle
jasonruyle / UFW_ban_country.md
Last active October 3, 2024 20:18
UFW to block countries
@aburan28
aburan28 / app.py
Created December 10, 2013 08:43 — forked from vgoklani/app.py
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def index(chartID = 'chart_ID', chart_type = 'bar', chart_height = 350):
chart = {"renderTo": chartID, "type": chart_type, "height": chart_height,}
series = [{"name": 'Label1', "data": [1,2,3]}, {"name": 'Label2', "data": [4, 5, 6]}]
title = {"text": 'My Title'}
curl -X POST -H "Content-Type: application/json" -d '{"src":"XXXXXXXXX","dst":"YYYYYYYYY","text":"こんにちはお元気ですか"}' -L -u <AUTHID>:<AUTHTOKEN> https://api.plivo.com/v1/Account/<AUTHID>/Message/
where:
XXXXXXXXX = source Plivo number (it must be a Phone Number in your Plivo account)
YYYYYYYYY = destination mobile number
<AUTHID> = Plivo AUTHID
<AUTHTOKEN> = Plivo AUTHTOKEN
@vgoklani
vgoklani / app.py
Last active December 19, 2022 09:13
Using Flask to output Python data to High Charts
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def index(chartID = 'chart_ID', chart_type = 'bar', chart_height = 350):
chart = {"renderTo": chartID, "type": chart_type, "height": chart_height,}
series = [{"name": 'Label1', "data": [1,2,3]}, {"name": 'Label2', "data": [4, 5, 6]}]
title = {"text": 'My Title'}