Posts

Showing posts from March, 2020
Radial Guage custom comopnent <RadialGauge    minValue={0}     maxValue={360}     majorTicks={["N","NE","E","SE","S","SW","W","NW","N"]} minorTicks={22} ticksAngle={360}     startAngle={180}     strokeTicks={false}     highlights={false}     colorPlate={"#33a"}     colorMajorTicks={"#f5f5f5"}     colorMinorTicks={"#ddd"}     colorNumbers={"#ccc"}     colorNeedle={"rgba(240, 128, 128, 1)"} colorNeedleEnd={"rgba(255, 160, 122, .9)"}     valueBox={false}     valueTextShadow={false}    colorCircleInner={"#fff"}     colorNeedleCircleOuter={"#ccc"}     needle-circle-size="15"     data-needle-circle-outer="false"     data-animation-rule="linear"     data-needle-type="line"     data-needle-start="75"     data-needle-end="99"     data-ne...
svg creation html file  <svg width="60" height="200"> <defs> <linearGradient id="gradient_3" x1="0%" y1="0%" x2="0%" y2="100%" spreadMethod="pad"> <stop offset="0%" stop-color="#2868F1" stop-opacity="1"></stop> <stop offset="50%" stop-color="white" stop-opacity="1"></stop> <stop offset="100%" stop-color="#D1D3D7" stop-opacity="1"></stop> </linearGradient> </defs> <g><rect x="0" y="0" width="60" height="100%" fill="url(#gradient_3)"></rect></g> <g><line x1="0" y1="0" x2="60" y2="0" stroke-width="3" stroke="black"></line></g> <g><circle radius="10" y="0"/...
React APp  creation using webpack https://www.freecodecamp.org/news/part-1-react-app-from-scratch-using-webpack-4-562b1d231e75/ use babel-loader@7 file-loader for image loading css-loader & style-loader
Installing GDAL in windows https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows
NetCDF to PostGIS Script  Script # Import modules import psycopg2, time, datetime from scipy.io import netcdf # Establish connection db1 = psycopg2.connect("host=xxxx dbname=priogrid user=xxxx password=xxxx") cur = db1.cursor() # Create Table in postgis print str(time.ctime())+ " Creating precipud19002008 table." cur.execute("DROP TABLE IF EXISTS precipud19002008;") cur.execute("CREATE TABLE precipud19002008 (gid serial PRIMARY KEY not null, year int, month int, lon decimal, lat decimal, prec decimal);") # Read netcdf file using the netcdf_file class. 'r' for read. f = netcdf.netcdf_file('/mnt/pc258/prio_grid/source/ClimateData/precipud19002008.nc', 'r') # Create lathash. Read the f.variables['lat'].data.tolist() creates a list of lat coodinates. print str(time.ctime())+ " Looping through lat coords." temp = f.variables['lat'].data.tolist() # Create list of lat coords lathash = {} f...
Flux Tower Dashboard  URL's SERF DATA PORTAL  ::       https://serf.net.au/flux-tower/dashboard Soil Health Dashboard :::      https://soilhealth.dac.gov.in/NewHomePage/StateWiseNPKChart

System Security

Web Security  10 Web Security Vulnerabilities You Can Prevent Common Web Security Mistake #1: Injection flaws                                  Injection flaws result from a classic failure to filter untrusted input. It can happen when you pass unfiltered data to the SQL server (SQL injection), to the browser XSS – we’ll talk about this  later ), to the LDAP server (LDAP injection), or anywhere else.  Prevention:  The good news is that protecting against injection is “simply” a matter of filtering your input properly and thinking about whether an input can be trusted.    Common Web Security Mistake #2: Broken Authentication Common Web Security Mistake #3: Cross Site Scripting (XSS) https://www.sans.org/reading-room
Image
Simple Tips for PostgreSQL Query Optimization Explain analyze  One index per query Column order in a multicolumn index Filters + joins Add caption Reference :  https://statsbot.co/blog/postgresql-query-optimization/ Finding Slow Queries One obvious way to start with tuning is to find specific statements that are performing poorly. pg_stats_statements The pg_stats_statements module is a great place to start. It simply tracks execution statistics of SQL statements and can be an easy way to find poor performing queries.Once you have this module installed, a system view named pg_stat_statements will be available with all sorts of goodness. Once it has had a chance to collect a good amount of data, look for queries that have relatively high total_time value. Focus on these statements first.SELECT * FROM pg_stat_statements ORDER BY total_time DESC; auto_explain The auto_explain module is also helpful for finding slow queries but has 2 disti...