Archive | NoteToSelf

My SSL/Certificate Cheatsheet

Whenever a certificate needs to be renewed, I always have to scramble to remember how to update/renew. I finally put a cheat sheet together.

I decided I will do all cert related stuff form Linux. Here are some commands:

To request a new csr with a new key:

openssl req -newkey rsa:2048 -keyout -out

Generating a 2048 bit RSA private key
writing new private key to ''
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:New York
Locality Name (eg, city) []:New York
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Your Company name
Organizational Unit Name (eg, section) []:IT
Common Name (e.g. server FQDN or YOUR name) []:*
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

To request a new csr with an existing key:

openssl req -new -key -out 

To make a PFX form a Private key and a cert:

openssl pkcs12 -export -out -inkey -in

To extract Private key and Cert from a PFX (3 steps)

Export the private key

openssl pkcs12 -in -nocerts -out -nodes

Export the certificate

openssl pkcs12 -in -nokeys -out

Remove the passphrase from the private key

openssl rsa -in -out 

When using PowerShell to pull REST data from MS CRM, escape `$filter !

Note to self.

When trying to filter a REST response in PowerShell, by using the “$filter” parameter in the url (as with MS CRM 2011), you must escape the “$” with “`$”.

For example:

Does not work:
$url=”$filter=StateCode/Value eq 0″

$url=”`$filter=StateCode/Value eq 0″

Gets me every time, and I can’t figure out why my filters are being ignored!


Using Let’s Encrypt, cerbot-auto with Apache on CentOS 6

There are plenty of better documented examples out there, so this is more of a note to self.

cd /opt
mkdir YourDir
cd YourDir/
chmod a+x certbot-auto

/certbot-auto --apache certonly -d -d -d -d -d -d -d -d

The name on the cert will be the first domain you list int he command above. All the other names will be part of the SAN cert.

And to renew, cron this up:
/opt/YourDir/certbot-auto renew


Import Picture into AD with PowerShell

I know this is everywhere, so this is more a note for myself. How to upload pictures to AD via PowerShell:

Import-RecipientDataProperty -Identity username -Picture -FileData ([Byte[]]$(Get-Content -Path .\username.jpeg -Encoding Byte -ReadCount 0))

I finally did it! 10K+ visits in a month!

Not bad seeing as I was at 2K last year this time!

Today		 373
Yesterday	 504
This month	 10183
December	 9085
November	 9827
October		 9427
September	 9010
August		 9440
July		 9151
June		 8171
May 		 7352
April		 5027
March		 3966
February	 3160
January		 2741

My git notes

Been playing around with git to manage my “Environment”. This is a note to self. May add more at some point
List files that have been “staged”
  • git diff –name-only –cached
To create a “Centro repo”
  • To setup an empty central repo:
    • mkdir /your/path/folder/project.git
    • cd /your/path/folder/project.git
    • git init –bare –shared
  • To add files to the central repo:
    • Go to the existing file structure and setup a new git repo (if it is not there already)
    • cd your/local/workspace/project
    • git init
    • git add .
    • git commit -m “First Commit”
    • git remote add origin
    • git push origin master
  • If you make a change  in your local copy and you want to push it up to the Centro repo
    • git add .
    • git commit -m “This is what changed”
    • git push origin master
  • And to get those changes to other machines
    • git pull origin master
  • And to setup a new machine
    • git clone

Got most of the info from here

Powered by WordPress. Designed by WooThemes