Skip to content

Instantly share code, notes, and snippets.

import subprocess
import json
def run_axfr_query(name_server, domain):
# Run the AXFR query using dig
command = f"dig @{name_server} {domain} AXFR +noall +answer"
output = subprocess.check_output(command, shell=True, universal_newlines=True)
# Parse the output and create the JSON dictionary
records = {}
@mlow
mlow / erpnext.sh
Last active April 12, 2025 05:43
Simple ERPNext setup script
#!/bin/bash
# This script helps with getting Frappe/ERPNext running quickly using
# the upstream Compose specifications. Not intended for production.
#
# Usage:
#
# $ git clone https://github.com/frappe/frappe_docker
# $ cd frappe_docker
# $ curl -Lo erpnext.sh <URL to this raw gist>
#
@mlow
mlow / Dockerfile
Last active July 24, 2023 22:06
Containerized Neovim
# Example usage
#
# $ cp Dockerfile .config/nvim
# $ docker build .config/nvim -t mynvim
#
# # in your .bashrc or .bash_aliases
# nvim() {
# docker run -it \
# --network host \
# -v ~/.ssh:/home/me/.ssh:ro \
2019/10/30 17:14:16 Unknown opcode 2016
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x508d38]
goroutine 23 [running]:
github.com/hanwen/go-fuse/fuse.(*request).serializeHeader(0x400008c000, 0x0, 0x28, 0x0, 0x0)
github.com/hanwen/go-fuse/fuse/request.go:212 +0x20
github.com/hanwen/go-fuse/fuse.(*Server).write(0x40000a0000, 0x400008c000, 0x0)
github.com/hanwen/go-fuse/fuse/server.go:462 +0x58
github.com/hanwen/go-fuse/fuse.(*Server).handleRequest(0x40000a0000, 0x400008c000, 0x400008c000)
Oct 29 23:34:49 rock64 gocryptfs[3838]: go-fuse: Unknown opcode 2016
Oct 29 23:34:49 rock64 gocryptfs-3838-logger[3849]: panic: runtime error: invalid memory address or nil pointer dereference
Oct 29 23:34:49 rock64 gocryptfs-3838-logger[3849]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x508d38]
Oct 29 23:34:49 rock64 gocryptfs-3838-logger[3849]:
Oct 29 23:34:49 rock64 gocryptfs-3838-logger[3849]: goroutine 1 [running]:
Oct 29 23:34:49 rock64 gocryptfs-3838-logger[3849]: github.com/hanwen/go-fuse/fuse.(*request).serializeHeader(0x400000c240, 0x0, 0x28, 0x0, 0x0)
Oct 29 23:34:49 rock64 gocryptfs-3838-logger[3849]: github.com/hanwen/go-fuse/fuse/request.go:212 +0x20
Oct 29 23:34:49 rock64 gocryptfs-3838-logger[3849]: github.com/hanwen/go-fuse/fuse.(*Server).write(0x40000c6000, 0x400000c240, 0x0)
Oct 29 23:34:49 rock64 gocryptfs-3838-logger[3849]: github.com/hanwen/go-fuse/fuse/server.go:462 +0x58
Oct 29 23:34:49 rock64 gocryptfs-3838-logger[3849]: github.com/hanwen/go-fuse/f
@mlow
mlow / subscription_manager
Created March 17, 2019 19:05
A bit subscription list
<opml version="1.1">
<body><outline text="YouTube Subscriptions" title="YouTube Subscriptions"><outline text="swallowgames" title="swallowgames" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCITAdOp3YrDijRkTMpcJplA" /><outline text="Glink" title="Glink" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCNTqu16j3F6RbtHZI-3untg" /><outline text="NileRed" title="NileRed" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCFhXFikryT4aFcLkLw2LBLA" /><outline text="Vsauce" title="Vsauce" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UC6nSFpj9HTCZ5t-N3Rm3-HA" /><outline text="celldweller" title="celldweller" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCpDmAxyuLoNrP-cek8tEfrw" /><outline text="DONG" title="DONG" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UClq42foiSgl7sSpLupnugGA" /><outline text="SuperExtraBuns" title="SuperExtraBuns" type="rss" xmlUrl="https://www.yout
@mlow
mlow / discover.py
Last active August 29, 2015 14:13 — forked from trhura/discover.py
#! /usr/bin/env python
# script for ubnt device discovery
# Usage: python discover.py or ./discover.py
import socket
from contextlib import closing
PORT=40860
@mlow
mlow / gist:7407764
Last active December 27, 2015 23:39
Import LogBlock's signtext to Prism
-- Assuming Logblock Database = logblock, table = lb-world, Prism Database = minecraft
-- For versions prior than Prism 2.0
-- sign-text
INSERT INTO `minecraft`.`prism_actions` (action_time,action_type,player,world,x,y,z,data)
SELECT `logblock`.`lb-world`.date, "sign-change", `logblock`.`lb-players`.playername, "world", `logblock`.`lb-world`.x, `logblock`.`lb-world`.y, `logblock`.`lb-world`.z,
CONCAT('{"block_id":',`logblock`.`lb-world`.type,',"block_subid":',`logblock`.`lb-world`.data, ',"lines":["',
SUBSTRING_INDEX(SUBSTRING_INDEX(`logblock`.`lb-world-sign`.signtext, '\0', 1), '\0', -1), '","', -- line 1
SUBSTRING_INDEX(SUBSTRING_INDEX(`logblock`.`lb-world-sign`.signtext, '\0', 2), '\0', -1), '","', -- line 2
SUBSTRING_INDEX(SUBSTRING_INDEX(`logblock`.`lb-world-sign`.signtext, '\0', 3), '\0', -1), '","', -- line 3
@mlow
mlow / gist:5155024
Last active December 14, 2015 21:59
A craft command to get around the craft bench not working in protocol enabled version of spigot
import com.sk89q.commandbook.CommandBook;
import com.sk89q.commandbook.util.PlayerUtil;
import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.minecraft.util.commands.CommandException;
import com.sk89q.minecraft.util.commands.CommandPermissions;
import com.zachsthings.libcomponents.ComponentInformation;
import com.zachsthings.libcomponents.bukkit.BukkitComponent;
import java.util.ArrayList;
import java.util.Collection;
@mlow
mlow / Derp.java
Created August 6, 2012 16:04
Java from int to roman numeral
private static String[] RVALS = {"M", "CM", "D", "CD", "C", "XC", "L",
"XL", "X", "IX", "V", "IV", "I"};
private static int[] IVALS = {1000, 900, 500, 400, 100, 90,
50, 40, 10, 9, 5, 4, 1};
public static String toRomanNumeral(int value) {
if (value >= 4000 || value <= 0) return "";
String roman = "";
for (int i = 0; i < RVALS.length; i++) {