This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this function to the Profile script | |
# Use the following command to generate the Profile script | |
# | |
# $profileTest = Test-Path $PROFILE | |
# if ($profileTest -eq $FALSE) { | |
# New-Item $PROFILE -Type File | |
# } | |
# | |
# OR | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ============================================= | |
# Installs and Uninstalls the ChefDK | |
# ============================================= | |
# | |
# -i Install ChefDK | |
# -u Uninstall ChefDK | |
# -c Verify ChefDK | |
# -h Show Help |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference https://gist.github.com/justintv/168835 | |
# Used in Elementery OS terminal | |
# Add to ~/.bashrc file | |
# Sets the Git branch name in the PS1 prompt | |
function git_prompt_setter() { | |
local RED="\\\[\\\033[1;31m\\\]" | |
local NORMAL="\\\[\\\033[00m\\\]" | |
# Modifies the existing prompt and adds the git branch name | |
PS1=$(echo $PS1 | sed 's/\(\\\?[$#]\)\s*$/'"$RED"'\$\(__git_ps1\)'"$NORMAL"'\1 / ' ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#================================================ | |
# Removes the Docker images based on conditions | |
#================================================ | |
# Variable Declaration | |
declare -A image_exclusion=( ["node"]="8-alpine" ["jenkins"]="latest" ) | |
# Checks whether image has been excluded or not |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
######################################################## | |
# | |
# Checks for Network connection by using Ping utility | |
# | |
######################################################## | |
# Main flow of Execution | |
main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################################################# | |
# | |
# Restarts the Network Manager automatically when the | |
# Network disconnects, because of wifi connectivity problem | |
# | |
############################################################# | |
# Function which checks for the root user execution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################# | |
# # | |
# - Removes the duplicate normal files from the given directory and makes them # | |
# as the hard link for the non removed file. # | |
# - The non removed file is the one which comes first in the lexical ordering # | |
# - Script uses fdupes utility to find out the duplicate files # | |
# # | |
# = Usage: bash script.sh duplicate_files_folder # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# utility function which is used to create and change | |
# to the given directory name | |
# Add to the .bashrc file | |
# usage: | |
# mkcd directory_name | |
mkcd() { | |
local directory_name="${1}" | |
if [ -z $directory_name ] | |
then | |
echo "Pass the directory name as the argument!!!" > /dev/stderr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Loops through the proc directory | |
for processId in `ls /proc/`; do | |
# Checks for the status file for a process | |
if [[ $processId =~ ^[0-9]+$ && -r "/proc/${processId}/status" ]]; then | |
# Gets the swap space usage for the process | |
swapUsage=`grep VmSwap "/proc/${processId}/status" | awk '{print $2}'` | |
if [[ ! -z $swapUsage && $swapUsage > 0 ]]; then | |
# Gets the process name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Global variable declarations | |
format="plain" | |
directories=() | |
current_directory=`pwd` | |
report_directory="${current_directory}/report/" | |
fresh_report_directory="0" | |
# usage |
OlderNewer