Skip to content

Instantly share code, notes, and snippets.

View fragtion's full-sized avatar

Dimitri Pappas fragtion

  • Johannesburg, South Africa
View GitHub Profile
@fragtion
fragtion / gist:74497d279d05bb47dba9f7be83c90c43
Last active February 15, 2024 20:52
MAC Address troubleshooting (unicast, broadcast, multicast)
To validate that any MAC address is unicast, simply confirm that the second character of the mac address (ie, the second character of the first octet, specifically speaking) is one of 0,2,4,8,A,C,E
for example
02:00:00:00:00
04:00:00:00:00
0A:00:00:00:00
0E:00:00:00:00
E2:00:00:00:00
F2:00:00:00:00
F2:00:00:00:00
@fragtion
fragtion / gist:a86ef3d19e75134f8f360f0bc3476293
Created December 17, 2023 22:57
MacBookPro Disable startup chime
Source: https://apple.stackexchange.com/questions/458195/how-to-disable-startup-chime-on-macbook-pro-5-2-2009
`OK after spending countless hours on this, I finally figured it out. And in the end, I didn't even need Mac OS X for it.
Boot into Ubuntu, open a terminal window and issue the following commands:
sudo rm /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82
printf "\x07\x00\x00\x00\x00" > ~/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82
sudo cp ~/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82 /sys/firmware/efi/efivars
And yes, deleting and then creating and copying the var back to /sys/efi/efivars was the ONLY method that worked. Attempting to write
@fragtion
fragtion / fix-intel-brightness.txt
Last active December 17, 2023 22:20
Fix Intel Adaptive Brightness
Intel have introduced a "feature" for computers/laptops with Intel Graphics Adapters, that automatically adjusts the brightness/contrast
of your screen depending on the image being shown on the display
Furthermore, they have removed the option to disable this functionality when the system is running on AC power (in other words, when not
running on battery). I was not able to find it in "Intel Graphics Settings" control panel, or the "Intel® Graphics Command Center"
downloaded from the Mirosoft Store (not even the Beta version).
The problem is, this "feature" seems to work in a counter-intuitive way: When there is dark (more black) content shown on the screen,
the brightness is DIMMED, and when there is mostly light content (more white), the brightness increases! The brightness adjustment is
not instant, but takes a few seconds - so some people may not even notice the effect.
@fragtion
fragtion / configuration.yml
Created September 24, 2023 01:52
leetify-cs2-stats-home-assistant
sensor:
- platform: rest
name: leetify
resource: https://api.leetify.com/api/profile/76561197990921651 #replace the profile id with your own profile id, from eg: https://api.leetify.com/api/profile/76561197990921651
json_attributes:
- games
- recentGameRatings
value_template: 'OK'
scan_interval: 600
- platform: template
@fragtion
fragtion / gist:56e1d50d19015612bd6327f9522679b4
Created August 19, 2023 02:14
vmware-fix-physicaldrive-error
The operation on file \\.\PhysicalDrive failed ...
Fix:
1) Physical disk should be offline in the host OS.
2) Clear readonly attribute with diskpart
```
diskpart
list disk
select disk 5
@fragtion
fragtion / 0x0000007Bfix
Created February 2, 2023 02:11
0x0000007B fix
First inject drivers: https://gist.github.com/TomCan/9644966
Change to AHCI mode from IDE mode:
You can use the MS Fix it tool or edit the registry yourself.
Link to tool here: http://support.microsoft.com/kb/922976/
Regedit:
1. Exit all Windows-based programs.
2. Press [Win] + R or take the RUN option from the start menu.
3. Now type Regedit there and press Enter Key to open up the Registry Editor Window. (If you receive the User Account Control dialog box, click Continue.)
4. Locate and then click the following registry sub key:
@fragtion
fragtion / osx-static-route.txt
Created December 3, 2022 23:00
Mac / OSX Static Route
In terminal:
sudo route -n add 192.168.2.0/24 172.31.30.1
@fragtion
fragtion / fake-vga-monitor
Created August 22, 2022 14:54
Fake VGA Monitor
This is by far not the ideal solution, but for now it will do: I put a 102 Ohm resistor across pins 2 and 7 of my VGA port (also known as the headless Mac Mini trick), and Windows 10 now believes I have a second monitor attached.
On a different computer I had to use pins 1 and 6 and reboot before the "monitor" would work.
@fragtion
fragtion / samsung-android-pack-repack.sh
Created January 11, 2022 21:10 — forked from nikiink/samsung-android-pack-repack.sh
Procedure to modify a product.img.lz4 used by Samsung Android phones with Android 10
ANDROID 10 SAMSUNG IMG PACK/REPACK - UBUNTU 18.10 COSMIC
[BOOTLOADER UNLOCKED IS REQUIRED - FIRST UNLOCK BOOTLOADER]
-----------------------------------------------------------
/etc/apt/sources.list
deb http://old-releases.ubuntu.com/ubuntu/ cosmic main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ cosmic main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ cosmic-security main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ cosmic-security main universe restricted multiverse
@fragtion
fragtion / upnphack.txt
Last active October 21, 2021 19:27
MikroTik RouterOS upnp hack
# RouterOS has a limitation where you can't run UPnP on the same interface for both internal and external (in order to DST-NAT from a LAN IP to another LAN IP on same interface/subnet)
# This hack lets you workaround this limitation
#
# In the following example, bridge1 has IP 192.168.0.2 and is the gateway for other some clients with uPnP needs
# The router's default gateway upstream, is another LAN device, eg 192.168.0.1
#
# How it works:
# 1. First we disable uPnP daemon
# 2. We define the intended internal uPnP interface as an external one for now
# 3. Enable uPnP