I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:
Considerations to take when live streaming:
The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:
-
Set the buffer size (
-bufsize:v
) equal to the target bitrate (-b:v
). You want to ensure that you're encoding in CBR mode. -
Set up the encoders as shown:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from nvidia-patch hack | |
#include "pch.h" | |
#include "nvfbcdefs.h" | |
#ifdef _WIN64 | |
#define LIBNAME TEXT(".\\NvFBC64_.dll") | |
#else | |
#define LIBNAME TEXT(".\\NvFBC_.dll") | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
char password[] = "password"; | |
int get_password() { | |
int auth_ok = 0; | |
char buff[16]; | |
printf("Enter password: "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function install_dependencies() { | |
echo "Installing dependencies..." | |
sudo apt -qq update | |
sudo apt -qq install -y curl git wget | |
sudo apt -qq install -y bison flex kernel-package libssl-dev | |
} | |
function init() { |
$ uname -r
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# based on: https://gist.github.com/s-leroux/7cb7424d33ba3753e907cc2553bcd1ba | |
# modified by: cca | |
set -u -o pipefail | |
set_dir(){ _dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"; }; set_dir | |
safe_source () { source $1; set_dir; } | |
# end of bash boilerplate | |
print_usage(){ | |
cat << USAGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os | |
import hashlib | |
import argparse | |
import binascii | |
import struct | |
def encrypt_v1(imei, key): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint16_t udp_checksum(struct udphdr *p_udp_header, size_t len, uint32_t src_addr, uint32_t dest_addr) | |
{ | |
const uint16_t *buf = (const uint16_t*)p_udp_header; | |
uint16_t *ip_src = (void*)&src_addr, *ip_dst = (void*)&dest_addr; | |
uint32_t sum; | |
size_t length = len; | |
// Calculate the sum | |
sum = 0; | |
while (len > 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Sublime Text 3 Serial key build is 3176 | |
> * Added these lines into /etc/hosts | |
127.0.0.1 www.sublimetext.com | |
127.0.0.1 license.sublimehq.com | |
> * Used the license key | |
----- BEGIN LICENSE ----- |
NewerOlder