This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # Based on: https://gist.github.com/nahushrk/5d980e676c4f2762ca385bd6fb9498a9 | |
| # | |
| # The original script broke with newer Ollama versions due to hardcoded `library` | |
| # namespace paths and a malformed tar archive structure. This rewrite fixes those | |
| # issues and adds: namespaced/custom-registry model support, a `list` command, | |
| # `--as` (import under a different name), `--force`, `--output`, tag defaulting | |
| # to `latest`, auto-detection of the Ollama base path, and safe tarfile extraction | |
| # for Python 3.12+. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "patternsample/mq" | |
| "fmt" | |
| "time" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| file, err := os.Open(path) | |
| if err != nil { | |
| return err | |
| } | |
| defer file.Close() | |
| // Only the first 512 bytes are used to sniff the content type. | |
| buffer := make([]byte, 512) | |
| _, err = file.Read(buffer) | |
| if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # https://launchpad.net/~dotcloud/+archive/lxc-docker/+packages | |
| ### BEGIN INIT INFO | |
| # Provides: docker | |
| # Required-Start: $local_fs $remote_fs | |
| # Required-Stop: $local_fs $remote_fs | |
| # Should-Start: autofs $network $named alsa-utils pulseaudio | |
| # Should-Stop: autofs $network $named alsa-utils pulseaudio | |
| # Default-Start: 2 3 4 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "shutdown" | |
| ) | |
| func main() { | |
| ch := shutdown.Add("test") | |
| ch2 := shutdown.Add("test2") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "crypto/tls" | |
| "crypto/x509" | |
| "fmt" | |
| "io" | |
| "log" | |
| ) |