This blog post is a summary of my project at the European Organization for Nuclear Research ( CERN ) where I worked in their Identity and Access Management ( IAM ) team. My project was to introduce Two-Factor Authentication ( 2FA ) in the Keycloak system. CERN started migration to the Keycloak Identity Provider (IdP) as part of the MALT project which aimed to move away from Microsoft products. The…
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 IP addresses that are sending an unusual number of requests to the system. We can apply rate-limiting to both Nginx and HAProxy. Nginx runs on each end node hosting the service, while HAProxy serves as the…
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, Kibana , only accepts JSON logs by default. 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…
This semester I took Georgia Tech s Computational Photography 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. 1. Pyramid blending 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…
A camera obscura 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). To build a room obscura we need to choose a room which gets plenty of sunlight. I chose my bedroom for this. 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. I…
Yubikey is currently the de facto device for U2F authentication. It enables adding an extra layer of security on top of SSH , system login, signing GPG keys, and so on. It is also compatible with several other authentication methods, such as WebAuthn and PAM . 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…
Collectd is Unix daemon used for periodically collecting system usage statistics, which can include identifying CPU or memory bottleneck issues. The collected data can then be transformed to graphs using RRDtool or a Grafana dashboard (Grafana provides real time graphs and complex search queries). The daemon itself is modular and functions through external plugins with each plugin performing a…
When working with authentication protocols the commonly used technique in the past was known as authentication by assertion . 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…
This blog post has been converted from a presentation I gave during the Thematic CERN School of Computing 2019 . 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…
The RPM 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 RPM package using the rpmbuild utility and will then explain how to schedule build tasks using Koji. Finally, it will describe how to automate the build pipeline using…
Link to GitHub repository: https://github.com/BoostGSoC18/geometry The work is present under the following branches: feature/geodesic_direct feature/karney_inverse example/distance_formula Summary The goal of this project was to implement the direct and inverse geodesic algorithms in the Boost Geometry library. These methods were proposed by Charles Karney in his paper in 2011. In a previous blog…
Constrained optimization problems are encountered in numerous domains, such as protein folding , Magnetic Resonance Image reconstruction , and radiation therapy . 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…
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. Computing the great circle distance between these two points is often a corner case for most geodesic computations, and the…
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 universal…
The hips package now supports parallel tile fetching. The user can achieve this either using the urllib or aiohttp package. In case of aiohttp , the fetched tile data is coupled with HipsTileMeta to create a HipsTile object. This ensures there is no misalignment of tile data, otherwise, tiles could get swapped during the drawing period. async def fetch_tile_aiohttp ( url : str , meta :…
Link to GitHub repository: http://github.com/hipspy/hips In addition to the main hips repository, I also maintained my personal HIPS -to-Py repository on GitHub . This contains Jupyter notebooks which showcase the functionality in hips and numerous related Python scripts. The Wiki page contains a short description on hips. It also contains links to resource documents and telcon notes, which are…
As documented in the tile distortion issue section, the previous technique for drawing HiPS tiles brings some astrometry offsets for distorted tiles. An example of such distortions can be viewed at this link (uncheck Activate deformations reduction algorithm to view the astrometry offsets): http://cds.unistra.fr/~boch/ AL /test-reduce-deformations2.html To overcome this issue, the parent tile is…
The hips package now supports RGB tile drawing. To make this possible, the output image dimensions had to be altered according to the following configuration: The output image shape is two dimensional for grayscale, and three dimensional for color images: shape = (height, width) for FITS images with one grayscale channel shape = (height, width, 3) for JPG images with three RGB channels shape =…
Pytest provides a feature for parameterized testing in Python. The built-in pytest.mark.parametrize decorator enables parametrization of arguments for a test function. This allows the user to compare the values for input and output. Here is a typical example which shows its usage: get_hips_order_for_resolution_pars = [ dict ( tile_width = 512 , resolution = 0.01232 , resolution_res =…
In the hips 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 hips-extra 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. As hips-extra repository does not come with the standard hips…
One of the major part of the hips package 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. Computing boundaries of a HiPS tile A tile is defined by four…
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 PEP 484 . In this regards, static type checking is the most important. It…
The Hierarchical Progressive Surveys (HiPS) 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 HiPS tiles and HiPS pixels which contain the astronomical data. The HiPS scheme emphasizes on usability, and abstracts the…
From Wikipedia : In geometry , a coordinate system is a system which uses one or more numbers , or coordinates , to uniquely determine the position of the points or other geometric elements on a manifold such as Euclidean space . The following text briefly explains the coordinate systems being used in astronomy, some of which are listed below: RA / DEC RA (right ascension) and DEC (declination)…
For the HiPS client 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 threading library. The elapsed time is calculated using the time module. For fetching the tiles urllib , grequests , aiohttp , and asyncio packages are used. The HiPS survey…