Skip to content

Instantly share code, notes, and snippets.

@vinadm
vinadm / install_cygwin.ps1
Created November 16, 2021 12:34 — forked from staticfloat/install_cygwin.ps1
Cygwin installation script
function Install-Cygwin {
param ( $CygDir="c:\cygwin", $arch="x86")
# Generate random password (forcing a non-alphanumeric at the end because of policies
$password = (([char[]]([char]'a'..[char]'z') + 0..9 | sort {get-random})[0..12] -join '') + '.'
Write-Verbose "Not-so-secret password: $password"
if(!(Test-Path -Path $CygDir -PathType Container)) {
Write-Verbose "Creating directory $CygDir"
New-Item -Type Directory -Path $CygDir -Force
@vinadm
vinadm / cpverify.bat
Created September 4, 2019 12:43
cpverify
@echo off
"C:\Program Files (x86)\Crypto Pro\CSP\cpverify.exe" -rm
#!/bin/sh
cd /volume3/Share
files=$(find . -name "*.bak")
for f in $files; do
(cd $(dirname $f) && zip -m $(basename $f.zip) $(basename $f))
done
DROP TABLE v8users
GO
EXEC sp_rename 'v8users_old', 'v8users'
GO
UPDATE Params
SET FileName = 'users.usr'
WHERE FileName = 'users.usr_old'
GO
EXEC sp_rename 'v8users', 'v8users_old'
GO
UPDATE Params
SET FileName = 'users.usr_old'
WHERE FileName = 'users.usr'
GO
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="1C Web-service Extension" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Program Files\1cv8\8.3.13.1865\bin\wsisapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="bitness64" />
</handlers>
</system.webServer>
</configuration>
@vinadm
vinadm / gist:39aacfd2b3f09f107c870ffc8edc95ee
Created July 2, 2019 09:01
netsh firewall set service RemoteDesktop enable
psexec.exe \\<computer name> netsh firewall set service RemoteDesktop enable
@vinadm
vinadm / gist:5e97918ef1a70070a8a10a589b3cb38b
Created July 2, 2019 09:00
Modify the registry to enable RDP with psexec,
psexec.exe \\<computer name> reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
@vinadm
vinadm / gist:971b676f1b79a91329274c6239b6dabd
Created July 2, 2019 08:42
enable Remote Desktop with wmic
wmic /node:<computer name> process call create 'cmd.exe /c reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f'
@vinadm
vinadm / gist:5d3a5f0739eb28238a3b2dd506371307
Created July 2, 2019 08:40
netsh firewall set service RemoteDesktop enable
wmic /node:<computer name> process call create "cmd.exe /c netsh firewall set service RemoteDesktop enable"