Run: php create-phar.php
app.phar successfully created
Run: php app.phar
| // Write a pid file, but first make sure it doesn't exist with a running pid. | |
| func writePidFile(pidFile string) error { | |
| // Read in the pid file as a slice of bytes. | |
| if piddata, err := ioutil.ReadFile(pidFile); err == nil { | |
| // Convert the file contents to an integer. | |
| if pid, err := strconv.Atoi(string(piddata)); err == nil { | |
| // Look for the pid in the process list. | |
| if process, err := os.FindProcess(pid); err == nil { | |
| // Send the process a signal zero kill. | |
| if err := process.Signal(syscall.Signal(0)); err == nil { |
| package main | |
| import ( | |
| "fmt" | |
| "sort" | |
| "strconv" | |
| "strings" | |
| ) | |
| func main() { |
| <?php | |
| /** | |
| * GitLab Web Hook | |
| * See https://gitlab.com/kpobococ/gitlab-webhook | |
| * | |
| * This script should be placed within the web root of your desired deploy | |
| * location. The GitLab repository should then be configured to call it for the | |
| * "Push events" trigger via the Web Hooks settings page. | |
| * | |
| * Each time this script is called, it executes a hook shell script and logs all |
| import base64 | |
| import random as r | |
| MAX_VALUE = 256 * 9 | |
| private_key = int(r.random() * MAX_VALUE) | |
| public_key = MAX_VALUE - private_key | |
| shared_key = MAX_VALUE | |
| print("Public Key: %d" % public_key) |
| <?php | |
| $root = \dirname(__DIR__); | |
| /** @psalm-suppress UnresolvableInclude */ | |
| require_once $root . '/cli-autoload.php'; | |
| use GuzzleHttp\Client; | |
| use ParagonIE\Sapient\Sapient; | |
| use ParagonIE\Chronicle\Chronicle; | |
| use ParagonIE\ConstantTime\Base64UrlSafe; |
| #/bin/bash | |
| git config --global alias.pushall '!git remote | xargs -L1 git push --all' |
| <!doctype html> | |
| <title>Site Maintenance</title> | |
| <style> | |
| body { text-align: center; padding: 150px; } | |
| h1 { font-size: 50px; } | |
| body { font: 20px Helvetica, sans-serif; color: #333; } | |
| article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
| a { color: #dc8100; text-decoration: none; } | |
| a:hover { color: #333; text-decoration: none; } | |
| </style> |
| chmod 700 ~/.ssh | |
| chmod 600 ~/.ssh/* | |
| chmod 644 ~/.ssh/*.pub |
Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.
gituser via Diskstation interface (with File Station and WebDAV privilages)git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.