Skip to content

Instantly share code, notes, and snippets.

View AkdM's full-sized avatar
👋

Anthony Da Mota AkdM

👋
View GitHub Profile
@AkdM
AkdM / .gitignore
Last active January 13, 2024 11:27
Daily backup Home Assistant configuration into a git repository
View .gitignore
# You can whitelist files/folders with !, those will not be ignored.
# ignore
custom_components/
zigbee2mqtt/log
zigbee2mqtt/state.json
home-assistant.log
home-assistant.log.1
home-assistant.log.fault
.ssh/ # Don't be stupid and ignore that folder
@AkdM
AkdM / yt-dl_ffmpeg_live.md
Last active October 22, 2022 21:50
youtube-dl and ffmpeg with a YouTube live stream
View yt-dl_ffmpeg_live.md

The following will get the YT livestream (it should be a .m3u8 file), and will output multiple %d.mp4 files, every 20 seconds thanks to ffmpeg:

ffmpeg -i `youtube-dl --youtube-skip-dash-manifest -g "https://www.youtube.com/watch?v=f9ALdmDLPGU"` -c copy -flags +global_header -f segment -segment_time 20 -segment_format_options movflags=+faststart -reset_timestamps 1 "%d.mp4"
@AkdM
AkdM / webos_cheatsheet.md
Last active February 18, 2024 13:33
LG webOS cheatsheet
View webos_cheatsheet.md

Context

I have a LG OLED 65C1, now rooted with RootMyTV v2. I have been hacking around exploring all the possibilities, and this gist is thus a personal cheatsheet.

Commands

🔄 "Stealth" reboot

If ever your TV goes into servicing at LG for whatever reason, it would be better to have every chances to your sides by not allowing them seeing you made some "not covered" stuff to the TV. A reboot command can be detected, so there's an alternative. But it has to be confirmed yet if it's really stealth or not.

Please however note the following from @Informatic. But we don't know if LG can do something about it:

@AkdM
AkdM / hideMyEmail.applescript
Last active November 25, 2022 01:21
Generate new "Hide My Email" email with iCloud+ using AppleScript
View hideMyEmail.applescript
-- Kill System Preferences first if already open
if application "System Preferences" is running then
tell application "System Events"
set theID to unix id of processes whose name is "System Preferences"
try
do shell script "kill -9 " & theID
delay 0.1
end try
end tell
end if
@AkdM
AkdM / stream.md
Last active June 18, 2022 11:12
RTSP Stream with `youtube-dl`
View stream.md
@AkdM
AkdM / heic2jpg.sh
Last active January 20, 2024 08:26
HEIC to JPG using terminal (in macOS)
View heic2jpg.sh
# Add this to your .zshrc or .bashrc
# Use it by simply calling `heic2jpg pwd/picture1.heic pwd/picture2.heic pwd/picture3.heic`
# Only compatible with macOS. You can also change line 21 to make it compatible with something else.
# If you decide to delete source files, those will be in the bin, not deleted as with `rm` command.
# You will need imagemagick bin to convert the pictures: `brew install imagemagick`
heic_convert() {
echo "Converting $# .HEIC files to .jpg"
for var in "$@"
@AkdM
AkdM / ios14-certificate-pinning-bypass.md
Last active January 8, 2024 05:02
iOS 14 app TLS decrypt / certificate pinning bypass steps
View ios14-certificate-pinning-bypass.md

This is not a tutorial, just a small guide to myself but feel free to get some infos here.

Working on an iPhone 7 running iOS 14.5.1

  1. Jailbreak an iPhone/iPad/whatever

  2. If necessary, you'll need to bypass Jailbreak detection for some apps with tweaks like A-Bypass, Hestia, HideJB, etc.

  3. Get the PID of the app you want to capture traffic from with frida-ps -Ua ( a is for showing running apps only, you can -U to show all running processes instead)

@AkdM
AkdM / amd.js
Last active April 15, 2021 16:33
AMD.js
View amd.js
// ==UserScript==
// @name AMD Button
// @version 0.1
// @description YAY
// @author AkdM
// @match https://www.amd.com/*/direct-buy/*
// @icon https://www.google.com/s2/favicons?domain=amd.com
// @grant none
// ==/UserScript==
@AkdM
AkdM / addToCart.js
Last active April 8, 2021 16:12
Add to Bookmark
View addToCart.js
javascript: (async function () {
const t = (t) => (document.querySelector(".page-title").innerText = t);
try {
t("looking for product id...");
var e = (() => document.location.pathname.split("/").filter((t) => /\d{10}/.test(t))[0])();
t("adding to cart..."), await ((t) => fetch(`https://www.amd.com/en/direct-buy/add-to-cart/${t}`, { credentials: "include", method: "GET", mode: "cors", redirect: "error" }))(e), t("added to cart, fetching checkout URL...");
var a = await (async () => {
var t = await fetch("https://www.amd.com/en/direct-buy/shopping-cart/modal?_wrapper_format=drupal_modal", { credentials: "include", method: "POST", mode: "cors" });
return (await t.text()).match(/\/.{2}\\\/direct-buy\\\/checkout\\\/payment\\\/\d*\\\/.{2}/)[0].replace(/\\/g, "");
})();
@AkdM
AkdM / dbus_cheatsheet.md
Created February 14, 2020 00:22
D-Bus Cheatsheet
View dbus_cheatsheet.md

Requirements

  • qdbus (sudo apt install qdbus)

Commands

List services

qdbus