Monday, 15 February 2016

Install Apache2 from source in $HOME directory without root access

1. Download apache2 from source website.
2. Unzip
3. Make installation directory inside $HOME, i made "install" directory in my case.
4. Go inside the apache unzip directory
5. Run command ./configure --prefix=@HOME/path-to-install-directory.
6. make
7. make install
8. Then start apache by $HOME/path-to-install-directory/bin/apachectl start
     
          In my case it throws the following error:
   
          httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1               for ServerName
          (13)Permission denied: make_sock: could not bind to address [::]:80
          (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
          no listening sockets available, shutting down
          Unable to open logs
    
         So error given below is removed by changing the nameserver to localhost     
         httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1               for ServerName
 
         In my case i added ServerName localhost:80  in $HOME/path-to-install-                   directory/conf/httpd.conf 

          and again start apache by the command in step 8 the upper error disappeared but the remaining           was there. 

         so i get some ideas from this link http://askubuntu.com/questions/338218/why-am-i-getting-permission-denied-make-sock-could-not-bind-to-address-when 

         and made the following changes :  
                 I just add Listen 1025 in   $HOME/path-to-install-directory/conf/httpd.conf  file instead of 
                 Listen 80  and again start apache, this time it starts with no error.


Sunday, 3 January 2016

Error on upgrading the librehatti from Django1.7 to Django1.8 with Pyhton3.4

$ mysql -u root -p librehatti < librehatti.sql

         |-ERROR 1452 (23000) at line 41792: Cannot add or update a child row: a foreign key constraint fails (`librehatti`.`#sql-3f6_f5`, CONSTRAINT `bills_quoteditem_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `catalog_product` (`id`))

$ python manage.py syncdb


        |- File "/home/aasp/LibreHatti/src/useraccounts/models.py", line 80
           return unicode(self.user)
                  ^
           TabError: inconsistent use of tabs and spaces in indentation

Solution:
         >>http://stackoverflow.com/questions/19295519/indentation-error-with-python-3-3-when-python2-7-works-well
         >>https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces

$ python manage.py syncdb         
             |- File "/home/aasp/LibreHatti/src/librehatti/suspense/admin.py", line 9, in <module>
                from librehatti.suspense.forms import StaffForm
                File "/home/aasp/LibreHatti/src/librehatti/suspense/forms.py", line 3, in <module>
                from models import SuspenseClearance
                ImportError: No module named 'models'

Then use

$ python manage.py migrate           
              |- and the same error as above

Solution:
          >> so make changes in LibreHatti/src/librehatti/suspense/forms.py {in this case, "from .models import whatever" in stead of "from models import whatever"}


$ python manage.py runserver

           |- ImportError at /
               No module named 'reports'
           Solution:   
             >>{in this case, "from .models import whatever" in stead of "from models import whatever"}
     
           |- File "/home/aasp/LibreHatti/src/librehatti/urls.py", line 6, in <module>
              from .reports.register_generator import GenerateRegister
              File "/home/aasp/LibreHatti/src/librehatti/reports/register_generator.py", line 13, in                              <module>
              from helper import get_query
              ImportError: No module named 'helper'
             Solution:
             >>same chages as above in forms.py, register_generator.py, and search.py

           |- 'module' object has no attribute 'izip'
           Solution:
             >> replace "izip" with "zip_longest"
             >> http://stackoverflow.com/questions/15698427/merging-three-lists-into-into-one-dictionary
              >> http://stackoverflow.com/questions/32261698/my-idle-does-not-recognize-itertools-izip-as-a-function
             >> https://docs.python.org/3/library/itertools.html#itertools.zip_longest

            |- File "/home/aasp/LibreHatti/src/librehatti/suspense/views.py", line 5, in <module>
               from models import SuspenseClearance
               ImportError: No module named 'models'
           Solution:
              >>{in this case, "from .models import whatever" in stead of "from models import whatever"}

             |- File "/home/aasp/LibreHatti/src/librehatti/reports/views.py", line 5, in <module>
                from forms import ClientForm
                ImportError: No module named 'forms'
             Solution:
              >>{in this case, "from .models import whatever" in stead of "from models import whatever"}

               |- File "/home/aasp/.virtualenvs/py3/lib/python3.4/site-packages/django/core/urlresolvers.py", line 102, in get_callable lookup_view)
                  ImportError: Could not import 'quoted_bill'. The path must be fully qualified.
                Solution:
                   >> Commented the line url(r'^quoted_bill/', 'librehatti.prints.views.quoted_bill'), in url.py

Friday, 25 September 2015

Silly mistakes "Task 'saas' is not in your gulpfile" deploying sass with ionic framework

Here is the log of discussion on IRC


satinder
I am deploying ionic on ubuntu machine, i found an error with gulp
$ gulp saas
$ gulp saas
[12:06:36] Using gulpfile ~/myApp/gulpfile.js
[12:06:36] Task 'saas' is not in your gulpfile
[12:06:36] Please check the documentation for proper gulpfile formatting
joeco
yea this is with deploying to ios, like I said, Android is fine and still is working.
junmin has joined
joeco
it's either a problem with ionic, ios or cordova, but if anyone else serious is making interesting apps they know exactly what I'm talking about.
it's super aggravating.
← junmin has quit (Ping timeout: 240 seconds)
joeco
satinder. in your gulpfile, you need some lines that look somewhat like this:
gulp.task('saas', function() {
});
that's assuming you want to run a 'saas' task. (you maybe meant 'sass')
otherwise, just type 'gulp' as your command, and the 'default' task should run
satinder
joeco: yes it is there
gulp.task('default', ['sass']);
gulp.task('sass', function(done) {
gulp.src('./scss/ionic.app.scss')
joeco
that is not defining a new task. It is saying whatever is in the brackets is a dependency of 'default'
satinder
it is already present there
joeco
it means anything in the brackets has to resolve before 'default' is run.
so if you don't want sass, just erase it from the brackets
satinder
right
joeco
or else make a new .task() with 'sass' as the main name / definition
← dan2k3k4 has quit (Ping timeout: 246 seconds)
joeco
oh I see, you have one there
satinder
yes
joeco
maybe it needs to be listed above the 'default'? just a guess
satinder
ok i am trying that way
joeco
are you sure the 'sass' task has something like this as the last line: .on('end', done);
ilmgb has joined
joeco
you have to call the 'done' so that it knows to start the next task
satinder
gulp.task('sass', function(done) {
gulp.src('./scss/ionic.app.scss')
.pipe(sass({
errLogToConsole: true
}))
.pipe(gulp.dest('./www/css/'))
.pipe(minifyCss({
keepSpecialComments: 0
}))
.pipe(rename({ extname: '.min.css' }))
.pipe(gulp.dest('./www/css/'))
.on('end', done);
});
but still not working
qwebirc95493 has joined
joeco
well I don't know. but one other thing you can try, a really handy and simple/straightforward plugin is run-sequence on npm
i use it. you may restructure your order of gulp tasks, the sequence they run in.
maybe going threough that exercise will reveal why the 'sass' task is messed up.
satinder
okay, i will try that ,,,
It's OK, you're connected again :)
[sinisalo.freenode.net]
*** Looking up your hostname...
*** Checking Ident
*** Couldn't look up your hostname
*** Got Ident response
*** Spoofing your IP
← qwebirc95493 has quit (Ping timeout: 246 seconds)
← blackjid has quit (Ping timeout: 240 seconds)
joeco
satinder, I think I know the real solution
can you check your ionic.project file?
under gulpstartuptasks: [] ... you have a misspelling.
← mickhansen has quit (Ping timeout: 240 seconds)
satinder
joeco: Which file
gulpfile.js
?
joeco
it should be in the root of your project
ionic.project
it is the startup file that is called when you do "ionic run android" or whichever
from there it calls gulpfile.js
satinder
yes it is there
{
"name": "myApp",
"app_id": "",
"gulpStartupTasks": [
"sass",
"watch"
],
"watchPatterns": [
"www/**/*",
"!www/lib/**/*"
]
this is the content of ionic.project file
mickhansen has joined
joeco
hmm.. that's strange. the "sass" matches the "sass" in your gulpfile
so I don't know why it said: Task 'saas' is not in your gulpfile
how about in your "watch" task, back in the gulpfile?
does it depend on "saas"?
satinder
no i don't think so
aasp@1313:~/myApp$ gulp watch
[12:33:25] Using gulpfile ~/myApp/gulpfile.js
[12:33:25] Starting 'watch'...
[12:33:25] Finished 'watch' after 11 ms
dan2k3k4 has joined
satinder
Actually i am not using the default sass files of the ionic project
joeco
oh
wait, your original command you typed was "gulp saas"
that's why
what if you type "gulp sass"
satinder
yes it works!
joeco
ha. took the long way to get there :)
marthinal has joined
satinder
yes, thanks joeco
joeco
sure, n/p

Tuesday, 8 September 2015

Adding two repositories to git.

Looking for adding two repo on same git, or say adding another repository other than origin in the same project.

1. Add first repo:

$ git add remote origin master <project repo url>
$ git push -u origin <branch>

2. Adding Second repo

$ git remote add <user> <project repo url>
$ git push <user> <branch>

Tuesday, 30 September 2014

Saturday, 24 May 2014