Skip to content

Instantly share code, notes, and snippets.

@anzz1
anzz1 / gif.bat
Created March 15, 2023 21:25
gif.bat
@echo off
if [%~1]==[] echo gif: No input file specified.&exit /b 1
:loop
if [%~x1]==[.gif] (set "_outfile=%~n1_1.gif") else (set "_outfile=%~n1.gif")
ffmpeg -hide_banner -vsync 0 -i "%~1" -vf "fps=20,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 -final_delay 300 -f gif "%_outfile%" || call :chksz "%_outfile%"
shift
if not [%~1]==[] goto loop
goto :eof
:chksz
if [%~z1]==[0] del "%~1"
@anzz1
anzz1 / h264.bat
Created March 15, 2023 21:25
h264.bat
@echo off
if [%~1]==[] echo h264: No input file specified.&exit /b 1
:loop
if [%~x1]==[.mp4] (set "_outfile=%~n1_1.mp4") else (set "_outfile=%~n1.mp4")
ffmpeg -hide_banner -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i "%~1" -vf "hwupload,hwdownload,format=nv12" -c:v h264_nvenc -profile:v high -preset slow -pix_fmt yuv420p -rc vbr_hq -b:v 0 -c:a libfdk_aac -b:a 0 -ar 44100 -ac 2 -f mp4 "%_outfile%" || call :chksz "%_outfile%"
shift
if not [%~1]==[] goto loop
goto :eof
:chksz
if [%~z1]==[0] del "%~1"
@anzz1
anzz1 / quickedit.c
Created February 26, 2023 11:29
quickedit.c
// quickedit.c
// cl /MD /Zl /O1 /Ob2 /Oi /GS- /kernel /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /c quickedit.c
// link kernel32.lib /entry:"main" /subsystem:console /pdb:none /machine:I386 /nodefaultlib /incremental:no /manifest:no /safeseh:no /emitpogophaseinfo /RELEASE /OPT:REF /OPT:ICF /OPT:NOWIN98 /MERGE:.rdata=.text quickedit.obj
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#include <windows.h>
@anzz1
anzz1 / md5.c
Created October 9, 2022 03:33
md5.c
// md5.c
#include <stdlib.h>
static char* bin2hex(const unsigned char* b, size_t len, char* s)
{
int i;
for (i = 0; i < len; i++)
{
s[i*2] = (b[i] >> 4) < 10 ? (b[i] >> 4) + 48: (b[i] >> 4) + 87;
@anzz1
anzz1 / crc32.c
Created October 9, 2022 01:57
crc32.c
// crc32.c
static const unsigned int crc32_table[] =
{
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@anzz1
anzz1 / gist:305fb0c502b5820f1ef7864ecf1665cd
Created May 3, 2022 00:24
Visual Studio 6.0 Crash Fix (Buffer Overflow)
// Microsoft Visual Studio 6.0
// Crash Fix (Buffer Overflow)
//
// Module: Resource Editor
// DEVRES.PKG v6.0.8168.0 - 17.6.1998 0:00
//
// Original SHA1 : 59afd55f13310dcdbfff777fe6f4c7d0a8191a82
// Fixed SHA1 : 00bb8497adca2467eaba022a34bf4fdafd3d7c6c
//
@anzz1
anzz1 / Enable-Privilege.ps1
Created April 21, 2022 04:08
Enable-Privilege.ps1
function Enable-Privilege {
<#
.SYNOPSIS
Enables or disables security privileges on a target process.
.DESCRIPTION
Enables or disables security privileges on a target process.
Multiple privileges can be set at once, separated by a comma.
@anzz1
anzz1 / testEME.html
Created April 10, 2022 23:32
testEME.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Test EME</title>
<script>
function testEME() {
// https://shaka-player-demo.appspot.com/support.html
var keySysConfig = [{
@anzz1
anzz1 / chrome\userChrome.css
Last active April 8, 2022 02:11
Add URL field back to "Add Bookmark" menu in Firefox
/* userChrome.css */
@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@namespace html "http://www.w3.org/1999/xhtml";
/* Add option to edit bookmark URLs under blue star menu */
#editBMPanel_locationRow {
visibility: visible !important;
}