Skip to content

Instantly share code, notes, and snippets.

View mchaker's full-sized avatar

M mchaker

View GitHub Profile
@mchaker
mchaker / _hover_example.py
Created August 14, 2017 13:27 — forked from dankrause/_hover_example.py
Example code to use the (unofficial, unsupported, undocumented) hover.com DNS API.
import requests
class HoverException(Exception):
pass
class HoverAPI(object):
def __init__(self, username, password):
params = {"username": username, "password": password}
r = requests.post("https://www.hover.com/api/login", params=params)
@mchaker
mchaker / multicraft.conf
Last active September 28, 2019 03:35 — forked from cloudrck/multicraft.conf
Nginx Configuration for running Multicraft Panel
upstream php7.2-fpm-sock {
server unix:/var/run/php/php7.2-fpm.sock;
}
server {
listen 80;
server_name minecraft.example.com;
root /srv/minecraft/multicraft/;
index index.php;

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@mchaker
mchaker / UniFi Tunnelbroker.md
Created June 26, 2021 13:59 — forked from CHTJonas/UniFi Tunnelbroker.md
Tunnelbroker config for UniFi Security Gateway

UniFi Tunnelbroker Configuration

This GitHub Gist details the manual configuration needed on a UniFi controller to enable IPv6 tunneling with Hurricane Electric's Tunnelbroker service.

Setup

This is what works for me personally. Stuff you'll need to do to adapt this to your ends:

  • Replace "local-ip" with your USG's public IPv4 address.
  • Replace "remote-ip" with the address of your Tunnelbroker tunnel server.
  • Replace "address" with the IPv6 address that your are allocated.
@mchaker
mchaker / jq-cheetsheet.md
Created January 1, 2022 05:06 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@mchaker
mchaker / Edit_Repack_ISO_tutorial.md
Created March 12, 2022 14:17 — forked from AkdM/Edit_Repack_ISO_tutorial.md
Edit and repack .iso bootable image

On Linux

Installing mkisofs

apt-get install mkisofs

Editing ISO image

mkdir /tmp/custom_iso

To install tcptraceroute on Debian/Ubuntu:

$ sudo apt-get install tcptraceroute

To install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:

$ sudo yum install tcptraceroute
@mchaker
mchaker / _Google Analytics 4 with Hugo.md
Last active April 20, 2022 23:56 — forked from zjeaton/_Google Analytics 4 with Hugo.md
Google Analytics 4 (with Measurement ID) in Hugo

Google Analytics 4 in Hugo

Blog post with slightly more detail can be found here. If you want to just get to it, read on.

I (very) recently decided to reimplement GA in my site, and found that existing implementation in Hugo was not compatible with GA4's new Measurement ID. This is an easy way to drop your Measurement ID into your site. I'm not going to go into how to sign up for GA.

This implementation requires that you create a site parameter for analytics, create a partial, and call the partial. I tweaked the names of the parameters and files so they didn't collide with the built-in hugo code.

Place the GoogleAnalyicsID (Measurement ID) in config.toml within [params].

Keybase proof

I hereby claim:

  • I am mchaker on github.
  • I am mchaker (https://keybase.io/mchaker) on keybase.
  • I have a public key whose fingerprint is 3C85 3A1F 55F6 7A35 6B32 11A2 98ED 8FCB EB8F FA76

To claim this, I am signing this object:

@mchaker
mchaker / improve-stablediffusion-pipeline-mem-mgmt.py
Created September 6, 2022 09:58 — forked from fladdict/gist:2115eb7ea32c9245e4f45642553aa3e9
Improve Diffuser Pipeline / StableDiffusion Memory Management
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16, use_auth_token=True)
pipe = pipe.to("cuda")
img2imgPipe = StableDiffusionImg2ImgPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16, use_auth_token=True)
img2imgPipe = img2imgPipe.to("cuda")
inpaintingPipe = StableDiffusionInpaintingPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16, use_auth_token=True)
inpaintingPipe = inpaintingPipe.to("cuda")