Skip to main content

Posts

Create virtual host or site in local ubuntu machine

To create a virtual host or local site in ubuntu machine, do the following things- 1) Put your contents in your local machine,                           for me its in "/var/www/html/workingdir/testdomainfolder" 2) Cd /etc/apache2/sites-available/ 3) Create a file name- "www.testdomain.com", do the following-     sudo vim www.testdomain.com 4) Write the following contents in "www.testdomain.com", change domain name according to your and write your document root <VirtualHost *:80> ServerName www.testdomain.com DocumentRoot /var/www/html/workingdir/testdomainfolder ScriptAlias /cgi-bin/ /usr/lib/cgi-bin <Directory /var/www/html/workingdir/testdomainfolder> Order allow,deny Allow from all Options +FollowSymLinks -Indexes AllowOverride All </Directory> <Directory /usr/lib/cgi-bin> Order allow,deny Allow from all Options None AllowOverri...

https://bitbucket.org . GIT COMMANDS

git status git add . git add xyx.php git commit -m"changes done" git push git config --global --edit git commit --amend --reset-author   git push --set-upstream origin master GIT   To create a new branch git checkout -b automon_115 git status git branch git push -u origin automon_115 git checkout master git diff To create a branch first time-   >.   git checkout -b cmdb_120

configuring python project in local

git clone https://devendra_kumarsingh@bitbucket.org/***********/automonitoring.git 1) create a virtual environment virtualenv automonitoring_env  for python- 2.7      virtualenv -p /usr/bin/python automonitoring_env 2) cd automonitoring_env/   // ENVIRONEMNT FOLDER 3)  source bin/activate 4)  cd ../automonitoring  // PROJECT FOLDER  5)  pip install -r pip_req.txt  To set a environment in pycharm - 1) click on app  2) edit configuration 3) add environment- dev then run  GET CLONE RUN- virtualenv PROJECT_FOLDER_NAME_env OR virtualenv -p /usr/bin/python fileupdate_env CD PROJECT_FOLDER_NAME_env THEN RUN-> . bin/activate OR source fileupdate_env/bin/activate CD ../SOURVE_CODE_FOLDER/ THEN RUN - pip install -r pip_req.txt   SET ENVIRONMENT-> CLICK ON APP-> EDIT CONFIGURATION THEN ADD-> “ENV AND VALUES DEV” To set  a virtual environment in ubuntu-...

condition with order by clause in query - postgresql

SELECT count (main.id) as count ,main.status, ( sum ( count (main.id)) over ()) as total FROM Tickets main   JOIN Groups Groups_1 ON ( LOWER (Groups_1. Domain ) = 'rt::ticket-role' ) AND ( LOWER (Groups_1. Name ) = 'requestor' )   AND (Groups_1. Instance = main.id ) JOIN CachedGroupMembers CachedGroupMembers_2   ON (CachedGroupMembers_2.Disabled = '0' )   AND ( CachedGroupMembers_2.GroupId = Groups_1.id ) JOIN Users Users_3   ON ( Users_3.id = CachedGroupMembers_2.MemberId )   JOIN queues queues_3 ON ( main.queue = queues_3.id) JOIN users users_4 ON ( main. owner = users_4.id ) WHERE (main.IsMerged IS NULL )   AND (main.Status != 'deleted' ) AND (main. Type = 'ticket' )   and main.created:: timestamp AT time zone 'utc' >= '2017-11-20 23:06:06'   and main.queue in ( 5 , 6 , 7 , 8 ) and main.created:: timestamp AT time zone 'utc' <= '2018-07-11 06:14:26'  ...

postgresql view query

drop view ticket_resolution; create view ticket_resolution as   select t1.id,t1.queue,t1.type,t1.owner,t1.subject,t1.initialpriority,t1.finalpriority,t1.priority,t1.timeestimated,t1.timeworked,t1.status,t1.sla,t1.timeleft, t1.told,t1.starts::timestamp AT time zone 'utc' as starts,t1.started::timestamp AT time zone 'utc' as started,t1.due::timestamp AT time zone 'utc' due,t1.resolved::timestamp AT time zone 'utc' resolved,t1.lastupdatedby,t1.lastupdated::timestamp AT time zone 'utc' lastupdated,t1.creator,t1.created::timestamp AT time zone 'utc' as created , floor((EXTRACT(EPOCH FROM current_timestamp) - EXTRACT(EPOCH FROM t1.created::timestamp AT time zone 'utc'))/60)::integer, case when ( floor( (EXTRACT(EPOCH FROM current_timestamp)   - ( EXTRACT(EPOCH FROM t1.started::timestamp AT time zone 'utc') +coalesce((sum(t2.hold_end_time-t2.hold_start_time))::integer,0)) )/60 )::integer < 3...