Skip to content

Instantly share code, notes, and snippets.

@pcurylo
pcurylo / cross_command_interpreter_calls
Created May 11, 2016 13:20
Calling another command interpreter
#To Powershell
#From Bash
powershell -inputformat none -noprofile echo hello | grep hello
#From cmd
powershell echo hello
#To Bash
#From Powershell
?????
#From cmd
@pcurylo
pcurylo / win_cert_mgmt
Last active October 7, 2019 21:10
Windows Certificate Management
Using PowerShell
ls|foreach-object {if ($_.subject -like "*entrust*") {$_|select-object @{Name="SigAlgo"; Expression={$_.SignatureAlgorithm.FriendlyName}},FriendlyName,Subject,NotBefore,NotAfter,Issuer}}
ls|foreach-object {if ($_.subject -like "*entrust*") {$_|select @{n="SigAlgo"; e={$_.SignatureAlgorithm.FriendlyName}},FriendlyName,Subject,NotBefore,NotAfter,Issuer}}
ls|where-object -filterscript {$_.subject -like "*entrust*"} | select @{n="SigAlgo"; e={$_.SignatureAlgorithm.FriendlyName}},FriendlyName,Subject,NotBefore,NotAfter,Issuer
ls|?{$_.subject -like "*entrust*"} | select @{n="SigAlgo"; e={$_.SignatureAlgorithm.FriendlyName}},FriendlyName,Subject,NotBefore,NotAfter,Issuer
@pcurylo
pcurylo / gist:6589897
Created September 17, 2013 03:52
Cygwin and apt-cyg
Installing or reinstalling Cygwin... lots of packages.
Cygwin now has a -P command line for feeding comma separated list of packages to install. Should be easier then clicking all those boxes.
now using apt-cyg to install packages: https://code.google.com/p/apt-cyg/
$wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
$chmod +x apt-cyg
$mv apt-cyg /usr/local/bin
apt-cyg (not cyg-apt) was working... change in repos for Cygwin to differentiate between x86 (32-bit) and x86_64 breaks the apt-cyg script. Fix detailed in issue 31 (https://code.google.com/p/apt-cyg/issues/update.do?id=31#makechanges). Diff below will fix.
@pcurylo
pcurylo / Getting_Started_PS+Git+GitHub
Created September 16, 2013 00:02
Getting setup with PowerShell and Git and GitHub
My journey with PowerShell, Git, GitHub (CygWin, Strawberry Perl already installed)
PowerShell - already on Win7+
-create profile folder ~/Documents/WindowsPowershell/
-create modules folder ~/Documents/WindowsPowershell/Modules
-Keep this handy: http://technet.microsoft.com/en-us/library/ee692764.aspx
-recommend
installing Chocolatey: http://chocolatey.org/ (you'll need something like CPAN for Perl to keep track of PS stuff and other things)
to install:
cmd.exe> @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin - See more at: http://chocolatey.org/#sthash.5KjLIpD5.dpuf