Skip to content

Instantly share code, notes, and snippets.

View maikeruit's full-sized avatar
😎

Mihail maikeruit

😎
  • Russia
View GitHub Profile
@tvorogme
tvorogme / generate.fif
Last active May 29, 2024 09:15
TON deploy smart contract
#!/usr/bin/fift -s
"TonUtil.fif" include
"Asm.fif" include
// If you dont know about stack-base languages
// Please read something before read comments and trying to understand what is going on here :)
5 :$1..n // parse arguments
$1 parse-workchain-id =: wc // set workchain id from command line argument
$2 parse-int =: subwallet-id // set subwallet id
@felixhammerl
felixhammerl / README.md
Last active June 21, 2024 21:13
MitM TLS encrypted traffic in macOS using SSLKEYLOGFILE

Option 1: Via macOS environment variable:

  1. mkdir -p ~/Library/LaunchAgents
  2. Put tlskeylogger.plist at ~/Library/LaunchAgents/tlskeylogger.plist
  3. launchctl load ~/Library/LaunchAgents/tlskeylogger.plist, so it will load on the next restart
  4. launchctl start ~/Library/LaunchAgents/tlskeylogger.plist, so it will load the environment variable immediately
  5. Restart your browser(s)
  6. See how TLS keys are being written to ~/.tlskeyfile via tail -f ~/.tlskeyfile

NB: This may be hit or miss and many apps do not respect the env var.

@nealfennimore
nealfennimore / wireguard.conf
Last active June 15, 2024 10:58
Wireguard VPN - Forward all traffic to server
# ------------------------------------------------
# Config files are located in /etc/wireguard/wg0
# ------------------------------------------------
# ---------- Server Config ----------
[Interface]
Address = 10.10.0.1/24 # IPV4 CIDR
Address = fd86:ea04:1111::1/64 # IPV6 CIDR
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # Add forwarding when VPN is started
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE # Remove forwarding when VPN is shutdown
@EddiG
EddiG / wireshark.md
Last active March 31, 2024 10:34
How to decrypt SSL/TLS traffic in Wireshark on MacOS

The main point is to save the SSL/TLS keys those used by the web browser (SSLKEYLOGFILE=/tmp/tmp-google/.ssl-key.log).
In the example below we run brand new instance of Google Chrome (--user-data-dir=/tmp/tmp-google do the trick):
SSLKEYLOGFILE=/tmp/tmp-google/.ssl-key.log /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/tmp/tmp-google
Then run the Wireshark and open the Preferences -> Protocols -> SSL, where we put the path to the SSL keys log file into the (Pre)-Master-Secret log filename field.
Now all SSL/TLS traffic from this browser instance will be decrypted.

Building pgModeler in MacOS with Homebrew

The official installation instructions for pgModeler recommends installing Xcode and the Enterprise DB distribution of Postgres to fulfill its build requirements. Luckily, Homebrew's got us covered!

  1. Checkout the source

    git clone https://github.com/pgmodeler/pgmodeler.git
    
@MauricioMoraes
MauricioMoraes / access_postgresql_with_docker.md
Last active May 27, 2024 01:21
Allow Docker Container Access to Host's Postgres Database on linux (ubuntu)

You have to do 2 things in order to allow your container to access your host's postgresql database

  1. Make your postgresql listen to an external ip address
  2. Let this client ip (your docker container) access your postgresql database with a given user

Obs: By "Host" here I mean "the server where docker is running on".

Make your postgresql listen to an external ip address

Find your postgresql.conf (in case you don't know where it is)

$ sudo find / -type f -name postgresql.conf

@s4l1h
s4l1h / debian-8-build-php-5.3.29.sh
Created February 28, 2017 13:39
Debian 8 (jessie) build php 5.3.29
#!/bin/bash
mkdir /opt/php-5.3.29
mkdir /usr/local/src/php5-build
cd /usr/local/src/php5-build
wget http://de.php.net/get/php-5.3.29.tar.bz2/from/this/mirror -O php-5.3.29.tar.bz2
tar jxf php-5.3.29.tar.bz2
# Thanks https://crybit.com/20-common-php-compilation-errors-and-fix-unix/
apt-get install libbz2-dev libxml2-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libc-client2007e-dev libkrb5-dev libmcrypt-dev libpq-dev libmysqlclient-dev
mkdir /usr/include/freetype2/freetype
@cfobel
cfobel / janus.plugin.streaming.cfg
Last active March 27, 2023 22:50
WebRTC Stream Logitech C920 through Janus gateway
; /opt/janus/etc/janus/janus.plugin.streaming.cfg
; [stream-name]
; type = rtp|live|ondemand|rtsp
; rtp = stream originated by an external tool (e.g., gstreamer or
; ffmpeg) and sent to the plugin via RTP
; live = local file streamed live to multiple listeners
; (multiple listeners = same streaming context)
; ondemand = local file streamed on-demand to a single listener
; (multiple listeners = different streaming contexts)
; rtsp = stream originated by an external RTSP feed (only
@jeremykendall
jeremykendall / postgres-dump-restore.markdown
Last active April 27, 2021 20:27
PostgreSQL: dump and restore (to db with different name and roles even)

Postgres Export and Import

Export

pg_dump -U [superuser] -Fc [dbname] > db.dump

Import

@sphaero
sphaero / gstreamer-build.sh
Last active February 11, 2023 16:25
Install & build gstreamer from git
#!/bin/bash --debugger
set -e
BRANCH="master"
if grep -q BCM2708 /proc/cpuinfo; then
echo "RPI BUILD!"
RPI="1"
fi
[ -n "$1" ] && BRANCH=$1