RSSAmplifier

Blog

/home/adeel

Notes on software, astronomy, machine learning, and infrastructure.

adl1995.github.ioRSS feed ↗26 posts

Latest posts

The Two-Factor Authentication System at CERN

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 in HAProxy and Nginx

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…

Creating a JSON logger for Flask

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…

My course portfolio for Computational Photography

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…

Building a Camera Obscura

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…

Passwordless logins with Yubikey

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…

Plotting graphical data using RRDtool and a Python Collectd plugin

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…

The Kerberos Authentication System for Single Sign-On (SSO)

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…

Programmatically organising your backpacking trip using Google My Maps

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…

Building RPM packages with rpmbuild, Koji, and GitLab-CI

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…

Google Summer of Code 2018 final evaluation report

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…

Using variadic templates with lambda expressions in C++ for constrained optimization

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…

Inaccuracy in Boost Geometry geodesic algorithms for nearly antipodal points

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 overview of activation functions used in neural networks

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…

Parallel tile fetching and CPU-and-memory statistics

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 :…

Google Summer of Code 2017 final evaluation report

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…

Fixing tile distortion issue in hips package

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…

RGB tile drawing in hips package

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 =…

Parameterized testing using Pytest

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 =…

Creating custom decorators in Python 3.6

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…

HiPS tile drawing

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…

Type annotations in Python 3.6 and using Mypy as a static type checker

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…

An overview of Hierarchical Progressive Surveys (HiPS) and the HEALPix framework

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…

An introduction to coordinate systems used in Astronomy

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)…

A comparison of response times using URLLib, GRequests, and asyncio

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…

My First Article

Hello World! This blog will be extensively used for posting GSoC updates, apart from other technical ramblings.