Skip to content

Instantly share code, notes, and snippets.

@ahbanavi
ahbanavi / encryption.php
Last active May 1, 2024 23:18
Encrypt / Decrypt JSON data between Python and PHP using AES 256 GCM
<?php
const PASSPHRASE = ''; // use 'openssl rand -hex 32' to generate key, same with python
function encrypt(array $data): string
{
$data_json_64 = base64_encode(json_encode($data));
$secret_key = hex2bin(PASSPHRASE);
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-gcm'));
$tag = '';
$encrypted_64 = openssl_encrypt($data_json_64, 'aes-256-gcm', $secret_key, 0, $iv, $tag);
@0xdevalias
0xdevalias / reverse-engineering-webpack-apps.md
Last active May 1, 2024 23:17
Some notes and techniques for reverse engineering Webpack (and a little bit about React/Vue) apps
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active May 1, 2024 23:17
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@megahirt
megahirt / Docker with XDebug.md
Last active May 1, 2024 23:16
Debugging PHP with XDebug v3 inside Docker using VSCode

Debugging PHP with XDebug v3 inside Docker using VSCode

Assumptions / Prerequisites

  • XDebug v3+ inside Docker (e.g. php:7.3-apache Docker image)
  • Running Docker v20.10+
  • VSCode with PHP Debug Extension (Felix Becker)
  • Using Docker Compose for orchestration

Objective

@WerySkok
WerySkok / MediaWiki.conf
Created October 8, 2023 20:26
NGINX config for MediaWiki
server {
listen 80;
server_name example.wiki;
# this config assumes that MediaWiki is installed into /opt/mediawiki/w,
# so LocalSettings.php would be located at /opt/mediawiki/w/LocalSettings.php
root /opt/mediawiki;
index index.php;
# allow larger file uploads and longer script runtimes
@leocomelli
leocomelli / git.md
Last active May 1, 2024 23:16
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
T3ZWQ-P2738-3FJWS-YE7HT-6NA3K
KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
65Z2L-P36BY-YWJYC-TMJZL-YDZ2S
SFZHH-2Y246-Z483L-EU92B-LNYUA
GSZVS-5W4WA-T9F2E-L3XUX-68473
FTZ8A-R3CP8-AVHYW-KKRMQ-SYDLS
Q3ZWN-QWLZG-32G22-SCJXZ-9B5S4
DAZPH-G39D3-R4QY7-9PVAY-VQ6BU
KLZ5G-X37YY-65ZYN-EUSV7-WPPBS
@steven2358
steven2358 / ffmpeg.md
Last active May 1, 2024 23:11
FFmpeg cheat sheet
@flaksp
flaksp / README.md
Last active May 1, 2024 23:06
Convert BitWarden JSON export file to Apple iCloud Keychain CSV import file saving TOTP and notes

BitWarden to Apple iCloud Keychain passwords converter

This Python scripts allows you to move your passwords from BitWarden to Apple iCloud.

You need to know:

  • It ignores secure notes, credit cards and other types that are not passwords.
  • It ignores BitWarden entries without usernames, passwords and URLs.
  • It also ignores URLs that do not start with http:// or https://.
  • It normalizes all TOTP tokens, e.g. wskg vtqa h5kl bhb4 v4v2 ybyo woc6 qme2 will be converted to otpauth://totp/example.com:dude@foo.bar?secret=WSKGVTQAH5KLBHB4V4V2YBYOWOC6QME2&amp;issuer=example.com&amp;algorithm=SHA1&amp;digits=6&amp;period=30.
@MagicJohnJang
MagicJohnJang / Prerequisites.md
Last active May 1, 2024 23:05
D3-Sankey on Angular component + Typescript

(It's not a file, do this before using)

  1. Have D3.js v4 implement in your project first.
  2. npm install --save d3-sankey

npm install --save @types/d3-sankey