Skip to content

Instantly share code, notes, and snippets.

View mikeblum's full-sized avatar
🥝

Michael Blum mikeblum

🥝
View GitHub Profile
@mikeblum
mikeblum / windows-iso-on-mac.sh
Created August 21, 2023 17:56
Build Windows 11 Live USB On Mac
diskutil list
diskutil eraseDisk MS-DOS "WIN11" GPT /dev/disk4
hdiutil mount ~/Downloads/Win11_22H2_EnglishInternational_x64v2.iso
rsync -vha --exclude=sources/install.wim /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WIN11
ll /Volumes
@mikeblum
mikeblum / pi-hole.nomad
Created December 11, 2021 23:45
Pi-hole on Nomad
job "pi-hole" {
datacenters = ["homelab"]
type = "system"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
constraint {
@mikeblum
mikeblum / README.md
Last active February 17, 2022 19:51
Branching/tagging Github Wikis

##Branching/tagging Github Wikis##

###Creating an HPI Wiki release###

Download HPI

git clone https://github.com/tsgrp/hpi.git hpi

Download the HPI Wiki - this url is found by adding wiki to the repository Git url:

.bd-callout {
padding: 1.25rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
border: 1px solid #eee;
border-left-width: .25rem;
border-radius: .25rem
}
.bd-callout h4 {
@mikeblum
mikeblum / postgres_queries_and_commands.sql
Created April 17, 2021 16:05 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@mikeblum
mikeblum / xkcd.cypher
Last active October 3, 2020 19:42
Import XKCD Into Neo4j
CALL apoc.periodic.commit("
OPTIONAL MATCH (current:Xkcd) WITH current ORDER BY current.id DESC LIMIT 1
OPTIONAL MATCH (oldest:Xkcd) WITH current, oldest ORDER BY oldest.id ASC LIMIT 1
WITH current.id AS current_issue,
CASE
WHEN oldest IS NULL THEN 1
WHEN oldest.id = 1 THEN current.id END
AS oldest_issue, 'https://xkcd.com/info.0.json' AS uri
CALL apoc.load.jsonParams(uri, null, null)
YIELD value WITH value.num AS latest_issue, current_issue, oldest_issue
@mikeblum
mikeblum / sizeChecker.java
Created September 8, 2016 20:26
Calculate the size of an InputStream
package size_checker;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
public class SizeChecker {
@mikeblum
mikeblum / typeahead.less
Created January 8, 2015 16:25
Twitter Typeahead Styling Template
div.typeahead-dropdown{
padding-top: 0px;
padding-bottom: 0px;
width: 100%;
background-color: #fff;
}
.form-horizontal > .typeahead-group{
margin-right: 0px;
margin-left: 0px;
@mikeblum
mikeblum / README.md
Created August 1, 2016 03:58 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

@mikeblum
mikeblum / package_and_deploy_lambda_function.sh
Created July 3, 2016 04:00
Deploy Python Lambda fucntions to AWS
#!/bin/bash
# expects the lambda function .py file to be in the same directory as this script.
# based off of Amazon's official documentation:
# http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-pkg.html#with-s3-example-deployment-pkg-python
# get the lambda function
lambda_func_file=$1
lambda_func="${lambda_func_file%.*}"
# exit if no file specified
[[ -z "$1" ]] && { echo "Lambda function is empty" ; exit 1; }
# generate a deployment timestamp