GitHub: How to Add code Snippets in your blogs?

GitHub: How to Add code Snippets in your blogs?

STARTING A TECH BLOG? SEARCHING FOR A WIDGET TO ADD YOUR CODES?You are in the Right Blog.

It's been a while that I'm exploring new things on Github for maintaining my codes. Well all of us know GitHub is a public repository hosting cloud platform where we can host as many projects as we can for free.
Today I'll be sharing an easy yet helpful way of displaying your codes in your blog. We will be using GITHUB GIST for this purpose. All you need to do is:
  • Create a github account.
  • After you login to github, goto GIST
  • By default you will be directed to creating a GIST
    GIST can be anything like a code, debug report, logs, raw data, etc...
  • After creating a gist save it.
  • You will get a link to embed the code snippet.
  • Copy the Code Snippet and paste in your blog wherever you want it to be displayed.
  • That's it, you will get your code snippet embedded in your blog. Also you will see a statement 
hosted with by GitHub
How To Set JAVA Environment Variables in Windows?

How To Set JAVA Environment Variables in Windows?

Checking whether you have installed Java or not in your machine is quite easy. In your command prompt type java and press enter. If you see a list of entries (i.e. parameters for using java commands) which means java is installed. If not installed your need to download it from the official site: FREE JAVA INSTALL.
But installation only is not enough to run a java based application in your machine. Most of the time we cannot see the logs in Windows based softwares. But in case you are able to see the installation logs provided by that particular applicaiton you will see issues like: 
Path not found for Java, JAVA_HOME not found System cannot find JRE, JDK etc... 

Today in this blog I'll be writing about setting some environment variables required for Java.
In order to set environment variables:

  • Open My Computer or This PC
  • Do Right Click and Click Properties
  • Click Change Settings
  • Switch to Advanced Tab
  • Click Environment Variables
  • Click New
    Here we add a Variable name and Value in two separate box.
    In order to add Java Variables add following Environment Variables each at a time:
Variable Name: JAVA_HOME 
Variable Value: C:\Program Files\Java\jdk1.8.0_112
Note: Enter path of respective jdk version exploring the path mentioned above.

Variable Name: JDK_HOME
Variable Value: %JAVA_HOME%

Variable Name: JRE_HOME
Variable Value:%JAVA_HOME%\jre

Variable Name: CLASSPATH
Variable Value: .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib

After you add the environment variables one more thing should be done.

How To Integrate Disqus in Blogger?

Disqus (pronounced discuss) is a worldwide blog comment hosting service for web sites and online communities that uses a networked platform. The company's platform includes various features, such as social integration, social networking, user profiles, spam and moderation tools, analytics, email notifications, and mobile commenting.

Why Disqus?

  • User can post comment, vote comment, flag comment and share comments to social networks. Also they can subscribe to comments.
  • You will get notification to your email for each new comment.
  • A commenter can attach media files (image, video) in their comments.
  • You can see your site’s comment activity in a graph.
  • You can set custom avatar for comments for those who don’t actually display their avatar.
  • Commenter can post their comment as guest or they can post using their open ID.
  • Disqus adds real time threaded comments and shows a related discussion below comments which reduces your bounce rate.
  • You can make money from Disqus by showing recommendations just like nRelate related posts.
There are two different way to integrate disquss in any of the content management system(CMS). You can either do all the configuration from the disqus website or do it from your blog gadgets and templates.You just need to choose a platform and follow the instruction.

As our site is hosted in blogger. I did exlpore ways to integrate blogger and disqus. I wanted to integrate it so much because this medium of comment posting is similar to that of some of the great news sharing sites reddit and 4chan. Like these sites, disqus also maintains the threads within thread,  vote ups, as well as the recommendation of comments and sharing them. You can not only expect if your blogger read the blogs but with the help of disqus now you can also get their valuable feedback.


Configuration from blogger(Manual work):
  • In your blogger Dashboard , Click "Layout", and Click "Add a Gadget below the blog text area of your layout where your blog is posted.
  • Clicking the "Add a Gadget", you will see the collection of Gadgets made available by blogger as well as third parties. Search for "HTML/Javascript"
  • Enter the title of the gadget as "Disqus".
  • Save the gadget and also save the arrangements.
Now we will add a disqus code inside that gadget from our Template section. Before doing that make sure that you have created a disqus account. If not signup now it is too easy, Signup and get a username.
  • Now again go to the dashboard and Click "Template". Then click "Edit HTML".
  • After that click within the code area and find the text "Disqus". (Searching is done by CTRL+F key combination)
  • After you find the code block expand the code division.
  • Find the code snippets withing that division and remove them.
  • Instead of those codes you just deleted, copy the code mentioned below:
  • That's It. Now Save your template.
  • Don't forget to hard refresh your blog( Which is generally done by pressign CTRL+ F5)
You Should now see a  disqus comments area just below your website. Cheers1

How to replace a string in a file(s)?


Working with Files and strings in a file in Unix is what a beginner shell script learner wants to do after s/he learns the very basic commands via terminal. So I found this really really really important resource on unix.stackexchange.com which describes multiple operations on strings in files.
The link mentioned below answers following questions.
  • replace string foo with bar in all files in the current directory?
  • do the same recursively for sub directories?
  • replace only if the file name matches another string?
  • replace only if the string is found in a certain context?
  • replace if the string is on a certain line number?
  • replace multiple strings with the same replacement
  • replace multiple strings with different replacements



Clone a System using Clonezilla

Clone a System using Clonezilla

For me Cloning is another term for copying. Cloning is performing a mass copy paste operation but not just normal files like movies and documents. You want to clone an operating system in multiple blank hard disks, what will you do? Will you insert the bootable CS/USB everytime in all of those machines and install them on and on taking a week? I suggest you not to, because I've an alternative which can perform that task. And that is "CLONEZILLA"

Clonezilla is a partition and disk imaging/cloning program which helps us to install or creating a working system via system deployment. We can also perform system recovery tasks with Clonezilla. We can download the iso from its official website.
There are two types of Clonezilla which can choose based upon our need and they are: Clonezilla live and Clonezilla SE (server edition).
  • Clonezilla live is suitable for single machine backup and restore.
  • Clonezilla SE is for massive deployment, it can clone many (40 plus!) computers simultaneously.
Clonezilla saves and restores only used blocks in the hard disk. This increases the clone efficiency. With some high-end hardware in a 42-node cluster, a multicast restoring at rate 8 GB/min was reported.
Today I will be demonstrating the Clonig Operation on my blog:
Here are few things which you will need prior to begin Cloning.
  • Clonezilla iso
  •  Bootable Pendrive(conezilla bootable)
  • A source hard drive for clonning
  • A destination hard drive to clone.
1. Download Clonezilla iso file and make a bootable pendrive and boot from it.
2. It will show the boot menu as in the Image 1 below.
Image 1
3. Choose the Clonezilla live (Default settings, VGA 800x600) option and press enter.

Image 2
4. Choose your preferred Language 


Image 3

5. Now Choose Don’t touch Keymap option as in Image 3.
6. Choose Start_Clonezilla Start Clonezilla option and press enter as in Image 4 below.

Image 4

7. Choose device-device option and press enter as in Image 5 below.

Image 5

8. Choose Beginner Beginner mode: Accept the default options option and press enter as in the Image 6 below.

Image 6

9. Choose disk_to_local_disk local_disk_to_local_disk_clone option and press enter as in the Image 7 below.

Image 7

10. Be careful in this step, this is the crucial part. Now you have to choose the Hard Disk from which data is to be transferred. So, check the Serial Number of Hard disk from which data is to be transferred (known as SOURCE) and accordingly choose the option with that serial number and press enter. Double Check the serial number of hard disk because it can cause the reverse process which we wouldn’t want.
Image 8

11. Now in this step, it will show only one option which is the hard disk where the data will be copied (Known as Destination). That is in this hard disk we’ll clone our updated data or contents. Be sure and double check if it is the disk where we want to clone our updated hard disk. To be sure Check the serial number of the hard disk.
Image 9

12. Choose Skip checking/repairing source file system option and press enter as in Image 10 below.

Image 10

13. Press ENTER to proceed as in Image 11 below.

Image 11

14. Type Y and press ENTER for confirmation as in the Image 12 below.

Image 12

15. Again for confirmation type Y and press ENTER as in the Image 13 below.

Image 13

16. Now the partition table will be created on the destination disk. You don’t have to do anything in this step just for info, screen like Image 14 will be appeared.

Image 14

17. Now it will ask for confirmation for cloning boot loader to target or destination disk so basically, type Y and press ENTER as in Image 15 below.

Image 15

18. Now the cloning will start and let it be, the screen will look as in Image 16 below.

Image 16

19. After complete cloning, it will ask to continue so press ENTER. The screen is as in Image 17 below.
Image 17

20. Now Power off the system. And the cloning is completed.
Image 18



Subscribe techjhola !! Enojy!!!