Skip to content

Instantly share code, notes, and snippets.

View semenovi's full-sized avatar

semenovi semenovi

View GitHub Profile
@phith0n
phith0n / fpm.py
Last active March 18, 2026 12:56
Fastcgi PHP-FPM Client && Code Execution
import socket
import random
import argparse
import sys
from io import BytesIO
# Referrer: https://github.com/wuyunfeng/Python-FastCGI-Client
PY2 = True if sys.version_info.major == 2 else False
@gurchik
gurchik / calc.asm
Last active September 14, 2018 12:34
A heavily-documented RPN calculator written in pure x86 assembly
; Allow the linker to find the _start symbol. The linker will begin program execution
; there.
global _start
; Start the .data section of the executable, which stores constants (read-only data)
; It doesn't matter which order your sections are in, I just like putting .data first
section .rodata
; Declare some bytes at a symbol called error_msg. NASM's db pseudo-instruction
; allows either a single byte value, a constant string, or a combination of the two
; as seen here. 0xA = new line, and 0x0 = string-terminating null
@0x49D1
0x49D1 / sample.cs
Last active February 6, 2023 09:04
Run python script in initialized process
public string run_cmd(string cmd, string args)
{
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = "PATH_TO_PYTHON_EXE";
start.Arguments = string.Format("\"{0}\" \"{1}\"", cmd, args);
start.UseShellExecute = false;// Do not use OS shell
start.CreateNoWindow = true; // We don't need new window
start.RedirectStandardOutput = true;// Any output, generated by application will be redirected back
start.RedirectStandardError = true; // Any error in standard output will be redirected back (for example exceptions)
using (Process process = Process.Start(start))
@jadient
jadient / python-batchfile.bat
Last active October 21, 2024 22:11
Run python code directly from a batch file
@echo off & python -x "%~f0" %* & goto :eof
# ==========================================================
# one way to place python script in a batch file
# place python code below (no need for .py file)
# ==========================================================
import sys
print "Hello World!"
for i,a in enumerate(sys.argv):
@Bibimaw
Bibimaw / quality_metrics_OpenCV.cpp
Last active February 20, 2024 00:31
[C++] SSIM & PSNR quality metrics using OpenCV Mat structure
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <iostream>
using namespace std;
using namespace cv;
// quality-metric
namespace qm
{
@kmorcinek
kmorcinek / .gitignore
Last active December 9, 2025 17:42
.gitignore for C# projects
# The following command works for downloading when using Git for Windows:
# curl -LOf https://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore
#
# Download this file using PowerShell v3 under Windows with the following comand:
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
#
# or wget:
# wget --no-check-certificate https://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore
# User-specific files