Skip to content

Instantly share code, notes, and snippets.

View AmmarHaddadi's full-sized avatar

AmmarHaddadi

View GitHub Profile
@pmoranga
pmoranga / extract_windows_certificate_from_installer.md
Created September 16, 2016 09:54
Get the (readable) certificate from a windows executable (PE)

Get the (readable) certificate from a windows executable (PE)

From: http://web.fournier.nl/2013/10/get-readable-certificate-from-windows.html

I searched high and low for a simple (linux) solution on how to extract the certificate of an authenticode signed windows binary. I don't want to use wine, nor mono. This is what I came up with:

  • Extract the certificate with 7zip: 7z e setup.exe CERTIFICATE
  • remove the first 8 bytes: dd if=CERTIFICATE bs=1 skip=8 of=setup.exe.pkcs7
  • Read it: openssl pkcs7 -in setup.exe.pkcs7 -inform DER -print_certs -text
@djaiss
djaiss / gist:85a0ada83e6bca68e41e
Last active September 30, 2025 06:54
Block Twitter/Facebook in your /etc/hosts
# Block Facebook IPv4
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.fbcdn.net
@mistic100
mistic100 / Mediakeys.ahk
Last active October 31, 2025 23:46
Media keys shortcuts for AutoHotkey
; AutoHotkey Media Keys
^!Space::Send {Media_Play_Pause}
^!Left::Send {Media_Prev}
^!Right::Send {Media_Next}
^!NumpadMult::Send {Volume_Mute}
^!NumpadAdd::Send {Volume_Up}
^!NumpadSub::Send {Volume_Down}
@aras-p
aras-p / preprocessor_fun.h
Last active October 9, 2025 17:55
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,