Enjoy octobers with Hacktoberfest

I know what you are going to do this October. Scratching your head already? No, don’t do it because I will be explaining you in details all that you can do to make this october a remarkable one, by participating in Hacktoberfest.

Guessing what is the buzz of Hacktoberfest all around? 🤔

Hacktoberfest is like a festival celebrated by people of open source community, that runs throughout the month. It is the celebration of open source software, and welcomes everyone irrespective of the knowledge they have of open source to participate and make their contribution.

  • Hacktoberfest is open to everyone in our global community!
  • Five quality pull requests must be submitted to public GitHub repositories.
  • You can sign up anytime between October 1 and October 31.

<<<<Oh NO! STOP! Hacktoberfest site defines it all. Enough! Get me to the point.>>>>

Already had enough of the rules and regulations and still wondering what is it all about, why to do and how to get started? Welcome to the right place. This hacktoberfest is centering a lot around open source. What is it? Get your answer.

What is open source?

If you are stuck in the name of open source itself, don’t worry, it’s nothing other than the phrase ‘open source’ mean. Open source refers to the availability of source code of a project, work, software, etc to everyone so that others can see, modify changes to it that can be beneficial to the project, share it, download it for use. The main aim of doing so is to maintain transparency, collaborative participation, the overall development and maintenance of the work and it is highly used for its re-distributive nature. With open source, you can organize events and schedule your plans and host it onto an open source platform as well. And the changes that you make into other’s work is termed as contribution. The contribution do not necessarily have to be the core code. It can be anything you like- designing, organizing, documentation, projects of your liking, etc.

Why should I participate?

The reason you should is you get to learn, grow, and eventually develop skills. When you make your work public, it becomes helpful to you because others analyze your work and give you valuable feedback through comments and letting you know through issues. The kind of work you do makes you recognized among others. By participating in an active contribution, you also find mentors who can guide you through the project, that helps you in the long run.

And did I tell you, you get T-shirts for contributing? Hacktoberfest allows you to win a T-shirt by making at least 5 contributions. Maybe this is motivating enough to start, right? 😛 Time to enter into Open Source World.

How to enter into the open source world?

All you need is “Git” and understanding of how to use it. If you are a beginner and don’t know how to start or have difficulty in starting off, refer this “Hello Git” before moving further. The article shows the basic understanding of Git and how to push your code through Git to make it available to everyone. Understanding is much more essential, so take your time in going through it and understanding the concept. If you are good to go, you are now ready to make contribution to other’s work.

Steps to contribute:

Step 1; You should have a github account.

Refer to the post “Hello Git“, if you have not already. The idea there is the basic understanding of git workflow and creating your first repository (your own piece of work).

Step 2: Choose a project.

I know choosing a project is a bit confusing. It seems overwhelming at first, but trust me once you get the insights of working, you will feel proud of yourself. If you are a beginner, I would recommend you to first understand the process by making small changes like correcting mistakes in a README file or adding your name to the contributors list. As I already mention, not every contributions are into coding. Select whatever you like and you feel that you can make changes, which will improve the current piece of work.

There are numerous beginner friendly as well as cool projects that you will see labelled as hacktoberfest. Pick one of your choice. Once you are done with selecting a project, get into the project and follow the rest.

Step 3: Fork the project.

You will come across several similar posts where they will give instructions to you and what you need to perform to get to the objective, but most important is that you understand what you are doing and why you are doing. Here am I, to explain you, why exactly you need to perform these commands and what does these terms mean.

Fork means to create a copy of someone else’s repository and add it to your own github account. By forking, you are making a copy of the forked project for yourself to make changes into it. The reason why we are doing so, is that you would not might like to make changes to the main repository. The changes you make has to be with you until you finalize it to commit and let the owner of the project know about it.

You must be able to see the fork option somewhere at the top right.

screenshot-from-2018-10-29-22-10-36.png

Do you see the number beside it. These are the number of forks done to this repository. Click on the fork option and you see it forking as:

Screenshot from 2018-10-29 22-45-09

Notice the change in the URL. You will see it is added in your account. Now you have the copy of the project.

Step 4: Clone the repository

What cloning is? It is actually downloading the repository so that you make it available in your desktop to make changes. Now that you have the project in hand, you are ready to amend changes that you feel necessary. It is now on your desktop and you know how to edit with the help of necessary tools and application on your desktop.

“clone or download” written in green button shows you a link and another option to directly download.

If you have git installed on your machine, you can perform commands to clone it as:

git clone "copied url"

copied url is the url shown available to you for copying it.

Step 5: Create a branch.

Branching is like the several directory you have in your computer. Each branch has the different version of the changes you make. It is essential because you will be able to track the changes you made by creating branches.

To perform operation in your machine, all you need is change to the repository directory on your computer.

 cd  <project name>

Now create a branch using the git checkout command:

git checkout -b 

Branch name is the name given by you. It can be any name of your choice, but relatable.

Step 6: Make changes and commit

If you list all the files and subdirectories with the help of ls command, your next step is to find the file or directory in which you have to make the changes and do the necessary changes. For example. if you have to update the README file, you will need an editor to open the file and write onto it. After you are done updating, you are ready for the next step.

Step 7: Push changes

Now you would want these changes to be uploaded to the place from where it came. So, the phrase that is used is that you “push changes”. It is done because after the work i.e., the improvements to the project, you will be willing to let it be known to the owner or the creator of the project.

so to push changes, you perform as follows:

git push origin 

You can reference the URL easily (by default its origin). You can alternatively use any shortname in place of origin, but you have to use the same in the next step as well.

Step 8: Create a pull request

If you go to the repository on Github, you will see information about your updates and beside that you will see “Compare and pull request” option. This is the request made to the creator of the main project to look into your changes and merge it into the main project, if that is something the owner allows and wants to have. The owner of the project sees the changes you make and do the necessary patches as he/she feels right.

And you are done. Congratulations! 🎉

Not only this, you are always welcome to go through the issues list of a project and try to solve the problem, first by commenting and letting everyone know whatever idea you have to  solve the issue and once you are approved of the idea, you make contributions as above. You can make a pull request and reference it to the issue that you solved.

But, But, But… Why don’t you make your own issues on a working project and add a label of Hacktoberfest for others to solve?  You will amazed by the participation. You are the admin of your project. People will create issues and pull requests and you have to review them and merge them to your main project. Try it out!

I  hope you find it useful and you enjoyed doing it.

Happy Learning!

Advertisements

split() v/s rsplit() & partition() v/s rpartition()

split(), rsplit(), partition(), rpartition() are the functions on strings that are used in Python. Sometimes there are confusion between these. If you feel the same, then I assure you, it will be no longer confusing to you.

Understanding split()

So, what does split() do? As the name suggests, split() splits the given string into parts. split() takes up two arguments – one is the delimiter string(i.e., the token which you wish to use for seperating or splitting into words). The other is the maxsplit value, that is, the maximum split that you wish to have. By default, split() takes up space as delimiter string. The resultant is the list of splited words.

Here is how you use it:

By passing no arguments,

>> s = "Hello people, How are you?"
>>> s.split()
['Hello', 'people,', 'How', 'are', 'you?']

By passing argument with just the delimiter,

>> s = "Hello people, How are you?"
>>> s.split(",")
['Hello people', ' How are you?']

By passing argument with the delimiter and the maxsplit (say 1, which means to allow only one split),

>>> s = "Hello people, How are you?"
>>> s.split('H', 1)
['', 'ello people, How are you?']

If you try passing any number against the maxsplit that is above the maximum splits possible, then it will always return the list of maximum possible seperated words.

Understanding rsplit()

You might have a question – When split() splits the string, why at all we need rsplit() and what is it? The answer is rsplit() does nothing extra than splitting a given string, except of the fact that it starts splitting from the right side. It parses the string from the right side.

Here is how you use it:

By passing no arguments,

>> s = "Hello people, How are you?"
>>> s.split()
['Hello', 'people,', 'How', 'are', 'you?']

By passing argument with just the delimiter,

>>> s = "Hello people, How are you?"
>>> s.split(",")
['Hello people', ' How are you?']

Note- the output remains the same when we don’t pass any arguments or when we just provide the delimiter.

However, if we pass the arguments with maxsplit as below, you will see the difference:

>> s = "Hello people, How are you?"
>>> s.rsplit('H', 1)
['Hello people, ', 'ow are you?']

Observe, now the split took place on the right occurrence of delimiter.

Understanding partition()

Understood split() and rsplit(). But what is partiton()? The answer is – partition() just splits the string into two parts, given the delimiter. It splits exactly into two parts (left part and right part of the specified delimiter). The output returns a tuple of the left part, the delimiter, and the right part.

Here is how you use it:

>> s = "I love Python because it is fun"
>>> s.partition("love")
('I ', 'love', ' Python because it is fun')

Note: There is no default argument. You have to pass an argument mandatorily otherwise it throws an error.

Understanding rpartition()

It should be intuitive to use, by know, the working of rpartition(). rpartition() just like rsplit() does the partition from right side. It parses the string from the right side and when a delimiter is found, it partition the string into two parts and give back the tuple to you as is the case for partition().

Here is how you use it:

>> s = "Imagining a sentence is so difficult, isn't it?"
>>> s.rpartition("is")
('Imagining a sentence is so difficult, ', 'is', "n't it?")

Notice the last occurrence of “is” in the above given string.

 

 

Hope this helps in understanding the working of these functions!

Happy Coding.

Dictionary using CLI

If you write posts like me, I am sure, quite often you must have referred a dictionary. Even if you didn’t require it while writing posts or you don’t happen to blog, dictionary is something unavoidable and it should be readily available to you because at any point of time unknowingly, it may be required to you.

You may have different ways of using dictionaries in your life. By different ways of using  dictionaries I mean, you might have used it online, or sometimes while typing you may have a tendency to check your dictionary apps on phone, etc. That can be ineffective at times, because it may take your time in finding exactly what you need and breaks your concentration. But here am I, with some amazing handy commands, taken from this amazing book: The Linux Cookbook by Michael stutz, that you can use to refer Dictionary and it won’t take much of your time and efforts to feel comfortable with it. Let me show you how you can use dictionary through Command Line Interface.

If you are using GNU/Linux, you have a list of words already in your system. You can find it by using: whereis dict. You will get the location of the source.  It should be either /usr/dict or /usr/share/dict.  The traditional Unix-style dictionary is the words sorted in ascending order, a long list albeit! The newer type dictionary contains the headwords as well as their definitions. To use the latter, you need to install WordNet – “a lexical database containing Nouns, verbs, adjectives and adverbs, grouped into sets of cognitive synonyms (synsets), each expressing a distinct concept”. Note: There are other databases other than wordnet as well.

Let us look into what we can do with the System Dictionary:

  • Sometimes it so happens that you don’t remember the full word and if you remember the first part of it, you may wish to lookup a word that begin with the type of string. To lookup a word beginning with ‘civ'(say), you have the command : look civ. It will return the list of words that starts from that given string.
  • To list all the words containing the string (say, int), regardless of case type: grep -i int /usr/share/dict/word
  • To list all the words that end with a string (say, ed) use: grep ed$ /usr/share/dict/word

Using Wordnet, you can find the meaning of the words as well. To install in your system, it is as simple as sudo apt install wordnet (I am using Ubuntu).

Let us have a look into what we can do with Wordnet:

  • To see all the available options for that particular word, you can use: wordnet your_word. your_word is the word which you want to search for.
  • To search the definition of a particular word (say, sad) along with some sentences as examples, use : wn sad -over or wordnet sad -over

Personally,  I like Wordnet because it’s just a terminal away from me. I don’t have to go anywhere to hunt for the exact meaning of a particular word. It allows me different options/forms of what I want from that word. For example, it shows me all the derived senses of the word ‘sad’, if I use wn sad -deria. The output is:

Screenshot from 2018-08-08 01-59-29

Isn’t it cool? And amazingly, it has different options for different words. -deria was option available for this word because a at the end denotes the adjective (the type of the word ‘sad’) and deri denotes the derived forms. If you try with some different word like fun, you will see different options for wn funas :

Screenshot from 2018-08-08 01-53-56.png

Note how the options for this word changed. We have hypernyms, hyponyms, synonyms, attributes, derived forms, domain, familiarity, coordinate terms, common words available for this word ‘fun’. Here, n at the end of the commands denotes the Noun form (the word fun being noun).

Spell is another one such amazing tool to spell check the file interactively. You can download it using sudo apt install spell. Say, you have a file named ‘file.txt’. To spell check the entire file, you just need to use: ispell file.txt. Amazingly, it corrects each wrong spelt word individually by providing a lot other substitutes and similar sounding words, along with the option to add it to your personal dictionary, replace it then and there, uncapitalize it, lookup for it, etc

Screenshot from 2018-08-08 02-54-05

Screenshot from 2018-08-08 02-54-26

Do you feel any difference between what you use as your dictionary and the one above i.e., using command line interface? I hope Yes.

I like playing around with Linux tools and commands because they have so much to offer according to my needs. The best part is that I can modify the commands according to my desire. Obviously, I don’t need to learn the commands. More than that, I like to share these petty tricks and information with you all, as I happen to come across them. Hope this article was helpful to you!

Internet Relay Chat

Hola folks!

If you are hearing about IRC for the first time and you wish to know about it, don’t worry, you are at the right place. This post should get you started and guide you along. I have covered the basic things that you should know and some useful tips and tricks. Enjoy reading.

What is IRC?

As Wikipedia defines, IRC (Internet Relay Chat ) is an application-layer protocol used for communication in the form of chatting through text. To start talking through IRC, you need to have IRC clients. These basically are applications that needs to be installed or you can do this through browser. Examples of some IRC clients are: XChat, WeeChat, HexChat, etc. that you can use in your PC. You can find the comparison here. Mobile applications include AndroIRC, IRCCloud, HoloIRC etc. Browser based clients are KiwiIRC, Mibbit, etc. Try them all and choose what you like! These IRC clients connect to a server you have set as default in your program settings. Communication is done in channels(discussion forums), and requires certain rules and etiquette which you need to follow.

If you have a question like – Why IRC? – IRC because it is considered as the main communication channel for open source projects. It is the most light-weight platform that can run on even low bandwidth Internet. There are several channels available on several servers, which you can join according to your interests (My favorite the one close to my heart is #dgplug – Linux Users’ group of Durgapur with the motto Learn and teach others:) ). All you need to have is the proper name of the channel, if you wish to join any. Internally, for every message you send in the channel through your client application, it is sent across the internet to the IRC servers, which echoes it to every other user connected to the channel.

Interested? Let’s get accustomed with the basics.

How to get started?

To get started, you ought to follow the following steps :

1. Like I mentioned, to join a particular channel, you have to start by joining a server. Simplest way of doing it is running this command in your IRC client : /server chat.freenode.net You can also do it manually based on the type of IRC client you are using.

2. To start using IRC, you have to have a nickname i.e., the name that will be used to address you. You will be called with this name if you join a channel. In other words, you will be known to the other users with this name that you will provide at the time of registration. Choose a nickname and  type this in the chat head of freenode : /nick YourNick. Note – YourNick is the name given by you, which you wish to have. YourNick should contain lower case alphabets, underscore(_), digits(0-9), or hyphen (-) and a maximum of 16 characters.
If you face an issue like “The nick is already in use”. It means you have to choose a different nick because it is already been taken.

3. Next step is to register your nick because you would like to have this as permanent and restrain other people from using your nick which you choose. To register, type the following in the freenode chat head :/msg nickserv register password email.Password is the password you wish to set for your nick to protect your nick and claim your identity. Email is the email that you need to give for confirming the password that has been set up.

4. When you receive the confirmation mail, do the specified instructions mentioned in your mail, in the chat area of freenode.

5. After you have verified your nick, you are all set to go ahead. If you ever get disconnected, you can identify yourself (similar to sign-in option that you use in other platforms) using: /msg nickserv identify YourNick Password.

6. Now that you have a proper identity, your task is to join a channel i.e., your main purpose on being in IRC. There are several channels that you can join and discuss. To join a channel, just write /join #channel_name. In place of channel_name, you have to write the proper name of the channel existing on the server.

Do’s and Dont’s

Unlike any other platform, there are certain norms that you must keep in mind while using IRC:

  • Type in full proper English sentences.
  • Be polite and gentle.
  • Be patient specially when nobody answers you or you disagree with someone on a particular context.
  • Remember IRC channels are very useful in gaining knowledge and you happen to see knowledgeable, renowned people, specialists in a particular domain hanging around in channels. So, you should be specific and meaningful in the questions you ask.
  • Do not act foolish.
  • Do not use any slang. Don’t swear. Don’t be obnoxious.
  • Do not use ALL CAPS TO TYPE – it is like you are shouting at someone.
  • Do not flood the channel i.e, sending too many texts all at once

The above are some of the basic requirements that you need to keep in mind before speaking up in any channel. Any intolerance or wayward behaviors, could get you kicked out or banned permanently from a channel. Yes you heard that right!

Utilities of IRC

IRC is very useful, if you use it the right way. Make the most of IRC by learning from other people’s issues, exploring stuff, finding problems to your solutions by reaching out to people in that domain, finding projects and mentors, etc. I leave it to you to find more 🙂

Talking about some other basic functionality, If you are on IRC (Internet Relay Chat), you get certain services known as IRC services. You use this to modify and/or add  functionality to your account. These are basically a special type of bots that has several statuses and flags for you to set. The most common services that you will find are:

  • NickServ – a nickname service bot. You might have observed that while registering you messaged NickServ with your email and password. It has other functions too.

Type /msg NickServ help and you are sure to get the following commands:

SET                               – Sets various control flags
UNGROUP                   – Removes a nickname from your account
Other commands     – ACC, ACCESS, CERT, DROP, HELP, LISTLOGINS, LISTOWNMAIL, LOGOUT, REGAIN, SETPASS, STATUS, TAXONOMY, VACATION, VERIFY

If you do not know what these commands are for, you can try to seek individual help by typing in: /msg NickServ help <command>. There may be some sub-commands within a command, like in case of SET command, if you type /msg NickServ help SET, you get to see the following set of sub-commands:

ACCOUNTNAME – Changes your account name
EMAIL                   – Changes your email address
EMAILMEMOS    – Forwards incoming memos to your email address
ENFORCE              – Enables or disables automatic protection of a nickname
HIDEMAIL            – Hides your email
NEVERDROP        – Prevents you from being added to access lists.
NOMEMO              – Disables the ability to receive memos
NOOP                     – Prevents services from settings mode upon you automatically
PASSWORD          – Changes the password associated with your account
PRIVATE               – Hides information about you from other users
PROPERTY           – Manipulates metadata entries associated with an account
PUBKEY                – Changes your ECDSANIST256p-CHALLENGE public key.
QUIETCHG           – Allows you to opt-out of channel change messages.

Now to see more of what each sub-commands offers you, you can type /msg NickServ help <command> <sub-command>. Example – /msg NickServ help SET HIDEMAIL.

Do try and configure all the necessary flags that is essential for you. One such useful is ENFORCE that ensures your nick is protected and it automatically changes the nick of the someone who attempts to use yours. Another such useful flag is PRIVATE that hides your information.

  • ChanServ – a channel service bot. It provides the status of the channel i.e, it maintains the basic information about the channel, like when a user joins or leaves a channel. It is set by the channel operators/admins. Normal users have no access to ChanServ. ChanServ provides several helpful services like kicking the user, banning the user, change the channel topic, etc.

You can obtain the info of a particular channel by : /msg chanserv info #channel. The information will contain the following: founder of the channel, timestamp and the date of registration of the channel, the status of the channel and the flags.

  • MemoServ –  a memo service bot, is used to record and deliver messages to users who are currently offline.
  • OperServ is used by IRC operators to perform administrative functions. Also known as AdminServ, RootServ, or OpServ (srvx).

Some others are also seen following this naming convention in some services packages including:

  • BotServ, a bot which allows channel operators to assign bots to their channels. These bots are mostly a ChanServ representative in the channel.
  • HelpServ, the help service bot, is used to provide help on a variety of IRC topics.
  • HostServ, a host service bot, is used to allow general users to register a vhost so that their real IP address on IRC is hidden.
  • RootServ, used on specific networks, is utilized by Services Root Administrators to perform Root Administrative functions for the IRC Network and Services Program.
  • SpamServ, used to protect channels against spam.[1]
  • StatServ, a statistic services bot, is used to perform various statistical analysis on the IRC Network.

[Reference URL : https://en.wikipedia.org/wiki/IRC_services under heading : Components]

Useful commands

Now that you have figured out the basic commands and their usage, there are several other commands and options available in IRC like the following:

/LIST – It lists all the available channels on the server. The list is really long.

/WHOIS <nick> – It shows information about the specified nick.

/NAMES #channel – It lists all the users on that channel.

/AWAY <message> – To denote the users that you are not using IRC at the current moment, with a message. However, /AWAY can follow no message also.

/QUIT <message> – To quit the IRC and the current channel with a message.

/ME <message> – To denote any action of yours. Example- /me is happy to join dgplug will appear as ann is happy to join dgplug (ann is my nickname. If you use this, your nick will appear instead of ann)

/QUERY <nick>– To open a seperate window for privately messaging the specified nick.

You can find more on this here.

Modes in IRC

I have covered most of the basics that you need to know about IRC. Another important concept that is used in IRC is that of channel modes used by channel operators and user modes that is used by users/participants. These modes have different use cases and functionalities. You can check the several possible modes here.

To set user mode, you need to type in the chat head of freenode: /mode nickname +/-mode. So, for example, you wish to set +R mode, which ignores private messages from users who are not identified with services, you have to type in /mode nickname +R. Similarly, to remove this feature, you can do /mode nickname -R.

Channel operators can set modes accordingly with the help of available channel modes. These modes acts like core settings of a channel. One such example is +r, which prevents users who are not identified to services from joining the channel.

If you as a user wish to see the modes set by a particular channel, you can check by: /mode #channel.

Facts and Figures

Hope you got a glimpse of IRC and enjoyed knowing about it. Unfortunately, according to the statistics, the usage of IRC declined by 60% after the social networking platforms like Facebook, Twitter, etc came into being.

Personally, I like IRC very much and I find it more useful than any other social platform. I  am sure you will feel the same once you try it. Go forth and conquer IRC!

 

Special thanks to Jason Braganza for editing and correcting my grammar.

J. P Barlow ~ EFF

February 7, 2018 was the dark day of our lives, when John Perry Barlow passed away at the age of 70 due to heart attack in San Francisco. John Perry Barlow, a co-founder of Electronic Frontier Foundation and the Freedom of the Press Foundation, political activist, lyricist for  Grateful Dead,  championed the ideals of free and open Internet. He had a vision to change our view of how we can use Internet. He came around in cyberspace in 1985 and in 1996, his  Declaration of the Independence of Cyberspace goes like this:

Governments of the Industrial World, you weary giants of flesh and steel, I come from Cyberspace, the new home of Mind. On behalf of the future, I ask you of the past to leave us alone. You are not welcome among us. You have no sovereignty where we gather.

This was in defense to the Internet, aimed at the government. In this declaration, he fought for protecting the Internet against the cruel impositions and laws from the government of United States. If you go through the entire 16 short paragraphs of his declaration, you would come to know his efforts and strong desire to appeal to the government to make all the difference. This was not only the appeal and his strife against the government, but a message to all those people about their rights and the way they use the Internet. It was his dream that anyone should express his or her beliefs  anywhere, without coercion.

In his keynote of PyCon – 2014, he talked about the cyberspace that needed reform since the space  was held upon a faint idea of culture. After he joined in the cyberspace,  he imagined a “new substrate for the community to form it”.  He told that Internet needs to be spread everywhere and “it was about the connection and not separation” and the content that needs liberation. He had an aspiration of creating a system, in which people can voice their thoughts freely, that doesn’t necessarily needs to be heard by everyone.

He believed in giving voice to the people and explained it by giving examples, like, if he had world’s largest diamond in his pocket, he could be curious or not of people not knowing it, but it is still valuable. Likewise, if a song is running in his head, it will be useless or valueless only after he let it be known. It was due to the fact, that the concert did by his band was taped by many people and he did not stop people from doing this, although, initially they thought that people are stealing and they should stop them to do so. He did this because he believed that it was going to be the “effecting system for spreading word about what they did”. He told about the culture existing in the different languages- there are TDX people, UNIX culture, Python. He talked about how government can use their power “to surveil people in a way that they have never done before”. He told how he almost always have a conversation with Ed Snowden, on how the government can’t stop even if they make something so that they do not happen to talk to each other. He dreamt that “right to know” should be considered as a natural human right and must be applicable to everyone who is being surveiled about the know-hows of what the government is doing  and the reason they are doing so.

Being that old, he still had the enthusiasm in himself and he desired to do a lot more. Truly, it is inspiring and at the same time encouraging to know about his avidity in his aspiration. He had a huge hope on us because we are the future and it is we who can shape up the politics and the technical architecture.

I was enthralled by the keynote.

Barlow is still alive and it’s living in his ideals that he set up. It’s on us now how to continue the legacy because his efforts are priceless. Watch the John Perry Barlow synopsium by the Internet Archives.

Bash fun :P

If you are new to GNU/Linux, the pro like commands would have made you feel no less than a hacker initially (Note: Hacker doesn’t mean the one who breaks into your system, steals your data, passwords and do mischievous activities. The one who does this is called Cracker. Hacker is one who do all the innovation with their intelligence and it is something not restricted to computers and tech, it may be beyond that). All the commands you type in the terminal makes you a different person all-together than the one who uses operating system like Windows, which stresses on GUI than CLI. At times, may be, you must have felt “this” particular stuff would have been easier or better in some respects being in Windows than in Linux. Want to add something? was it uncomfortable or seemed difficult at first? or, contrary to this, may be you had the impression that you are doing an ingenious task running all those “unfriendly” commands and getting some unfathomable outputs, making you feel like a true programmer and making you happy deep inside. Nevertheless, it’s all different opinions. Whether or not, you like GNU/OS (or what people say as Linux), I have a fun thing to share with you! Excited?

For people who already been using GNU/Linux (Linux to be in particular), I don’t have to tell them anything because they already know what bash is and would have come here to see what bash fun I will be talking about (lol :P).

OK, now let’s begin the real fun!

Screenshot from 2018-07-11 22-26-59.png

Can you see my terminal? Is it same as your’s? Of-course no. It has my beautiful name written on it. Want to have your name written like this or something dynamic that changes each time? Hang on! I got to tell you how.

For having your name appear like this each time you open up a terminal, you have several options. First option is without installing anything new. Before I move on with the first step, I would like to tell you something, rather warn you something and, that is, the output of this program written in Python:

 for i in range (1000):
       print("Don't play with Bash !!")

It is essential that you note, you shouldn’t play with it and make each change very carefully and with a backup copy so that you do not end up doing some trouble to your login shell. Any mis-activity may lead to anomalous behavior.

Let’s begin with the actual stuff:

First step: Use an online Text to ASCII art generator. Write anything you wish using any of the characters from your keyboard. For example like one below:

Screenshot from 2018-07-11 23-14-36  Here, you can try out with the different types of font, character width, character height available to you. After you have done with it, you need to copy the generated output and paste it to the end of your .bashrc file. (You have to append and not overwrite). I will highly recommend you to open .bashrc file using the editor in which you are comfortable in. To avoid trouble that can happen in any case, you can use gedit or pluma for ease in copy and pasting. Use gedit ~/.bashrc or, pluma ~/.bashrc . Put echo statement at each line and put it under inverted commas so that it is treated as a string to be printed. To avoid confusion, let me clear you with this picture:

Screenshot from 2018-07-11 23-23-30

Notice there is already a piece of code written. You just need to append the lines at the end. Save your .bashrc file and close it. Open up a new terminal and you will see the changes as below:

screenshot-from-2018-07-12-00-01-141.png

Isn’t it cool? Now whenever you will open the terminal, you will see the lines in this format which you chose.

Alternatively, you can also use figlet. To use figlet, you have to install figlet (depending on your distribution) by: sudo apt install figlet or, sudo dnf install figlet. After it is installed, you have to open the bashrc file, i.e., gedit ~/.bashrc  or, pluma ~/.bashrc . At the end of the bashrc file, write figlet "Your text". Your text includes whatever text you wish to print. When you open a new terminal, you will find your text written at the top, quite similar to the art I showed above. You can explore more of figlet by reading its manual. For reading the manual, type man figlet.

This was all about text. Do you wish to see some characters printed in your terminal each time and would it sound more cool if I say you that each time you open the terminal, you will see some fun facts or quotes written? And guess what with each time you open the terminal, you see some different texts written. Do you want that? Well, if the above was interesting to you, you will find the below as interesting too.

For that, you need to install cowsay. To know more of cowsay, you are free to read on wiki and manual. Install cowsay by either sudo dnf install cowsay or, sudo apt install cowsay,  depending on your distribution. Open the bashrc file, i.e., gedit ~/.bashrc  or, pluma ~/.bashrc. At the end of bashrc file, type cowsay -f eyes "Some text"

I have appended cowsay -f eyes "I am watching what you do". And here is the output:

screenshot-from-2018-07-12-00-27-14.png

Now you have several options to try out. To list the names of all possible characters, type cowsay  -l. To see all the characters designed with symbols, write this small script on the terminal:

for i in $(cowsay -l); do cowsay -f $i "$i"; done

You may choose whichever you like and then append it to the bashrc file. Do tell me your favorite one in the comments. Mine is calvin and tux.

Screenshot from 2018-07-12 00-45-05

Quite Interesting and fun? right? Oh wait, you must be wondering about the fun facts and quotes which I told you that changes each time you open a new terminal. Here is what you need to do:

fortune | cowsay -f  tux

In place of tux, you can put your favorite character and you are done. You will see some fun facts or quotes written. See what I got when I opened four different terminals:

Screenshot from 2018-07-12 00-59-32.png

Full of humour and pun. Imagine you being in office unwilling to do work and happened to open up a terminal and you get to see this, might make you smile.

 Try this out and explore the bash fun!

Read Me!

If you are actually reading this, You are trapped into reading this. I wanted you to read me because it is something related to README (lol :P)

Creating readme file is a part of documentation and it is essential in the development process. README.md is a markdown file that you should, or it is necessary that you,  create for giving a summary about your projects onto a platform like GitHub (can be README.rst as well). It helps in making others know about your work, what your project is all about, etc. Wondering, why I have to write to you for a plain thing like readme that just describes your project? The answer is – You instill the mind of the readers with curiosity, interest of looking into your project, only through README. Think about using any tool without having a proper documentation. Would you like it then? Let’s say you like Python3.x. Had there been no proper documentation of Python3.x, from where do you think you could have started learning and exploring. Point? So, it is very essential that you write a proper README.md file. Think yourself as a developer once, who is making a important project (let’s say, a simple code that you built with the immense logic and knowledge you have in Programming), and you host it into a platform like GitHub. Don’t you think your viewers need to know more about it, rather than simply seeing the code? Yes, they need to know, because they might not get what the project is and what it does, until you explicitly describe it.

While working on a project, I was given a task to create a README file for the GitHub repository. Now, when I used to create repositories of my own, I did not bother to think so much and I had the tendency to write just few lines on whatever the project was all about. Think, when you are collaborating with developers and creating a real life, problem solving project, just an usual readme file could not be praiseworthy. Just as your project, your description about the project needs to stand out. This was what struck my mind and felt that it is highly essential. I came across blogs (thanks to Akash Nimare), some GitHub readme suggestions (Thanks to PurpleBooth), some templates. and here’s the summary to all that you need. I am also adding the corresponding markdown format to make it easier for you to follow. Markdown is a syntax for formatting plain-text to display it on the web in a particular manner. It has amazing styling features that is easy to use, once you try. These are something your readme file should have:

  • Project Title

A must thing. Project title is the first thing you need to mention. If you have not given any title to your project, give one suitable name and keep it at the front. This is the main heading of the entire README.

  • Project info

This includes the one liner or two liner small info showing the actual purpose and what the title mean. Note: This is something different from project introduction. Here, you just need to mention the main purpose. You may, instead, include a project tagline here. An example, MasterCard has their tagline as “There are some things money can’t buy. For everything else, there’s MasterCard”.

  • Project Introduction

Now you got to introduce the project. Describe in brief. Mostly, one or two paragraphs would do. Introduction generally contains the origin of the project. Explain what it does and what parameters are there which govern the mechanism of your project.

  • Motivation

Here, you need to mention about what made you do this project. Describe the necessity and what you wish to achieve by doing the project. If it is something that is real life problem solving solution, you ought to include this and attract viewers.

  • Build Status

This includes the status of your working project. It is not mandatory. However, if you wish, you can follow how to add status badges in your repository.

  • Tech/Framework

You mention all the technology stack that you have used in your project i.e., the programming languages, the framework, the tools, etc. By including this, you make the viewers know more about your project, your work, etc.

  • Getting Started

Now that you have mentioned about the Tech/Framework, you got to tell the viewers (of your project) how to get started. To tell them how, you need to mention here a few lines about how they can use it. This heading includes subheadings, which are:

  1. Prerequisites:   You need to mention the requirements the user need to have to use your application/project. The requirements may be any software that is essential to run your program, any libraries or modules that might need to be pre-installed, etc.
  2. Installation:   You should precisely mention the steps of installation of your entire work so that the user don’t have to face any problem. It would be good, if you add screenshots of the installation process. In short, a demonstration is needed.
  3. Testing:   Give a suitable example and show how to run your application, i.e., take an input case and show the process of testing your application with the specific input case. Show how it worked to give a particular output. It would be better, if you add screenshots, because pictures make it more descriptive and easy to understand.
  • API Reference

If you have used any API or small snippet of code from somewhere in your project, it is always a good habit to mention that in your readme file. It creates a good impression and adds a reference to the viewers.

  • Features

Mentioning features is a plus point. You mention all the qualities that your project possess and the areas that are noteworthy in your project. You can highlight the major functionality.

  • Contributing

Here, you give the information and instructions to the viewers explaining how they can contribute and submit pull requests to you. Now, since this might be a long list of guidelines and procedures, it is better to keep this as a separate file called CONTRIBUTE.md. For this file, you may follow this which I found. It is an amazing description of the pull request process, code of conduct, etc.

  • Contributors

If you have worked in a team, this heading must include the list of names or the people who have contributed in your project. If you have single-handedly worked on the project, this is not mandatory for you. However, you may include the heading as Author and write you name and your introduction.

  • Credits/Acknowledgement

It is always a good habit to credit people and references you have taken. It gives an impression of you, that you respect other people’s work and you show them gratitude by doing this. It adds to the beauty of your reputation and your work.

  • License

You must add a separate LICENSE.md and give a link here. Mostly, you add the type of License you have taken, year and your name (or your team’s name while working in a group).

You are free to add something that is essential, or is something that your project demands. I just gave a general overview and points that are noteworthy. As I promised, I will be showing you the markdown format for the above points. A quick syntax table for you to understand the purpose of each of them:

Syntax

Purpose

# Heading
## Sub-heading
### Sub-heading of a sub-heading
> Blockquote
* Bullets
1. Number Bullets
(https://www.foobar.com) Links
[text](https://www.foobar.com) Links inside a text
**Text** Bold
__Text__ Bold
~~Text~~ Strikethrough text
*Text* Underline
_Text_ Underline
“`Code“` Insert Codes
Heading0 | Heading1 | Heading2
— | — | —
Row0Col0 | Row0Col1 | Row0col2
Row1Col0 | Row1Col1 | Row1col2
Table

The above table is the basic requirement (know-how) to write your readme file in markdown. There are other syntaxes as well which you can refer. Here, is the README.md template, that you can follow:

Screenshot from 2018-07-09 14-00-45

Screenshot from 2018-07-09 14-26-21

Screenshot from 2018-07-09 14-26-30

The Left hand side is the markdown format. The right hand side is the preview of the markdown file (README.md). The above screenshots was to make convenient for you to see the difference and understand. Pasting the format below:

# PROJECT TITLE
> project Info
## Overview / Introduction
Project Introduction goes here. This is the project that does this … The factors on wich it is dependent on. It is helpful in …
## Motivation
Unimpressed by the current scenario of …, my project deals with … and that was the motivation that led me to make this … I sensed the need of …
## Build status
You can use Tarvis CI or any.
## Tech/Framework used
Build with
* Your tools
* Frameworks
## Getting Started
I will show you how to get started with “project title”.
### Prerequisites
You must have :
1. System requirements:
* OS: Linux / MaccOS / Windows
* 64bit machine
2. Libraries/Modules :
* Numpy
* …
* …
3. …
### Installation
Follow steps as below:
1. …
2. …
### Testing
Sample Input: …
Follow steps as:
1. …
2. …
3. …
Output: …
## API Reference
Add reference (if any).
Use link as:
## Features
* Sustainability
* Real time based
* …
## Contributing
Want to contribute? See CONTRIBUTING.md for more information.
## Contributors / Author
Author of the project is
* Anu Kumari Gupta – CSE
## Credits / Acknowledgement
I wish to give my gratitude to …
Sources which helped me …
## License
MIT © 2018 Anu Kumari Gupta
Check LICENSE.md
 Note: To change the paragraph, you should give double space at the end of the current paragraph.
Now that you have got the essential skills to write your README.md file in markdown, go ahead and write one!

 

Hello Git!

Want to host your project on sites like GitHub using git and at the same time wish to do it with command line interface instead of graphical user interface? or, Looking for a quick reference to Git? or maybe you don’t wish to read the lengthy documentation to follow a fixed number of steps? or you wish to introduce yourself to git world?  Worry not, this blog will cover all that you need for hosting your projects on a platform like GitHub and say hello to git. Do you want me not to blabber anymore? OK, without wasting much of your time, let’s quickly get into this.

Without actually moving to the steps (because it is essential to know a little about it before following blindly), I want you to have an idea of what the terms mean and refer to. I am trying myself in explaining this to you with simple, layman words. However, if you do not find convincing, you may click on them to know more, from where they are taken and re-framed. Also for those who are new to Git, I should consider them, by saying that, you need to know the terms before moving onto following steps. Make yourself clear about the analogies and terms (Note: I am limiting the terms to what is required in the steps, there are many more) used in the steps before we proceed. And here I go:

VCS – Version Control System, is the management of the projects that you build, helps you to track your process in doing any kind of project and it allows you to use this system by a numerous tools. One such is Git. That means, if you ever want to look back to your own code and revert some changes, using the tools provided by VCS helps a lot. Obviously, you won’t be willing to make several folders, subdirectories to track each changes that you make while building a project.

Repository – A place where your project resides is repository. So, a local repository means a place where your own files are in the system. Remote repositories are versions of your project that are hosted on the Internet or network somewhere.

Branch – GitHub is a place where developers do collaborative projects. It becomes very essential that their work is separated from others, to avoid confusion and maintain clarity. Working on core code might be one such task, implementing features or fixing bugs might be another. The developers branch their work to obtain different versions. The main branch is your origin/master.

commit –  Whenever you want to make changes to your repository, you commit. And after you commit using commands from git, your changes in the project are reflected onto your system. You can add short messages as well.

push – After that you have done commit using commit, you would like this changes made onto a remote server or platform, like, one as GitHub. To make those changes available to your  GitHub repositories, you push the changes.

clone – Whenever you wish to make a copy of a remote repository, you clone it. In other words, you download it to your local system so that you can amend changes, update, etc.

Now one more useful thing to add after understanding some selected terms (you may always refer for more). When you are on the way to host your project on GitHub, you need to understand the levels it is going through. By levels I mean, the performing areas that it passes through. Suppose, you have created several files that constitute your project, in a directory. Now, this is your working directory i.e, the directory where you have started all the work. These files are untracked files (i.e, they are not known by git yet). To make git track your files, you add them so that it can be ready or be prepared to make the final changes. The moment you add them, you send your files to the staging area. You may take the word staging, as laying down the stage to perform something big. Here also, you are preparing your files before commit. At this stage, if you modify any file, you need to again add it. I hope till now you are fine with it. You have reached the staging area. Now, your task is to finally commit (or, make it happen). When you commit, you now have your local repository created, with all the files of your project.

Not to mention, I have a story told to me by Sayan, that could make things clear to you all the more:

You create a new character, Tux. Tux wants to be photographer, who has just bought a new DSLR. Tux plans to be the next travel photographer, who would take the best picture from the top of Mt. Everest. But Tux is a newbie, so Tux starts watching for YouTube tutorials for learning to post process the images. Tux creates a directory named *working* to put all un-processed images. Then, fires up DarkTable to process the images. Every time after a set of similar operations (like crop & rotate, shadows & highlights, etc), Tux creates a copy of the *working* directory and names it `snapshot-{n}. After a couple of operations, Tux stands having “snapshot-1”, “snapshot-2”, “snapshot-3”, …. , “snapshot-100” directories. This directories is history of how Tux developed the image over time. At any point, Tux can go back to a given snapshot and build again on top of it. It’s been a month now, Tux have learned a lot on post-processing images. Tux now mixes and matches multiple images file to create a snapshot directory. One day, Tux while processing the images, goes into experimental mode. and only after a while realized that the changes should be going into two different snapshot directories (`snapshot-139` & `snapshot-140`). Smart Tux quickly thought of an idea, creates a new staging directory. A staging directory works as an intermediate between the working directory and the snapshot directory. So, Tux now works on working directory, and one Tux is happy with the changes
Tux moves all changed files into staging directory, and then creates a copy of the staging directory as new snapshot directory.

Thanking Sayan for the awesome analogy which he mentioned here. Nice story, isn’t? Got cleared? OK, let’s move on to apply Git. Fire your terminal and go to the directory in which you have all the projects. Time to say Hello to Git. Skipping the installation of git in your OS, with the hope that you can follow this. Moving on to the steps:

1. Configure git settings.

You need to configure git, that is, you need to introduce yourself to git by giving your name and email. Perform as below by providing your name in the place of “Your Name” and email id in place of “Your email”:
git config --global user.name "Your Name"
git config --global user.email "Your email id"

Say, you are presently in a directory named git_demo, and you have files as hello.txt, gitfun.txt.

2. To make your current directory as git repository, you have to initiate git by:
git init

An empty repository is initialized, as you can see what it says.

3. Check your status. You will see the terminal mentioning of some untracked files (as I told you about the untracked files earlier). You can always perform this step whenever you wish to know the tracked and untracked files in the directory.
git status

Initially, you will see all the files as untracked.

4. To make git track your file, do
git add hello.txt

After performing this, your file directly goes into the staging area. Now, if you perform step 3 again, i.e, run git status, you will see that hello.txt comes under “Changes to be committed” and gitfun.txt comes under the heading “Untracked files”. Things are getting cleared, what I mentioned above, isn’t it?

If you wish to make changes to hello.txt, no problem, you can create changes.

5. To see the changes that are made to your file (i.e., what is deleted and what is inserted), do
git diff

Note: If you are modifying your file, you need to add it again (step 4) and you can check the status then (step 3).

6. You can also see the difference created in the staging area by
git diff --staged

7. At any point of time, if you feel that you want to unstage it, you may do this:
git reset --filename

7. Now that you are done with adding, be ready to commit. You add a short message along with it, so that, it helps you to comprehend the actual changes or the reason to change, etc.
git commit -m "Your message"

“Your message” can be “Created a new file” if you are committing for the first time. It may be “Updated the contents”, if you are updating the contents. You can simply mention anything you want.

8. To see the committed changes, you ought to do
git log

Now this will give you the information of the author (i.e, you if you have provided your own name and email id while git configuration), message which is committed, timestamp, commit ID.

You have successfully created your local repository. Now you would be willing to host it to GitHub. You should create an empty repository in GitHub before doing this. Say, you have created a repository named as project. After creating, you will see a URL under quick setup. Copy the URL

9. Add your files to the GitHub, perform as below. “Your URL” is the copied URL that you enter.
git remote add origin "Your URL"

To add a new remote Git repository as a shortname you can reference the URL easily (by default its origin). You can alternatively use any shortname in place of origin, but you have to use the same in the next step as well.

10. Push the files to the GitHub. This will require you to enter your GitHub handle and password.
git push origin master

This means that you are pushing your files to the master branch of your created repository.

Hooray! Successfully hosted your first ever project on GitHub!
Do make out time to follow ProGit or GitMagic for more detailed knowledge on Git.

‘Turtle’: Python

If you are well-versed with Python Programming language, you must be knowing the beauty of it. You know we have so many modules out there in Python, some of them are such that you might not even know that they exist. We have a lot in Python and so is its functionality. If you play around with the help of Python modules, you will see how much fun it is!  And not only the modules, Python as a whole is fun. It’s simple to use and highly flexible. From simple, sweet functionalities to modules that handle complex computational problems, Python is considered a boon. There’s a lot to discuss about Python and its use cases, application areas, etc. But here, we will discuss about one of the graphic object model support that is in Python.

Turtle is one such module from Python that helps you create a data object called turtle that can be used to draw pictures, design according to your desire. There are several others that is used for graphic designing. Imagine speaking to a turtle, to which, you can instruct to design beautiful, elegant designs on your screen. Now, just imagine what possible instructions should run in your head to give to the turtle, if you have to instruct the turtle to design? Maybe you want the turtle to move ‘accordingly’ such that an impression is made onto the screen? And what do you think what should be that ‘accordingly’ directions given by you? Maybe, to move forward and backward, or left and right! Right? You order and turtle is ready for you to work. Still wondering, how is it actually going to take place? But you already said the answer. It is as simple as to say. Set your mind with curiosity and follow along!

First import turtle module:
import turtle

Set-up a graphics window (This is basically your canvas or design area):
win = turtle.Screen()

Create your turtle and Name it:
tort = turtle.Turtle()

Now, order your turtle to move:
To move forward with 50 pixels(say) in direction it is pointed to :
tort.forward(50)
To move backwards with 50 pixels pointing to same direction:
tort.backward(50)

To change the directions in which turtle is pointing:
Rotate the pointer clockwise by 25(say) degrees :
tort.right(25)
Right the pointer anticlockwise by 25 degrees :
tort.left(25)

Now that we know how to start off, let’s create our first program in Python( I’ll be showing you in Python 3) using turtle:

Lets draw a square (200 X 200):

>>> import turtle
>>> win = turtle.Screen()
>>> tort = turtle.Turtle()
>>> for moves in range(4):
...     tort.forward(200)
...     tort.right(90)

When you try this out, you will see something like this:

Screenshot from 2018-07-04 21-58-39.png

Wooh! Congratulations on your first basic program (HelloWorld of graphics with turtle in Python).

You can try out some similar shapes and get the feel of it. The above looks very plain and uninteresting. Isn’t it? What is missing? Yes, colors! Let’s add color to it and give it a feel. Also, we have some more functionalities like you can instruct turtle to pick up its tail so as not to draw anything at the moment( this is useful in cases of drawing on screen at different places using the same turtle), change the shape, etc. Let’s discuss:

To set the background color:
win.bgcolor("green")

To set the color of the pointer( or our turtle ):
tort.color("blue")

To set the width of the impression on the screen (say, width = 15):
tort.pensize(10)

To pick up the turtle tail so that it doesn’t create impression on the screen:
tort.up()

To create impression on the screen at the current location:
tort.stamp()

The above returns a stamp_id for that stamp, which can be used to delete it by calling clearstamp(stamp_id)

To set the turtle’s speed to an integer value in the range 0 to 10 (If no argument is given, current speed is returned):
tort.speed()   #returns the speed
tort.speed(9)  #sets the speed

To draw a circle using turtle( say, radius = 25):
tort.circle(25)

To undo the last action performed by turtle (Number of available undo actions is determined by the size of the undobuffer):
tort.undo()

To return the current position:
tort.position()

To goto a certain (x, y) point:
tort.goto(50, 50)

To indicate the starting point of a filled polygon:
tort.begin_fill()

To close the polygon and fill with the current fill color:
tort.end_fill()

To change the shape of the pointer, you have options among ‘arrow’, ‘classic’, ‘turtle’, ‘circle’ or ‘square’:
tort.shape('turtle')

Till now, we have discovered just basic steps but you can try out several designs by experimenting. For example, try this out:

Screenshot from 2018-07-04 23-48-05.png

I have used here a small code as:

>>> import turtle
>>> win = turtle.Screen()
>>> win.bgcolor('green')
>>> tort = turtle.Turtle()
>>> tort.color('blue')
>>> tort.shape('turtle')
>>> tort.up()
>>> for size in range(5, 200, 2):
...      tort.stamp()
...      tort.forward(size)
...      tort.right(50)

Here, I have used a background color of green and with the blue turtle shaped object tort, I made the turtle leave an impression, making it move forward, and rotating it each time so that it can form a circular pattern, on an interval.

You can try out something like this:

Screenshot from 2018-07-05 02-17-57.png

The code for the above:
>>> import turtle
>>> win = turtle.Screen()
>>> win.bgcolor('black')
>>> color = ['red', 'blue', 'yellow', 'green', 'lightblue', 'orange','lightgreen']
>>> tort = turtle.Turtle()
>>> for itr in range(360):
...      tort.color(color[itr%7])
...      tort.forward(itr)
...      tort.left(62)

Here, I am taking a list and keeping some colors in it and using in the iteration to change the colors each time. The code is intuitive to understand the actual flow occurring.  You make the turtle move forward with continuously increasing values used in the loop and turn the turtle by 62 degrees each time. Other portion of code remains same, that is, importing turtle module, setting up the display, etc.

So, now that you have started designing so much, paint out your imagination on screen! You can also use two or more turtles combined. Combined turtles can be used to make much more impressive and beautiful designs. For more info, you can refer the original documentary.

Happy coding:)

Fedora->Ubuntu : Journey Unexpected – II

You read me telling about all the mess ups which took place when I tried to shrink partitions and make up space for my Fedora. Unfortunately, that could not happen. I messed up all and I had to reinstall a new OS. So, as I told you that a thought of using Ubuntu came in my mind before all this happened. It was the right time to switch to what I desired to use. So, using that live Fedora 27 OS, I had to take another pen drive to make live Ubuntu on it. At that time, newest version available was Ubuntu 17, but the official site clearly mentioned that there was a bug and it had affected many  Lenovo laptops and anyone can download and use it at their own risk. At that point of time, after so much frustration, I couldn’t have afforded to face one another problem. So, I downloaded Ubuntu 16.04 LTS. Used the third pen drive to install Ubuntu as the main distro (one pen drive had live Fedora 27 in it, another had all my files, third was this). I decided that I should finally forget Windows and that was the decision I never regretted afterwards XD.  This was the happy picture when Ubuntu was installed without any dual boot:

IMG_20171223_215429.jpg

Following the official site for Ubuntu downloads, I followed the steps of installing it on my desktop. Everything was fine. The view, the sound, the moment until I came to know that Internet was not working. Imagine the situation of me, who only have desktop and for any fixes on desktop required Internet connection on it. Moreover, I wasn’t able to tether my mobile onto the P.C. LAN connection was perfect, because had it not been perfect, I wouldn’t have been able to download the ISO file of Ubuntu. It was becoming very terrible once again. I tried several steps and all possible solutions given in Stack Overflow, Quora, etc. None solved my problem. I tried pinging from my terminal through IP address and it was successfully pinging but when I pinged by using the actual names, it wasn’t pinging. I was unable to access Internet through browser(only had Firefox pre-installed). Could not have downloaded another browser without Internet. I had correctly configured the IPv4 and DNS settings in the Network Manager for the LAN connection( did similar settings as I had done in live Fedora ). The top right corner showed that I was connected, but somehow I was not able to understand what was the problem.

img-20171226-wa0066-e1530623814822.jpeg

The above is the proof that it did show that I was connected. It’s just that I was unable to load pages in my browser.  I had a  thought that may be there is a problem in browser settings or may be a firewall is activated. I went through each of them ( the browser settings ), but couldn’t find anything that could help me.

There are some pictures for the evidence of the fact that network status was active and the /network/interfaces file consisted of all that it should contain. However, I tried manually changing the file for appending address, netmask, gateway under the default network name, which was ens33 in my case( tried both as static and dhcp ) manually and then restart the networking but then I reverted the changes once it did not solve my problem.

 

After numerous searches from here and there, hanging around in several forums, I finally managed to solve my problem by creating a symbolic link that was missing. This was when I found that there was no /etc/resolv.conf :

1.png

It was very probable that it was a DNS issue because it was successfully pinging with IP address and not by their names. I found that I did not have /etc/resolv.conf file. The file was missing. Without Internet connection, it was useless to perform reinstallation of resolvconf. I created the file inside   /etc/ as resolv.confin which I kept similar contents as /run/resolvconf/resolv.conf. Also, I created /etc/resolvconf/resolv.conf.d/base (I don’t remember exactly why) and added nameservers onto the base as:

nameserver 8.8.8.8
nameserver 8.8.4.4

Then, I created the symbolic link following  like this:

Move the file to /run/resolvconf/

sudo mv /etc/resolv.conf /run/resolvconf/resolv.conf

Then create the symlink Using command:

sudo ln -s ../run/resolvconf/resolv.conf /etc/resolv.conf

Then Restart the Network using

sudo /etc/init.d/networking restart

Or there is a Alternative way

sudo dpkg-reconfigure resolvconf

I checked the symbolic link by performing ls -al command. The link was established. And so was the Internet restored, DNS( Domain Name Server) to be precise. Special thanks to Linux User’s group on Facebook (the only reason I like Facebook for having groups of people like them to help out, from all over the world). There were many suggestions to me: some suggested me to check drivers, some suggested me to check firewall and many such things.

These all experiments took one more week of my semester break. Phew! At least, it worked at last. I took an inspiration from this, that I shouldn’t run away from my problem until I chase it enough to solve it however. I still remember one of my friend telling me that Ubuntu has a lot of bugs and so I should change my Linux distro. Well, this wasn’t a solution and I ignored( just like the way you need to ignore some people’s views). Another said that, I should reinstall Ubuntu as it might have not finished its installation properly and some packages would have been missing. Ignored! Anyways, I solved it and am happy to share with you:) All’s well that ends well.