Skip to content

Instantly share code, notes, and snippets.

View MarcHagen's full-sized avatar
🐣
I may be slow to respond.

Marc MarcHagen

🐣
I may be slow to respond.
View GitHub Profile
@Blackshome
Blackshome / sensor-light-add-on.yaml
Last active March 25, 2024 00:14
sensor-light-add-on.yaml
blueprint:
name: Sensor Light Add On
description: >
# ♾️ Sensor Light Add On - Media & Movie - House Alarm - Smoke Alarm + More
**Version: 2.0**
Lights, Camera, Action! Get ready to grab the popcorn because it's movie time with a touch of cinematic magic! 🎬✨
@ImMyst
ImMyst / .zshrc
Last active November 20, 2020 14:50
My .zshrc config
🟢 Zsh config, snippets and aliases
@bearice
bearice / gist:331a954d86d890d9dbeacdd7de3aabe8
Created August 8, 2019 07:09
ubuntu preseed file for EFI booted software RAID1 rootfs
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US.UTF-8
# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
@noamtamim
noamtamim / README.md
Last active April 29, 2024 13:13
Markdown with PlantUML

How to use PlantUML with Markdown

PlantUML is a really awesome way to create diagrams by writing code instead of drawing and dragging visual elements. Markdown is a really nice documentation tool.

Here's how I combine the two, to create docs with embedded diagrams.

Step 0: Setup

Get the command-line PlantUML from the download page or your relevant package manager.

@candlerb
candlerb / missing-device-ports.py
Last active September 4, 2019 08:18
Report to highlight devices which are missing ports that are in the DeviceType template
# Install as reports/missing-device-ports.py
# Run as: python3 manage.py runreport missing-device-ports
from extras.reports import Report
from dcim.models import Device
class MissingDevicePorts(Report):
description = "Find devices which are missing ports that are in the device type template"
def test_add_ports(self):
@likewhoa
likewhoa / howto
Created September 9, 2016 16:44
code that generates a UEFI capable ISO for Gentoo Linux
$ cat mkefiboot
#!/bin/bash
macbootimg() {
python /usr/lib/python3.3/site-packages/livedvd/mkefiboot -a -l "Gentoo Linux" -i gentoo.icns -p "Gentoo Linux" efi/boot macboot.img
}
efiimg() {
local mountdir
mountdir=$(mktemp -d)
@evanwill
evanwill / gitBash_windows.md
Last active April 26, 2024 03:58
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@dpalomar
dpalomar / .gitattributes
Created April 8, 2016 12:43
Fixing CRLF with gitattributes
From this [issue](https://github.com/puphpet/puphpet/issues/1025#issuecomment-157059174):
I know that this issue is closed, but as I spent a lot of time to understand what was going on, I made some researches and I can explain why this happen, and you can fix it.
Using git config core.autocrlf true can help, but not on a multi-developpers project.
This command has to be the same on each developper machine, and that's not always the case.
You have to use the .gitattributes provided in the puphpet archive and edit it as follow (carefull, this file need to be in your project root)
You also need to use an IDE that allow you to save/edit files as LF (like phpstorm). You can check the type of the file in the bottom right corner, in the status bar (you'll see LF or CRLF while a file is opened)
@wilhelmy
wilhelmy / dirlist.xslt
Last active June 5, 2023 10:44
make nginx dirlistings look like lighttpd's through the magic of xslt-transforming xml dirlistings. I don't even.
<?xml version="1.0"?>
<!--
dirlist.xslt - transform nginx's into lighttpd look-alike dirlistings
I'm currently switching over completely from lighttpd to nginx. If you come
up with a prettier stylesheet or other improvements, please tell me :)
-->
<!--
Copyright (c) 2016 by Moritz Wilhelmy <mw@barfooze.de>
@carcinocron
carcinocron / debugger pause beforeunload
Last active April 25, 2024 16:48
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)