Skip to content

Instantly share code, notes, and snippets.

View IamFaizanKhalid's full-sized avatar
🪄
What's life without a few dragons?

Faizan Khalid IamFaizanKhalid

🪄
What's life without a few dragons?
  • Mansehra, Pakistan
  • 22:41 (UTC +05:00)
View GitHub Profile
@IamFaizanKhalid
IamFaizanKhalid / README.md
Last active June 24, 2023 07:11
Golang with Lambda + Redis setup with Localstack using Docker

This demonstrates how to configure your Golang Lambda function (that uses Redis) on localstack using docker.

Prerequisites:

Usage

  • Run ./setup.sh to set up.
  • Run ./update.sh to update lambda with your latest code.
@IamFaizanKhalid
IamFaizanKhalid / env2json.sh
Created June 22, 2023 07:04
Read .env file and print it in JSON format.
awk 'NF' .env | jq -cMR '[inputs | split("=") | {(.[0]): (.[1]) }] | add'
@IamFaizanKhalid
IamFaizanKhalid / protoc-install.sh
Created December 5, 2022 05:12
Script to install protobuf compiler on unix based systems. Download latest release from: https://github.com/protocolbuffers/protobuf/releases
#!/usr/bin/env bash
cp -r ./include/google /usr/local/include/
cp ./bin/protoc /usr/local/bin/protoc
xattr -d com.apple.quarantine /usr/local/bin/protoc
@IamFaizanKhalid
IamFaizanKhalid / get_function_name.go
Created December 1, 2022 04:38
Function to get current function's name in Golang.
package main
import (
"fmt"
"runtime"
)
func main() {
myFunction()
}
@IamFaizanKhalid
IamFaizanKhalid / ProtectDriveFromAutorunVirus.cmd
Created November 8, 2022 14:56
Protect USB drive from AutoRun virus.
@echo off
echo This will create an undeletable folder AUTORUN.INF and a file RECYCLER on
echo the drive you choose in next prompt.
echo.
echo 1. Enable
echo 2. Disable (Undo this tweak)
echo 3. Exit
echo.
set /p twk=Choose an option :
if "%twk%"=="1" goto d
@IamFaizanKhalid
IamFaizanKhalid / WriteProtectUSBDevicesOnThisPC.cmd
Created November 8, 2022 14:39
Write-protect USB devices on a Windows PC.
@echo off
pushd "%~dp0"
:A
echo.
echo 1. Set USB Devices as Read Only on this PC
echo 2. Set USB Devices as Read and Write on this PC
echo 3. Exit
echo.
set /p usbd=Choose an option :
SET _REG=reg add "HKLM\SYSTEM\ControlSet001\Control\StorageDevicePolicies" /f /t REG_DWORD /v WriteProtect /d
@IamFaizanKhalid
IamFaizanKhalid / USB Shortcut File Reovery.cmd
Created November 7, 2022 15:00
Script to access files in a USB drive, hidden by the malicious shortcut creating malware on another PC behind a shortcut.
@echo
title USB Shortcut File Reovery - Faizan Khalid
cls
echo Enter the USB Drive Letter (e.g. F): & set /p Drive=
cls
echo Recovering Files..
attrib -h -r -s %Drive%:*.* /s /d
attrib +s +h "%Drive%:System Volume Information" /s /d
cls
echo Done!
@IamFaizanKhalid
IamFaizanKhalid / wallpaper.cmd
Created November 7, 2022 14:51
Windows script to save wallpapers from Windows Spotlight to Desktop.
echo off
title Windows Spotlight
cls
echo This will copy all wallpapers from %userprofile%\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\ to the folder "wallpaper" on the Desktop
pause
cd %userprofile%\Desktop
md wallpaper
cd wallpaper
rem md %date:/=%
rem cd %date:/=%

Keybase proof

I hereby claim:

  • I am iamfaizankhalid on github.
  • I am iamfaizankhalid (https://keybase.io/iamfaizankhalid) on keybase.
  • I have a public key ASBsKzdTeZIy5l1gGQVd5izLE77jfizTAMBj0Pgz-U-4sgo

To claim this, I am signing this object:

@IamFaizanKhalid
IamFaizanKhalid / install_maven_jar.txt
Created June 7, 2021 15:55
Command to install a packaged jar into local maven repository
mvn install:install-file
-Dfile=./lib/RedshiftJDBC41-no-awssdk-1.2.27.1051.jar
-DgroupId=com.amazon.redshift \
-DartifactId=jdbc41
-Dversion=1.2.27.1051
-Dpackaging=jar