Help
RSS
API
Feed
Maltego
Contact
Domain > adl1995.github.io
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2018-04-03
151.101.45.147
(
ClassC
)
2024-08-24
185.199.109.153
(
ClassC
)
Port 80
HTTP/1.1 301 Moved PermanentlyConnection: keep-aliveContent-Length: 162Server: GitHub.comContent-Type: text/htmlpermissions-policy: interest-cohort()Location: https://adl1995.github.io/X-GitHub-Request-Id: 6A77:22A14C:3EC6C6A:4075879:66C991CAAccept-Ranges: bytesAge: 0Date: Sat, 24 Aug 2024 07:54:50 GMTVia: 1.1 varnishX-Served-By: cache-bfi-krnt7300049-BFIX-Cache: MISSX-Cache-Hits: 0X-Timer: S1724486091.771789,VS0,VE64Vary: Accept-EncodingX-Fastly-Request-ID: eea596b158d290c52c158918e3f298a5e82af222 html>head>title>301 Moved Permanently/title>/head>body>center>h1>301 Moved Permanently/h1>/center>hr>center>nginx/center>/body>/html>
Port 443
HTTP/1.1 200 OKConnection: keep-aliveContent-Length: 52495Server: GitHub.comContent-Type: text/html; charsetutf-8permissions-policy: interest-cohort()Last-Modified: Mon, 08 Jan 2024 03:45:19 GMTAccess-Control-Allow-Origin: *ETag: 659b6fcf-cd0fexpires: Sat, 24 Aug 2024 08:04:50 GMTCache-Control: max-age600x-proxy-cache: MISSX-GitHub-Request-Id: A9AE:22A14C:3EC6C78:4075883:66C991CAAccept-Ranges: bytesAge: 0Date: Sat, 24 Aug 2024 07:54:50 GMTVia: 1.1 varnishX-Served-By: cache-bfi-kbfi7400087-BFIX-Cache: MISSX-Cache-Hits: 0X-Timer: S1724486091.882299,VS0,VE71Vary: Accept-EncodingX-Fastly-Request-ID: 5f07f5968b35a063b36e87da7a885b218ea81c28 !DOCTYPE html>!--if IEMobile 7 >html classno-js iem7>!endif-->!--if lt IE 9>html classno-js lte-ie8>!endif-->!--if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)>!-->html classno-js langen>!--!endif-->head> meta charsetutf-8> title>/home/adeel/title> meta nameauthor contentAdeel Ahmad> !-- http://t.co/dKP3o1e --> meta nameHandheldFriendly contentTrue> meta nameMobileOptimized content320> meta nameviewport contentwidthdevice-width, initial-scale1> link hrefhttps://adl1995.github.io/favicon.png relicon> link hrefhttps://adl1995.github.io/theme/css/main.css mediascreen, projection relstylesheet typetext/css> script srchttps://adl1995.github.io/theme/js/modernizr-2.0.js>/script> script srchttps://adl1995.github.io/theme/js/ender.js>/script> script srchttps://adl1995.github.io/theme/js/octopress.js typetext/javascript>/script> link hrefhttp://fonts.googleapis.com/css?familyPT+Serif:regular,italic,bold,bolditalic relstylesheet typetext/css> link hrefhttp://fonts.googleapis.com/css?familyPT+Sans:regular,italic,bold,bolditalic relstylesheet typetext/css>/head>body> header rolebanner>hgroup> h1>a hrefhttps://adl1995.github.io/>/home/adeel/a>/h1>/hgroup>/header> nav rolenavigation>ul classsubscription data-subscriptionrss>/ul>ul classmain-navigation> li>a href/about-me.html>About me/a>/li> li>a href/wanderings>Wanderings/a>/li> li>a href/personal/resume.pdf>Résumé/a>/li>/ul>/nav> div idmain> div idcontent>div classblog-index> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/the-two-factor-authentication-system-at-cern.html>The Two-Factor Authentication System at CERN/a> /h1> p classmeta>time datetime2024-01-08T08:42:00+01:00 pubdate>Mon 08 January 2024/time>/p>/header> div classentry-content>p>This blog post is a summary of my project at the European Organization for Nuclear Research (span classcaps>CERN/span>) where I worked in their Identity and Access Management (span classcaps>IAM/span>) team./p>p>My project was to introduce Two-Factor Authentication (span classcaps>2FA/span>) in the Keycloak system. span classcaps>CERN/span> started migration to the Keycloak Identity Provider (IdP) as part of the span classcaps>MALT/span> project which aimed to move away from Microsoft products. The project was a hrefhttps://home.cern/news/news/computing/three-year-malt-project-comes-close>cancelled/a> in late 2021, however, some services were allowed to continue development. The span classcaps>IAM/span> team was allowed to continue development for the span classcaps>CERN/span> span classcaps>SSO/span>, which was based on Keycloak./p>p>We developed a custom span classcaps>2FA/span> implementation with Keycloak which allowed users to optionally login from the span classcaps>SSO/span> login page. Internally, this setup posed a few …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/the-two-factor-authentication-system-at-cern.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/rate-limiting-in-haproxy-and-nginx.html>Rate limiting in HAProxy and Nginx/a> /h1> p classmeta>time datetime2023-05-29T18:00:00+02:00 pubdate>Mon 29 May 2023/time>/p>/header> div classentry-content>p>Rate-limiting is a common strategy for safe guarding a server from potential DDoS attacks or sudden peaks in network traffic. Rate-limiting instructs the server to block requests from certain span classcaps>IP/span> addresses that are sending an unusual number of requests to the system./p>p>We can apply rate-limiting to both Nginx and HAProxy. Nginx runs on each end node hosting the service, while HAProxy serves as the load-balancer and distributes incoming requests among available nodes. This post describes how to rate-limit requests on both Nginx and HAProxy and shows how to whitelist IPs and rate-limit a single span classcaps>URL/span>. The final section shows how to apply this configuration in Puppet./p>h2>1. Rate-limiting in HAProxy/h2>p>This section describes how to configure HAProxy to rate-limit …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/rate-limiting-in-haproxy-and-nginx.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/creating-a-json-logger-for-flask.html>Creating a JSON logger for Flask/a> /h1> p classmeta>time datetime2022-08-09T21:30:00+02:00 pubdate>Tue 09 August 2022/time>/p>/header> div classentry-content>p>By default Flask writes logs to the console in plain-text format. This can be limiting if you intend to store your logs in a text file and periodically send them to a central monitoring service. For example, a hrefhttps://www.elastic.co/kibana/>Kibana/a>, only accepts span classcaps>JSON/span> logs by default./p>p>You might also want to enrich your logs with additional metadata, e.g. timestamps, method names, log type (Warn, Debug, etc.). In this post we will use the Python a hrefhttps://docs.python.org/3/library/logging.html>logging/a> library to modify Flask’s logging format and write them to a text file. In the end we will see how to periodically send these logs to an external service using a hrefhttps://flume.apache.org/>Flume/a>./p>p>In our app we would like to setup two types of loggers. One for …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/creating-a-json-logger-for-flask.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/my-course-portfolio-for-computational-photography.html>My course portfolio for Computational Photography/a> /h1> p classmeta>time datetime2022-04-15T14:22:00+02:00 pubdate>Fri 15 April 2022/time>/p>/header> div classentry-content>p>This semester I took Georgia Tech’s a hrefhttps://omscs.gatech.edu/cs-6475-computational-photography>Computational Photography/a> course. It was a very hands-on course, mostly comprising of assignments and projects. This post includes the results for all its assignments and projects./p>h2>1. Pyramid blending/h2>p>The goal of this assignment was to combine two separate images into a seamlessly blended image, using a mask. The input took a left image, a right image, and a mask, which was a binary image used to overlap the two inputs./p>p>img altPyramid blending srchttps://adl1995.github.io/images/portfolio/pyramid_blending.png>/p>h2>2. Panoramas/h2>p>For this assignment we wrote code to align span classamp>&/span> stitch together a series of images into a panorama. We followed the text from a hrefhttp://szeliski.org/Book/1stEdition.htm>Computer Vision: Algorithms and Applications/a> book. The assignment followed homography techniques to create the output picture./p>p aligncenter> img srchttps://adl1995.github.io/images/portfolio/panorama_1.jpg altpanorama_1 stylewidth:350px;/> img srchttps://adl1995.github.io/images/portfolio/panorama_2.jpg altpanorama_2 stylewidth:350px;/> img srchttps://adl1995.github.io/images/portfolio/panorama_3.jpg altpanorama_3 stylewidth:350px;/>/p>p>After stitching …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/my-course-portfolio-for-computational-photography.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/building-a-camera-obscura.html>Building a Camera Obscura/a> /h1> p classmeta>time datetime2022-01-29T11:02:00+01:00 pubdate>Sat 29 January 2022/time>/p>/header> div classentry-content>p>A a hrefhttps://en.wikipedia.org/wiki/Camera_obscura>camera obscura/a> is the predecessor of modern day cameras. It works by letting light in through a small pinhole and projects it onto a surface (e.g. a wall)./p>p>To build a room obscura we need to choose a room which gets plenty of sunlight. I chose my bedroom for this./p>p>img altscene srchttps://adl1995.github.io/images/obscura/scene.jpg>/p>p>Next we need to identify all the sources of light and completely seal them. In my case I used garbage bags to cover my two windows./p>p aligncenter> img srchttps://adl1995.github.io/images/obscura/setup_2.jpg altsetup_2 stylewidth:350px;/> img srchttps://adl1995.github.io/images/obscura/setup_3.jpg altsetup_3 stylewidth:350px;/>/p>p>I used packing tape instead of duct tape as it can tear off paint from the wood. However, this led to some light bleeding in from the edges. I fixed this using aluminum foil./p>p>img altfailed srchttps://adl1995.github.io/images/obscura/failed.jpg>/p>p>I experimented with three pinholes of various sizes …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/building-a-camera-obscura.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/passwordless-logins-with-yubikey.html>Passwordless logins with Yubikey/a> /h1> p classmeta>time datetime2020-11-29T07:50:00+01:00 pubdate>Sun 29 November 2020/time>/p>/header> div classentry-content>p>Yubikey is currently the de facto device for span classcaps>U2F/span> authentication. It enables adding an extra layer of security on top of span classcaps>SSH/span>, system login, signing span classcaps>GPG/span> keys, and so on. It is also compatible with several other authentication methods, such as WebAuthn and span classcaps>PAM/span>./p>p>This post will show how to leverage your Yubikey for unlocking the system lock-screen, both with and without using a password. It will then delve into how to automatically lock the screen when the Yubikey is unplugged./p>p>To achieve logins with Yubikeys we require a span classcaps>PAM/span> configuration. span classcaps>PAM/span> or Pluggable Authentication Modules define the authentication flow for common Linux utilities, such as code>sudo/code>, code>su/code>, and code>passwd/code>. We will override the default authentication flow for the a hrefhttps://linux.die.net/man/1/xlock>xlock …/a>/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/passwordless-logins-with-yubikey.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/plotting-graphical-data-using-rrdtool-and-a-python-collectd-plugin.html>Plotting graphical data using RRDtool and a Python Collectd plugin/a> /h1> p classmeta>time datetime2020-05-11T11:02:00+02:00 pubdate>Mon 11 May 2020/time>/p>/header> div classentry-content>!-- Date: 2019-05-30 07:57 -->!-- Title: Using RRDtool and a Python Collectd plugin to graph weather data -->!-- Title: Plotting graphs data from a Python Collectd plugin using RRDtool -->p>Collectd is Unix daemon used for periodically collecting system usage statistics, which can include identifying span classcaps>CPU/span> or memory bottleneck issues. The collected data can then be transformed to graphs using a hrefhttps://oss.oetiker.ch/rrdtool>RRDtool/a> or a a hrefhttps://en.wikipedia.org/wiki/Grafana>Grafana/a> dashboard (Grafana provides real time graphs and complex search queries)./p>p>The daemon itself is modular and functions through external plugins with each plugin performing a distinct function. This post will explore a plugin which em>collects weather information of a given city/em>. The first section will explain how the plugin configuration works and how to plot a graph of the output data using RRDtool. Finally, we will delve into the plugin internals and see how it is written./p>blockquote>p>Note: For an intro on how to setup Collectd …/p>/blockquote>/div> footer> a relfull-article hrefhttps://adl1995.github.io/plotting-graphical-data-using-rrdtool-and-a-python-collectd-plugin.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/the-kerberos-authentication-system-for-single-sign-on-sso.html>The Kerberos Authentication System for Single Sign-On (SSO)/a> /h1> p classmeta>time datetime2019-07-21T21:43:00+02:00 pubdate>Sun 21 July 2019/time>/p>/header> div classentry-content>p>When working with authentication protocols the commonly used technique in the past was known as em>authentication by assertion/em>. In this scheme a user logs in to their machine which then authenticates their request to a remote server. Once the authentication is finished the user can then communicate with other services. This provides a very low level of security, which has led to numerous vulnerabilities in the early versions of the a hrefhttps://en.wikipedia.org/wiki/Berkeley_r-commands#Security>rlogin/a> Unix login utility./p>p>An alternative solution is for the user to repeatedly provide their password each time they wish to use a service. This however requires the user to send their plain text password over the network, which could potentially be intercepted by a third-party user and can get …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/the-kerberos-authentication-system-for-single-sign-on-sso.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/programmatically-organising-your-backpacking-trip-using-google-my-maps.html>Programmatically organising your backpacking trip using Google My Maps/a> /h1> p classmeta>time datetime2019-05-30T09:14:00+02:00 pubdate>Thu 30 May 2019/time>/p>/header> div classentry-content>blockquote>p>This blog post has been converted from a a hrefhttps://docs.google.com/presentation/d/10NlBmnUk7qsh0nPso3Lqg8OvoP6CZg8sHJx1gllHem4/edit#slideid.g577465d654_0_0>presentation/a> I gave during the a hrefhttps://indico.cern.ch/event/771113/overview>Thematic span classcaps>CERN/span> School of Computing 2019/a>./p>/blockquote>p>When planning a journey to a new country or a city it helps to mark down all the places you would like to visit and eventually create a travel plan for each day. I personally use Google Maps for finding places of interest including historical buildings, museums, and libraries. As an example, if I was to visit say Split, Croatia I could search for “places to visit split” on Google Maps. It will then list all the attractions based on features such as reviews and popularity./p>p aligncenter> img srchttps://adl1995.github.io/images/google-my-maps/things-to-do-split.png altThings to do in Split stylewidth:300px;/>/p>p>Although it is possible to individually “Save” each place in Google Maps, it does not …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/programmatically-organising-your-backpacking-trip-using-google-my-maps.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/building-rpm-packages-with-rpmbuild-koji-and-gitlab-ci.html>Building RPM packages with rpmbuild, Koji, and GitLab-CI/a> /h1> p classmeta>time datetime2019-05-06T08:24:00+02:00 pubdate>Mon 06 May 2019/time>/p>/header> div classentry-content>p>The span classcaps>RPM/span> system facilitates the user to query and update a software package. It also allows examining package interdependencies, and verifying package file permissions. This blog post will describe the process of building an span classcaps>RPM/span> package using the code>rpmbuild/code> utility and will then explain how to schedule build tasks using Koji. Finally, it will describe how to automate the build pipeline using continuous integration in GitLab./p>h3>1. span classcaps>RPM/span> Package Manager/h3>p>span classcaps>RPM/span> Package Manager is an open-source package management system which was originally designed for Red Hat Linux, but it is now supported on most Linux distributions. span classcaps>RPM/span> packages can generally be of two types:/p>ul>li>Binary span classcaps>RPM/span>: A binary span classcaps>RPM/span> contains the compiled binary of a complete application (or a library …/li>/ul>/div> footer> a relfull-article hrefhttps://adl1995.github.io/building-rpm-packages-with-rpmbuild-koji-and-gitlab-ci.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/google-summer-of-code-2018-final-evaluation-report.html>Google Summer of Code 2018 final evaluation report/a> /h1> p classmeta>time datetime2018-08-09T09:28:00+02:00 pubdate>Thu 09 August 2018/time>/p>/header> div classentry-content>h4>Link to GitHub repository: a hrefhttps://github.com/BoostGSoC18/geometry>code>https://github.com/BoostGSoC18/geometry/code>/a>/h4>p>The work is present under the following branches:/p>ul>li>a hrefhttps://github.com/BoostGSoC18/geometry/tree/feature/geodesic_direct>feature/geodesic_direct/a>/li>li>a hrefhttps://github.com/BoostGSoC18/geometry/tree/feature/karney_inverse>feature/karney_inverse/a>/li>li>a hrefhttps://github.com/BoostGSoC18/geometry/tree/example/distance_formula>example/distance_formula/a>/li>/ul>h3>Summary/h3>p>The goal of this project was to implement the direct and inverse geodesic algorithms in the a hrefhttps://github.com/boostorg/geometry>Boost Geometry/a> library. These methods were proposed by Charles Karney in his a hrefhttps://arxiv.org/abs/1109.4448>paper/a> in 2011./p>p>In a previous a hrefhttps://adl1995.github.io/inaccuracy-in-boost-geometry-geodesic-algorithms-for-nearly-antipodal-points.html>blog post/a>, the inaccuracy of the existing methods was discussed, which provided inconsistent results for nearly antipodal points. To monitor the progress, a weekly a hrefhttps://github.com/BoostGSoC18/geometry/issues/1>report/a> was provided through GitHub, which summarized the work done. Finally, a hrefhttps://github.com/BoostGSoC18/geometry/issues/3>benchmarks/a> were performed against existing methods in Boost Geometry. The performance metric used was execution time and accuracy./p>p>Additional material, such as utility scripts for parsing the …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/google-summer-of-code-2018-final-evaluation-report.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/using-variadic-templates-with-lambda-expressions-in-c-for-constrained-optimization.html>Using variadic templates with lambda expressions in C++ for constrained optimization/a> /h1> p classmeta>time datetime2018-06-01T15:44:00+02:00 pubdate>Fri 01 June 2018/time>/p>/header> div classentry-content>p>Constrained optimization problems are encountered in numerous domains, such as a hrefhttps://www.princeton.edu/~fhs/paper199/paper199.pdf>protein folding/a>, a hrefhttp://cai2r.net/public/documents/FlorianKnoll_thesis.pdf>Magnetic Resonance Image reconstruction/a>, and a hrefhttps://ieeexplore.ieee.org/document/4100822>radiation therapy/a>. In this problem, we are given with an objective function which is to be minimized or maximized with respect to constraints on some variables. The constraints can either be soft constraints or hard constraints, which can be specified by boolean operators, such as equality, relational, and conditional operators. /p>p>This post provides insight on how to model constraints using lambda expressions, and how to pass a varying number of constraints to a function using variadic templates. Before moving on with the C++ implementation, it will be helpful to review how variadic functions are used in C and how they differ from the …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/using-variadic-templates-with-lambda-expressions-in-c-for-constrained-optimization.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/inaccuracy-in-boost-geometry-geodesic-algorithms-for-nearly-antipodal-points.html>Inaccuracy in Boost Geometry geodesic algorithms for nearly antipodal points/a> /h1> p classmeta>time datetime2018-05-10T21:55:00+02:00 pubdate>Thu 10 May 2018/time>/p>/header> div classentry-content>p>Nearly antipodal points or antipodes refer to the most geographically distant points on a sphere, that is, the points are diametrically opposite to each other. If a line is drawn between these two points, it passes through the center of the sphere and forms its diameter./p>p>Computing the great circle distance between these two points is often a corner case for most geodesic computations, and the distance is either overestimated or underestimated. In case of a hrefhttps://en.wikipedia.org/wiki/Vincenty%27s_formulae>Vincenty’s formulae/a>, the solution fails to converge, or provides inaccurate results. This can have major implications in applications which rely on accurate results, such as flight navigation systems. The software can handle this either by doing an error analysis check and providing specific values …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/inaccuracy-in-boost-geometry-geodesic-algorithms-for-nearly-antipodal-points.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/an-overview-of-activation-functions-used-in-neural-networks.html>An overview of activation functions used in neural networks/a> /h1> p classmeta>time datetime2017-11-13T10:54:00+01:00 pubdate>Mon 13 November 2017/time>/p>/header> div classentry-content>p>An activation function is used to introduce non-linearity in an artificial neural network. It allows us to model a class label or score that varies non-linearly with independent variables. Non-linearity means that the output cannot be replicated from a linear combination of inputs; this allows the model to learn complex mappings from the available data, and thus the network becomes a a hrefhttps://en.wikipedia.org/wiki/Universal_approximation_theorem>universal approximator/a>. On the other hand, a model which uses a linear function (i.e. no activation function) is unable to make sense of complicated data, such as, speech, videos, etc. and is effective only up to a single layer./p>p>To allow backpropagation through the network, the selected activation function should be differentiable. This property is required to compute …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/an-overview-of-activation-functions-used-in-neural-networks.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/parallel-tile-fetching-and-cpu-and-memory-statistics.html>Parallel tile fetching and CPU-and-memory statistics/a> /h1> p classmeta>time datetime2017-09-09T10:58:00+02:00 pubdate>Sat 09 September 2017/time>/p>/header> div classentry-content>p>The a hrefhttp://hips.readthedocs.io>hips/a> package now supports parallel tile fetching. The user can achieve this either using the a hrefhttps://docs.python.org/3/library/urllib.html>urllib/a> or a hrefhttps://aiohttp.readthedocs.io/en/stable>aiohttp/a> package./p>p>In case of a hrefhttp://aiohttp.readthedocs.io/en/stable/>aiohttp/a>, the fetched tile data is coupled with a hrefhttp://hips.readthedocs.io/en/latest/api/hips.HipsTileMeta.html>code>HipsTileMeta/code>/a> to create a a hrefhttp://hips.readthedocs.io/en/latest/api/hips.HipsTile.html>code>HipsTile/code>/a> object. This ensures there is no misalignment of tile data, otherwise, tiles could get swapped during the drawing period./p>div classhighlight>pre>span>/span>code>span classk>async/span> span classk>def/span> span classnf>fetch_tile_aiohttp/span>span classp>(/span>span classn>url/span>span classp>:/span> span classnb>str/span>span classp>,/span> span classn>meta/span>span classp>:/span> span classn>HipsTileMeta/span>span classp>,/span> span classn>session/span>span classp>,/span> span classn>timeout/span>span classp>:/span> span classnb>float/span>span classp>)/span> span classo>->/span> span classn>HipsTile/span>span classp>:/span>span classw> /span>span classsd>"""Fetch a HiPS tile asynchronously using aiohttp."""/span> span classk>async/span> span classk>with/span> span classn>session/span>span classo>./span>span classn>get/span>span classp>(/span>span classn>url/span>span classp>,/span> span classn>timeout/span>span classo>/span>span classn>timeout/span>span classp>)/span> span classk>as/span> span classn>response/span>span classp>:/span> span classn>raw_data/span> span classo>/span> span classk>await/span> span classn>response/span>span classo>./span>span classn>read/span>span classp>()/span> span classk>return/span> span classn>HipsTile/span>span classp>(/span>span classn>meta/span>span classp>,/span> span classn>raw_data/span>span classp>)/span>/code>/pre>/div>p>We also limit the amount of simultaneously open connections using a hrefhttp://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.TCPConnector>code>aiohttp.TCPConnector/code>/a> class. The returned object is passed to a hrefhttp://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ClientSession>code>aiohttp.ClientSession/code>/a>‘s code>__init__/code> method. This procedure can be understood in …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/parallel-tile-fetching-and-cpu-and-memory-statistics.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/google-summer-of-code-2017-final-evaluation-report.html>Google Summer of Code 2017 final evaluation report/a> /h1> p classmeta>time datetime2017-08-28T22:35:00+02:00 pubdate>Mon 28 August 2017/time>/p>/header> div classentry-content>h4>Link to GitHub repository: a hrefhttp://github.com/hipspy/hips>code>http://github.com/hipspy/hips/code>/a>/h4>p>In addition to the main a hrefhttp://github.com/hipspy/hips>hips/a> repository, I also maintained my personal a hrefhttps://github.com/adl1995/HIPS-to-Py>span classcaps>HIPS/span>-to-Py repository on GitHub/a>. This contains Jupyter notebooks which showcase the functionality in a hrefhttp://github.com/hipspy/hips>hips/a> and numerous related Python scripts. The a hrefhttps://github.com/adl1995/HIPS-to-Py/wiki/HiPS-to-Py>Wiki page/a> contains a short description on hips. It also contains links to resource documents and telcon notes, which are hosted on Google Docs. /p>h4>List of Pull Requests/h4>h6>Work related with HiPS tile drawing/h6>ul>li>a hrefhttps://github.com/hipspy/hips/pull/105>Add progress bar support for fetching and drawing HiPS tiles/a>/li>li>a hrefhttps://github.com/hipspy/hips/pull/104>Add reporting functionality for HipsPainter/a>/li>li>a hrefhttps://github.com/hipspy/hips/pull/99>Introduce precise drawing algorithm/a>/li>li>a hrefhttps://github.com/hipspy/hips/pull/75>Add methods for drawing markers over sky image/a>/li>li>a hrefhttps://github.com/hipspy/hips/pull/91>Introduce class HipsDrawResult in simple.py/a>/li>li>a hrefhttps://github.com/hipspy/hips/pull/89>Add method to_split in SimpleTilePainter for checking whether to split a …/a>/li>/ul>/div> footer> a relfull-article hrefhttps://adl1995.github.io/google-summer-of-code-2017-final-evaluation-report.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/fixing-tile-distortion-issue-in-hips-package.html>Fixing tile distortion issue in hips package/a> /h1> p classmeta>time datetime2017-08-10T11:28:00+02:00 pubdate>Thu 10 August 2017/time>/p>/header> div classentry-content>p>As documented in the a hrefhttp://hips.readthedocs.io/en/latest/drawing_algo.html#tile-distortion-issue>tile distortion issue/a> section, the previous technique for drawing HiPS tiles brings some astrometry offsets for distorted tiles./p>p>An example of such distortions can be viewed at this link (uncheck “Activate deformations reduction algorithm” to view the astrometry offsets): a hrefhttp://cds.unistra.fr/~boch/AL/test-reduce-deformations2.html>http://cds.unistra.fr/~boch/span classcaps>AL/span>/test-reduce-deformations2.html/a>/p>p>To overcome this issue, the parent tile is divided into four children tiles if it meets the following two criteria:/p>ul>li>One edge is greater than 300 pixels when projected/li>li>Or, the ratio of smaller diagonal on larger diagonal is smaller than 0.7 and one of the diagonal is greater than 150 pixels when projected/li>/ul>p>For handling these checks, a function code>is_tile_distorted/code> is introduced:/p>div classhighlight>pre>span>/span>code>span classk>def/span> span classnf>is_tile_distorted/span>span classp>(/span>span classn>corners/span>span classp>:/span> span classnb>tuple/span>span classp>)/span> span classo>->/span> span classnb>bool …/span>/code>/pre>/div>/div> footer> a relfull-article hrefhttps://adl1995.github.io/fixing-tile-distortion-issue-in-hips-package.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/rgb-tile-drawing-in-hips-package.html>RGB tile drawing in hips package/a> /h1> p classmeta>time datetime2017-07-23T12:46:00+02:00 pubdate>Sun 23 July 2017/time>/p>/header> div classentry-content>p>The code>hips/code> package now supports span classcaps>RGB/span> tile drawing. To make this possible, the output image dimensions had to be altered according to the following configuration:/p>p>The output image shape is two dimensional for grayscale, and three dimensional for color images:/p>ul>li>code>shape (height, width)/code> for span classcaps>FITS/span> images with one grayscale channel/li>li>code>shape (height, width, 3)/code> for span classcaps>JPG/span> images with three span classcaps>RGB/span> channels/li>li>code>shape (height, width, 4)/code> for span classcaps>PNG/span> images with four span classcaps>RGBA/span> channels/li>/ul>p>In addition to this, in-case of span classcaps>JPG/span> and span classcaps>PNG/span> format, the tiles are flipped in the vertical direction, which leads to incorrect tile drawing using the previous technique. The figure below is taken from the a hrefhttp://www.ivoa.net/documents/HiPS/20160623/WD-HiPS-1.0-20160623.pdf>hips paper/a>, figure 6, which shows the inverted tiles./p>p>img altHiPS inverted tiles figure srchttps://adl1995.github.io/images/flipped-hips-tile.png>/p>p>To overcome this, the …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/rgb-tile-drawing-in-hips-package.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/parameterized-testing-using-pytest.html>Parameterized testing using Pytest/a> /h1> p classmeta>time datetime2017-07-13T09:40:00+02:00 pubdate>Thu 13 July 2017/time>/p>/header> div classentry-content>p>Pytest provides a feature for parameterized testing in Python. The built-in code>pytest.mark.parametrize/code> decorator enables parametrization of arguments for a test function. This allows the user to compare the values for input and output./p>p>Here is a typical example which shows its usage:/p>div classhighlight>pre>span>/span>code>span classn>get_hips_order_for_resolution_pars/span> span classo>/span> span classp>/span> span classnb>dict/span>span classp>(/span>span classn>tile_width/span>span classo>/span>span classmi>512/span>span classp>,/span> span classn>resolution/span>span classo>/span>span classmf>0.01232/span>span classp>,/span> span classn>resolution_res/span>span classo>/span>span classmf>0.06395791924665553/span>span classp>,/span> span classn>order/span>span classo>/span>span classmi>4/span>span classp>),/span> span classnb>dict/span>span classp>(/span>span classn>tile_width/span>span classo>/span>span classmi>256/span>span classp>,/span> span classn>resolution/span>span classo>/span>span classmf>0.0016022/span>span classp>,/span> span classn>resolution_res/span>span classo>/span>span classmf>0.003997369952915971/span>span classp>,/span> span classn>order/span>span classo>/span>span classmi>8/span>span classp>),/span> span classnb>dict/span>span classp>(/span>span classn>tile_width/span>span classo>/span>span classmi>128/span>span classp>,/span> span classn>resolution/span>span classo>/span>span classmf>0.00009032/span>span classp>,/span> span classn>resolution_res/span>span classo>/span>span classmf>0.00012491781102862408/span>span classp>,/span> span classn>order/span>span classo>/span>span classmi>13/span>span classp>),/span>span classp>/span>span classnd>@pytest/span>span classo>./span>span classn>mark/span>span classo>./span>span classn>parametrize/span>span classp>(/span>span classs1>'pars'/span>span classp>,/span> span classn>get_hips_order_for_resolution_pars/span>span classp>)/span>span classk>def/span> span classnf>test_get_hips_order_for_resolution/span>span classp>(/span>span classn>pars/span>span classp>):/span> span classn>hips_order/span> span classo>/span> span classn>_get_hips_order_for_resolution/span>span classp>(/span>span classn>pars/span>span classp>/span>span classs1>'tile_width'/span>span classp>,/span> span classn>pars/span>span classp>/span>span classs1>'resolution'/span>span classp>)/span> span classk>assert/span> span classn>hips_order/span> span classo>/span> span classn>pars/span>span classp>/span>span classs1>'order'/span>span classp>/span> span classn>hips_resolution/span> span classo>/span> span classn>hp/span>span classo>./span>span classn>nside2resol/span>span classp>(/span>span classn>hp/span>span classo>./span>span classn>order2nside/span>span classp>(/span>span classn>hips_order/span>span classp>))/span> span classn>assert_allclose/span>span classp>(/span>span classn>hips_resolution/span>span classp>,/span> span classn>pars/span>span classp>/span>span classs1>'resolution_res'/span>span classp>)/span>/code>/pre>/div>p>Without the support of parameterized testing, the code had to be duplicated three times …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/parameterized-testing-using-pytest.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/creating-custom-decorators-in-python-36.html>Creating custom decorators in Python 3.6/a> /h1> p classmeta>time datetime2017-07-02T12:41:00+02:00 pubdate>Sun 02 July 2017/time>/p>/header> div classentry-content>p>In the a hrefhttp://hips.readthedocs.io>hips/a> package, often data has to be fetched from remote servers, especially HiPS tiles. One way to cut back on the queries was by introducing the a hrefgithub.com/hipspy/hips-extra>hips-extra/a> repository. This contains HiPS tiles from various HiPS surveys. This allows us to quickly fetch tiles from local storage, which makes the testing process less time-consuming./p>p>As a hrefgithub.com/hipspy/hips-extra>hips-extra/a> repository does not come with the standard a hrefhttp://hips.readthedocs.io>hips/a> package, user has to manually clone it. The availability of the package is checked using an environment variable. This can be set using:/p>div classhighlight>pre>span>/span>code>span classnv>$export/span>span classw> /span>span classnv>HIPS_EXTRA/span>span classo>/span>span classse>\p/span>athspan classse>\t/span>ospan classse>\h/span>ips-extra/code>/pre>/div>p>In Python, the path can be retrieved using the code>os/code> module: code>os.environHIPS_EXTRA/code>. Now, what if the user does not have a hrefgithub.com/hipspy/hips-extra>hips-extra/a> repository …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/creating-custom-decorators-in-python-36.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/hips-tile-drawing.html>HiPS tile drawing/a> /h1> p classmeta>time datetime2017-06-24T11:50:00+02:00 pubdate>Sat 24 June 2017/time>/p>/header> div classentry-content>p>One of the major part of the a hrefhttp://hips.readthedocs.io>hips package/a> is being able to draw HiPS tiles onto a larger sky image. This involves using projective transformation for computing and drawing a HiPS tile at the correct location. The discussion below is for the tile containing the galactic center pixel values. To achieve this, several steps are involved./p>h3>Computing boundaries of a HiPS tile/h3>p>A tile is defined by four corners, a hrefhttp://hips.readthedocs.io>hips/a> uses the a hrefhttps://github.com/astropy/astropy-healpix/blob/3fcb80921f362e3620f9892e934d4f0f69b7bf21/astropy_healpix/high_level.py>astropy_healpix.HEALPix.boundaries_skycoord/a> function which returns the angle ($\theta$ and $\phi$) in radians wrapped inside a hrefhttp://docs.astropy.org/en/stable/api/astropy.coordinates.SkyCoord.html>astropy.coordinates.SkyCoord/a> class. This contains the four corners of a HiPS tile in the order (North, West, South, East). A snippet which computes the corners of a HiPS tile is provided …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/hips-tile-drawing.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/type-annotations-in-python-36-and-using-mypy-as-a-static-type-checker.html>Type annotations in Python 3.6 and using Mypy as a static type checker/a> /h1> p classmeta>time datetime2017-06-11T12:58:00+02:00 pubdate>Sun 11 June 2017/time>/p>/header> div classentry-content>p>The main goal of type annotations is to open up Python code for static analysis. It makes it easier to debug and maintain code because each type is explicitly stated. It also makes the code review process simpler as the parameters and return types can be inferred from the function header. These changes were introduced in a hrefhttps://www.python.org/dev/peps/pep-0484>span classcaps>PEP/span> 484/a>./p>p>In this regards, static type checking is the most important. It allows support for off-line third-party type checkers, such as Mypy, which will be introduced in a a href#static-type-checking-using-mypy>later section/a>./p>h3>Purpose of annotations/h3>p>The code>typing/code> module in Python 3.6 contains many definitions that are useful in statically typed code. For instance, the code>Any/code> type is used by default for every argument and …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/type-annotations-in-python-36-and-using-mypy-as-a-static-type-checker.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/an-overview-of-hierarchical-progressive-surveys-hips-and-the-healpix-framework.html>An overview of Hierarchical Progressive Surveys (HiPS) and the HEALPix framework/a> /h1> p classmeta>time datetime2017-05-31T19:39:00+02:00 pubdate>Wed 31 May 2017/time>/p>/header> div classentry-content>p>The a hrefhttps://www.aanda.org/articles/aa/pdf/2015/06/aa26075-15.pdf>Hierarchical Progressive Surveys (HiPS)/a> is a scheme for describing astronomical images and provides a solution for managing large amounts of data. Underneath, HiPS utilizes the HEALPix framework for mapping a sphere (in this case, part of a sky) and transforms it into a href#hips-tiles>HiPS tiles/a> and a href#hips-pixels>HiPS pixels/a> which contain the astronomical data. The HiPS scheme emphasizes on usability, and abstracts the scientific details to reach a wider audience. This can be further built upon for statistical analysis of large datasets. A brief overview of HEALPix is given below before moving onto the working of HiPS./p>h3>Introduction to HEALPix/h3>p>HEALPix, an acronym of ‘Hierarchical Equal Area isoLatitude Pixelization of a sphere’, is a framework for discretizing high resolution data. It …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/an-overview-of-hierarchical-progressive-surveys-hips-and-the-healpix-framework.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/an-introduction-to-coordinate-systems-used-in-astronomy.html>An introduction to coordinate systems used in Astronomy/a> /h1> p classmeta>time datetime2017-05-23T12:37:00+02:00 pubdate>Tue 23 May 2017/time>/p>/header> div classentry-content>p>From a hrefhttps://en.wikipedia.org/wiki/Coordinate_system>Wikipedia/a>:/p>blockquote>p>In a hrefhttps://en.wikipedia.org/wiki/Geometry titleGeometry>geometry/a>, a strong>coordinate system/strong> is a system which uses one or more a hrefhttps://en.wikipedia.org/wiki/Number titleNumber>numbers/a>, or strong>coordinates/strong>, to uniquely determine the position of the a hrefhttps://en.wikipedia.org/wiki/Point_(geometry) titlePoint (geometry)>points/a> or other geometric elements on a a hrefhttps://en.wikipedia.org/wiki/Manifold titleManifold>manifold/a> such as a hrefhttps://en.wikipedia.org/wiki/Euclidean_space titleEuclidean space>Euclidean space/a>./p>/blockquote>p>The following text briefly explains the coordinate systems being used in astronomy, some of which are listed below:/p>h3>strong>span classcaps>RA/span> / span classcaps>DEC/span>/strong>/h3>p>span classcaps>RA/span> (right ascension) and span classcaps>DEC/span> (declination) are the longitudes and latitudes of the sky. span classcaps>RA/span> corresponds to east / west direction, similar to longitude, while span classcaps>DEC/span> measures north / south directions, like latitude./p>h3>strong>span classcaps>WCS/span>/strong>/h3>p>World Coordinate System (span classcaps>WCS/span>) is a set of transformations that map pixel locations in an image to their real-world units, such as their position on the sky sphere. These transformations can …/p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/an-introduction-to-coordinate-systems-used-in-astronomy.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/a-comparison-of-response-times-using-urllib-grequests-and-asyncio.html>A comparison of response times using URLLib, GRequests, and asyncio/a> /h1> p classmeta>time datetime2017-05-09T15:54:00+02:00 pubdate>Tue 09 May 2017/time>/p>/header> div classentry-content>p>For the a hrefhttps://github.com/hipspy/hips>HiPS client/a> multiple tiles have to be fetched for time efficiency. To achieve this, we create a separate thread for each outgoing request. Thus, requests are sent concurrently. A comparison is done utilizing Python’s code>threading/code> library. The elapsed time is calculated using the code>time/code> module. For fetching the tiles code>urllib/code>, code>grequests/code>, code>aiohttp/code>, and code>asyncio/code> packages are used. The HiPS survey chosen for this comparison is code>alasky.u-strasbg.fr/code>. /p>p>For fetching 10 tiles, it takes the following time (in seconds):/p>div classhighlight>pre>span>/span>code>Elapsed Time URLLib (without concurrency): 3.5430831909179688Elapsed Time URLLib (with concurrency): 0.388397216796875Elapsed Time URLLib (with aiohttp): 0.3900480270385742Elapsed Time GRequests: 1.6238431930541992/code>/pre>/div>p>Similarly, for fetching 100 tiles, it takes:/p>div classhighlight>pre>span>/span>code>Elapsed Time URLLib (without concurrency …/code>/pre>/div>/div> footer> a relfull-article hrefhttps://adl1995.github.io/a-comparison-of-response-times-using-urllib-grequests-and-asyncio.html>Read On →/a> /footer> /article> article>header> h1 classentry-title> a hrefhttps://adl1995.github.io/my-first-article.html>My First Article/a> /h1> p classmeta>time datetime2017-03-19T22:45:00+01:00 pubdate>Sun 19 March 2017/time>/p>/header> div classentry-content>p>Hello World!/p>p>This blog will be extensively used for posting GSoC updates, apart from other technical ramblings./p>/div> footer> a relfull-article hrefhttps://adl1995.github.io/my-first-article.html>Read On →/a> /footer> /article>div classpagination> br />/div>/div>aside classsidebar> section> a hrefhttps://adl1995.github.io/archives.html>h1>Archives/h1>/a> /section> section> h1>Recent Posts/h1> ul idrecent_posts> li classpost> a hrefhttps://adl1995.github.io/the-two-factor-authentication-system-at-cern.html>The Two-Factor Authentication System at CERN/a> /li> li classpost> a hrefhttps://adl1995.github.io/rate-limiting-in-haproxy-and-nginx.html>Rate limiting in HAProxy and Nginx/a> /li> li classpost> a hrefhttps://adl1995.github.io/creating-a-json-logger-for-flask.html>Creating a JSON logger for Flask/a> /li> /ul> /section> section> h1>Categories/h1> ul idrecent_posts> li>a hrefhttps://adl1995.github.io/category/astronomy.html>Astronomy/a>/li> li>a hrefhttps://adl1995.github.io/category/automation.html>automation/a>/li> li>a hrefhttps://adl1995.github.io/category/gsoc.html>GSoC/a>/li> li>a hrefhttps://adl1995.github.io/category/image-processing.html>image-processing/a>/li> li>a hrefhttps://adl1995.github.io/category/machine-learning.html>Machine Learning/a>/li> li>a hrefhttps://adl1995.github.io/category/security.html>security/a>/li> /ul> /section> section> h1>Tags/h1> a hrefhttps://adl1995.github.io/tag/c.html>C++/a> /section> section> h1>Social/h1> ul> li>a hrefhttp://github.com/adl1995 target_blank>GitHub/a>/li> li>a hrefhttps://stackoverflow.com/users/4547264/adeel-ahmad target_blank>StackOverflow/a>/li> li>a hreffeeds/all.rss.xml target_blank>RSS/a>/li> /ul> /section>/aside> /div> /div> footer rolecontentinfo>p> Copyright © 2017-2023 - Adeel Ahmad - span classcredit>Powered by a hrefhttp://getpelican.com>Pelican/a>/span>/p>/footer> script typetext/javascript> var _gaq _gaq || ; _gaq.push(_setAccount, UA-116995793-1); _gaq.push(_trackPageview); (function() { var ga document.createElement(script); ga.type text/javascript; ga.async true; ga.src (https: document.location.protocol ? https://ssl : http://www) + .google-analytics.com/ga.js; var s document.getElementsByTagName(script)0; s.parentNode.insertBefore(ga, s); })(); (function(i,s,o,g,r,a,m){iGoogleAnalyticsObjectr;irir||function(){ (ir.qir.q||).push(arguments)},ir.l1*new Date();as.createElement(o), ms.getElementsByTagName(o)0;a.async1;a.srcg;m.parentNode.insertBefore(a,m) })(window,document,script,//www.google-analytics.com/analytics.js,ga); ga(create, UA-116995793-1); ga(send, pageview);/script> script typetext/javascript> var disqus_shortname adl1995githubio; (function() { var dsq document.createElement(script); dsq.type text/javascript; dsq.async true; dsq.src http:// + disqus_shortname + .disqus.com/embed.js; (document.getElementsByTagName(head)0 || document.getElementsByTagName(body)0).appendChild(dsq); })(); /script> script typetext/javascript> (function(i,s,o,g,r,a,m){iGoogleAnalyticsObjectr;irir||function(){ (ir.qir.q||).push(arguments)},ir.l1*new Date();as.createElement(o), ms.getElementsByTagName(o)0;a.async1;a.srcg;m.parentNode.insertBefore(a,m) })(window,document,script,https://www.google-analytics.com/analytics.js,ga); ga(create, UA-116995793-1, auto); ga(send, pageview); /script>/body>/html>
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]