Skip to content

Instantly share code, notes, and snippets.

View prabhatkashyap's full-sized avatar

Prabhat Kashyap prabhatkashyap

  • Nexthoughts Software Technology Pvt. Ltd.
  • Noida
View GitHub Profile
nexthoughts@NexThoughts:~/Desktop$ java InstallCert services.krediidiinfo.ee
Loading KeyStore /usr/lib/jvm/java-7-oracle/jre/lib/security/jssecacerts...
Opening connection to services.krediidiinfo.ee:443...
Starting SSL handshake...
javax.net.ssl.SSLException: java.lang.UnsupportedOperationException
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1842)
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1825)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1346)
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
Caused by: sun.security.validator.ValidatorException:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
static public String decrypt(String encryptedString) {
String UNICODE_FORMAT = "UTF8"
String DESEDE_ENCRYPTION_SCHEME = "DESede"
String myEncryptionKey = "Provide the same key used for encryption"
String myEncryptionScheme = DESEDE_ENCRYPTION_SCHEME
byte[] arrayBytes = myEncryptionKey.getBytes(UNICODE_FORMAT)
KeySpec ks = new DESedeKeySpec(arrayBytes)
SecretKeyFactory skf = SecretKeyFactory.getInstance(myEncryptionScheme)
Cipher cipher = Cipher.getInstance(myEncryptionScheme)
static public String encrypt(String unencryptedString) {
String UNICODE_FORMAT = "UTF8"
String DESEDE_ENCRYPTION_SCHEME = "DESede"
String myEncryptionKey = "Provide your encryption key"
String myEncryptionScheme = DESEDE_ENCRYPTION_SCHEME
byte[] arrayBytes = myEncryptionKey.getBytes(UNICODE_FORMAT)
KeySpec ks = new DESedeKeySpec(arrayBytes)
SecretKeyFactory skf = SecretKeyFactory.getInstance(myEncryptionScheme)
Cipher cipher = Cipher.getInstance(myEncryptionScheme)
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
sudo apt-get install dos2unix #installs it if it isn't already installed
dos2unix ~/repositories/casperjs/bin/casperjs #Can't be ran on a linked resource
casperjs #Check to make sure you get said helpmessage
#If it does not exist, create ~/repositories
mkdir ~/repositories
cd ~/repositories
#clone the repository from the master branch
git clone git://github.com/n1k0/casperjs.git
#Symlink the relevant file into your bin
ln -sf ~/repositories/casperjs/bin/casperjs ~/bin/casperjs
phantomjs --version
#If it does not exist, create ~/repositories
mkdir ~/repositories
#Move it and rename
mv phantomjs-1.9.1-linux-x86_64 ~/repositories/phantomjs
#If you don't have bin under your home folder, create it
mkdir ~/bin
#64-bit
mv phantomjs-1.9.1-linux-x86_64/bin/phantomjs ~/bin/phantomjs
#32-bit
mv phantomjs-1.9.1-linux-i686/bin/phantomjs ~/bin/phantomjs