Skip to content

Instantly share code, notes, and snippets.

View 1trackprojects1's full-sized avatar
🌎
:/

Track Projects 1trackprojects1

🌎
:/
View GitHub Profile
@mariocesar
mariocesar / email_parse.py
Last active February 25, 2023 13:41
Parse a raw email
"""
$ cat source.email | python email_parse.py
"""
import fileinput
import email
from email.Utils import parseaddr
def parse():
raw_message = ''.join([line for line in fileinput.input()])
@robulouski
robulouski / gmail_imap_example.py
Last active April 19, 2024 02:27
Very basic example of using Python and IMAP to iterate over emails in a gmail folder/label. http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#!/usr/bin/env python
#
# Very basic example of using Python and IMAP to iterate over emails in a
# gmail folder/label. This code is released into the public domain.
#
# RKI July 2013
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#
import sys
import imaplib
@manishtpatel
manishtpatel / main.go
Last active October 18, 2023 03:12
GoLang Encrypt string to base64 and vice versa using AES encryption.
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
)
@fish2000
fish2000 / uninstall-all-via-pip.sh
Last active February 29, 2024 17:41
Get Rid Of PyObjC
yes | pip uninstall pyobjc-core \
pyobjc-framework-Accounts \
pyobjc-framework-AddressBook \
pyobjc-framework-AppleScriptKit \
pyobjc-framework-AppleScriptObjC \
pyobjc-framework-Automator \
pyobjc-framework-CFNetwork \
pyobjc-framework-CalendarStore \
pyobjc-framework-Cocoa \
pyobjc-framework-Collaboration \
@henriquemenezes
henriquemenezes / one-line-random-string-generators.md
Last active September 23, 2024 15:20
List of one-line random string generators

One-line Random String Generator

Python

CSPRNG (Cryptographically Secure Pseudo-Random Number Generator) functions:

  • os.urandom(n): return a string of n random bytes.
  • random.SystemRandom(): provides random functions that uses os.urandom().

Note: Don't use random module for PRNG for security purposes.

@tkrajina
tkrajina / unmarshal_interface.go
Last active October 29, 2024 03:30
Unmarshal JSON to specific interface implementation
package main
import (
"encoding/json"
"fmt"
"reflect"
)
type Something interface{}
@keithweaver
keithweaver / get-json.py
Created March 10, 2017 03:47
Get JSON file with Python
import json
def getJSON(filePathAndName):
with open(filePathAndName, 'r') as fp:
return json.load(fp)
# Example of returning just JSON
# jsonFile = getJSON('./test.json') # Uncomment this line
# It gets returned as a dictionary.
@hfiref0x
hfiref0x / akagi_41.c
Created August 16, 2017 03:31
UAC bypass using CMSTPLUA COM interface
typedef interface ICMLuaUtil ICMLuaUtil;
typedef struct ICMLuaUtilVtbl {
BEGIN_INTERFACE
HRESULT(STDMETHODCALLTYPE *QueryInterface)(
__RPC__in ICMLuaUtil * This,
__RPC__in REFIID riid,
_COM_Outptr_ void **ppvObject);
@masbog
masbog / dexMD5.py
Last active October 8, 2024 02:34
get dex MD5 of WhatsApp Application and get WhatsApp Version from an APK file
#!/usr/bin/env python3
# tweak up from https://github.com/mgp25/classesMD5-64/blob/master/dexMD5.py
# build AXML library from https://github.com/mikusjelly/axmlparser
# add xml manifest parse for getting WhatsApp Version
# to use this $ python3 dexMD5.py apk/WhatsApp.apk
# Output :
# WhatsApp Version : 2.17.296
# WhatsApp ClassesDEX MD5 : b'YrJNPljM3TuNFPIOZ+jziw=='
#
# @MasBog
/**
Simple(ish) example of discord gateway
This code will get to ready, and then remain connected with heartbeats
see https://discordapi.com/topics/gateway for more info
zlib compression is implemented as it will be required in gateway v7 (so get used to it now)
*/
const WebSocket = require('ws'); // npmjs.org/ws
const zlib = require('zlib-sync'); // npmjs.org/zlib-sync
const erlpack = require('erlpack'); // github.com/discordapp/erlpack