0% found this document useful (0 votes)
15 views5 pages

Useful Commands

Uploaded by

Ajay Dashiwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

Useful Commands

Uploaded by

Ajay Dashiwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Query for MySQL DB size

SELECT size_mb FROM (SELECT table_schema as name,ROUND(SUM(data_length +


index_length) / 1024 / 1024, 1) as size_mb FROM information_schema.tables GROUP BY
table_schema) alias_one WHERE name = 'idsplive';

select r.st_code,d.districtname as districtname,reporting_code as RU_Code,reporting_name as


RU_Name,rutype as type, dpl_status as DPHL from reporting_unit as r, district as d where
r.dis_code=d.districtcode and dpl_status='Y' and required='Y' and onoff is null and
r.st_code='TL' order by r.st_code,d.districtname

update reporting_unit set dpl_status='N' where reporting_code='00277607'


update reporting_unit set dpl_status='Y' where reporting_code in
('00229399','00230368','00277992','00276195')

National level District wise L Form Data


select s.statename,d.districtname,p.weekno,p.dengu_sample_tested as
DengueSample,p.dengu_sample_positive as DenguePositive, p.chikungunya_sample_tested as
ChikunguniyaTested, p.chikungunya_sample_positive as ChikunguniyaPostive,
p.je_sample_tested as JETested, p.je_sample_positive as JEPositive,
p.meningococcal_sample_tested as MeningococcalTested, p.meningococcal_sample_positive
as MeningococcalPositive, p.typhoid_sample_tested as TyphoidTested,
p.typhoid_sample_positive as TyphoidPositive, p.diphtheria_sample_tested as DiptheriaTested,
p.diphtheria_sample_positive as DiptheriaPositive, p.cholera_sample_tested as CholeraTested,
p.cholera_sample_positive as CholeraPositive, p.shigella_sample_tested as ShigellaTested,
p.shigella_sample_positive as ShigellaPositive, p.hepatitis_a_sample_tested as
HepatitisATested, p.hepatitis_a_sample_positive as HepatitisAPositive,
p.hepatitis_b_sample_tested as HepatitisBTested, p.hepatitis_b_sample_positive as
HepatitisBPositive, p.leptospirosis_sample_tested as LeptospirosisTested,
p.leptospirosis_sample_positive as LeptospirosisPositive, p.malaria_sample_tested as
MalariaTested, p.malaria_sample_pv_positive as MalariaPVPositive,
p.malaria_sample_pf_positive as MalariaPFPositive from new_tbl_form_l2019 as p, state as s,
district as d where s.statecode=p.state_code and d.districtcode=p.district_code and required='Y'
order by s.statename,d.districtname

National level District wise P Form Data


select s.statename,d.districtname,p.weekno,p.acute_diarr_disease as AcuteDiarrhealDisease,
p.bacillary_dysentery as BacilaryDysentry,p.viral_hapatitis as ViralHepatitis,p.enteric_fever as
EntericFever,p.malaria as Malaria,p.dengu_dhf_dss as Dengue_DHF_DSS,p.chikungunia as
Chikunguniya,p.acute_encephalitis as AcuteEncephalitis,p.meningitis as Meningitis,p.measles
as Measles,p.diphtheria as Diptheria,p.pertussis as Pertusis,p.chicken_pox as
ChickenPox,p.fever_unknown as FeverofUnknownOrigin,p.acute_respiratory as
AcuteRespiratory,p.pneumonia as Pneumonia,p.leptospirosis as
Leptospirosis,p.acute_flaccid_paralysis as AcuteFilacidParalysis,p.dog_bite as
DogBite,p.snake_bite as SnakeBite from new_tbl_form_p2019 as p, state as s, district as d
where s.statecode=p.state_code and d.districtcode=p.district_code order by
s.statename,d.districtname

District code corrections


update district set districtcode='PRN' where districtcode='PER' and statecode='NL'
update district set districtcode='CHG' where districtcode='CRG' and statecode='AS'

update block set dis_code='PRN' where dis_code='PER' and st_code='NL'


update reporting_unit set dis_code='PRN' where dis_code='PER' and st_code='NL'
update reporting_unit set dis_code='PRN' where dis_code='PER' and st_code='NL'
update disease_outbreak set dis_code='PRN' where dis_code='PER' and st_code='NL'
update list_tbl_form_l set district_code='PRN' where district_code='PER' and state_code='NL'
update master_table set districtcode='PRN' where districtcode='PER' and statecode='NL'
update spl_login_status set district_code='PRN' where district_code='PER' and state_code='NL'
update tbl_hrd set districtcode='PRN' where districtcode='PER' and statecode='NL'

update tbl_form_s2022 set district_code='PRN' where district_code='PER' and state_code='NL'


update new_tbl_form_p2022 set district_code='PRN' where district_code='PER' and
state_code='NL'
update new_tbl_form_l2022 set district_code='PRN' where district_code='PER' and
state_code='NL'

Update columns from one table to another table


UPDATE ihip_master250324 SET pmg_latitude = pmgati_p.latitude,pmg_longitude =
pmgati_p.longitude FROM pmgati_p WHERE ihip_master250324.facility_nin = pmgati_p.nin
UPDATE ihip_master250324 SET pmg_latitude = pmgati_s.aam_latitude,pmg_longitude =
pmgati_s.aam_longitude FROM pmgati_s WHERE ihip_master250324.facility_nin =
pmgati_s.nin_id

(For week no 52/53 issue) - S Form


select state_code,weekno,dt_week_from,mdate from tbl_form_s2022 where weekno>=52 and
extract(year from dt_week_from)=extract(year from mdate) and state_code not in ('KL','WB')
order by state_code
(For week no 52/53 issue) - P/L Form
select state_code,weekno,reporting_week_from,mdate from new_tbl_form_l2020 where
weekno>52 and extract(year from reporting_week_from)=extract(year from mdate) order by
state_code

delete from tbl_form_s2022 where weekno>=52 and extract(year from


dt_week_from)=extract(year from mdate) and state_code not in ('KL','WB')

With Thanks
Ajay Kumar, Consultant (IT)
IDSP, NCDC, 22 Shamnath Marg, Delhi - 110 054 |+91-011-23992206
Please think about your environment before printing this email.
Disclaimer: This e-mail and its attachments may contain official Indian Government information. If you are not the intended recipient, please
notify the sender immediately and delete this e-mail. Any dissemination or use of this information by a person other than the intended
recipient is unauthorized. The responsibility lies with the recipient to check this email and any attachment for the presence of viruses.

IDSP backup path


D:\ICT Component\Backup_Source_Code
IHIP Chart API for NCDC Website
curl https://ihip.mohfw.gov.in/idsp-api/v1/idspdiseasedata --header 'Authorization: Basic' -u
"ncdcihip01:nview@005"

Cloud Support 011-24305000 Extension: 62005/62062

Additional entries for VPN request

Server IP Location of Server Port Website/URL of Servers


10.247.255.206 NDCSP 443,8444 https://portal.webcloud3.nic.in
10.247.225.221 NDCSP 443 https://monitor.webcloud3.nic.in

For configuring different php versions in single apache

https://psujit775.medium.com/how-to-install-multiple-php-versions-with-apache-on-ubuntu-
b37cd23d3019#:~:text=To%20run%20multiple%20versions%20of%20PHP%20simultaneously
%20on%20Apache%2C%20you,for%20a%20particular%20virtual%20host.

With Thanks
Ajay Kumar, Consultant (IT)
IDSP, NCDC, 22 Shamnath Marg, Delhi - 110 054 |+91-11-23992206
कागज़ बचाएं!!! वृक्ष बचाएं!!! पर्यावरण बचाएं!!!
Disclaimer: This e-mail and its attachments may contain official Indian Government information. If you are not the intended recipient, please
notify the sender immediately and delete this e-mail. Any dissemination or use of this information by a person other than the intended recipient is
unauthorized. The responsibility lies with the recipient to check this email and any attachment for the presence of viruses.

1. Cross site scripting(XSS) - Patched


2. Vulnerable and Outdated Components - Patched
3. Misconfigured Cookie Attributes - Being Patched

4. Lack of security headers - Being Patched (https://webdock.io/en/docs/how-guides/security-


guides/how-to-configure-security-headers-in-nginx-and-apache#:~:text=The%20Content
%2DSecurity%2DPolicy%20header,to%20load%20on%20the%20website.)
5. SSL with weak cipher suites - Patched
6. Domain Access via IP Address - Patched
7. Host Header Attack - Patched
8. Server Version/Banner Disclosure - Patched
9. Email Harvesting - Patched
10. Insecure HTTP methods enabled - Patched

https://geekflare.com/apache-web-server-hardening-security/
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
Header set X-XSS-Protection "1; mode=block"

https://www3.ntu.edu.sg/home/ehchua/programming/howto/Apache_HowToConfigure.html

1. Type du -a /dir/ | sort -n -r | head -n 20 for estimating the folder size

E File No 8083589 for VC equipment at 4th Floor


With Thanks
Ajay Kumar, Consultant (IT)
IDSP, NCDC, 22 Shamnath Marg, Delhi - 110 054 |+91-9968275024
कागज़ बचाएं!!! वृक्ष बचाएं!!! पर्यावरण बचाएं!!!
Disclaimer: This e-mail and its attachments may contain official Indian Government information. If you are not the intended recipient, please
notify the sender immediately and delete this e-mail. Any dissemination or use of this information by a person other than the intended recipient is
unauthorized. The responsibility lies with the recipient to check this email and any attachment for the presence of viruses.

After installing R (shinny server)


https://www.rstudio.com/products/shiny/download-server/redhat-centos/

Configuration
https://docs.rstudio.com/shiny-server/#default-configuration

https://lsmgr.email.gov.in/accounts/login/?next=/postorius/lists/

select year_add from reporting_unit where to_number(year_add, '9999')=2011

pg_restore --create --dbname=postgres --username postgres 12-11-2020.sql

Command prompt pg_restore --dbname IDSP --username postgres D:\27-02-2022.sql

dropdb -U postgres idsp && pg_restore --create --dbname=IDSP --username postgres 12-11-
2020.sql

Statewise list of all disease with district name, block name, reporting name
select s.statename,d.districtname,b.bl_name,r.reporting_name,r.reporting_code,p.* from
new_tbl_form_p2020 as p, state as s, district as d, block as b, reporting_unit as r where
s.statecode=p.state_code and d.districtcode=p.district_code and b.bl_code=p.block_code and
r.reporting_code=p.reporting_unit and p.required='Y' and p.state_code='AP'

Statewise reported RUs


select s.statename,p.weekno,count(p.reporting_unit) from tbl_form_s2018 as p, state as s
where p.state_code=s.statecode group by s.statename,p.weekno

https://support.hp.com/us-en/drivers/selfservice/hp-laserjet-p3005-printer-series/1846088/
model/1846099

With Thanks
Ajay Kumar, Consultant (IT)
IDSP, NCDC, 22 Shamnath Marg, Delhi - 110 054 |+91-011-23935532
Please think about your environment before printing this email.
Disclaimer: This e-mail and its attachments may contain official Indian Government information. If you are not the intended recipient, please
notify the sender immediately and delete this e-mail. Any dissemination or use of this information by a person other than the intended
recipient is unauthorized. The responsibility lies with the recipient to check this email and any attachment for the presence of viruses.

Check Size of tables


select table_name, pg_size_pretty( pg_relation_size(quote_ident(table_name)) )
from information_schema.tables
where table_schema = 'public'
order by pg_relation_size(quote_ident(table_name)) desc

Check size of Database


SELECT pg_size_pretty( pg_database_size('dbname') );

Check size of Single table


SELECT pg_size_pretty( pg_total_relation_size('tablename') );

Check number of records in tables


SELECT relname as TableName,n_live_tup as RecordCount FROM pg_stat_user_tables
ORDER BY n_live_tup DESC;

https://stackoverflow.com/questions/2732474/restore-a-postgres-backup-file-
using-the-command-line

You might also like