Wednesday 11 April 2018

How to Install kurento Media Services on ubuntu 64 bit




In order to install the latest stable Kurento Media Server version (6.6.1) you have to type the following commands, one at a time and in the same order as listed here. When asked for any kind of confirmation.

echo "deb http://ubuntu.kurento.org trusty kms6" | sudo tee /etc/apt/sources.list.d/kurento.list For Ubuntu 14.04
echo "deb http://ubuntu.kurento.org xenial-dev kms6" | sudo tee /etc/apt/sources.list.d/kurento-dev.list for ubuntu 16.04


wget -O - http://ubuntu.kurento.org/kurento.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install kurento-media-server-6.0


Now, Kurento media service install successfully. Use this command for Kurento media services start and stop respectively.

sudo service kurento-media-server-6.0 start
sudo service kurento-media-server-6.0 stop

Thursday 5 April 2018

Encrypt And Decrypt Connection String In Web.Config File Using Command Prompt


Encrypting Web.Config

  1. Open Command Prompt with Administrator privileges
  2. At the Command Prompt, enter: cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
    This command will narrate you to the framework version folder given.
  3. In case your web Config is located in "D:\Articles\EncryptWebConfig" directory path, then enter the following to encrypt the ConnectionStringASPNET_REGIIS -pef "connectionStrings" "D:\Articles\EncryptWebConfig"
    Use Aspnet_regiis.exe tool with the –pef option and specify the application path as shown above.
    Note: The parameter "connectionStrings" is case sensitive.
  4. Once you click the enter. You will get the output as follows.


Decrypt connection string
You can always decrypt the connection string if you want, to decrypt you just need follows the commands as follows at the command prompt.
cd C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319  
Once after you did you the above command you can execute the preceding one.
ASPNET_REGIIS -PDF "connectionStrings" "F:\Visual Studio\EncryptConnectionString\EncryptConnectionString" 
The text ‘connectionString’ is case sensitive as mentioned above 
If the command is correct, you can get an output as follows.



Now if you check your Web config again, you can see the connection string has got encrypted. Have a happy coding!

Encrypt and Decrypt Connection Strings in Web.Config file in ASP.Net Using Visual Studio Command Prompt

In this article, I will provide some example to encrypt and decrypt Connection Strings in Web.Config file in ASP.Net.


The Encryption and Decryption of the Web.Config file’s ConnectionStrings section
will be performed using aspnet_regiis.exe Command Line Utility of the Visual Studio.


The plan text connection string in web.config file.
<configuration>
 <connectionStrings>
   <add name="SqlServices" connectionString="Data Source=localhost;Integrated Security=SSPI;Initial
Catalog=Northwind;" />
 </connectionStrings>
</configuration>


Encrypting the connection string in web.config file


You need to follow the following steps for encrypting the Connection Strings in the Web.Config file
1. Open Visual Studio Command Prompt
You will need to open the Visual Studio Command Prompt from the Start Menu =>
Programs => Microsoft Visual Studio 2010 => Visual Studio Tools => Visual Studio Command Prompt.
Note: You must be login as Administrator and right-click Visual Studio Command Prompt and select.
Note: In this tutorial, I am explaining the process using Microsoft Visual Studio 2015
The same process will be applicable to the other versions. The only difference will be that you
need to open Visual Studio Command Prompt from the
folder of the respective version of Visual Studio installed on your machine.


2. Encrypting the Connection String in Web.Config using aspnet_regiis.exe tool
In order to encrypt the ConnectionString section in the Web.Config file, we will need to
use the aspnet_regiis.exe tool
Parameters
Action - It notifies the action to be performed.&nbsp; In order to perform Encryption, the parameter value is -pef
Section Name - The name of the section of the Web.Config file to be encrypted.
For this case, the value will be connectionStrings
Path of the folder – Here we need to specify the path of the folder containing
the Web.Config file.
Syntax : aspnet_regiis.exe -pef "connectionStrings" "<Path of the Folder containing the Web.Config file>"
Example : aspnet_regiis.exe -pef "connectionStrings" "D:\Mudassar\Projects\MyTestWebsite"



Note: The above command will encrypt all the Connection Strings present in
the ConnectionStrings section of the Web.Config file.



Encrypted Connection String in the Web.Config file
The following screenshot shows the Encrypted Connection String in the Web.Config
file after encryption.
<configuration>
 <connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider">
   <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"

xmlns="http://www.w3.org/2001/04/xmlenc#">
     <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
     <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
       <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
         <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
         <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
           <KeyName>Rsa Key</KeyName>
         </KeyInfo>
         <CipherData>
           <CipherValue>ZbDTF00MYzUUW5U3w3PU0rfiAH1UKhvuLSNWPmB/YifBKne6HAWfVc3CnKVimy
P8SFyamaR5o AIAxj/xavfpox8EOYXNI+afsksiuA5huSDupCZKNuXq+VCZrdIyn6YOq+W7s3Ojlu7q9VwKco
Kurl28l2hcPvWkBk11KYB7hr0=</CipherValue>
         </CipherData>
       </EncryptedKey>
     </KeyInfo>
     <CipherData>
       <CipherValue>42IPPRUjJxCNDHEBLCAJI4/NyLpLueZSBzUXO69lVdZU8+nLpxO+opnbZNxqddyzNnbCO1
Uk2Da 3ljExkqnLIxT2zs90JAhZvJ5ljIgCipq7ZEp7zHOpvTH9fBGoZJJWhgdddOrHZsLDE9mILjlvBHDhPQrYcMHt
Y6oLIbxJq92it82iBJv0fS7v1S/o0p4hAtfky+6hXCZWSKUJHr88NDrKe2EEK3mazD2QD5Ozf/w=</CipherValue>
     </CipherData>
   </EncryptedData>
 </connectionStrings>
</configuration>


Accessing the Encrypted Connection String value in ASP.Net Code behind
ASP.Net will automatically decrypt the Connection String when it is fetched in the code behind and
hence in code behind you need to access the Connection String in the same way as you would do normally.
string ConnString = ConfigurationManager.ConnectionStrings[SqlServices
].ToString();


Decrypting the Connection String in Web.Config using aspnet_regiis.exe tool
In order to decrypt the ConnectionString section in the Web.Config file, we will need to use the same
aspnet_regiis.exe tool that was used for encryption.
Parameters
Action – It notifies the action to be performed. In order to perform Decryption, the parameter value is -pdf.
Section Name – The name of the section of the Web.Config file to be decrypted. For this case,
the value will be connectionStrings.
Path of the folder – Here we need to specify the path of the folder containing the Web.Config file.
Syntax
aspnet_regiis.exe -pdf "connectionStrings" "<Path of the Folder containing the Web.Config file>"
Example
aspnet_regiis.exe -pdf "connectionStrings" "D:\Mudassar\Projects\MyTestWebsite"


Note: The above command will decrypt all the Connection Strings present in
the ConnectionStrings section of the Web.Config file.


Tuesday 3 April 2018

Create Subtitle Using Autosub


Install AutoSub

  1. Download Python 2.7 from https://www.python.org/ftp/python/2.7.12/python-2.7.12.msi
  2. Install Python

  3. Run CMD(Win +R) Type in CMD pip install autosub C:\Python27\Scripts\pip.exe install https://pypi.python.org/packages/35/7b/9d5361c0f7abfcc 6d826a5279b1c450 1f7616505629f6c54857587ec6e37/autosub-0.3.9.tar.gz OR (Download Last version autosub https://pypi.python.org/pypi/autosub) C:\Python27\Scripts\pip.exe install "c:\youdownloaded\autosub-0.3.9.tar.gz"
  4. Change Name File Autosub Rename C:\Python27\Scripts\autosub autosub_app.py
  5. Modify with notepad.exe or Notepad++(Edit Text) autosub_app.py
    1. In line 48 add ", delete=False" temp = tempfile.NamedTemporaryFile(suffix='.flac') by temp = tempfile.NamedTemporaryFile(suffix='.flac', delete=False)
    2. Eliminate line 53 os.system('stty sane'). (Optional)
  5. Eliminate line 53 os.system('stty sane'). (Optional)
Copy ffmpeg.exe to C:\Python27\Scripts\ (Erorr) Copy ffmpeg.exe to C:\Python27\
.
6. Test Script C:\Python27\python.exe C:\Python27\scripts\autosub_app.py --list-languages


Auto-generating subtitles for any video file


Spanish
C:\Python27\python.exe C:\Python27\scripts\autosub_app.py -S es -D es TuVideo.mp4
English
C:\Python27\python.exe C:\Python27\scripts\autosub_app.py -S en -D en YouVideo.mp4
Japanese
C:\Python27\python.exe C:\Python27\scripts\autosub_app.py -S ja -D ja YouAnimeVideo.mp4


Optional
Compile script Python(Exe Executable)
C:\Python27\python.exe -m compileall C:\Python27\scripts\autosub_app.py
Run
C:\Python27\scripts\autosub_app.pyc YouVideo.mp4 (English Default)


7.- Translate your Subtitles
Download Subtitle Edit https://github.com/SubtitleEdit/subtitleedit/releases
SubtitleEdit-3.4.13-Setup.zip Or version portable SE3413PL.zip


Run SubtitleEdit.exe
Open Subtitle (TuVideo.srt,YouAnimeVideo.srt,YouVideo)
Menu-Auto-Translate-(PowerbyGoogle)
From(Japanese) To English
Translate


with
C:\Python27\Scripts\pip.exe install autosub
Message Install normally is:

Uninstall AutoSub
C:\Python27\Scripts\pip.exe uninstall autosub

Sitecore Publishing Service 7.0 Installation Guide

  About the Publishing Service module The Publishing Service module is an optional replacement for the existing Sitecore publishing methods....