SPF Lookup in Go

In this gist, We will check how we can extract SPF records in Go. Prerequisite Go version $ go version go version go1.13 linux/amd64 Dependency DNS Library(https://github.com/miekg/dns) Install dependency $ go get github.com/miekg/dns spfLookup.go Here you can change nameserver according to your requirement. I have specified here google’s name server (8.8.8.8). You can also use cloudflare’s nameserver (1.1.1.1) Conclusion You can make any DNS query with miekg/dns library. In the above script, we have looked up TXT Records and then we have searched for a string containing v=spf1. ...

August 3, 2020 · 1 min · Ashish Tiwari
go ship logs to ELK flow

Shipping Golang logs with ELKB stack

Goal of this blog In this blog, I am going to show you how easily we can write logs to the files in Golang. As well as we are going to store all logs on elasticsearch with EKB (Elasticsearch, Kibana, Beats). Why ELKB stack ? Logs are very important for debugging, reporting, insights etc. In today’s tech world, We uses multiple cloud servers, private servers etc. Which consist of lots of different applications, scripts, programs, daemons, services and they generate their logs too. It is very difficult to go to each server and check all log files in case of debugging or to generate any insights or reporting. ...

June 6, 2020 · 6 min · Ashish Tiwari

[Part 1] Setup LEMP environment with Docker - Setup Nginx and PHP

Hi guys, In this series, we are going to setup LEMP Stack (Linux, Nginx, MySQL, PHP). Mainly it is used by web developers. I am assuming you have a basic idea about Docker & How it works. In this blog, We are going to setup PHP and Nginx. Why Docker? I will not go too much deep, You can find more resources over the internet about the docker. Docker makes the installation process very smooth and it gives your isolated environment as the container. ...

May 16, 2020 · 3 min · Ashish Tiwari

Add Responsive Google Slides on Hugo

Steps to add Responsive google slides iframe with Hugo: Hugo version: $ hugo version Hugo Static Site Generator v0.69.0-4205844B linux/amd64 BuildDate: 2020-04-10T09:12:34Z Step 1: Create Shortcode Create gslides.html file vim layouts/shortcodes/gslides.html Step 2: Add below code: <div id="Container" style="padding-bottom:56.25%; position:relative; display:block; width: 100%"> <iframe id="googleSlideIframe" width="100%" height="100%" src="{{ .Get "src" }}" frameborder="0" allowfullscreen="" style="position:absolute; top:0; left: 0"></iframe> </div> Step 3: Use shortcode ‘gslides’ in your Blog/Post Markdown file Simply place below snippet in your markdown file. ...

April 13, 2020 · 1 min · Ashish Tiwari
Linux from scratch login screen

Challenges in linuxfromscratch

Successfully built custom #Linux system by referring https://t.co/lyrdKkfXo9 . Listed my challenges here https://t.co/gU2SoAxly2@nixcraft#linux #lfs #linuxfromscratch pic.twitter.com/XlWchVHy26 — Ashish Tiwari 🇮🇳 (@_ashish_tiwari) April 27, 2020 I have started with www.linuxfromscratch.org, I am facing some challenges and problems which I am going to share with you in this blog. I will keep updating this blog as well as I move forward. Before we get start You need some basic linux command knowledge to use linuxfromscratch guide. I am going to build LFS on my local machine. If your machine has a different OS or different configuration, Then some solution will not work. ...

April 11, 2020 · 10 min · Ashish Tiwari