Skip to content

Instantly share code, notes, and snippets.

Ryan Blunden ryan-blunden

Block or report user

Report or block ryan-blunden

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ryan-blunden
ryan-blunden / repos.jsonc
Created Jun 4, 2019
Good mix of repositories for testing a Sourcegraph instance
View repos.jsonc
{
"repos": [
"sourcegraph/sourcegraph", // Mix
"sourcegraph/deploy-sourcegraph", // YAML
"jenkinsci/jenkins", // Java
"getsentry/sentry", // Python
"moby/buildkit", // Go
"pallets/flask", // Python
"googleapis/gapic-generator", // Java
"Azure/azure-storage-js", // TypeScript
@ryan-blunden
ryan-blunden / nginx.conf
Created May 13, 2019
NGINX conf for lang servers with basic auth
View nginx.conf
# This config was generated by Sourcegraph.
# You can adjust the configuration to add additional TLS or HTTP features.
# Read more at https://docs.sourcegraph.com/admin/nginx
error_log stderr;
pid /var/run/nginx.pid;
# Do not remove. The contents of sourcegraph_main.conf can change between
# versions and may include improvements to the configuration.
include nginx/sourcegraph_main.conf;
@ryan-blunden
ryan-blunden / docker-compose.yml
Created May 13, 2019
Docker Compose for lang servers
View docker-compose.yml
version: '3'
services:
sourcegraph:
container_name: sourcegraph
image: sourcegraph/server:3.2.0
environment:
- SRC_LOG_LEVEL=dbug
ports:
- '127.0.0.1:80:80'
- 443:7080
@ryan-blunden
ryan-blunden / generate_sourcegraph_docs_nav.py
Last active May 3, 2019
WIP Python script for generating the nav for docs.sourcegraph.com. Once fully baked, it will be ported to Go and greatly improved.
View generate_sourcegraph_docs_nav.py
#!/usr/bin/env python3
from __future__ import annotations
from dataclasses import dataclass, field
import inspect
import os
import re
import sys
from typing import List
@ryan-blunden
ryan-blunden / commands.sh
Last active Mar 27, 2019
Sourcegraph with language servers behind SSL with basic auth
View commands.sh
# Execute settings to insert lang server settings
docker container exec sourcegraph /bin/bash -c 'cat /var/opt/sourcegraph/settings_init.sql | psql -U postgres sourcegraph'
# Execute psql commands
docker container exec sourcegraph /bin/bash -c 'echo "SELECT * FROM settings;" | psql -U postgres sourcegraph'
View docsite_hot_reload.sh
#!/usr/bin/env bash
# usage (requires fswatch): `fswatch -o . | xargs -n1 -I{} ./bin/hot-reload.sh`
# usage (requires fsevents-tools): `while true; do notifywait ~/Projects/docsite; ./update.sh; done`
killall docsite
cd cmd/docsite
go get
cd -
docsite -config "../sourcegraph/doc/docsite.json" serve
View ssl_no_input.sh
#! /usr/bin/env bash
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ~/.sourcegraph/config/sourcegraph.key -out ~/.sourcegraph/config/sourcegraph.crt -subj "/CN=localhost
View mermaid.css
/**
* Placeholder for required styles to correctly render exported Mermaid SVG files from the online live editor
*/
/* Number in below styles is unique for each export */
#mermaid-1551921004212 .label {
font-family: 'trebuchet ms', verdana, arial;
color: #333;
font-size: 14px;
@ryan-blunden
ryan-blunden / docker-compose.yml
Last active Feb 25, 2019
Docker Compose example for Sourcegraph with the Go language server
View docker-compose.yml
version: "3"
services:
sourcegraph:
image: sourcegraph/server:3.1.1
environment:
- SRC_LOG_LEVEL=dbug
ports:
- 80:7080
- 443:7080
- 2633:2633
@ryan-blunden
ryan-blunden / postgres-upgrade.sh
Created Feb 7, 2019
Testing Sourcegraph 3.0 db upgrade
View postgres-upgrade.sh
#!/usr/bin/env bash
set -xeuo pipefail
export OLD=${OLD:-"9.6"}
export NEW=${NEW:-"11"}
export SRC_DIR=${SRC_DIR:-"$HOME/.sourcegraph"}
docker run \
-w /tmp/upgrade \
You can’t perform that action at this time.