Skip to content

Instantly share code, notes, and snippets.

View Ruzzz's full-sized avatar

Ruslan Zaporojets Ruzzz

View GitHub Profile
// ==UserScript==
// @name Center txt
// @author Ruzzz | ruzzzua@gmail.com
// @include http://*/*.txt
// @version 0.0.1
// @date 2014-02-04
// ==/UserScript==
(function () {
var e=document.getElementsByTagName('pre')[0];
{
"env" :
{
"CL_PARAMS" : "/O2 /W3 /GL /MT /GS /EHsc /D \"NDEBUG\" /D \"WIN32_LEAN_AND_MEAN\" /D \"WIN32\" /D \"_WINDOWS\"",
"LINK_PARAMS" : "/link /OPT:REF /SUBSYSTEM:CONSOLE"
},
"path" : "%PATH%;%ProgramFiles%\\microsoft visual studio 12.0\\vc",
"shell_cmd": "vcvarsall.bat x86 && cl.exe %CL_PARAMS% \"${file}\" %LINK_PARAMS% /OUT:\"${file_base_name}.exe\" && del *.obj",
"file_regex": "^(...*?)[(]([0-9]*),([0-9]*)[)]",
{
"env" :
{
"CL_PARAMS" : "/O2 /W3 /GL /MT /GS /EHsc /D \"NDEBUG\" /D \"WIN32_LEAN_AND_MEAN\" /D \"WIN32\" /D \"_WINDOWS\" /D_USING_V110_SDK71_ /I \"%ProgramFiles(x86)%\\Microsoft SDKs\\Windows\\7.1A\\Include\"",
"LINK_PARAMS" : "/link /OPT:REF /SUBSYSTEM:CONSOLE,5.01 /LIBPATH:\"%ProgramFiles%\\Microsoft SDKs\\Windows\\7.1A\\Lib\""
},
"path" : "%PATH%;%ProgramFiles%\\Microsoft SDKs\\Windows\\7.1A\\Bin;%ProgramFiles%\\microsoft visual studio 12.0\\vc",
"shell_cmd": "vcvarsall.bat x86 && cl.exe %CL_PARAMS% \"${file}\" %LINK_PARAMS% /OUT:\"${file_base_name}.exe\" && del *.obj",
"file_regex": "^(...*?)[(]([0-9]*),([0-9]*)[)]",
@Ruzzz
Ruzzz / winxp_activation_info.vbs
Created April 26, 2014 11:54
Show WinXP activation info
computer = "." ' Current
set wmiService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & computer & "\root\cimv2")
set products = wmiService.ExecQuery("Select * from Win32_WindowsProductActivation")
for each product in products
text = "Machine name: " & product.ServerName & vbCrLf & _
"ProductID: " & product.ProductID & vbCrLf
if product.ActivationRequired = false then _
text = text & "No activation required!" & vbCrLf
text = text & _
product.RemainingGracePeriod & " days remaining before activation of the system is required" & vbCrLf & _
{
"shell_cmd": "g++.exe \"${file}\" -O2 -std=c++0x -s -static -o \"${file_path}\\\\${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"path" : "%PATH%;c:\\mingw64\\bin\\",
"working_dir": "${file_path}",
"selector": "source.c, source.c++, source.cpp",
"variants":
[
{
"name": "Run",
#include <windows.h>
#include <stdio.h>
#define RVATOVA(base,offset) ((LPVOID)((DWORD)(base)+(DWORD)(offset)))
#define VATORVA(base,offset) ((LPVOID)((DWORD)(offset)-(DWORD)(base)))
BOOL IsDllExistsInExport(IN HMODULE _hModule, const IN PCHAR DllName)
{
HMODULE hModule = _hModule;
if (hModule == NULL)
@Ruzzz
Ruzzz / andrd_prepcert.bat
Created August 24, 2015 17:29
Prepare certificate with public key in PEM (text) or DER (binary) formats for Android /system/etc/security/cacerts
:: Contact: ruzzzua@gmail.com
:: Version: 2015.08.14
:: Dependencies: OpenSSL
@echo off
if "%1"=="" goto :USAGE
if "%1"=="-der" goto :DER
:PEM
@Ruzzz
Ruzzz / convcert.bat
Created August 24, 2015 17:30
Convert x509 certificate from DER or PEM format to another format.
:: Contact: ruzzzua@gmail.com
:: Version: 2015.08.14
:: Dependencies: OpenSSL
@echo off
if "%1"=="" goto :USAGE
if "%2"=="" goto :USAGE
if "%1"=="-toder" goto :TODER