Origin


Resu, North Garo Hills, Meghalaya 794108

Sunday 26 April 2015

Changing Computer Name in Elementary OS 0.2 (Luna)

It's a simple two-line command to execute:

$sudo gedit /etc/hostname


and replace the old name with the new name. It has to be done here also:

$sudo gedit /etc/hosts

Restart the computer and check the terminal. The changes will be reflected.

Saturday 28 February 2015

AdJuvenes 0.1.0

I started out this small project late last year for students of classes IX & X as a platform for practicing objective maths online and as a pre-runner to my actual Node.js-based web app which I have been building for over a year now (this MathOptio will be later part of it). I wish I could have some more time, but again, perfection begets another time.


What is out now is very minimal, and there could be some minor errors. Append to that is another major constraint in the form of platforms offering DBaaS for CouchDB (the database for this project) with their pricey slabs (most of them charge "per pull request"). So I decided not to use any for now and pulled-off implementing the login/password/account pages along with the essential dynamic questions and their corresponding AngularJS factories for this version.

Two chapters, "Linear Equations in Two Variables" in Algebra and "Quadrilaterals" in Geometry, are excluded for now. They will be available in BETA release.

http://www.adjuvenes.com/

Tuesday 21 October 2014

Simple AngularJS $http request to fetch a CouchDB document

We begin first by installing CouchDB:

#yum install couchdb

After installation, we start the CouchDB server:

#service couchdb start

To see if it is running, type

#curl http://127.0.0.1:5984/ in the console, or type

http://127.0.0.1:5984/

in the browser's address bar. Either way, if all is good, you should get the JSON response:

{"couchdb":"Welcome","uuid":"a8e76df6219160824c631647aa7d9f1c","version":"1.6.1","vendor":{"version":"1.6.1","name":"The Apache Software Foundation"}}

I will skip all the curl -X CRUD operations here (you can refer it anywhere later) and we will create an example database and a document manually.

Go to http://127.0.0.1:5984/_utils/ in your browser. This is your FUTON, CouchDB's interface.

Click on "+ Create Database ... " button located at the top left corner of your Futon interface. Let us call it mars. Inside our newly created database, is another sub-interface. We click on the "+ New Document" button to create one, and the first field you see is the _id field with a 32-character hexadecimal string value, something like, 7df239fb136c51dffebf364d14000878. This is the UUID. Here, I will replace the string with satellite.


Now let us add on more field: click the "+ Add Field" button. We give the field name name and its value phobos. Save the document by clicking the "Save Document" button.

Upon clicking on the "Source" tab, you will see a structured JSON document like this:


{
   "_id": "satellite",
   "_rev": "1-70b8ebd5210674e1c3a381f0143a1d53",
   "name": "phobos"
}

We now have a JSON data in CouchDB, let us try to fetch it from inside an AngularJS controller using the $http service.

 var url = 'http://127.0.0.1:5984/mars/satellite';

 $http.get(url)
    .success(function (data, status, headers, config) {

    angular.forEach(data, function(value, key) {
$log.log(key);
$log.log(value);

    });
    }).
    error(function(data, status, headers, config) {
      // log error
    });

The console response you will get is the following:

XMLHttpRequest cannot load http://127.0.0.1:5984/mars/satellite. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.

This is because we have not set the [httpd] and the [cors] sections of our CouchDB server's local.ini file. Navigate to it

#cd /etc/couchdb

and open the local.ini file

#gedit local.ini

In the [httpd] section, append

enable_cors = true

and add another section

[cors]
origins = *
credentials = true
origins = http://localhost, https://localhost
methods = GET, POST, PUT, DELETE
headers = Authorization, Cookie


(you can do without the origins, methods, headers also for now)

Save, and restart the server

#service couchdb restart

Now you'll have your JSON data!

Sunday 3 August 2014

Installing hhcount.sty to generate Tally Marks in LaTeX document in Fedora 20

1. Download the file hhcount.sty and save it (like in your Downloads folder)

2. Navigate to /usr/share/texlive/texmf-dist/tex/latex/
    #cd /usr/share/texlive/texmf-dist/tex/latex/
    and create a folder named hhcount
    #mkdir hhcount

3. Now navigate back to your Downloads folder (or wherever you downloaded hhcount.sty) file and
    move/copy the file to the newly created folder.
    #mv hhcount.sty /usr/share/texlive/texmf-dist/tex/latex/hhcount

4. Run the texhash command
    #texhash

5. Since hhcount.sty is dependent on hhutils0.sty, you need to download it again and like in
    the previous steps, create a folder hhutils0 inside /usr/share/texlive/texmf-dist/tex/latex/ and move
  hhutils0.sty there. Again run texhash command.

6. Now include \usepackage{hhcount} in your tex file and wherever you need to include tally  
    marks, use \fcsore{n}, where n is the frequency number. If you need to put a tally mark against 5,        use \fcscore{5}, if against 7 use \fcscore{7}. Run LaTeX, and you'll get the tally marks in  
     your document as

Wednesday 11 June 2014

The errors after uninstalling satya164's "Elegance Colors" GNOME Shell Theme

A lot who have tried satya164's "Elegance Colors" GNOME Shell Theme in Fedora 20 know that upon doing

#yum update

the errors comes out as follows:


"download.opensuse.org_repositories_home_satya164_elegance-colors_Fedora_20_             | 1.6 kB  00:00:00     
http://download.opensuse.org/repositories/home%3A/satya164%3A/elegance-colors/Fedora_20/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.


 One of the configured repositories failed (added from: http://download.opensuse.org/repositories/home:/satya164:/elegance-colors/Fedora_20/x86_64/),
 and yum doesn't have enough cached data to continue." 

Navigate to

#cd /etc/yum.repos.d

and list them all

#ls

You'll see the following three repo files still there: 

download.opensuse.org_repositories_home_satya164_elegance-colors_Fedora_20_.repo
download.opensuse.org_repositories_home_satya164_elegance-colors_Fedora_20_x86_64_gnome-shell-theme-elegance-colors-2.9-3.2.x86_64.rpm.repo
download.opensuse.org_repositories_home_satya164_elegance-colors_Fedora_20_x86_64_.repo


Next you remove them all

#rm download.opensuse.org_repositories_home_satya164_elegance-colors_Fedora_20_.repo
#rm download.opensuse.org_repositories_home_satya164_elegance-colors_Fedora_20_x86_64_gnome-shell-theme-elegance-colors-2.9-3.2.x86_64.rpm.repo
#rm download.opensuse.org_repositories_home_satya164_elegance-colors_Fedora_20_x86_64_.repo

Do the update

#yum update

And it's done!

Saturday 17 May 2014

Install Numix Theme/Icons on Elementary OS 0.2 (Luna)

$ sudo apt-add-repository ppa:numix/ppa
$ sudo apt-get update
$ sudo apt-get install numix-gtk-theme numix-icon-theme-circle


Thursday 15 May 2014

Install Icon packages on Fedora 20

(It's assumed that GNOME Tweak Tool is already installed in the system.)

Icons are mostly packaged in tar.gz or .ZIP file. Let's get a couple of them from http://gnome-look.org/Square-Beam 1.0 and The Circle 0.2 and install and use them. Click on their respective download links and get the Square-Beam_1_0.tar.gz and TheCircle.zip packages.

Now, navigate to the /home/username/Downloads folder (or to whichever directory you have downloaded them to):

# cd /home/username/Downloads

Extract Square-Beam_1_0.tar.gz to the /usr/share/icons directory:

# tar xzf Square-Beam_1_0.tar.gz -C /usr/share/icons



Unzip TheCircle.zip at the /usr/share/icons directory:

# unzip TheCircle.zip -d /usr/share/icons

Next, open GNOME Tweak Tool and select one of them, say, Square-Beam




Here's a glimpse of the Square-Beam 1.0 icon set:



And of The Circle 0.2: