def menu(client) : while True : client.send("dialog --menu \"Menu List\" 30 50 8 1 \"User Management\" 2 \"Directory Management\" 3 \"File Management\" 4 \"Software Management\" 5 \"Device Partition Management\" 6 \"Logical Volume Management\" 7 \"Server Management\" 8 \"Exit\" ") choice = client.recv(10) if choice == "1" : import user user.user(client) elif choice == "2" : import dirs dirs.dirs(client) elif choice == "3" : import files files.files(client) elif choice == "4" : import software software.software(client) elif choice == "5" : import dpm dpm.dpm(client) elif choice == "6" : import lvm lvm.lvm(client) elif choice == "7" : import sm sm.sm(client) elif choice == "8" : client.send("recieve only") client.send("dialog --infobox \"Thank You... \n Exiting....\" 5 18") client.send("false")
def resize(self, size_change): """ Resizes this logical volume according to size_change so to eg. add 5 GB you just pass +5G """ return lvm(['lvresize', '--size', size_change, self.lvname]) # vim:set sw=4 ts=4 et: # -*- coding: utf-8 -*-
#!/usr/bin/env python import matplotlib.pyplot as plt import lvm import sys import itertools def getgroupname(n): return n.split('_')[0] for f in sys.argv[1:]: d = lvm.lvm(f) plt.figure() names = d.data.dtype.names[1:] Ngroups = len(set(map(getgroupname, names))) namegroups = itertools.groupby(names, getgroupname) for i, (groupname, items) in enumerate(namegroups): plt.subplot(Ngroups, 1, i) plt.ylabel(groupname) for name in items: normy = d.data[name] normy -= min(normy) normy /= max(normy) t = d.data.X_Value tindex = t<400 plt.plot(t[tindex], normy[tindex], label=name) plt.legend(loc='best') plt.savefig(f[:-4] + '.png')
def extend(self, pvs): return lvm(['vgextend', self.name] + pvs) # vim:set sw=4 ts=4 et: # -*- coding: utf-8 -*-
def reduce(self, pvs): return lvm(['vgreduce', self.name] + pvs)
def remove(self): return lvm(['vgremove', '--force', self.name])
def display(self): return lvm(['vgdisplay', '-c', self.name])
def create(cls, name, sources=[]): lvm(['vgcreate', name] + sources) return cls(name)
(a, b) = e_3[idx] if d_hat[u, a] < eta and d_hat[v, b] < eta: total += m[a, b] count += 1 # Put a zero entry if e'''_uv is empty in Equation (3). if count > 0: f_hat[u, v] = total / count return f_hat if __name__ == "__main__": # Unit test. n = 50 r = 2 f = lvm.lvm(n, r) kappa = 0.49 p = n**(-1 + kappa) # e is a list of pairs of indices corresponding to the observed entries. e = [] for i in range(n): for j in range(n): if np.random.uniform() < p: e.append((i, j)) # m is a noisy signal of f m = np.zeros((n, n)) for idx in range(len(e)): (i, j) = e[idx]
elif int(ch) == 6: os.system(" ls -l ") elif int(ch) == 7: os.system("firefox") elif int(ch) == 8: y = input("Enter the name of the program you want to install...") os.system("yum install {}".format(y)) elif int(ch) == 9: docker.docker() elif int(ch) == 10: lvm.lvm() elif int(ch) == 11: hadoop.hadoop() elif int(ch) == 12: aws.aws() elif r == "remote": ip = input("Enter IP address where you want to remote login : "******"Enter Your Choice : ") if int(ch) == 1: os.system(' ssh {} date '.format(ip))
def remove(self): return lvm(['lvremove', '--force', self.lvname])
def display(self): return lvm(['lvdisplay', '-c', self.lvname])
def create(cls, vgname, name, size): lvm(['lvcreate', '--name', name, '--size', size, vgname]) return cls(vgname, name)