This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Text; | |
| using System.Linq; | |
| public class TrimMean | |
| { | |
| private const string E_PERCENTAGE_OUT_OF_RANGE = | |
| "Percentage argument should be in the range 0.0 - 1.0 (inclusive)"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Change a COM+ Proxy App Remote Server Name (RSN). | |
| $appName = "<app name>" | |
| $propertyValue = "<server name>" | |
| $propertyName = "ApplicationProxyServerName" | |
| $collectionName = "Applications" | |
| $catalog = New-Object -ComObject COMAdmin.COMAdminCatalog | |
| $collection = $catalog.GetCollection($collectionName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <#@ template language="C#" #> | |
| using System.Reflection; | |
| [assembly: AssemblyVersion("1.0.<#= this.rev #>.<#= this.build #>")] | |
| [assembly: AssemblyFileVersion("1.0.<#= this.rev #>.<#= this.build #>")] | |
| <#+ | |
| int rev = (int)(DateTime.UtcNow - new DateTime(2020, 1, 1)).TotalDays; | |
| int build = (int)DateTime.Now.TimeOfDay.TotalMinutes; | |
| #> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Configuration; | |
| namespace CustomConfigSectionApp | |
| { | |
| public class AwesomeSettings : ConfigurationSection, IAwesomeSettings | |
| { | |
| #region "accessor" | |
| public static AwesomeSettings Settings { get; } = | |
| ConfigurationManager.GetSection(typeof(AwesomeSettings).Name) as AwesomeSettings; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get update | |
| sudo apt-get install vsftpd | |
| sudo nano /etc/vsftpd.conf | |
| uncomment/add following lines: | |
| anonymous_enable=NO | |
| local_enable=YES | |
| write_enable=YES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| namespace XXXXXXX | |
| { | |
| public class EnumToList<T> where T: Enum | |
| { | |
| public List<T> Convert() | |
| { | |
| var list = new List<T>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $path = "C:\inetpub\logs\LogFiles" | |
| $retentionDays = 10 | |
| $filter = "*.log" | |
| $path ` | |
| | Get-ChildItem -Recurse -File -Filter $filter ` | |
| | ? { ([datetime]$_.LastWriteTime) -lt [System.DateTime]::Now.AddDays(-$retentionDays) } ` | |
| | Remove-Item -Force -Verbose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $scriptPath = $MyInvocation.MyCommand.Path | |
| $scriptPath = Split-Path $scriptPath | |
| [Reflection.Assembly]::LoadFile("$scriptPath\NLog.dll") | Out-Null | |
| # Load Logzio.DotNet.NLog and it's dependencies. | |
| [Reflection.Assembly]::LoadFile("$scriptPath\Logzio.DotNet.NLog.dll") | Out-Null | |
| [Reflection.Assembly]::LoadFile("$scriptPath\Logzio.DotNet.Core.dll") | Out-Null | |
| [Reflection.Assembly]::LoadFile("$scriptPath\Newtonsoft.Json.dll") | Out-Null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Main() | |
| { | |
| var encrypted = "VAGREPRCG GNETRG VA FUNATUNV"; | |
| char[] alphabet = GenerateUppercaseAlphabet(); | |
| for(var adj = (1-alphabet.Length); adj <= (alphabet.Length-1); adj++) | |
| { | |
| var output = ""; | |
| encrypted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <System.Reflection.DefaultMember("DefaultReturn")> | |
| Public Class ArgumentMessageBuilder(Of T As Class) | |
| Private Const MESSAGE_SEPARATOR As String = " " | |
| Private Const PROPERTY_SEPARATOR As String = ", " | |
| Private Const PAIR_SEPARATOR As String = "=" | |
| Private Const SURROUND As String = "({0})" | |
| Private m_message As String | |
| Private m_object As T |