Delete stale files by last accessed time and created time (Bash)

Delete stale files by last accessed time and created time (Bash)

I implemented file based caching on one of my projects to cache large number of responses which are CPU and memory intensive. The file caching worked as a charm at start but soon I started to hit the storage capacity of the web server. So I wanted a script that can be configured in cron

Continue reading

Bash Cheat Sheet - File operation

Bash Cheat Sheet - File operation

Get filename with file extension


FULLFILENAME=$(basename $FILE)

Get filename without file extension


FILENAME="${FILE%.*}"

Get extension from filename


EXTENSION="${FILE##*.}"

Get MIME type of the given file


MIME_TYPE=`file --brief --mime-type "$FILE"`

Get current directory of the script

Get the full directory name of the script no matter where it is being called

Continue reading

Google Drive upload bash script

Google Drive upload bash script

I was looking for a simple command line script to upload files to Google drive and I stumbled upon gdrive a command line utility to manage files in google drive. But it was heavy weight for my requirements and had dependencies which I was not able to install in the servers. So I decided on

Continue reading

Active Directory Interview Questions

Active Directory Interview Questions
Frequently asked interview questions on Active Directory.

This is a compilation of question and answers
on Active Directory from various sources listed below.This provides a starting point in preparation for Windows Administration interview.

  1. Define Active Directory

    Active Directory is a database that stores data pertaining to the users and objects within the network. Active

Continue reading

Basic concepts of Active Directory Directory Services

Basic concepts of Active Directory Directory Services

What is Active Directory Directory Services (ADDS)?

  1. Active Directory is useful for managing enterprise's user information. It is used for storing and managing large volume of user credentials.

  2. Active Directory directory Services (ADDS) is used for managing security policies for users and resources within the network.

  3. AD is used for Single Sign On (SSO) allowing

Continue reading