Posts for: #Bash

Basics of curl command

Introduction

We all might have used the curl command but might be unaware of it. It’s super old and still serves a great purpose. It has been available since 1996 and still is widely used in many embedded technologies, web API testing, CLI applications, etc. In this article, we’ll see some basics of using the curl command along with its applications.

What is the curl command?

Curl or cURL command is the utility or tool to access the internet from the command line interface using various protocols. This looks trivial but it can blow up your mind! Most people use this tool for fetching and processing the data from the servers/internet from their terminal without the browser but there is a lot more to it. It is used in various embedded devices for accessing the network in a lightweight and accessible way. Let’s see how you can use the curl command from the very basics.

[]

Crossposting with a single script: Crossposter.sh

Introduction

If you have been writing articles you know the pain to get some attention, if you have already been cross-posting your articles it usually takes some time to do that. This task can be automated with a shellscript. If you have been cross-posting articles on medium.com, dev.to and at hashnode.com, then I have a treat for you.

Introducing crossposter.sh!!

What is Crossposter.sh?

Crosspost to dev.to/hahsnode/medium from the command line.

Crossposter.sh is a shellscript(BASH) to automate crossposting to platforms like dev.to, medium.com and hashnode.com. The script takes in markdown version of your post with a few inputs from you and posts it to those platforms. You would require a token/key for each of those platforms to post it from the command line. You can check out the official repository of Crossposter.

[]

Django + Auth0 Quick Setup

Introduction

This is a guide and a walkthrough of how to quickly set up a base Django project with Auth0 as integration for authentication and authorization. I will walk you through the Django setup and how to use and integrate the functionalities of the Auth0. I will also discuss how why you should be using Auth0 and why I love it.

The script takes 2:44 minutes time to do everything from scratch. From installing virtualenv in python to integrating the Auth0 application.

[]

Django Quick Setup Script

Introduction

Once you learn something very neatly and understand it very clearly, it feels like you are wasting time doing things over and over again. Same things in setting up a Django project, you feel like you could save those typing minutes by making a script.

In this article, we will make a script a batch script for windows and a BASH script for Linux/macOS. We will make a virtual environment using python and then install the libraries and dependencies like in this case we will install Django. You can also tinker with these scripts and install other dependencies if you want like Django rest framework, crispy forms, markdown, Redis, etc. We will also make a Django project using the positional parameter passed before running the script from the command line.

[]

Scrapping the meaning of a word from dictionary.com using BASH script.

Introduction

Web Scraping is quite an interesting and powerful tool or skill to have in a Programmer’s toolkit. It helps in analyzing data and getting some information in various formats. Web Scraping is a process in which a user fetches a website’s content using some pattern in those HTML tags and the desired content to be fetched or scraped.

For this article, we aim to fetch the meaning of a word entered by the user from the dictionary.com website. We need to print just the meaning of the word from the HTML tags in it. We must have a good understanding of HTML and some basic Linux tools such as cURL, grep, sed, and others for doing all of these.

[]

Cryptocurrency Price Scrapping using BASH and Coingecko API

Introduction

Cryptocurrency is in such a hype that it is attracting even nerds and terminal fanboys, it is quite comfortable for such people to view the price inside of their terminal, also for normal people to learn about how to interact with an API from the local machine. We are gonna make a script about 20 lines in BASH to extract data from the coingecko cryptocurrency API and some tools such as grep and sed. That being said let’s start scripting.

[]

BASH Scripting Guide - PART - 3

Bash or shell won’t be much popular and powerful if they didn’t have some tools and utilities baked in. But even further they are supported natively in Bash, which just makes every task and challenge quite hassle-free to deal with. In this part of the series, I’ll try to cover an overview of some quite powerful and robust tools and utilities in Bash(shell in general) and also some of the advanced topics like dictionaries and positional parameters. Enough talk let’s dive in.

[]

Learning BASH by making a Number game

Introduction

OK! Learning BASH can be quite confusing without a proper goal in hand. So this will be a pretty good idea to start learning BASH and have a ton of fun. In this little time, we’ll make a Number game which I have designed myself last year in C++, which took about 3 months due to lazy research and wasting time. But I was surprised that I made this game within two hours in BASH. You can refer to the game instructions in this repository at Github.

[]

BASH Scripting Guide - PART - 2

Introduction

In this part, topics such as switch cases, mathematical expression, arrays, and strings. This won’t be an in-depth guide to understand each and every concept, but to make users aware of the things and features in Bash. This also would not be an absolute basic guide, I expect to have some basic programming knowledge such as binary systems, logical and mathematical concepts. Don’t worry, you won’t be bombarded with commands, I’ll just explain with easy examples to get started.

[]

BASH Scripting Guide - PART - 1

Introduction

If you are new to BASH and Linux, don’t you worry the community is the driving force here. If someone’s stuck somewhere, the platforms, forums, and blogs are ready to help anyone there. BASH is a short term of Bourne-Again Shell, it is a shell interface that has much more capabilities and functions than the simple Bourne shell(sh). It has some quite remarkable features and it is even capable of calling itself a programming language in some sense.

[]