Exemplo n.º 1
0
 def update(self):
     buf = StringIO.StringIO()
     buf.seek(0, os.SEEK_SET)
     buf.truncate()
     buf.write(self.content)
     buf.seek(0, os.SEEK_SET)
     put(buf, self.filepath, self.use_sudo)
Exemplo n.º 2
0
 def update(self):
     buf = StringIO.StringIO()
     buf.seek(0, os.SEEK_SET)
     buf.truncate()
     buf.write(self.content)
     buf.seek(0, os.SEEK_SET)
     put(buf, self.filepath, self.use_sudo)
Exemplo n.º 3
0
def git_config():
    buf = StringIO.StringIO(GITCFG % (
        rlinput('name: ', config['name']),
        rlinput('email: ', config['email']),
        rlinput('signingkey: ', config['signingkey']),
        rlinput('editor: ', config['editor']),
    ))
    put(buf, '~/.gitconfig')
Exemplo n.º 4
0
def git_config():
    buf = StringIO.StringIO(GITCFG % (
        rlinput('name: ', config['name']),
        rlinput('email: ', config['email']),
        rlinput('signingkey: ', config['signingkey']),
        rlinput('editor: ', config['editor']),
    ))
    put(buf, '~/.gitconfig')
Exemplo n.º 5
0
def sysctl():
    netconf = '/etc/sysctl.d/net.conf'
    buf = StringIO.StringIO(b'''\
net.ipv4.tcp_congestion_control = htcp

net.core.rmem_default = 2621440
net.core.rmem_max = 16777216
net.core.wmem_default = 655360
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096	2621440	16777216
net.ipv4.tcp_wmem = 4096	655360	16777216
''')
    put(buf, netconf, use_sudo=True)
    sudo('chown root.root %s' % netconf)
    sudo('sysctl -p /etc/sysctl.d/net.conf')
Exemplo n.º 6
0
def sysctl():
    netconf = '/etc/sysctl.d/net.conf'
    buf = StringIO.StringIO(b'''\
net.ipv4.tcp_congestion_control = bbr

net.core.rmem_default = 2621440
net.core.rmem_max = 16777216
net.core.wmem_default = 655360
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096	2621440	16777216
net.ipv4.tcp_wmem = 4096	655360	16777216
net.ipv4.tcp_retries2 = 8
''')
    put(buf, netconf, use_sudo=True)
    sudo('chown root.root %s' % netconf)
    sudo('sysctl -p /etc/sysctl.d/net.conf')