Skip to content

Instantly share code, notes, and snippets.

View Shrinidhikulkarni7's full-sized avatar
🏠
Working from home

Shrinidhi Kulkarni Shrinidhikulkarni7

🏠
Working from home
View GitHub Profile
@Shrinidhikulkarni7
Shrinidhikulkarni7 / clearSpace.sh
Last active June 19, 2020 17:38
This script to clear space consumed by docker's dangling contents.
#!/bin/bash
currentUsage=$(df -h | grep '/dev/mapper*' | awk {'print $5'})
echo "The current disk space is " $current_usage
max_usage="85%"
if [ $((${current_usage%?})) -ge $(( ${max_usage%?})) ]; then
docker system prune -a -f
@Shrinidhikulkarni7
Shrinidhikulkarni7 / bankers.c
Last active December 1, 2016 14:27
Seen a quite few people struggling with Bankers Algorithm,for VTU 5th sem SS and OS lab. Well,this is the simplified version of the program,which is short and easy to understand too. :)
#include<stdio.h>
#include <stdlib.h>
void main()
{
int k=0,output[10],d=0,t=0,ins[5],i,avail[5],allocated[10][5],need[10][5],MAX[10][5],pno,P[10],j,rz, count=0;
//clrscr();
long int timer=0;
printf("\n Enter the number of resources : ");
scanf("%d", &rz);
printf("\n enter the max instances of each resources\n");