Skip to content

Instantly share code, notes, and snippets.

@MVoz
MVoz / wsl.conf
Created May 7, 2018 19:54 — forked from cwilhit/wsl.conf
"#Let’s enable extra metadata options by default
[automount]
enabled = true
root = /windir/
options = "metadata,umask=22,fmask=11"
mountFsTab = false
#Let’s enable DNS – even though these are turned on by default, we’ll specify here just to be explicit.
[network]
generateHosts = true
@MVoz
MVoz / build-all-ruby.bat
Created April 30, 2018 07:12 — forked from koron/build-all-ruby.bat
WindowsのMSVCで32bitと64bitのrubyをコンパイル&インストールするバッチ。 使い方はRubyのソース内のトップディレクトリにコピーしてダブルクリックするだけ。 インストール場所はルートディレクトリを指定してバージョンとアーキテクチャ種別を加味したサブディレクトリになる。 VC用の環境設定ファイル(VS_ROOT)とインストールルート(INSTALL_ROOT)の位置は決め打ちになってるので要注意。
@ECHO OFF
GOTO :MAIN
:SETTINGS
SET VS_ROOT=C:\Program Files (x86)\Microsoft Visual Studio 10.0
SET INSTALL_ROOT=D:\Ruby
EXIT /B
:BASENAME
SET BASENAME=%~nx1
@MVoz
MVoz / mexopts.bat
Created April 27, 2018 22:56 — forked from dgleich/mexopts.bat
Mex opts file for mingw64 for C and C++
@echo off
rem MSSDK71OPTS.BAT
rem
rem Compile and link options used for building MEX-files
rem using the Microsoft Windows Software Development Kit.
rem
rem $Revision: 1.1.6.2 $ $Date: 2011/03/09 05:35:27 $
rem Copyright 2010 The MathWorks, Inc.
rem
rem StorageVersion: 1.0
@MVoz
MVoz / OpenSSL cheat sheet for socket programmers.md
Created April 19, 2018 20:09 — forked from azadkuh/OpenSSL cheat sheet for socket programmers.md
OpenSSL cheat sheet. This is a brief howto for socket programmers.

#OpenSSL cheat sheet This is a brief howto for socket programmers.

create RSA key pairs

ex: 1024bits length key pair:

$> openssl genrsa -out myprivate.pem 1024
$> openssl rsa -in myprivate.pem -pubout -out mypublic.pem
@MVoz
MVoz / dll2lib.md
Created April 19, 2018 19:39 — forked from azadkuh/dll2lib.md
extract the *.lib from a *.dll in Win32

extract *.lib from *.dll

do the following steps:

1. exports

extract the functions and classes in *.dll by:
$> dumpbin.exe /exports libsample.dll /out:libsample.def

2. function names

@MVoz
MVoz / Git_mergetool_commands
Created April 5, 2018 08:47 — forked from RohanBhanderi/Git_mergetool_commands
Git Mergetool and difftool with Beyond Compare 4
//Git Mergetool and difftool with Beyond Compare 4
//For Windows
//IF running this command in git bash then escape $ with \
git config --global diff.tool bc4
git config --global difftool.bc4.cmd "\"C:/Program Files (x86)/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\""
git config --global difftool.prompt false
git config --global merge.tool bc4
git config --global mergetool.bc4.cmd "\"C:/Program Files (x86)/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
git config --global mergetool.bc4.trustExitCode true
@MVoz
MVoz / vs_env_vars_win32.txt
Created April 2, 2018 03:50 — forked from teeks99/vs_env_vars_win32.txt
Visual Studio 2017 Command Prompt Variables
On Windows 7 - 32 Bit Install
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2017\Visual Studio Tools
Developer Command Prompt for VS 2017
Runs: %comspec% /k "C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
Sets: PROCESSOR_ARCHITECTURE=x86
x64 Native Tools Command Prompt for VS 2017 (cl.exe doesn't run!)
Runs: %comspec% /k "C:\Program Files\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
@echo off
setlocal
for /F %%a IN ('echo %1^|findstr /R ^[0-9][0-9]*$') DO set arg1num=%%a
IF "%1"=="%arg1num%" (
doskey /history | findstr /N /R .* | findstr /B %1: > %TEMP%\__history.tmp
FOR /F "delims=: tokens=1*" %%a IN (%TEMP%\__history.tmp) DO @echo %%b
) ELSE (
IF "%1"=="" (
doskey /history | findstr /N /R .*
) ELSE (
@MVoz
MVoz / Windows C Compiler.ps1
Created April 1, 2018 17:53 — forked from retorillo/Windows C Compiler.ps1
Minimal PowerShell Script for Windows C Compiler (Requires Windows 10 SDK & Visual Studio 2015 Community)
$sdkver = "10.0.14393.0"
$sdkdir = "${env:ProgramFiles(x86)}\Windows Kits\10"
$sdkincdir = "$sdkdir\Include\$sdkver"
$sdklibdir = "$sdkdir\Lib\$sdkver"
$vcdir = "${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\VC"
$env:path += ";$vcdir\bin\amd64;$sdkdir\bin\amd64"
$env:include += ";$vcdir\include" `
+ ";$sdkincdir\shared;$sdkincdir\ucrt;$sdkincdir\um;$sdkincdir\winrt"
$env:lib += ";$vcdir\lib\amd64;$sdklibdir\ucrt\x64;$sdklibdir\um\x64"
$env:libpath += "$vcdir\lib\amd64"