Initially taken by Niko Matsakis and lightly edited by Ryan Levick
- Introductions
- Cargo inside large build systems
- FFI
- Foundations and financial support
package auth | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"net" | |
"net/http" | |
"net/url" |
Roughly 10ms deviations observed.
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"os" | |
"os/signal" | |
"syscall" |
#set up the dir structure if it doesn't exist | |
set t ~/.trello; mkdir -p $t | |
function if_exist # we don't want to litter our code with ifs if a read model or events are not there yet. Return /dev/nul for empty | |
if test -e $t/$argv[1]; echo $t/$argv[1]; else; echo /dev/null; end | |
end | |
function list # provide lists from our tab delimited entries with filtering and line item numbers to make choices | |
set list $argv[1]; set column_to_show $argv[2]; set filter $argv[3]; set count 1 | |
cat (if_exist $list) | grep -e "$filter\$" | while read line | |
set -l line_items (string split \t $line) | |
echo $count\) $line_items[$column_to_show] |
This file aims to explain how to deploy Portainer inside a compose file with the admin password already set.
For this example, we'll use the password superpassword
.
Use the following command to generate a hash for the password:
How to install NVIDIA Docker 2 package on Ubuntu and Debian:
If you came to this result (from Google or elsewhere) after realizing that Nvidia-docker's entry on this subject does not result in a working installation, here are the basic steps needed to install this package correctly:
For starters, ensure that you've installed the latest Docker Community edition by following the steps below:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
server { | |
listen 80; | |
server_name localhost; | |
location /oauth2/ { | |
proxy_pass http://oauth-proxy:4180; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Scheme $scheme; | |
proxy_set_header X-Auth-Request-Redirect $request_uri; |
This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!
Please refer to the link above to get access to our updated API documentation and examples.
conn, err := grpc.Dial( | |
s.rpcSocketPath, | |
grpc.WithInsecure(), | |
grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) { | |
return net.DialTimeout("unix", addr, timeout) | |
})) | |
if err != nil { | |
log.Fatalf("did not connect: %v", err) | |
} | |
defer conn.Close() |