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 / steam-routes.php
Last active September 6, 2023 00:45
Firewall Routes/Rules Generator for Steam PoPs/Relays
THIS GIST CONTAINS TWO VERSIONS - A PHP SCRIPT, AND A PYTHON SCRIPT
### PHP SCRIPT ###
/*
* This script will generate a list of IP segments for selected Steam PoPs/Relays, in desired format (mikrotik, windows, cidr, list, or mask)
* Example use case is for CSGO matchmaking - you can use this to block all servers except the ones you want to play on
*
* Example query (assuming you are hosting this on a php-enabled web server at 192.168.0.1):
* http://192.168.0.1/steam-routes.php?type=mikrotik&telnet=true&allow=jhb,cpt,jnb
@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 / fanspeeds.sh
Last active August 2, 2023 18:40
Dell R610 / R710 temperature-based fan speeds script
#!/bin/bash
# ----------------------------------------------------------------------------------
# Script for checking the temperature reported by the ambient temperature sensor,
# and if deemed too high send the raw IPMI command to enable dynamic fan control.
#
# Also get CPU temps from lm-sensors and adjust fan speeds according to defined
# speed % which should be set according to your needs (each CPU model will vary)
#
# Requires:
@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.