Skip to content

Instantly share code, notes, and snippets.

View gavinhungry's full-sized avatar

Gavin Lloyd gavinhungry

View GitHub Profile
@pratyakshm
pratyakshm / windowsinstallusingdism.md
Last active April 15, 2024 15:27
Installing Windows 11 on any device using DISM

Install Windows 11 on unsupported devices

Guide to install Windows 11 on any PC (does not involve ISO modifications) This guide will take you through a clean and simple way to install Windows 11 on your device by bypassing all requirements without doing any ISO modifications. Note: Guide shows fresh installation only.

Requirements:

  1. ISO file (Link 1) (Link 2) (22000.65)
  2. Rufus Microsoft Store GitHub Website
  3. USB drive [8GB or more]
@bulletmark
bulletmark / wifi-switcher
Last active January 2, 2024 03:06
Small program to switch wifi off/on when wired connection goes on/off
#!/usr/bin/env python3
# If you are using Linux NetworkManager then this program toggles your
# wifi connection off->ON whenever your wired connection goes ON->off,
# and vice-versa. Simply copy this to
# /etc/NetworkManager/dispatcher.d/99-wifi and ensure it is executable.
# No configuration is required. Get the latest version from
# https://gist.github.com/bulletmark/8e051a0a9ffdce689d86988c528e7764
# Author: Mark Blakeney, Jun 2020.
from __future__ import annotations
import subprocess
@WebReflection
WebReflection / executable-standalone-module.md
Last active March 4, 2024 20:55
NodeJS Executable Standalone Module

Update

If you're OK in having a node-esm executable, please consider this solution.

#!/usr/bin/env sh
# the /usr/local/bin/node-esm executable
input_file=$1
shift
exec node --input-type=module - $@ <$input_file
@scmx
scmx / using-details-summary-github.md
Last active April 1, 2024 02:07
Using <details> <summary> expandable content on GitHub with Markdown #details #summary #markdown #gfm #html

How to use <details> <summary> expandable content on GitHub with Markdown

Firstly, what is <details> <summary>?

The HTML Details Element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label can be provided using the <summary> element. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details.

Example

@Sporif
Sporif / userChrome.css
Last active April 26, 2022 09:38
NOTE: Doesn't work with Firefox 72+. Add userChrome.js support to Firefox with just userChrome.css. A compact version of https://github.com/Sporif/firefox-quantum-userchromejs. Instead of loading userChrome.xml file it uses a data URI.
toolbarbutton#alltabs-button {
-moz-binding: url(data:text/plain;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8IS0tIENvcHlyaWdodCAoYykgMjAxNyBIYWdnYWkgTnVjaGkNCkF2YWlsYWJsZSBmb3IgdXNlIHVuZGVyIHRoZSBNSVQgTGljZW5zZToNCmh0dHBzOi8vb3BlbnNvdXJjZS5vcmcvbGljZW5zZXMvTUlUDQogLS0+DQoNCjwhLS0gUnVuIHVzZXJDaHJvbWUuanMvdXNlckNocm9tZS54dWwgYW5kIC51Yy5qcy8udWMueHVsLy5jc3MgZmlsZXMgIC0tPg0KPGJpbmRpbmdzIHhtbG5zPSJodHRwOi8vd3d3Lm1vemlsbGEub3JnL3hibCI+DQogICAgPGJpbmRpbmcgaWQ9ImpzIj4NCiAgICAgICAgPGltcGxlbWVudGF0aW9uPg0KICAgICAgICAgICAgPGNvbnN0cnVjdG9yPjwhW0NEQVRBWw0KICAgICAgICAgICAgICAgIGlmKHdpbmRvdy51c2VyQ2hyb21lSnNNb2QpIHJldHVybjsNCiAgICAgICAgICAgICAgICB3aW5kb3cudXNlckNocm9tZUpzTW9kID0gdHJ1ZTsNCg0KICAgICAgICAgICAgICAgIHZhciBjaHJvbWVGaWxlcyA9IEZpbGVVdGlscy5nZXREaXIoIlVDaHJtIiwgW10pLmRpcmVjdG9yeUVudHJpZXM7DQogICAgICAgICAgICAgICAgdmFyIHh1bEZpbGVzID0gW107DQogICAgICAgICAgICAgICAgdmFyIHNzcyA9IENjWydAbW96aWxsYS5vcmcvY29udGVudC9zdHlsZS1zaGVldC1zZXJ2aWNlOzEnXS5nZXRTZXJ2aWNlKENpLm5zSVN0eWxlU2hlZXRTZXJ2aWNlKTsNCg0KICAgICAgICAgIC
@abn
abn / 00-lenovo-x1-5th-gen-thinkfan-setup.md
Last active January 30, 2024 19:31
Fedora thinkfan configuration for Lenovo X1 Carbon (5th Gen)

Thinkfan Configuration Notes

This are notes for configuration thinkfan for Fedora. This configuration procedure was followed on a Lenovo Thinkpad X1 Carbon (5th Gen) running Fedora 25.

Non standard (default) configuration was required for this machine as the default sensors are not available. Eg: /proc/acpi/ibm/thermal does not exist for this model.

An annoted configuration file has been included below. However, there is no guarentee that this will work as-is on every machine.

Installation

dnf -y install thinkfan
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 14, 2024 11:40
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@emiller
emiller / git-mv-with-history
Last active February 6, 2024 13:17
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.