More from the web

Thursday, 30 July 2015

Creating a Local Certificate Authority, Signing and Requesting Certificates


In this tutorial i will be using CentOS to demonstrate the configuration of OpenSSL as a local certificate authority. Once this is setup you can use this server to sign certificates for other servers on your network. In this example i will also generate a request for signing from the server but in production instances you can/will do this from the requesting server.

1) Find out where the openssl.cnf file is located

which openssl

locate openssl.cnf



2)  Change to the folder containing the openssl.cnf file, make a backup of the file

cd /etc/pki/tls


Use root user for the following


cp openssl.cnf openssl_bkup.cnf



3) Configure cnf file as needed

vi openssl.cnf

change

dir = ./local-ca or /etc/pki/local-ca

Under the [change req_distinguished_name] heading you can  modify the defaults
as needed (helps in faster option selection but not required)



Modify the opensssl configuration to enable revocation list  

comment out "crlnumber"
should be #crlnumber after change





4) After the configuration edits

mkdir local-ca
cd local-ca
mkdir newcerts
mkdir certs
mkdir req
mkdir private
mkdir crl

echo "01" > serial

touch index.txt



5) Create the CA
cd /etc/pki/local-ca

openssl req -new -x509 -newkey rsa:2048 -keyout private/cakey.pem -out cacert.pem -days 3650




6) Create request for certificate from the Certificate Authority above (different server)

openssl req -new -nodes -newkey rsa:1024 -keyout private/newsecuredserver.key -out req/newsecuredserver.req -days 1095



7) Create the signed Certificate from the request above
openssl ca -policy policy_anything -out certs/newsercuredserver.pem -in req/newsecuredserver.req



ssl certificate is .pem
key files are .key

Backup
Backup entire OpenSSL directory
/etc/pki

Remember to keep the directory permissions
ls -Fla pki

Create the certificate revocation list

openssl ca -config openssl.cnf -gencrl -out /crl/pem

Revoking Certificates
openssl ca -revoke /System/Library/OpenSSL/groundsweel/certs/mainfinsrvprod/pem

Create new request after revoking the certificate
openssl req -new -nodes -out /System/Library/OpenSSL/mainfinsrvprod/req/mainfinsrvprodnew.req

Create new signed certificate

openssl ca -config /System/Library/OpenSSL/openssl.cnf -policy poilicy_anything -out /System/Library/OpenSSL/main0ca/certs/mainfinsrvprodnew.pem -infiles /System/Library/OpenSSL/main-ca/req/mainfinsrvprodnew.req






Tuesday, 14 July 2015

Adding Code Syntax Highlighting To Blogger

In this tutorial we are going to use the SyntaxHighlighter scripts provided by Alex Gorbatchev from
here


It can be downloaded here or click  here


After downloading you need to host the files on the web. Blogger doesn't let you upload files, but
there are many options GitHub, Drop Box or from the site itself here

I am using the author's website to host the files.

Each of the lines containing the "BrushPhp" file correspondes to a particular type of highlighting,
the following for example is for php

<script src="https://host/syntaxhighlighter/scripts/shBrushPhp.js" type="text/javascript">

If you want to be able to format a particular language, then you need to provide a script for that language. A list of all the brushes can be found here

Add links to styles/shCore.css, styles/shThemeDefault.css, /scripts/shCore.js and whatever brushes you require ex  /scripts/shBrushBash.js
  
Modify the following to add your own share or use the author's hosting, as i am doing here.

<!-- Syntax Highlighter Additions START -->

<link href='http://agorbatchev.typepad.com/pub/sh/3_0_83/styles/shCore.css' rel='stylesheet' type='text/css'/>
<link href='http://agorbatchev.typepad.com/pub/sh/3_0_83/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script src='http://agorbatchev.typepad.com/pub/sh/3_0_83/scripts/shCore.js' type='text/javascript'/> <script src='http://agorbatchev.typepad.com/pub/sh/3_0_83/scripts/shBrushBash.js' type='text/javascript'/> <script src='http://agorbatchev.typepad.com/pub/sh/3_0_83/scripts/shBrushJScript.js' type='text/javascript'/> <script src='http://agorbatchev.typepad.com/pub/sh/3_0_83/scripts/shBrushJava.js' type='text/javascript'/> <script src='http://agorbatchev.typepad.com/pub/sh/3_0_83/scripts/shBrushPhp.js' type='text/javascript'/> <script src='http://agorbatchev.typepad.com/pub/sh/3_0_83/scripts/shBrushPlain.js' type='text/javascript'/> <script src='http://agorbatchev.typepad.com/pub/sh/3_0_83/scripts/shBrushSql.js' type='text/javascript'/> <script src='http://agorbatchev.typepad.com/pub/sh/3_0_83/scripts/shBrushXml.js' type='text/javascript'/>
<script language='javascript' type='text/javascript'>  SyntaxHighlighter.config.bloggerMode = true;  SyntaxHighlighter.all(); </script>
<!-- Syntax Highlighter Additions END -->

Go to your Blogger admin screen, and click on Template.

Then click Edit HTML. If you get a warning screen, click proceed.



Next find the <head> tag. This can be done by hitting Ctrl+F and using the find function.


Now copy and paste the code and Save Changes and close.


To add code in a post, Go to HTML mode. You need to wrap your code with <pre> tags and
include the type of programming language, eg for php

<pre class="brush:css">

your code

</pre>

Note: any less than or greater than signs must be replaced with &lt or &gt respectively

you can also add the first-line element to start the numbering
from a different location

<pre class="brush:php;first-line:10">



Wednesday, 8 July 2015

Large WER folder using most disk space on Windows Server 2008

The WER folder becomes large when there are a large number of problem reports.

WER stands for Windows Error Reporting (WER). Windows Error Reporting collects and offers to send post-error debug information (a memory dump), using the Internet, to the developer of an application that crashes or stops responding on a user's desktop. No data is sent without the user's consent.

You can delete the files from “C:\Users\username\AppData\Local\Microsoft\Windows\WER”.


To clear reports go to the "Control Panel" and select "System and Maintenance"
and under "Problem Reports and Solutions" select "View problem history"




The following should pop up



Right Click and select all the reports

Delete the reports

Hope this helps !!!

Saturday, 4 July 2015

Recommended Software For Burning Linux ISO Images


Pendrive Linux
 The one that normally works for me is Universal USB Installer from http://www.pendrivelinux.com/
according to their site:
"Universal USB Installer aka UUI is a Live Linux USB Creator that allows you to choose from a selection of Linux Distributions to put on your USB Flash Drive. The Universal USB Installer is easy to use. Simply choose a Live Linux Distribution, the ISO file, your Flash Drive and, Click Install."

They also supply YUMI which is a  Multiboot USB Creator
"YUMI (Your Universal Multiboot Integrator), is the successor to our MultibootISOs. It can be used to create a Multiboot USB Flash Drive containing multiple operating systems, antivirus utilities, disc cloning, diagnostic tools, and more."

Give them a look and tell me your thoughts/experiences

Friday, 3 July 2015

How to Add a Google XML Sitemap to your Blogger Blog


The XML Sitemap file is like a directory of all web pages that exist on your website or blog. Search engines like Google and Bing can use these sitemap files to discover pages on your site that the search bots may have otherwise missed during regular crawling.

The Problem with Blogger Sitemap Files

An complete sitemap file should mention all pages of a site but that’s not the case if your blog is hosted on Blogger.

The default XML sitemap file of any Blogger blog will have only the 26 most recent blog posts – see example. That’s a limitation because some of your older blog pages, that are missing in the default XML sitemap file, may never get indexed in search engines. There’s however a simple solution to fix this problem.
Generate a Complete Sitemap for your Blogger Blog

This section is valid for both regular Blogger blogs (that use a .blogspot.com address) and also the self-hosted Blogger blogs that use a custom domain (like postsecret.com).

Here’s what you need to do to expose your blog’s complete site structure to search engines with the help of an XML sitemap.

    Open the Sitemap Generator and type the full address of your blogspot blog (or your self-hosted Blogger blog).
    Click the Create Sitemap button and this tool will instantly generate the necessary text for your sitemap. Copy the entire generated text to your clipboard (see screenshot below).


 
  Next go to your Blogger dashboard and under Settings – > Search Preferences, the enable Custom robots.txt option (available in the Crawling and Indexing section). Paste the clipboard text here and save your changes.

And we are done. Search engines will automatically discover your XML sitemap files via the robots.txt file and you don’t have to ping them manually.

Blogger XML SitemapBlogger XML Sitemap

PS: If you have

switched from Blogger to WordPress, it still makes sense to submit XML sitemaps of your old Blogspot blog as that will aid search engines discover your new WordPress blog posts and pages.



Normally the  blog’s sitemap is located at

http://www.blogname/sitemap.xml

If you take a look at this URL, you can see that it lists out the URLs of all posts on BP along with their last modified timestamp. This information will help the crawlers in easily identifying any new entries on your blog.

Managing Sitemaps on Google WebMaster Tools

Google can easily find out your sitemap URL by reading your robots.txt file, but in case you want to explicitly specify the Sitemap URL and see the crawl/indexing statistics, you can update the new Sitemap URL in Webmaster tools. To add the new Blogger Sitemap, login at the below URL using your Google account.

https://www.google.com/webmasters/tools/

If your blog was already added to webmaster tools, then it will be listed on Webmaster tools, if not add it using the “ADD A SITE” button. Once your blog is listed on WebMaster tools, click on the site name so that it takes you to the Site Dashboard.
webmaster-tools-blogger
Now navigate to Crawl > Sitemaps on the left side menu. Now click on the “ADD/TEST SITEMAP” button,give sitemap.xml in the text box and click “Submit Sitemap

add-blogger-sitemap-on-webmaster-tools

Once it’s submitted, you can see the results on the same page. If you had previously added blogger’s RSS/ATOM feed as the sitemap using old methods, you can delete them(or you can keep them, it doesn’t make a difference).


Blogger Sitemap – FAQ

Question #1 – Is this feature available for custom domain blogs or blogspot blogs or both?

The Blogger XML sitemap is available on all blogger blogs including custom domain blogs or normal blogspot blogs. you just need to append /sitemap.xml to your blog’s home page URL to see the sitemap.


Question #2 – Can I add this blogger XML sitemap to Google Webmaster tools?

Yes you can add it to webmaster tools as described in the tutorial



Question #3 – Should I add blogger’s ATOM/RSS feed as blogger sitemap?

No you no longer need to do that. Blogger RSS/ATOM feeds will have a maximum of 500 posts. If you use the ATOM/RSS feed method, you will have to add new feeds everytime you make another 500 posts on your blog. Instead you can just add sitemap.xml as the only sitemap for your blog. Blogger will automatically add new posts to this sitemap and convert itself into a sitemap map in case there are more posts. So you can just add sitemap.xml and let Google/Blogger do the rest.


Question #4  - Should I then remove the old RSS/ATOM sitemaps from Webmaster tools?

Yes you can remove the old feed based sitemaps, but it’s not mandatory.


Taken  from

http://www.labnol.org/internet/submit-blogger-sitemap-to-google/10149/

http://www.bloggerplugins.org/2014/12/xml-sitemap-for-blogger.html

Wednesday, 1 July 2015

Creating an HTML Sitemap Page in Blogger

Creating Sitemap Page for All Labels

If you want to show all of your blog posts at same page then follow below steps one by one.
  1. Go to your blogger blog.
  2. Now Navigate to Pages > New Page > Blank Page.
  3. Switch it to HTML mode.
  4. Paste below code in the post body.

<script type=”text/javascript”>
var numposts = 100;
var standardstyling = true;
function showrecentposts(json) {
  for (var i = 0; i < numposts; i++) {
    var entry = json.feed.entry[i];
    var posttitle = entry.title.$t;
    var posturl;
    if (i == json.feed.entry.length) break;
    for (var k = 0; k < entry.link.length; k++) {
      if (entry.link[k].rel == ‘alternate’) {
        posturl = entry.link[k].href;
        break;
      }}
    posttitle = posttitle.link(posturl);
    if (standardstyling) document.write(‘<li>’);
    document.write(posttitle);}
    if (standardstyling) document.write(‘</li>’);
}
</script>
<ul>
<script src=”http://www.blogname.com/feeds/posts/default?orderby=published&amp;alt=json-in-script&amp;callback=showrecentposts&amp;max-results=999″></script>
</ul>
  1. Replace www.blogname.com with your own blog URL.
  2. Click Publish button.
  3. That’s it.

Creating Sitemap Page for Particular Label

If you want to show posts from specific labels, then instead of the above code, use below code.

<script type=”text/javascript”>
var numposts = 100;
var standardstyling = true;
function showrecentposts(json) {
  for (var i = 0; i < numposts; i++) {
    var entry = json.feed.entry[i];
    var posttitle = entry.title.$t;
    var posturl;
    if (i == json.feed.entry.length) break;
    for (var k = 0; k < entry.link.length; k++) {
      if (entry.link[k].rel == ‘alternate’) {
        posturl = entry.link[k].href;
        break;
      }}
    posttitle = posttitle.link(posturl);
    if (standardstyling) document.write(‘<li>’);
    document.write(posttitle);}
    if (standardstyling) document.write(‘</li>’);
}
</script>
<ul>
<script src=”http://www.blognamecom/feeds/posts/default/-/Label%20Name?orderby=published&amp;alt=json-in-script&amp;callback=showrecentposts&amp;max-results=999″></script>
</ul>
Replace www.blogname.com with your blog URL and Label%20Name with your label name.

Remember: If you are using single word as your label name like “SEO” then put SEO there but if you are using more than one word, then put %20 between each word.
For example: if the label name is Blogger Tricks, then put Blogger%20Tricks.
The label name is case sensitive, so take care of it. Means don’t put seo in the place of SEO. The code will not work in that case.

Final Words!


This was the little trick about how to make HTML sitemap page in Blogger for particular label or for all labels. I hope you guys like this tutorial. Feel free to leave comment below this post to share your views and feedback. Thanks and Happy Blogging!