Skip to content

Instantly share code, notes, and snippets.

View CynicRus's full-sized avatar
🌴
On vacation

Aleksandr Vorobiev CynicRus

🌴
On vacation
View GitHub Profile
@CynicRus
CynicRus / gist:5a2bd5a06a699cd0139aaff887f5cab5
Created May 11, 2024 17:41
build python2 on ubuntu 22.04
wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
sudo tar xzf Python-2.7.9.tgz
cd Python-2.7.9
sudo ./configure --enable-optimizations
sudo make altinstall
sudo ln -sfn '/usr/local/bin/python2.7' '/usr/bin/python2'
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
@CynicRus
CynicRus / unfinder.py
Last active February 10, 2024 16:56
The script to output files in which the substring is not found
import os
import io
import argparse
def unfind_substr(directory, word):
files = os.listdir(directory)
finalFiles = []
for file in files:
filename = os.path.join(directory, file)
if os.path.isfile(filename):
USAGE: clang.exe [options] file...
OPTIONS:
-### Print (but do not run) the commands to run for this compilation
--amdgpu-arch-tool=<value>
Tool used for detecting AMD GPU arch in the system.
--analyzer-output <value>
Static analyzer report output format (html|plist|plist-multi-file|plist-html|sarif|sarif-html|text).
--analyze Run the static analyzer
-arcmt-migrate-emit-errors
@CynicRus
CynicRus / .pas
Last active August 6, 2021 13:15
get windows key
const
CharMap: array [0..23] of char = 'BCDFGHJKMPQRTVWXY2346789';
var
ProductID: array of byte;
IdPart: array [0..14] of byte;
Registry: TRegistry;
DataSize: integer;
Key: ansistring;
i, j, c: integer;
begin
unit winevt_h;
{$ifdef FPC}
{$mode objfpc}{$H+}
{$EndIF}
interface
uses
Classes, SysUtils, Windows;
procedure SnappyDecompress(Input: TByteArray; Offset,
Length: integer; var Output: TByteArray);
var
i, l, o, c,targetIndex,SourceIndex,targetLength: integer;
function incPP(var AVal: integer): integer;
begin
result := AVal;
inc(AVal);
end;
@CynicRus
CynicRus / .pas
Created October 28, 2020 10:30
LowLevelKeyboard cut the msr input(mr800)
function LowLevelKeyboardProc(nCode: longint; wParam: wParam; lParam: lParam): LRESULT;
stdcall;
var
pkbhs: PKbdDllHookStruct;
AChr: array [0..1] of widechar;
VirtualKey: integer;
ScanCode: integer;
ConvRes: integer;
ActiveWindow: HWND;
@CynicRus
CynicRus / gist:8f5d213d16c9b9eb75ef13dbd9bfa273
Created October 23, 2020 09:44
Golang tokenizer on Freepascal
unit utokenizer;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
const