Skip to content

Instantly share code, notes, and snippets.

View Ruzzz's full-sized avatar

Ruslan Zaporojets Ruzzz

View GitHub Profile
@Ruzzz
Ruzzz / ssh_pubkey_fingerprint.py
Last active February 4, 2016 07:15
Calc id_rsa.pub fingerprint
import sys
import base64
import hashlib
// Alternative to: >ssh-keygen -E md5 -l -f id_rsa.pub
md5 = hashlib.md5()
md5.update(base64.b64decode(open('id_rsa.pub').read().split()[1]))
digest = md5.digest()
print (":".join("{:02x}".format(c) for c in digest))
@Ruzzz
Ruzzz / msvcxp.bat
Created March 31, 2016 21:10
vc++ xp-toolchain cmd helper
:: or %ProgramFiles(x86)%
set _SDK71PATH_=%ProgramFiles%\Microsoft SDKs\Windows\7.1A
set PATH=%_SDK71PATH_%\Bin;%PATH%
set INCLUDE=%_SDK71PATH_%\Include;%INCLUDE%
set LIB=%_SDK71PATH_%\Lib;%LIB%
set CL=/D_USING_V110_SDK71_ %CL%
set LINK=/SUBSYSTEM:CONSOLE,5.01 %LINK%
<?php
$filename = $_GET['file'];
$downloadRate = isset($_GET['speed']) ? intval($_GET['speed']) : 500; // KB/s
if (file_exists($filename) && is_file($filename))
{
header('Cache-control: private');
header('Content-Type: application/x-shockwave-flash');
header('Content-Length: '.filesize($filename));
:: OpenSSL
openssl s_client -connect smtp.gmail.com:587 -starttls smtp
openssl s_client -connect smtp.gmail.com:465
openssl s_client -connect smtp.yandex.ru:465
:: SSLyze
sslyze_cli.exe --tlsv1 --tlsv1_1 --tlsv1_2 --sslv2 --sslv3 --hide_rejected_ciphers --starttls=smtp smtp.gmail.com:587
sslyze_cli.exe --tlsv1 --tlsv1_1 --tlsv1_2 --sslv2 --sslv3 --hide_rejected_ciphers smtp.gmail.com:465
sslyze_cli.exe --tlsv1 --tlsv1_1 --tlsv1_2 --sslv2 --sslv3 --hide_rejected_ciphers smtp.yandex.ru:465
@Ruzzz
Ruzzz / jar_run.cmd
Created November 17, 2016 20:19
JAR Start Template
@echo off
setlocal
cd /d %~dp0
start javaw -Xms128m -Xmx1024m -jar NAME.jar %*
endlocal
type
MemAlign<T> = record
private
First: Byte;
Second: T;
public
class function Get(): Cardinal; static; inline;
end;
const
Version [HKCU/HKLM]\Software\
D4 Borland\Delphi\4.0
D5 Borland\Delphi\5.0
D6 Borland\Delphi\6.0
D7 Borland\Delphi\7.0
D2005 Borland\BDS\3.0
D2006 Borland\BDS\4.0
D2007 Borland\BDS\5.0
D2009 CodeGear\BDS\6.0
@Ruzzz
Ruzzz / diff_big.cpp
Last active January 2, 2017 14:39
Show differense of big files with same size (use WinAPI)
// The MIT License (MIT)
// Copyright (c) 2016 Ruslan Zaporojets
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
AIR Version SWF Version Flash Player Version
N/A 9 9.0.115.0
1.5, 2.0 10 10.0, 10.1
2.6 11 10.2
2.7 12 10.3
3 13 11.0
3.1 14 11.1
3.2 15 11.2
3.3 16 11.3
Type Signed/Unsigned x86 (bit) x64 (bit)
BYTE, BOOLEAN U 8 8
SHORT S 16 16
USHORT, WORD U 16 16
INT, LONG S 32 32
UINT, ULONG, DWORD U 32 32
INT_PTR, LONG_PTR, LPARAM S 32 64
UINT_PTR, ULONG_PTR, WPARAM U 32 64
LONGLONG S 64 64