1 |
a kornucopia of krap / Programming / OLDskool IPswitcher
on: 04/29/18 at 12:51pm |
|
Code: :: mSQUARED (c)2018 @ECHO off
TITLE = OLDskool IPswitcher v18.04.30.0
SET AdapterName_01="Ethernet" SET IPconfig_01=10.201.162.71 255.255.255.0 10.201.162.1 SET IPconfig_02=10.201.151.71 255.255.255.0 10.201.151.1
:: ---------------------------------------------------------------------------------------- :: Elevate privileges RUN AS ADMINISTRATOR :: :: http://blog.spiralofhope.com?p=13553 :: https://stackoverflow.com/questions/7044985 :: http://stackoverflow.com/a/12264592/1190568 :checkPrivileges NET FILE 1>NUL 2>NUL if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges ) :getPrivileges if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges) setlocal DisableDelayedExpansion set "batchPath=%~0" setlocal EnableDelayedExpansion ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs" ECHO args = "ELEV " >> "%temp%\OEgetPrivileges.vbs" ECHO For Each strArg in WScript.Arguments >> "%temp%\OEgetPrivileges.vbs" ECHO args = args ^& strArg ^& " " >> "%temp%\OEgetPrivileges.vbs" ECHO Next >> "%temp%\OEgetPrivileges.vbs" ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs" "%SystemRoot%\System32\WScript.exe" "%temp%\OEgetPrivileges.vbs" %* exit /B :gotPrivileges if '%1'=='ELEV' shift /1 setlocal & pushd . cd /d %~dp0 :: ----------------------------------------------------------------------------------------
:start CLS ECHO ------------------- ECHO OLDskool IPswitcher ECHO ------------------- netsh interface ip show address name=%AdapterName_01% ECHO. ECHO OPTIONS : ECHO. ECHO [1] - %AdapterName_01% IPv4 %IPconfig_01% ECHO [2] - %AdapterName_01% IPv4 %IPconfig_02% ECHO [3] - %AdapterName_01% IPv4 DHCP ECHO [4] - Display %AdapterName_01% Current Configuration ECHO [5] - Exit ECHO. SET choice= SET /p choice=Enter selection . . . IF NOT '%choice%'=='' SET choice=%choice:~0,1% IF '%choice%'=='1' GOTO UserSelect1 IF '%choice%'=='2' GOTO UserSelect2 IF '%choice%'=='3' GOTO UserSelect3 IF '%choice%'=='4' GOTO start IF '%choice%'=='5' GOTO end ECHO. PAUSE>NUL|SET/P =""%choice%" is not valid, press any key to continue . . . " GOTO start
:UserSelect1 ECHO. ECHO netsh interface ipv4 set address %AdapterName_01% static %IPconfig_01% netsh interface ipv4 set address %AdapterName_01% static %IPconfig_01% IF %ERRORLEVEL% NEQ 0 PAUSE GOTO start
:UserSelect2 ECHO. ECHO netsh interface ipv4 set address %AdapterName_01% static %IPconfig_02% netsh interface ipv4 set address %AdapterName_01% static %IPconfig_02% IF %ERRORLEVEL% NEQ 0 PAUSE GOTO start
:UserSelect3 ECHO. ECHO netsh interface ipv4 set address %AdapterName_01% dhcp netsh interface ipv4 set address %AdapterName_01% dhcp IF %ERRORLEVEL% NEQ 0 PAUSE GOTO start
:end EXIT
|
2 |
a kornucopia of krap / Programming / FUNCTION GetDetailsOS$()
on: 03/22/13 at 2:03pm |
|
Code:'http://alycesrestaurant.com/osversion.htm
struct OSVERSIONINFO,_ dwOSVersionInfoSize as ulong,_ dwMajorVersion as ulong,_ dwMinorVersion as ulong,_ dwBuildNumber as ulong,_ dwPlatformId as ulong,_ szCSDVersion as char[128]
L=len(OSVERSIONINFO.struct) OSVERSIONINFO.dwOSVersionInfoSize.struct=L calldll #kernel32, "GetVersionExA",_ OSVERSIONINFO as struct,_ result as boolean
print "Major Version is "; print OSVERSIONINFO.dwMajorVersion.struct print "Minor Version is "; print OSVERSIONINFO.dwMinorVersion.struct print "Build Number is "; print OSVERSIONINFO.dwBuildNumber.struct print "PlatformId is "; print OSVERSIONINFO.dwPlatformId.struct print "CSDVersion is "; print OSVERSIONINFO.szCSDVersion.struct '''''''''''''''''''''''''''''''''''''''''''''''''''' 'dwMajorVersion 'Identifies the major version number of the operating 'system as follows. Operating System Value 'Windows 95 4 'Windows 98 4 'Windows Me 4 'Windows NT 3.51 3 'Windows NT 4.0 4 'Windows 2000 5 'Windows XP 5 'Windows .NET Server 5 '''''''''''''''''''''''''''''''''''''''''''''''''''' 'dwMinorVersion 'Identifies the minor version number of 'the operating system as follows. 'Operating System Value 'Windows 95 0 'Windows 98 10 'Windows Me 90 'Windows NT 3.51 51 'Windows NT 4.0 0 'Windows 2000 0 'Windows XP 1 'Windows .NET Server 1 '''''''''''''''''''''''''''''''''''''''''''''''''''' 'dwBuildNumber 'Windows NT/2000/XP: Identifies the build number of the 'operating system. 'Windows 95/98/Me: Identifies the build number of the 'operating system in the low-order word. The high-order 'word contains the major and minor version numbers. '''''''''''''''''''''''''''''''''''''''''''''''''''' 'dwPlatformId 'Identifies the operating system platform. This member 'can be one of the following values. Value Platform '0: _VER_PLATFORM_WIN32s Win32s on Windows 3.1. '1: _VER_PLATFORM_WIN32_WINDOWS Windows 95, Windows 98, or Windows Me. '2: _VER_PLATFORM_WIN32_NT Windows NT 3.51, Windows NT 4.0, 'Windows 2000, Windows XP, or Windows .NET Server. '''''''''''''''''''''''''''''''''''''''''''''''''''' 'szCSDVersion 'Windows NT/2000/XP: Contains a null-terminated string, 'such as "Service Pack 3", that indicates the latest 'Service Pack installed on the system. If no Service 'Pack has been installed, the string is empty. ' 'Windows 95/98/Me: Contains a null-terminated string that 'indicates additional version information. For example, '" C" indicates Windows 95 OSR2 and " A" indicates Windows '98 Second Edition.
|
3 |
a kornucopia of krap / Programming / FUNCTION GetHardDrive_______$()
on: 03/22/13 at 1:58pm |
|
Code:print GetHardDriveLabel$("c:\") t$ = GetHardDriveSerialNumber$("c:\") print t$ t$ = dechex$(val(t$)) t$ = left$(t$, 4) + "-" + mid$(t$, 5) print t$ end
function GetHardDriveLabel$(lpRootPathName$) struct lpVolumeSerialNumber, SerialNumber as ulong struct lpMaxComponentLength, ComponentLength as ulong struct lpFileSystemFlags, SystemFlags as ulong lpVolumeNameBuffer$ = space$(255) nVolumeNameSize = len(lpVolumeNameBuffer$) lpFileSystemNameBuffer$ = space$(255) nFileSystemNameSize = len(lpFileSystemNameBuffer$) calldll #kernel32, "GetVolumeInformationA",_ lpRootPathName$ as ptr,_ lpVolumeNameBuffer$ as ptr,_ nVolumeNameSize as long,_ lpVolumeSerialNumber as struct,_ lpMaxComponentLength as struct,_ lpFileSystemFlags as struct,_ lpFileSystemNameBuffer$ as ptr,_ nFileSystemNameSize as long,_ result as long GetHardDriveLabel$ = trim$(lpVolumeNameBuffer$) end function
function GetHardDriveSerialNumber$(lpRootPathName$) struct lpVolumeSerialNumber, SerialNumber as ulong struct lpMaxComponentLength, ComponentLength as ulong struct lpFileSystemFlags, SystemFlags as ulong lpVolumeNameBuffer$ = space$(255) nVolumeNameSize = len(lpVolumeNameBuffer$) lpFileSystemNameBuffer$ = space$(255) nFileSystemNameSize = len(lpFileSystemNameBuffer$) calldll #kernel32, "GetVolumeInformationA",_ lpRootPathName$ as ptr,_ lpVolumeNameBuffer$ as ptr,_ nVolumeNameSize as long,_ lpVolumeSerialNumber as struct,_ lpMaxComponentLength as struct,_ lpFileSystemFlags as struct,_ lpFileSystemNameBuffer$ as ptr,_ nFileSystemNameSize as long,_ result as long GetHardDriveSerialNumber$ = str$(lpVolumeSerialNumber.SerialNumber.struct) end function
|
4 |
a kornucopia of krap / Programming / FUNCTION GetComputerName$()
on: 03/22/13 at 1:33pm |
|
Code:print GetComputerName$() end
function GetComputerName$() struct size, L as ulong size.L.struct = _MAX_COMPUTERNAME_LENGTH + 1 buffer$ = space$(size.L.struct) + chr$(0) calldll #kernel32, "GetComputerNameA",_ buffer$ as ptr,_ size as struct,_ result as ulong GetComputerName$ = left$(buffer$, size.L.struct) end function
|
5 |
a kornucopia of krap / Programming / FUNCTION GetUserName$()
on: 03/22/13 at 1:31pm |
|
Code:print GetUserName$() end
function GetUserName$() open"advapi32" for dll as #ad struct size, L as ulong size.L.struct = 100 buffer$ = space$(100) + chr$(0) calldll #ad,"GetUserNameA",_ buffer$ as ptr,_ size as struct,_ result as ulong close #ad GetUserName$ = left$(buffer$, size.L.struct) end function
|
8 |
a kornucopia of krap / Good Eats / The WSM BRINE
on: 03/22/11 at 6:53pm |
|
The WSM BRINE
Apple Brine For Turkey 2 quarts apple juice 1 pound brown sugar (light or dark) 1 cup Diamond Crystal Kosher Salt 3 quarts cold water 3 oranges, quartered 4 ounces fresh ginger, unpeeled and thinly sliced 15 whole cloves 6 bay leaves 6 large garlic cloves, peeled and crushed
Substitute 3/4 cup Morton Kosher Salt or 1/2 cup table salt for Diamond Crystal.
Combine apple juice, brown sugar, and salt in a large saucepan. Bring to a boil over high heat, stirring to dissolve. Boil for one minute, remove from heat, let mixture come to room temperature, then refrigerate to 40°F.
In a large non-reactive container, combine the apple juice mixture with the remaining ingredients. When adding the oranges, squeeze each piece to release the juice into the container, then drop in the peel.
Refrigerate 4-8 hours in brine, rest 1 hour. |
|