Skip to content

Instantly share code, notes, and snippets.

View denji's full-sized avatar
🇺🇦

Denis Denisov denji

🇺🇦
View GitHub Profile
@denji
denji / nvenc-install.sh
Last active January 30, 2024 19:39 — forked from lucaspar/nvenc-install.sh
Installation script of CUDA-accelerated `ffmpeg` with NVIDIA Encoder ( docker NVIDIA Encoder https://github.com/markus-perl/ffmpeg-build-script )
#!/bin/bash
# =========================================================================
# Source: https://gist.github.com/lucaspar/27f5e108b80524b315be10b2a9049817
# =========================================================================
# This script will compile and install a static FFmpeg build with
# support for NVENC in Ubuntu. Developed in Ubuntu 23.10,
# with NVIDIA Drivers v535.129.03 and CUDA v12.2 with a GPU
# with CUDA capability 8.6 (RTX 3080) (see ccap below).
# It assumes NVIDA drivers are installed and that you have a
# CUDA-compatible GPU. You can check installed drivers with:
@denji
denji / isolate-cpus.sh
Created July 19, 2022 23:59 — forked from oleduc/isolate-cpus.sh
CPU isolation bash script for KVM QEMU VFIO gpu passthrough for virtual machine performance optimizations using libvirt-hooks and cgroups
#!/bin/bash
# Cores reserved for the host machine
# Must include QEMU IO/Emulation cores if configured
# Ex: 1st Core -> reserved=0
# Ex: 1st & 2nt Cores -> reserved=0,1
# Ex: 1st Physical Core (16 Virtual Cores) -> reserved=0,8
reserved=0,8
# Host core range numbered from 0 to core count - 1
@denji
denji / aml-upgrade-package-extract.c
Last active January 6, 2024 17:50
Utility to extract AMLogic "USB Burning Tool" .IMG firmware for Linux
// gcc aml-upgrade-package-extract.c -o aml-upgrade-package-extract
// ./aml-upgrade-package-extract update-usb-burning-mode.img
// /dev/sdX - fat32 sdcard
// Make bootable Android update:
// dd if=aml_sdc_burn.UBOOT bs=1 count=442 of=/dev/sdX
// dd if=aml_sdc_burn.UBOOT seek=1 skip=1 bs=512 of=/dev/sdX
// sync
@denji
denji / Documentation.md
Last active December 20, 2023 06:59 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@denji
denji / git-cheatsheet.md
Last active December 1, 2023 00:50 — forked from jeremypage/git-cheatsheet.md
Git cheatsheet

Git cheatsheet

Find all instances of text in all commits

git grep "text to look for" $(git rev-list --all)

List commit messages since given commit

-- Query the database to calculate a recommended innodb_buffer_pool_size
-- and get the currently configured value
-- The rollup as the bottom row gives the total for all DBs on the server, where each other row is recommendations per DB.
SELECT
TABLE_SCHEMA,
CONCAT(CEILING(RIBPS/POWER(1024,pw)),SUBSTR(' KMGT',pw+1,1))
Recommended_InnoDB_Buffer_Pool_Size,
(
SELECT CONCAT(CEILING(variable_value/POWER(1024,FLOOR(LOG(variable_value)/LOG(1024)))),SUBSTR(' KMGT',FLOOR(LOG(variable_value)/LOG(1024))+1,1))
@denji
denji / Hackback
Last active November 8, 2023 23:35
Nikto, NMap , Skipfish and friends http://www.security-marathon.be/?p=844
_ _ _ ____ _ _
| | | | __ _ ___| | __ | __ ) __ _ ___| | _| |
| |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / |
| _ | (_| | (__| < | |_) | (_| | (__| <|_|
|_| |_|\__,_|\___|_|\_\ |____/ \__,_|\___|_|\_(_)
A DIY Guide for those without the patience to wait for whistleblowers
--[ 1 ]-- Introduction
@denji
denji / dmarc.rb
Created March 1, 2016 13:15 — forked from ab/AA_dmarc.rb_MOVED.md
DMARC analysis: some hacks to look at DMARC vendors
#!/usr/bin/env ruby
require 'resolv'
require 'set'
require 'thread'
require 'yaml'
KnownSelfDomains = [
'groupon.com',
'airbnb.com',
'citi.com',
@denji
denji / windows-keyboard-default-mode.md
Created September 29, 2020 00:21
Keyboard flags and indicators when start Windows 10

HKEY_USERS\.DEFAULT\Control Panel\Keyboard and edit the string value InitialKeyboardIndicators to one of the following values:

InitialKeyboardIndicators bitmask list:

  • 0 — turns off Scroll Lock, Num Lock, Caps Lock (default)
  • 1 — turn on Caps Lock
  • 2 — turn on Num Lock
  • 3 — turn on both Num Lock and Caps Lock
  • 4 — turn on Scroll Lock
  • 5 — turn on both Scroll Lock and Caps Lock
  • 6 — turn on both Scroll Lock and Num Lock
What we do now:
We use a static record size of 4K. This gives a good balance of latency and
throughput.
Optimize latency:
By initialy sending small (1 TCP segment) sized records, we are able to avoid
HoL blocking of the first byte. This means TTFB is sometime lower by a whole
RTT.
Optimizing throughput: