Skip to content

Instantly share code, notes, and snippets.

Avatar
☮️

Dzmitry Neviadomski nevack

☮️
View GitHub Profile
View enroll-macOS-beta.sh
sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll DeveloperSeed
View blacklist_headphones.sh
# Get MAC address
sudo defaults read /Library/Preferences/com.apple.Bluetooth.plist DeviceCache
# Blacklist it
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist IgnoredDevices -array-add '70-26-05-b1-18-5f'
@nevack
nevack / archived.md
Last active Aug 3, 2022
[ARCHIVED] Fix for CSR Dongle 0a12:0001 ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
View archived.md

This gist is currenctly archived.

Please refer to previous revisions if you know what to do.

The patch proposed was merged into kernel in 5.8 release, but no longer working as of linux 5.11

View Program.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace Metrologia
{
internal static class Program
{
@nevack
nevack / dl_chromium.py
Last active Oct 4, 2018
Download Chromium latest build from trunk
View dl_chromium.py
#!/usr/bin/python3
# Dmitry Nevedomsky, Yandex LLC, 2018
import urllib.request
import zipfile
import sys
import os
import psutil
import time
import subprocess
import argparse
@nevack
nevack / makefile
Last active Sep 23, 2018
Makefile to build NASM labs
View makefile
EXECUTABLE = lab
SOURCE = $(shell ls *asm | sed 1q)
OBJ = $(shell echo $(SOURCE) | cut -f 1 -d '.').o
AS = /usr/local/bin/nasm
ASFLAGS = -f macho
LD = ld
LDFLAGS = -macosx_version_min 10.7.0 -o $(EXECUTABLE) $(OBJ)
DBG = lldb
.PHONY: $(EXECUTABLE)
@nevack
nevack / util32.asm
Last active Mar 13, 2021
Utility subroutines for macOS 32bit NASM
View util32.asm
; Utility routines for NASM macOS 32bit
; Nevedomsky Dmitry, 2018
; macOS 10.15 Catalina removed support for executing 32bit apps
; See util64.asm for 64bit version
;==============================================================================
; CONSTANTS
;==============================================================================
View PapaJohnsPromoCodesParser.kt
import com.beust.klaxon.Klaxon
import com.github.kittinunf.fuel.httpGet
import com.github.kittinunf.result.Result
data class PapaJohnsContainer (
val codes: List<PapaJohnsCode>
)
data class PapaJohnsCode (
val name: String,
@nevack
nevack / text_to_image.py
Last active Oct 5, 2019
Text to image, that should be tilted to be readable
View text_to_image.py
import os
from PIL import Image, ImageDraw, ImageFont
import numpy
def find_coefficients(pa, pb):
matrix = []
for p1, p2 in zip(pa, pb):
matrix.append([p1[0], p1[1], 1, 0, 0, 0, -p2[0]*p1[0], -p2[0]*p1[1]])
matrix.append([0, 0, 0, p1[0], p1[1], 1, -p2[1]*p1[0], -p2[1]*p1[1]])
@nevack
nevack / check.c
Last active May 30, 2022
Reading Numbers in C
View check.c
#include <stdio.h>
int ReadInteger() {
int number;
char c;
while (1) {
// Read token token from stdout, ended by newline
if (!scanf_s("%d", &number) || getchar() != '\n') {
// Clear stdout before reading next token