Skip to content

Instantly share code, notes, and snippets.

View olealgoritme's full-sized avatar
🐧
vim >

Ole Algoritme olealgoritme

🐧
vim >
View GitHub Profile
@olealgoritme
olealgoritme / The Technical Interview Cheat Sheet.md
Created September 7, 2020 17:52 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

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!






\

@olealgoritme
olealgoritme / ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
Created April 26, 2020 20:35 — forked from Brainiarc7/ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
ffmpeg livestreaming to youtube via Nvidia's NVENC and Intel's VAAPI on supported hardware

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:

  1. Set the buffer size (-bufsize:v) equal to the target bitrate (-b:v). You want to ensure that you're encoding in CBR mode.

  2. Set up the encoders as shown:

// from nvidia-patch hack
#include "pch.h"
#include "nvfbcdefs.h"
#ifdef _WIN64
#define LIBNAME TEXT(".\\NvFBC64_.dll")
#else
#define LIBNAME TEXT(".\\NvFBC_.dll")
#endif
@olealgoritme
olealgoritme / buffer_overflow_stack_smashing.c
Created February 27, 2019 13:14
buffer overflow (stack smashing)
#include <stdio.h>
#include <string.h>
char password[] = "password";
int get_password() {
int auth_ok = 0;
char buff[16];
printf("Enter password: ");
@olealgoritme
olealgoritme / compile_newest_stable_kernel_with_acso_patch.sh
Created January 26, 2019 15:08 — forked from mdPlusPlus/compile_newest_stable_kernel_with_acso_patch.sh
Download, patch, compile and install the newest stable Linux kernel with the ACS override patch (Ubuntu / Debian)
#!/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() {
@olealgoritme
olealgoritme / clean-up-boot-partition-ubuntu.md
Created January 23, 2019 00:04 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@olealgoritme
olealgoritme / gist_create.sh
Created January 21, 2019 23:50
push gist quickly with bash
#!/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
@olealgoritme
olealgoritme / huaiwei-unlock.py
Created December 21, 2018 04:07 — forked from DonnchaC/huaiwei-unlock.py
Huaiwei unlock code generator - Based on the disassembler generated C code in https://github.com/forth32/huaweicalc
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import hashlib
import argparse
import binascii
import struct
def encrypt_v1(imei, key):
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)
@olealgoritme
olealgoritme / LICENCE SUBLIME TEXT
Created November 20, 2018 11:30
Sublime Text 3 Serial key build is 3176
## 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 -----