List user creation date for Active Directory users

On my SBS 2003 server, I wanted to know when a user was created. This info is extracted with ldifde

ldifde -d OU=SBSUsers,OU=Users,OU=MyBusiness,DC=xxx,DC=yyy -l whencreated -r "(ObjectCategory=user)" -f usercreationdate.txt

A file usercreationdate.txt is now created with the requested report.

© GeekLabInfo List user creation date for Active Directory users is a post from GeekLab.info. You are free to copy materials from GeekLab.info, but you are required to link back to http://www.geeklab.info

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.50 out of 5)
Loading...

How to use chained SSL certificates

What are chained SSL certificates?

Normal "single root" certs are only certified by one single parent which is recognised by clients immediately. Chained certs on the other side are signed by a parent which itself is signed by another parent. This effectively makes your cert a "grandchild" of the CA root. In the image attached you'll see a cert that is chained by two intermediate certs.

How to use chained SSL certificates?

The several server software distributions require different types of configuration. This page is not telling you how to set up ssl for your software, I'm just telling how to use chained certs with the different programs.

Apache

Apache has quite some SSL functionality on board. I'm not gonna discuss it all, just want to say that the words you're looking for are:

SSLCertificateFile [path to crt file here]
SSLCertificateKeyFile [path to key file here]
SSLCACertificateFile [path to intermediate ca certs bundle here]

I downloaded the intermediate CA certs from my SSL provider: https://search.thawte.com/support/ssl-digital-certificates/index?page=content&id=AR1371 . Your SSL provider has a page with their own intermediate CA certs.

PureFTPd

My PureFTPd key and cert are all located in /etc/pure-ftpd/pure-ftpd.pem. In order to make ftp clients accept the SSL cert, i performed the following steps:

  1. I downloaded the intermediate CA certs from my SSL provider: https://search.thawte.com/support/ssl-digital-certificates/index?page=content&id=AR1371 . Your SSL provider has a page with their own intermediate CA certs.
  2. I combined the contents of the key, my own cert and the intermediate CA certs to /etc/postfix/ssl/smtpd.pem. I don't know if the order of the certs is important, but just to be sure I went back one parent at a time. So my file contains from top to bottom: my private key, certificate for my domain, thawte DV SSL CA, thawte primary root. It doesn't need thawte primary server CA as your client already has this one.
  3. Test it: openssl s_client -connect [your-hostname]:21 -starttls ftp

Dovecot

My dovecot SSL key is located in /etc/pki/dovecot/private/dovecot.pem and my SSL cert is /etc/pki/dovecot/certs/dovecot.pem. In order to make email clients accept the SSL cert, i performed the following steps:

  1. I downloaded the intermediate CA certs from my SSL provider: https://search.thawte.com/support/ssl-digital-certificates/index?page=content&id=AR1371 . Your SSL provider has a page with their own intermediate CA certs.
  2. I added the contents of the intermediate CA certs to /etc/pki/dovecot/certs/dovecot.pem. I don't know if the order of the certs is important, but just to be sure I went back one parent at a time. So my file contains from top to bottom: YourDomain.com, thawte DV SSL CA, thawte primary root. It doesn't need thawte primary server CA as your client already has this one.
  3. Test pop3s: openssl s_client -connect popserver:995
  4. Test imaps: openssl s_client -connect imapserver:995

Postfix

My postfix key and cert are all located in /etc/postfix/ssl/smtpd.pem.
In order to make email clients accept the SSL cert, i performed the following steps:

  1. I downloaded the intermediate CA certs from my SSL provider: https://search.thawte.com/support/ssl-digital-certificates/index?page=content&id=AR1371 . Your SSL provider has a page with their own intermediate CA certs.
  2. I combined the contents of the key, my own cert and the intermediate CA certs to /etc/postfix/ssl/smtpd.pem. I don't know if the order of the certs is important, but just to be sure I went back one parent at a time. So my file contains from top to bottom: my private key, certificate for my domain, thawte DV SSL CA, thawte primary root. It doesn't need thawte primary server CA as your client already has this one.
  3. Test smtps: openssl s_client -connect [your-hostname]:465
  4. Test smtp with starttls: openssl s_client -connect [your-hostname]:25 -starttls smtp
© GeekLabInfo How to use chained SSL certificates is a post from GeekLab.info. You are free to copy materials from GeekLab.info, but you are required to link back to http://www.geeklab.info

1 Star2 Stars3 Stars4 Stars5 Stars (8 votes, average: 3.88 out of 5)
Loading...

How to check an EAN13 barcode’s CRC

An EAN13 barcode has a built-in checksum to help cash registers discover damaged barcodes. You can easily check these checksums by hand.

StandardDigit positions
EAN-8N1N2N3N4N5N6N7N8
EAN-12N1N2N3N4N5N6N7N8N9N10N11N12
EAN-13N1N2N3N4N5N6N7N8N9N10N11N12N13
EAN-14N1N2N3N4N5N6N7N8N9N10N11N12N13N14
SSCCN1N2N3N4N5N6N7N8N9N10N11N12N13N14N15N16N17N18
Step 1: Multiply value of each position by
x3x1x3x1x3x1x3x1x3x1x3x1x3x1x3x1x3
Step 2: Add results together to create sum
Step 3: Subtract the sum from nearest equal or higher multiple of ten = Check Digit

The following table gives an example to illustrate how a Check Digit is calculated:

PosN1N2N3N4N5N6N7N8N9N10N11N12N13
Number without Check Digit123456789123-
Step 1: Multiplyxxxxxxxxxxxx-
by131313131313-
Step 2: Add results============-
to create sum163125187249329= 91
Step 3: Subtract the sum from nearest equal or higher multiple of ten = 100-99 = 1
Number with Check Digit1234567891231

My PHP code to check the CRC code:

function ean13_check_digit($digits){
   $digits=preg_split("//",$digits,-1,PREG_SPLIT_NO_EMPTY);
   $a=$b=0;
   for($i=0;$i<6;$i++){
      $a+=(int)array_shift($digits);
      $b+=(int)array_shift($digits);
   }
   $total=($a*1)+($b*3);
   $nextten=ceil($total/10)*10;
   return $nextten-$total==array_shift($digits);
}
 
 
echo ean13_check_digit('1234567891231')?"good":"wrong";
echo ean13_check_digit('1234567891232')?"good":"wrong";
echo ean13_check_digit('1234567891233')?"good":"wrong";
echo ean13_check_digit('1234567891234')?"good":"wrong";
echo ean13_check_digit('1234567891235')?"good":"wrong";
echo ean13_check_digit('1234567891236')?"good":"wrong";
echo ean13_check_digit('1234567891237')?"good":"wrong";
© GeekLabInfo How to check an EAN13 barcode's CRC is a post from GeekLab.info. You are free to copy materials from GeekLab.info, but you are required to link back to http://www.geeklab.info

1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 1.67 out of 5)
Loading...