Skip to content

Instantly share code, notes, and snippets.

View mz2's full-sized avatar

Matias Piipari mz2

View GitHub Profile
#!/bin/bash
set -m
NFS_MOUNTPOINT="/$NFS/$HOSTNAME"
if [[ -v "${NFS_MOUNTPOINT}" ]]; then
mkdir -p "${NFS_MOUNTPOINT}" && chown couchbase:couchbase "${NFS_MOUNTPOINT}"
fi
@mz2
mz2 / gist:343bbbaaed47f383ec144776fb8f3993
Created August 2, 2018 09:10
Sync Gateway hangs at "Using plain authentication for user…" when starting up
sync_gateway_1 | 2018-08-02T01:43:34.202Z ==== Couchbase Sync Gateway/HEAD(nobranch)(508346b) ====
sync_gateway_1 | 2018-08-02T01:43:34.202Z [WRN] Using deprecated config option: "log". Use "logging.console.log_keys" instead. -- rest.(*ServerConfig).deprecatedConfigLoggingFallback.func5() at config.go:656
sync_gateway_1 | 2018-08-02T01:43:34.202Z [ERR] No logFilePath configured, and --defaultLogFilePath flag is not set. Log files required for product support are not being generated. -- base.(*LoggingConfig).Init.func1() at logging_config.go:55
sync_gateway_1 | 2018-08-02T01:43:34.202Z [INF] Console LogKeys: [* HTTP]
sync_gateway_1 | 2018-08-02T01:43:34.202Z [INF] Console LogLevel: info
sync_gateway_1 | 2018-08-02T01:43:34.202Z [INF] Log Redaction Level: none
sync_gateway_1 | 2018-08-02T01:43:34.202Z [INF] requestedSoftFDLimit < currentSoftFdLimit (5000 < 1048576) no action needed
sync_gateway_1 | 2018-08-02T01:43:34.202Z [INF] Opening db /library as bucket "library", pool "default", server <http://cou
@mz2
mz2 / Dockerfile
Created March 27, 2017 16:04
Development oriented Dockerfile for a Vapor app
# adapted from https://github.com/swiftdocker/docker-swift
# once docker-swift supports setting the swift version via a build-arg we could pull from there instead
FROM ubuntu:14.04
ENV SWIFT_BRANCH swift-3.0.2-release
ENV SWIFT_VERSION 3.0.2
ENV SWIFT_URL https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz
ENV SWIFT_SIG_URL https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz.sig
ENV SWIFT_PLATFORM ubuntu14.04
@mz2
mz2 / gist:a70694d7f260b46013055bf8b1380e9e
Created March 27, 2017 13:13
Example Dockerfile for Heroku deployment
# adapted from https://github.com/swiftdocker/docker-swift
# once docker-swift supports setting the swift version via a build-arg we could pull from there instead
FROM ubuntu:14.04
ENV SWIFT_BRANCH swift-3.0.2-release
ENV SWIFT_VERSION 3.0.2
ENV SWIFT_URL https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz
ENV SWIFT_SIG_URL https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz.sig
ENV SWIFT_PLATFORM ubuntu14.04
@mz2
mz2 / kill-docker
Created March 27, 2017 12:05
An example script that kills previous instance(s) of a docker container with name "manuscript-annotations"
#!/bin/bash
# $PATH tweak done so this also runs from Xcode.
PATH="/usr/local/bin:${PATH}"
if [[ $(docker ps -q --filter=ancestor=manuscript-annotations) ]]; then
docker stop $(docker ps -q --filter=ancestor=manuscript-annotations)
fi
@mz2
mz2 / run-docker
Created March 27, 2017 12:01
Example script that can be used to execute a Vapor app inside Docker connected to the Xcode console
#!/bin/bash
# $PATH tweak done so this also runs from Xcode.
PATH="/usr/local/bin:${PATH}"
./kill-docker
docker run --rm -it -v $PWD:/vapor -p 5432 -p 8080:8080 \
-e HOST_IP=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1') \
manuscript-annotations
@mz2
mz2 / Dockerfile
Created March 27, 2017 11:50
Example Dockerfile for running Vapor tests.
# adapted from https://github.com/swiftdocker/docker-swift
# once docker-swift supports setting the swift version via a build-arg we could pull from there instead
FROM ubuntu:14.04
ENV SWIFT_BRANCH swift-3.0.2-release
ENV SWIFT_VERSION 3.0.2
ENV SWIFT_URL https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz
ENV SWIFT_SIG_URL https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz.sig
ENV SWIFT_PLATFORM ubuntu14.04
@mz2
mz2 / .gitlab-ci.yml
Created March 27, 2017 11:22
An example .gitlab-ci.yml for running Vapor tests
before_script:
- git submodule update --init --recursive
cache:
key: ${CI_BUILD_REF_NAME}
paths:
- .build
build:
script:
//
// NSString+Levenshtein.h
// PyHelp
//
// Modified by Michael Bianco on 12/2/11.
// <http://mabblog.com>
//
// Created by Rick Bourner on Sat Aug 09 2003.
// rick@bourner.com
@mz2
mz2 / gist:1917390
Created February 26, 2012 15:24
R CMD check issues
Undocumented S4 methods:
generic '$' and siglist '_p_PEER__cEpsNodeSparse'
generic '$' and siglist '_p_PEER__cSPARSEFA'
generic '$' and siglist '_p_PEER__cWNodeSparse'
generic '$<-' and siglist '_p_PEER__cWNodeSparse'
generic '[' and siglist 'ExternalReference'
generic '[<-' and siglist 'ExternalReference'
generic '[[<-' and siglist '_p_PEER__cWNodeSparse,character'
generic 'length' and siglist 'SWIGArray'