Posts

Certificate conversions etc...

https://www.xolphin.com/support/Certificate_conversions/Convert_pfx_file_to_pem_file Convert pfx file to pem file Conversion to a combined PEM file To convert a PFX file to a PEM file that contains both the certificate and private key, the following command needs to be used: # openssl pkcs12 -in filename.pfx -out cert.pem -nodes Conversion to separate PEM files We can extract the private key form a PFX to a PEM file with this command: # openssl pkcs12 -in filename.pfx -nocerts -out key.pem Exporting the certificate only: # openssl pkcs12 -in filename.pfx -clcerts -nokeys -out cert.pem Removing the password from the extracted private key: # openssl rsa -in key.pem -out server.key https://www.aleksey.com/xmlsec/xmldsig-verifier.html https://www.cryptosys.net/sc14n/example-signed-xmldsig.html https://github.com/robrichards/xmlseclibs

Speed up your Wordpress 1.000x with REDIS

I was bored so I decided it was time to upgrade my server with new distro and switch to NGIX. My current installation was Debina6 PHP5.3 running Lighty web server. My typical cached server response was around 1s. Considering my server uses 12 CPUs this was really bad. But the page load is low and I didn't care to much:) Having problem with apt-get dist-upgrade  in the past I decided rather to install fresh version of debian/jessi  I like jesse because I got accustomed with systemd and jessie is finnaly on board with it. I decided that I will also cut down on number of CPUs down to just 4 (AMD Buldozer 2Ghz) and 4Gb of ram. So my new LAMP stack is now LNMP. Just migrating to NGINX and enabling OPCache the typical response time became 3-4x faster on 3x less CPUs. I didn't bother with server load at this point since this was just learning exercise. Now my page load time was about 300ms. Things are getting brighter I thought. But I was not happy yet. I found a great t...

Transcoding RM and WMA with Node.js under Windows

I just love Node.js! You can do just about anything with it. My task was to transcode media files and keep the folder structure. I also had to check for media ype. RM videos, RM audio and WMA audio files were used at input. Attention! If you are planning to try it out you must install ffpmeg , mencoder and ffprobe . Make sure you add installed files to Windows path! So first I used 'final-fs' => ' npm install final-fs ' to read all files from my input forder and create the same folder structure at my output. Because each file was different I had to use ffprobe => ' npm install node-ffprobe ' to inspect media info. I using under windows you have tho change source file so it uses win-spawn. So also you need to 'npm install win-spawn'. We will also need win-spawn to spawn ffmpeg or mencoder processes... So after we get media file info we are ready to use the appropriate codec... You can check the code here. The code is robust because I to...

Update Windows path without reboot

I really need this all the time! http://dustindavis.me/update-windows-path-without-rebooting.html Cheers!

Simple way to copy multiple files under windows

The problem was simple. I had to copy a whole lot of files (from a txt file) from one location to another in order to optimize file structure. I was thinking about using batch scripting but than I realized that the only thing I really need is to use copy.exe. So other stuff like opening file, reading it line by line, parsing the line could be done in some simple manner. So I choose python that I haven't used since collage and give it a try. Phython is simple and all you need to do is just install execution environment, write a couple of line of code and It should work just fine. So my input was: 154612818,28/21/BucenvstopvnovoletopovsejSlovenijix201301011400x700000x351x413x.mp4,2013/01/01/BucenvstopvnovoletopovsejSlovenijix201301011400x700000x351x413x.mp4 154612866,28/71/PrviletosnjinovorojenecjeAnjurx201301011334x700000x351x413x.mp4,2013/01/01/PrviletosnjinovorojenecjeAnjurx201301011334x700000x351x413x.mp4 154612881,28/84/Praznovanjenovegaletaposvetux201301011407x700000x351x41...

Batch copy files from list and preserve folder structure

@echo off set src_folder=F:\AVA3 set dst_folder=F:\AVA3_UNIQ set file_list=F:\recordings.txt for /f "delims=" %%a in (%file_list%) do (  echo "%%~pa"  echo "%src_folder%%%a"  echo "%src_folder%\%%a"  if not exist "%dst_folder%\""%%~pa" mkdir "%dst_folder%\""%%~pa"     xcopy "%src_folder%\%%a" "%dst_folder%\""%%~pa" /E )

How to invite all your Facebook friends to an event at once

UPDATED 12.12.2012 Step#1 . Open Google Chrome Step#2. Open any invitation dialog for Facebook pages, groups or events. Step#3. Don’t forget to check on “Search all Friends” in dialog box and scroll down until all your facebook appears. Step#4. Press CTRL+SHIFT+J , A window will open at the bottom. Step#5. Paste the JavaScript code given below in the console and hit enter button. AFTER YOU PRESSED ENTER YOU MUST WAIT 1-2 MINUTES:)