Skip to content

Instantly share code, notes, and snippets.

@syamsathyan
Created May 26, 2016 05:06
Show Gist options
  • Save syamsathyan/4a87681a8bad1a425853fd9ac2bd44f5 to your computer and use it in GitHub Desktop.
Save syamsathyan/4a87681a8bad1a425853fd9ac2bd44f5 to your computer and use it in GitHub Desktop.
from fabric.api import cd, env, run
def BF():
env.hosts = ['']
def GBL():
env.hosts = ['']
def free():
run('free -h')
def list_dir(dir_=None):
print("************************** Listing Files in Dir - %s" % (dir_))
string = run("for i in %s*; do echo $i; done" % dir_)
files = string.replace("\r","").split("\n")
return files
def listWebContent():
"""List Web Content"""
run("cd /nginx/html")
list_dir("/nginx/html/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment