Skip to content

Instantly share code, notes, and snippets.

@a4099181
a4099181 / putty-settings.cmd
Created April 9, 2016 20:49
PuTTY settings export
regedit /e "%userprofile%\Desktop\putty.reg" HKEY_CURRENT_USER\Software\SimonTatham
$names = "3DBuilder", "Bing", "CandyCrushSodaSaga", "Getstarted", "OfficeHub", "SkypeApp", "Solitaire", "Twitter", "Feedback"
ForEach($name in $names)
{
Get-AppxPackage -AllUsers | Where-Object { $_.Name.Contains($name) } | Remove-AppxPackage
Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName.Contains($name) } | Remove-AppxProvisionedPackage -Online
}
@a4099181
a4099181 / Ortho4XP.cmd
Last active December 2, 2016 19:35
One-liner to make many tiles with single command (it supports: 1. continuation - it skips those coords where destination folder exists; 2. custom configuration file per tile).
FOR /L %Y IN (48,1,55) DO FOR /L %X IN (12,1,23) DO IF NOT EXIST "zOrtho4XP_+%Y+0%X\Earth nav data" IF EXIST "zOrtho4XP_+%Y+0%X\Ortho4XP.cfg" ( "%USERPROFILE%\AppData\Local\Programs\Python\Python35\python.exe" Ortho4XP.py %Y %X "zOrtho4XP_+%Y+0%X\Ortho4XP.cfg" ) ELSE ( "%USERPROFILE%\AppData\Local\Programs\Python\Python35\python.exe" Ortho4XP.py %Y %X )
@a4099181
a4099181 / Shared-SQLLocalDB-instance.md
Created September 27, 2017 06:34
Some commands to work with shared SQLLocalDB instance.

Shared SQLLocalDB instance means that a single local instance may be accessed by any other allowed user.

sqllocaldb share <user> <name> <shared-name>

<user> - user name of the owner of the SQLLocalDB instance to share,

<name> - name of the SQLLocalDB instance to share,

@a4099181
a4099181 / ConvertPdfTo-Saab340Chart.cmd
Last active September 23, 2018 08:53
Converts PDF into PNG for use as a chart in LES Saab 340A at X-Plane. Requirements: ImageMagick and Ghostscript must be in %PATH%. Tested on Windows 10 1803 with ImageMagick 7.0.7-7 Q16 (64-bit) and Ghostscript 9.22.
FOR %I IN (*.pdf) DO magick ^
-density 300 "%I[0]" -trim -units pixelsperinch ^
-density 300 -resize "1304x1304^" -rotate "-90>" ^
-colorspace gray -background white -flatten ^
-gravity west -extent "2048x2048" %~nI.png

Flight sim command set

Textures processing

FOR /R .\Orthophotos %F IN (PL_15/*.jpg) DO (CD %~pF && "C:\Program Files\GIMP 2\bin\gimp-console-2.8.exe" ^
                                -i -b "(greeny \"PL_15\\%~nxF\" \"Ortho4XP_PL15_64\")" -b "(gimp-quit 0)")
Requirements:
@a4099181
a4099181 / Copy-ChartsIntoSaab340.ps1
Last active September 24, 2018 14:48
Copies charts into LES Saab 340A at X-Plane. Charts from 01 to 05 are departure's charts. Charts from 06 to 10 are destination's charts. Custom patterns are stored into chart_list.txt. Example chart_list.txt is attached also.
Param(
$xplane_dir = ".",
$chart_list = ( Get-ChildItem -Recurse -Path "$($xplane_dir)\Aircraft" -Filter "chart_list.txt" | Select-Object -First 1 ),
[Parameter(Mandatory=$true)]
$depICAO,
[Parameter(Mandatory=$true)]
$dstICAO,
$charts_dir = "$($env:USERPROFILE)\OneDrive\Charts"
)
@a4099181
a4099181 / dirstat.ps1
Created August 5, 2019 09:36
Powershell script to calculate directory size. Lists all directories in a current directory. Calculates and prints a size for each of them (dirstat, folder statistics).
Get-ChildItem -Directory |
Select-Object `
@{ N="Directory"; E={ $_.Name } }, `
@{ N="Size"; E={ (Get-ChildItem -Recurse -File -Path $_.FullName | Measure-Object -Property Length -Sum).Sum } } |
Sort-Object -Property Size -Descending
@a4099181
a4099181 / dice.scad
Last active October 27, 2019 20:40
OpenSCAD: dice.
/*
* 6-sided play cube
*/
$fn = 128 ;
WIDTH = 64 ;
DOT_DEEP = 3 ;
DOT_DENSITY = .2 ;
DOT_TABLE = [
[ 2, [ 2, 3, 4, 5, 6 ] ]
@a4099181
a4099181 / Dockerfile
Created November 7, 2020 07:54
OpenSSL Dockerfile
FROM alpine
VOLUME [ "/demoCA" ]
RUN apk update && \
apk add --no-cache openssl git perl && \
rm -rf /var/cache/apk/*
RUN ln -s /etc/ssl/misc/CA.pl /usr/bin/ca