Skip to content

Instantly share code, notes, and snippets.

View json-m's full-sized avatar
🏴

Jason M. json-m

🏴
View GitHub Profile
@scy
scy / gw2-golang-poc.go
Last active September 20, 2022 15:08
Example on how to access the Guild Wars 2 Mumble Link API on Windows using Go. Not supposed to be good Go code, but it works.
package main
import (
"fmt"
"log"
"syscall"
"time"
"unsafe"
"unicode/utf16"
"unicode/utf8"
@TheVoxcraft
TheVoxcraft / Vector3.py
Created August 8, 2017 14:41
Vector3 Class in python3
import math
class Vector3:
x = 0
y = 0
z = 0
def __init__(self, _x, _y, _z):
self.x = _x
self.y = _y
self.z = _z
def __add__(self, other):
@Brainiarc7
Brainiarc7 / ffmpeg-vp8&9-encode-test-vaapi-intel.md
Last active December 31, 2023 02:19
PSA: You can now use FFmpeg's VAAPI-based VP8 and VP9 encoder on Skylake+ systems on Linux: Tested on Ubuntu 16.04LTS

Build VAAPI with support for VP8/9 decode and encode hardware acceleration on a Skylake validation testbed:

Build platform: Ubuntu 16.04LTS.

First things first:

Install baseline dependencies first

sudo apt-get -y install autoconf automake build-essential libass-dev libtool pkg-config texinfo zlib1g-dev libva-dev cmake mercurial libdrm-dev libvorbis-dev libogg-dev git libx11-dev libperl-dev libpciaccess-dev libpciaccess0 xorg-dev intel-gpu-tools

@eyecatchup
eyecatchup / ffmpeg.md
Last active May 2, 2024 10:06
Some common ffmpeg commands, I tend to forget..

cut sequence from mp4 video

ffmpeg -ss <start_time_hh:ii:ss> -i input.mp4 -to <length_in_hh:ii:ss_from_start> -c copy ./out.mp4
ffmpeg -ss 00:47:42 -i input.mp4 -to 00:01:49 -c copy ./out.mp4

create thumbnail images from input video (@30fps)

@dwallraff
dwallraff / mtu_overhead.md
Created March 9, 2017 18:09
Encapsulation MTU overhead

MTU Encapsulation overhead

  • TCP header adds 20 bytes
  • IPv4 header adds 20 bytes
  • IPv6 header adds 40 bytes

  • GRE (IP Protocol 47) (RFC 2784) adds 24 bytes (20 byte IPv4 header, 4 byte GRE header)
@sindresorhus
sindresorhus / TrueColour.md
Created January 17, 2017 11:46 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
! pmacctd configuration
!
!
!
daemonize: true
pidfile: /var/run/pmacctd.pid
syslog: daemon
geoip_ipv4_file: /usr/local/share/GeoIP/GeoIP.dat
!
!aggregate: src_host_country, dst_host_country, flows,src_host,dst_host,src_port,dest_port,proto
@DakuTree
DakuTree / decryptchromecookies.py
Last active April 3, 2024 19:22
Decrypt Chrome Cookies File (Python 3) - Windows
#Based off https://gist.github.com/DakuTree/98c8362fb424351b803e & pieces of https://gist.github.com/jordan-wright/5770442
from os import getenv
from shutil import copyfile
import sqlite3
import win32crypt #https://sourceforge.net/projects/pywin32/
# Copy Cookies to current folder
copyfile(getenv("APPDATA") + "/../Local/Google/Chrome/User Data/Default/Cookies", './Cookies')
# Connect to the Database
@Brainiarc7
Brainiarc7 / ffmppeg-advanced-playbook-nvenc-and-libav-and-vaapi.md
Last active May 5, 2023 01:51
FFMpeg's playbook: Advanced encoding options with hardware-accelerated acceleration for both NVIDIA NVENC's and Intel's VAAPI-based hardware encoders in both ffmpeg and libav.

FFmpeg and libav's playbook: Advanced encoding options with hardware-based acceleration, NVIDIA's NVENC and Intel's VAAPI-based encoder.

Hello guys,

Continuing from this guide to building ffmpeg and libav with NVENC and VAAPI enabled, this snippet will cover advanced options that you can use with ffmpeg and libav on both NVENC and VAAPI hardware-based encoders.

For ffmpeg:

@exp0se
exp0se / powershell_eventlog_parsing.ps1
Last active September 29, 2023 23:29
Powershell log parsing
#Security log
#============
####
#4624 - Logon & Logoff events successful
#4625 - Logon unsucceful
####
# Get usernames
Get-WinEvent -path .\Security.evtx | Where {$_.id -eq "4624"} | Foreach {([xml]$_.ToXml()).GetElementsByTagName("Data").ItemOf(5)}| Select -ExpandProperty "#text" -Unique
# Get domains