Skip to content

Instantly share code, notes, and snippets.

@shankaraman
Last active January 12, 2016 12:40
Show Gist options
  • Save shankaraman/b2d98aaa77bd734bd457 to your computer and use it in GitHub Desktop.
Save shankaraman/b2d98aaa77bd734bd457 to your computer and use it in GitHub Desktop.
Inode Exhaustion
import os
# Sorry this is a very lame code
lst = []
data = os.popen('df -i').readlines()
data = data[1].split(' ')
for i in data:
if i != '':
lst.append(i)
exhaust_count = int(lst[3])
print "Total free inodes:",exhaust_count
count = 0
for i in range(exhaust_count+100):
os.system('touch '+str(i)+'.txt')
count+=1
print "So far:",count, "Remaining:",exhaust_count-count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment