Skip to content

Instantly share code, notes, and snippets.

@waynr
Last active June 11, 2020 17:48
Show Gist options
  • Select an option

  • Save waynr/a53b3f4ab3a80f76bea99c5ae705803d to your computer and use it in GitHub Desktop.

Select an option

Save waynr/a53b3f4ab3a80f76bea99c5ae705803d to your computer and use it in GitHub Desktop.

Revisions

  1. waynr revised this gist May 15, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup.example
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,4 @@ $ mv cgconfig.conf /etc/cgconfig.conf
    $ sed -i -e 's|UID|$(id -u)|' /etc/cgconfig.conf
    $ sudo cgconfigparser -l /etc/cgconfig.conf
    $ mv $GOPATH/bin/gopls $GOPATH/bin/gopls.real
    $ ln -sf /patch/to/gopls.bash $GOPATH/bin/gopls
    $ ln -sf /path/to/gopls.bash $GOPATH/bin/gopls
  2. waynr renamed this gist May 15, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. waynr revised this gist May 15, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    $ sudo apt install cgroup-tools
    $ mv cgconfig.conf /etc/cgconfig.conf
    $ sed -i -e 's|UID|$(id -u)|' /etc/cgconfig.conf
    $ sudo cgconfigparser -l /etc/cgconfig.conf
  4. waynr created this gist May 15, 2020.
    20 changes: 20 additions & 0 deletions cgconfig.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    group gotools {
    perm {
    admin {
    uid = UID;
    gid = UID;
    }
    task {
    uid = UID;
    gid = UID;
    }
    }
    cpu {
    cpu.shares = 256;
    }
    memory {
    # limit to 6GB
    memory.limit_in_bytes = 6442450944;
    }
    }
    ~
    5 changes: 5 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    $ mv cgconfig.conf /etc/cgconfig.conf
    $ sed -i -e 's|UID|$(id -u)|' /etc/cgconfig.conf
    $ sudo cgconfigparser -l /etc/cgconfig.conf
    $ mv $GOPATH/bin/gopls $GOPATH/bin/gopls.real
    $ ln -sf /patch/to/gopls.bash $GOPATH/bin/gopls
    5 changes: 5 additions & 0 deletions gopls.bash
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    #!/bin/bash

    cgexec \
    -g memory,cpu:gotools \
    $GOPATH/bin/gopls.real "$@"