Github down? Fixed.

Past few days, my internet was sort of down (ping was 2600ms!!!). Today, while it got fixed, I found out that I couldn’t access Github.
A simple fix did the trick. What I did was just changed my DNS servers to Google’s DNS servers, and everything was back to normal again.

Steps (on linux)-

1. Open a terminal & type -

sudo gedit /etc/resolvconf/resolv.conf.d/head  

I use gedit. You can replace it with the editor of your choice. For example, a nano user may write -
sudo nano /etc/resolvconf/resolv.conf.d/head

2. put your nameserver list in -

nameserver 8.8.8.8
nameserver 8.8.4.4

3. Then run-

resolvconf -u

4. Try github.com and confirm if it works.

There is a similar setup in Windows.

1. Just goto Network Places

2. Change Adapter Settings (left sidebar)

3. select your Internet network and right click and select Properties

4. select IPv4 and click Properties

5. Change the fields for DNS server #1 and #2 to “8.8.8.8” and “8.8.4.4” respectively.

I am not sure if it is region related or ISP (MTNL in my case), but changing your DNS to Google’s is anyway a good option.

Make an ISO backup of your Linux distro

Me and Linux have had an on & off relationship for quite a while. Like all penniless people, my broadband bandwidth is small, and thus, updating the distro becomes a pain.

Luckily, I found this -

https://github.com/Distroshare/distroshare-ubuntu-imager

What’s that?

Simply put, its a bash script to copy your current Linux installation into an iso. While that may sound boring, believe me, it’s a godsend. Just run the script after you are satisfied with your current Ubuntu installation (that includes all recent updates, third party apps and settings).

Why?

- No more updates after each new fresh install. Update your distro and save it as an iso and save the time later on.

- Have a ready .iso backup. That’s useful if you wish to make a bootable pen drive or install in a virtual machine.

Steps-

1. Download the ‘.sh’ and ‘.config’ files.

2. Mark the .sh as executable (Properties->Permissions->Execute check)

3. Run the .sh script in root (sudo).

Congratulations! You just saved yourself a shit-ton of configuration and after-installation hassles in the future.

Correctly installing WinBGIm library to Code blocks

If you tried installing the WinBGIm library using the files from the official site, and it didn’t work, then maybe you should try this. The files on the site didn’t work for me either, so a different source might be helpful. Here’s the steps to properly set it up in Code::Blocks as well.

1. Download the files from this repo – https://github.com/goelakash/WinBGIm .

2. Copy the graphics.h and winbgim.h file in your compilers include folder. (for me, in Win7, its in C:\Program Files (x86)\CodeBlocks\MinGW\”).

3. Copy the libbgi.a file in the lib folder of the same directory.

4. In your Codeblocks IDE, goto Settings-> Compiler-> Global Compiler Settings-> Linker Settings.

5. In the Link Libraries tab, click on Add, and navigate to the lib folder into which you just copied your libbgi.a file, and select it.

6. Paste this in Other linker options: 

-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32

Now, run a test file to confirm and enjoy.