Skip to content

Instantly share code, notes, and snippets.

@machv
machv / Get-WebCertificate.ps1
Created July 26, 2018 10:53
Generate WebServer certificate
function Get-WebCertificate {
Param(
[parameter(Mandatory = $true)]
[String]
$Fqdn,
[parameter(Mandatory = $true)]
[String]
$CertificateOutputPath,
declare @databasesToRestore table (BakFile nvarchar(128));
insert @databasesToRestore(BakFile) values
('S545.bak'),
('S1101546.bak');
---('S1101546.bak'),
---('S01601101547.bak');
---('S7.bak'),
---('S01549.bak'),
---('S.bak'),
@machv
machv / int_to_string.php
Created September 11, 2015 09:00
int to string for CZ
<?php
function int_to_text($int, $x = 1)
{
$len = strlen($int);
// desítky + jednotky
if(($len - 2) >= 0)
$des = substr($int, $len - 2, 2); //dvojciferne
else $des = substr($int, $len - 1, 1); //jednociferne
if($des < 21)
$des_text = int_to_text_basic($des, $x);
@machv
machv / common.config
Last active August 29, 2015 14:14
Mediatel WallBoard
{
"LayoutType" : "PANEL",
"PanelRows" : "2",
"PanelCols" : "4",
"RowDataSQL" : "",
"FontSize" : "1.0",
"DBType" : "MICROSOFT",
"DBConnStr" : "data source=APSHODMS;initial catalog=MediatelAutodialer;persist security info=True;user id=mediatel;password=---",
"WebService" : "http://172.26.9.4:8888/RealTimeWS.asmx",
@machv
machv / firewall.ps1
Created February 15, 2014 14:07
Set Public networks profile to private
$NLMType = [Type]::GetTypeFromCLSID(‘DCB00C01-570F-4A9B-8D69-199FDBA5723B’)
$INetworkListManager = [Activator]::CreateInstance($NLMType)
$NLM_ENUM_NETWORK_CONNECTED = 1
$NLM_NETWORK_CATEGORY_PUBLIC = 0x00
$NLM_NETWORK_CATEGORY_PRIVATE = 0x01
$INetworks = $INetworkListManager.GetNetworks($NLM_ENUM_NETWORK_CONNECTED)
foreach ($INetwork in $INetworks)