Skip to content

Instantly share code, notes, and snippets.

View devscott's full-sized avatar

Scott Sloan devscott

View GitHub Profile
@devscott
devscott / main.cs
Created October 12, 2015 15:28
Listing and searching the Certificate Store
using System;
using System.Security.Cryptography.X509Certificates;
namespace ListCertificates
{
class Program
{
static void Main(string[] args)
{
var store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
@devscott
devscott / gist:cccc5e0eda04b104bb9e
Created November 18, 2014 16:21
Windows batch script to rotate Putty logs
@echo off
REM This closes the active session of Putty to allow the log files to be modified and waits 2 seconds
taskkill /F /IM putty.exe
ping -n 2 -w 1000 127.0.0.1 > nul
REM This makes a copy of the latest log appending todays date to the file name and waits 2 seconds
copy "X:\Users\Common\TestLog.log" "X:\Users\Common\TestLog_%DATE:/=%.log"
ping -n 2 -w 1000 127.0.0.1 > nul
REM Manually create a blank log file in the same directory call Blank.Log