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,[Link] 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=[Link] and dpl_status='Y' and required='Y' and onoff is null and
r.st_code='TL' order by r.st_code,[Link]
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 [Link],[Link],[Link],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 [Link]=p.state_code and [Link]=p.district_code and required='Y'
order by [Link],[Link]
National level District wise P Form Data
select [Link],[Link],[Link],p.acute_diarr_disease as AcuteDiarrhealDisease,
p.bacillary_dysentery as BacilaryDysentry,p.viral_hapatitis as ViralHepatitis,p.enteric_fever as
EntericFever,[Link] as Malaria,p.dengu_dhf_dss as Dengue_DHF_DSS,[Link] as
Chikunguniya,p.acute_encephalitis as AcuteEncephalitis,[Link] as Meningitis,[Link]
as Measles,[Link] as Diptheria,[Link] as Pertusis,p.chicken_pox as
ChickenPox,p.fever_unknown as FeverofUnknownOrigin,p.acute_respiratory as
AcuteRespiratory,[Link] as Pneumonia,[Link] 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 [Link]=p.state_code and [Link]=p.district_code order by
[Link],[Link]
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 [Link] --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
[Link] NDCSP 443,8444 [Link]
[Link] NDCSP 443 [Link]
For configuring different php versions in single apache
[Link]
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 ([Link]
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
[Link]
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
Header set X-XSS-Protection "1; mode=block"
[Link]
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)
[Link]
Configuration
[Link]
[Link]
select year_add from reporting_unit where to_number(year_add, '9999')=2011
pg_restore --create --dbname=postgres --username postgres [Link]
Command prompt pg_restore --dbname IDSP --username postgres D:\[Link]
dropdb -U postgres idsp && pg_restore --create --dbname=IDSP --username postgres 12-11-
[Link]
Statewise list of all disease with district name, block name, reporting name
select [Link],[Link],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
[Link]=p.state_code and [Link]=p.district_code and b.bl_code=p.block_code and
r.reporting_code=p.reporting_unit and [Link]='Y' and p.state_code='AP'
Statewise reported RUs
select [Link],[Link],count(p.reporting_unit) from tbl_form_s2018 as p, state as s
where p.state_code=[Link] group by [Link],[Link]
[Link]
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;
[Link]
using-the-command-line