Basic Git Hub Usage Manual

Git Hub Usage Manual

GitHub Account Creation And Setup Configuration:

  1. Need to create an account on https://github.com with official email id. And also activate two factor authentication and set profile picture over there. Once done with these inform Jaco about it, so he can add you in the CeX organization account.
  2. Now create the Personal Access Token from the Settings, it will be useful when we want to push the changes to the remote through Git Bash.
  3. Download GitHub Desktop from https://desktop.github.com/ and Git from http://git-scm.com/download/ and install these two applications.
  4. When you start GitHub desktop, you have to login over there. To login on GitHub Desktop goto Tools And Options and then in Options you will find the add account option.
  5. For Git open Git Bash and run $ git config –global user.email “<EmailID>” command, this will configure your account in Git.

Git vs GitHub

Continue reading “Basic Git Hub Usage Manual”

How to Configure Samba Server on CentOs 7

Configure Samba Server on  CentOs 7

This article will be a quick guide to show you guys how to setup a network share with Samba on CentOs 7 or any other similar Linux distribution like Red Hat.

Samba share allows sharing of files between the server and various different computers on the same network.

Note: The following commands will require super user privileges.

1. Install Samba: Although Samba should come preinstalled on Centos but you can install it or check if it’s installed   using the command

sudo yum install samba

 

Samba 1 (2)

2. Start services smb and nmb: 
                        sudo service smb start && sudo service nmb start

You can now check the status of these services by typing the command

sudo service smb status

Samba 2 (2)

If everything is fine you will get an output like this.

3.  Loading the services on login: We want these services to be loaded with the default multiuser runlevel, we      want these services to be running when we login.

We first check if they are already enabled

sudo systemctl list-unit-files | grep smb

The service can be enabled using command

sudo chkconfig smb on && sudo chkconfig smb on

4. Create a directory to be shared: This will be the directory that will be shared.
         sudo mkdir  /home/<user_name>/<folder_name>

5. Modify the permissions of the new directory: This will ensure that the directory is readable, writable and executable.
               sudo  chmod  –R  777  /home/<user_name>/<folder_name>
               sudo  chcon  -R  -t  samba_share_t  /home/<user_name>/<folder_name>

6. Set a password for your user in samba: <user_name> is the name you used to login to your CentOs server. Remember this will be the username and password that you will use to access the samba share.

sudo smbpasswd  -a  <user_name>

7. Edit the file “/etc/samba/smb.conf”:
          sudo nano /etc/samba/smb.conf

Samba 3 (2)

Add the following details at the end of the file
[<folder_name>]
path = /home/<user_name>/<folder_name>
         browsable = yes
         guest ok = no
         valid users= user_name
         writable = yes

Samba 4 (2)
8. Allow samba through the firewall:
       sudo firewall-cmd  –permanent  –zone=public  –add-service=samba
       sudo firewall-cmd  –reload

Samba 5

 

How to use String.Format to get multiple value from radio button?

For getting more than one value let us say “ID” and “Contact” from single radio button on change event you have to write code like :

<input type=”radio” class=”radio” name=”RadioButton” value=’@String.Format(“{0}|{1}”,ID,Contact />

Now for getting these value using jquery :

<script>

$(“input[name=RadioButton]:radio”).change(function () {

var arm = $(this).val();

var arr = arm.split(‘|’);

var ID = arr[0];

var Contact = arr[1];

})

</script>

Happy Coding!!.

 

Jquery .live() running twice ?

This  happens when you click the same element again and again ,to rectify this situation just add .die before it .

$(selector).die(‘click’).live(‘click’, function () {

});

Happy Coding !!!!

 

The located assembly’s manifest definition does not match the assembly reference

Looking for the solution. Yes you are at the right place. Once I also faced the same issue when I was working on a MVC project, I got the error states that “The located assembly’s manifest definition does not match the assembly reference” .

reference

When I ran the solution I saw the YSD (yellow screen of death) that simply gave me the assembly name which is causing the issue.

Could not load file or assembly ‘System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. HRESULT: 0x80131040

In my case I have several MVC projects referring to “System.Web.Optimization” , but I’m getting this issue only in newly added project. When I investigated the issue I found that the project referring to the higher version of “System.Web.Optimization”. This is because the dll has been included using nuget and nuget always downloads the latest version of dll.

FYI:  The Microsoft.Web.Optimization package is now obsolete. With ASP.NET (MVC) 4 and higher you should install the Microsoft ASP.NET Web Optimization Framework.

Continue reading “The located assembly’s manifest definition does not match the assembly reference”

MVC HTML Helpers Methods

In this article we will learn what are HTML helper Methods that comes within MVC framework!!!!…

So What are HTML Helper Methods ???

Html Helpers methods are equivalent to ASP.Net web form controls, enables you to render HTML content, modify the HTML output .

  • HTML Helpers are more light  weight.
  • It does not have event model and viewstate.

HTML Links

The easiest way to render HTML link is to use HTML.ActionLink() helper . With MVC , the HTML.ActionLink() does not link to view rather it creates a link to controller.

Syntax:

HTML.ActionLink(“LinkText”,”ActionName”,”ControllerName”)

HTML Helpers

Continue reading “MVC HTML Helpers Methods”

What is Google Hacking ?

Google Hacking

This article is going to be all about Google Hacking. We live in a world where everything and anything that you might need is available on the internet at your disposal. Most people do not know how powerful a search engine Google is. We can do a lot of useful things with the help Google we just have to use it the right way.

Google Hacking is all about taking Google search to the next level. So if some of you are wondering why do I keep saying Google, there are like some other really good search engines out there, well it’s because of the following reasons.

  1. It is one of the most powerful search engine
  2. It is updated frequently.
  3. It has a very innovative page ranking algorithm which takes into consideration a lot of things.

Google Hacking basically means to use Google to get the best of the best search results. It is achieved by using some special operators known as ‘Google Operators.

Google Hacking

 

Continue reading “What is Google Hacking ?”

Data Entry Form using Simple HTML Helper In MVC

HTML Helper in MVC

In this article we will learn how to code for entering data form using simple HTML Helpers.

  • Create New ASP.NET MVC4 Web Application.
  • Select Razor As View Engine.
  • Right click on Model ->Add new Class ->Customer Class.HELPersModel
  • Right click on controller and -> Add new item-> CustomerController

ControllerHelper

Continue reading “Data Entry Form using Simple HTML Helper In MVC”

Render Pdf bytes array within browser in MVC

Render Pdf within browser

There are different ways to render Pdf in a browser. In this I’m explaining to render Pdf by fileContent/byte array. In a below example I’m using Index Action which returns the FileContentResult.

public ActionResult Index()
{
Response.Clear();
Response.AddHeader(“Content-Disposition”,“inline; filename=sample.pdf”);
Response.AddHeader(“Content-Type”,“application/pdf”);
Response.ClearHeaders();
Response.AddHeader(“Content-Length”, byteArray.Length.ToString());
FileContentResult result = new FileContentResult(byteArray, “application/pdf”);
return result;
}

That’s it from controller side. Now you have to call you Action to get it rendered on your HTML. You can use different HTML5 tags like :

<iframe>
<iframe src = @Url.Action(“Index”, “Home”)#zoom=150′ width = “100%” height=”525″ id=”iFramePdf” #zoom=”200″ frameBorder=”1″></iframe>

<embed>
<embed src=’@Url.Action(“Index”, “Home”)#zoom=150′ width = “100%” height=”525″ id=”iFramePdf” #zoom=”200″ frameBorder=”1″ type=”application/pdf”/>

<object>
<object data=’@Url.Action(“Index”, “Home”)#zoom=150′ width = “100%” height=”525″ id=”iFramePdf” #zoom=”200″ frameBorder=”1″ type=”application/pdf”>
</object>

Hope this article will help you.

Implement Jquery Auto Complete

Jquery Auto Complete

In this article we will show you how to use auto complete of jQuery. Auto complete widget provides suggestions while you type into the field. Here we are going to show you an example that how to implement auto complete and how we can customize it as per our requirement.

In the below example, we have 3 different objects in an array:
 
var data = [{
label: "Code",
value: "http://www.codehotfix.com"
},
{
label: "Hotfix",
value: "http://www.codehotfix.com"
},
{
label: "Code Hotfix",
value: "http://www.codehotfix.com"}
];
$(function () {
$("#idOfSearchTextBox").autocomplete({
source: function (request, response) {
var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(request.term), "i");
response($.grep(data, function (item) {
return matcher.test(item.label);
}));
},
select: function (event, ui) {
$("#idOfSearchTextBox").val(ui.item.label);
window.location.href = ui.item.value;
}
});
});

hotfix

Continue reading “Implement Jquery Auto Complete”