Friday, October 24, 2014

Recover lost data from git hard reset

Big thanks to this excellent post I used to restore a ton of "lost" data when I accidentally did a git hard reset back to an old commit: http://www.programblings.com/2008/06/07/the-illustrated-guide-to-recovering-lost-commits-with-git/

My takeaway steps to recovering data:

coty$ git fsck --lost-found
Checking object directories: 100% (256/256), done.
Checking objects: 100% (17780/17780), done.
dangling commit b7c3533a8219f99ff4dd7402372dcea9ce114644
coty$ git show b7c3533a8219f99ff4dd7402372dcea9ce114644
coty$ git stash save "before rebase to recover data"
coty$ git rebase b7c3533a8219f99ff4dd7402372dcea9ce114644

Friday, October 3, 2014

Fixing high-availability failover condition in Cisco CUP 10.5

When Cisco Unified IM and Presence servers are in a high availability enabled subcluster, the high availability can go into failover / failed over when one of the servers goes down or is rebooted. If this happens, you can't assign any new users to the subcluster without either bringing high availability back up, or disabling high availability for the server that is still working.

If you thought that this setting was in the CUP server admin pages, you'd be wrong. As I found here, you have to go into CUCM admin page to change this. It's under System > Presence Redundancy Groups. Click find, click on your subcluster, and Enable High Availability is there as a simple checkbox. Turn HA off and then back on again to get it back into a good state.

Thursday, October 2, 2014

Jabber 9 and 10.5 error: Starting a feature set failed and Incorrect Username or Password

If you encounter this error in Jabber 10.5:
Starting a feature set failed
or this error in Jabber 9.3 or higher:
Incorrect Username or Password
when trying to sign in to Jabber using CUCM and CUPS (as opposed to Webex), and your typed password is actually correct, you may have a problem with your CUPS server and/or not have this user assigned to a presence server.

Test/verify:
To verify this is the problem,  try manual sign-in to CUCM (phone features only). If you can sign in to phone features, your problem is with CUPS. Make sure you have assigned this end user to a CUPS server and that the CUPS server is in a good state.

Adobe PDF "Please Wait..." error message, and can't print PDF on Mac

Adobe has extra features beyond the PDF standards. If you have an Adobe-only PDF file (or you have a newer version than someone you're sending the PDF to), you'll be able to open the PDF normally while others will get this message in place of the PDF content:
This seems to be the case especially for PDF forms created in Acrobat Pro that can only be filled out in Acrobat Pro or Acrobat Reader.

To resolve this, the recipient either needs to open the file in the latest version of Adobe Acrobat, or you'll have to print the PDF from Acrobat using a PDF Printer. An additional caveat when using Acrobat on a Mac is that you cannot save a filled-out PDF form using the built-in PDF printer in Acrobat; it will tell you to save as a PDF. The form I had trouble with also was not able to be exported to the PDF/A standard, so the only option I had was to install a 3rd-party PDF printer. If Adobe had used the built-in printing functionality in OS X, we wouldn't even be having this issue.

Install PDFwriter from http://sourceforge.net/projects/pdfwriterformac/. If you're on Windows, CutePDF and Bullzip PDF Printer are both pretty good. Once you install PDFwriter, go to the Settings app in OS X and open Printers. Click the + at the bottom of the installed printers list to add a new printer, and select PDFwriter from the popup that follows. Now, go back to your PDF in Acrobat, click print, select PDFwriter as the printer, and print it. Your new PDF print file will be located in /users/shared/PDFWriter/. If you want to get fancy, you can also create a link to your dropbox folder by running this command from Terminal:
sudo ln -s /var/spool/pdfwriter/$USER ~/Dropbox/Documents/PDFs
This will upload your print-to-PDF files into your Dropbox.

reference: http://sourceforge.net/p/pdfwriterformac/discussion/1246009/thread/d66abec3/?limit=25

Friday, September 26, 2014

Replacing the default https certificate in a java keystore

I have a JBoss server that hosts a bunch of web apps, and I needed to update the self-signed certificate that signs the https requests.
Step 1: find the keystore.jks file
[root@jboss ~]# find / -iname keystore.jks
/opt/jboss/domain/configuration/security/main-loadbalancer-group/keystore.jks

Step 2: backup the keystore.jks file, and remove the old "https" keystore. This won't affect the running JBoss services until you restart it.
[root@jboss ~]# cd /opt/jboss/domain/configuration/security/main-loadbalancer-group
[root@jboss ~]# cp keystore.jks keystore.jks.bak
[root@jboss ~]# keytool -delete -keystore keystore.jks -alias https

Step 3: generate a new private key with alias of "https"
[root@jboss ~]# keytool -genkey -alias https -keyalg RSA -keystore keystore.jks -keysize 2048

Step 4: generate a certificate request for "https"
[root@jboss ~]# keytool -certreq -alias https -keystore keystore.jks -file myjbossserver.csr

Step 5: copy the certificate request to the CA server
Step 6: set up your CA config file with the SANs you want. Use this as a guide: http://apetec.com/support/GenerateSAN-CSR.htm
[ccondry@ca:~]$ sudo openssl ca -config ./myjbossserver.cnf -in myjbossserver.csr -out myjbossserver.crt
Step 7: copy the signed certificate and the ca's public certificate back to the jboss server
Step 8: import the ca certificate (mine is ca.crt) as a trusted certificate, with the alias "myca"
[root@jboss ~]# keytool -import -trustcacerts -alias myca -file ca.crt -keystore keystore.jks
Step 9: convert the certificate to DER so that keytool can import it
[root@jboss ~]# openssl x509 -outform der -in myjbossserver.crt -out myjbossserver.der
Step 10: import the new "https" certificate, in DER format
[root@jboss ~]# keytool -import -trustcacerts -alias https -file myjbossserver.der -keystore keystore.jks
Step 11: restart your jboss server for the changes to take effect! (note your jboss service is probably not "jboss", so just replace that with your service daemon script name)
[root@jboss ~]# service jboss restart

Thursday, September 25, 2014

Can't uninstall Exchange 2013 or install another Exchange server version in current domain

I was stuck with a broken Exchange 2013 installation (brand new, too - never could fix the 'emails stuck in drafts folder' issue). I also couldn't uninstall Exchange 2013, because I couldn't delete all the mailboxes in it (access to the error message was denied...). And, once you install Exchange 2013 in your domain, you can't install another previous version in the same forest.

Fix: Open up ADSI Edit, connect to your domain, and choose 'Default naming context'. When ADSI Edit has connected, look in the folder directly under "Default naming context [your.domain.com]". It is named with your domain's distinguished name. Delete these folders:
CN=Microsoft Exchange Security Groups
CN=Microsoft Exchange Security Objects
Now change the ADSI Edit connection from 'Default naming context' to 'Configuration' and look in the folder directly under it. Go to the "CN=Services" folder, then delete these folders:
CN=Microsoft Exchange
CN=Microsoft Exchange Autodiscover

You'll also have to delete some user accounts, but this was the step that took me the longest to figure out. Thanks to this site for the info: http://blog.dargel.at/2012/11/20/complete-remove-exchange-2013-using-adsiedit/

Tuesday, September 16, 2014

Attempted to send call to agent: (ID: ), on peripheral: (ID: ), who has no device target.

If you receive an error like this:
Attempted to send call to agent: ccondry_0 (ID: 5050), on peripheral: CUCM_PG (ID: 5000), who has no device target.
Then you need to add the Routing Client in question to the Agent Targeting Rule you have set up for the agent device. Here is a screenshot of the button to add more routing clients to an existing Agent Targeting Rule: