show dbs
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
| # Source: https://gist.github.com/CognitiveDifference/466c32bf98c07dcd9719599ceed3ecdc | |
| MAKE := make --no-print-directory | |
| DESCRIBE := $(shell git describe --match "v*" --always --tags) | |
| STATUS := $(shell git status --porcelain | grep " M ") | |
| DESCRIBE_PARTS := $(subst -, ,$(DESCRIBE)) | |
| VERSION_TAG := $(word 1,$(DESCRIBE_PARTS)) | |
| COMMITS_SINCE_TAG := $(word 2,$(DESCRIBE_PARTS)) |
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
| # $ golangci-lint run --config=~/.golangci.yml ./... > lint.txt | |
| version: "2" | |
| linters: | |
| enable: | |
| - asasalint | |
| - asciicheck | |
| - bidichk | |
| - bodyclose | |
| - canonicalheader |
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 ( | |
| "fmt" | |
| "net/http" | |
| "net/http/httputil" | |
| "net/url" | |
| "github.com/gin-gonic/gin" | |
| ) |
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/python3 | |
| # MIT License | |
| # | |
| # Copyright (c) 2017 Marcel de Vries | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
| # Proper (fast) Python implementations of Dan Bernstein's DJB2 32-bit hashing function | |
| # | |
| # DJB2 has terrible avalanching performance, though. | |
| # For example, it returns the same hash values for these strings: "xy", "yX", "z7". | |
| # I recommend using Murmur3 hash. Or, at least, FNV-1a or SDBM hashes below. | |
| import functools | |
| djb2 = lambda x: functools.reduce(lambda x,c: 0xFFFFFFFF & (x*33 + c), x, 5381) | |
| sdbm = lambda x: functools.reduce(lambda x,c: 0xFFFFFFFF & (x*65599 + c), x, 0) | |
| fnv1a_32 = lambda x: functools.reduce(lambda x,c: 0xFFFFFFFF & ((x^c)*0x1000193), x, 0x811c9dc5) |
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
| FROM nginx:alpine AS builder | |
| # nginx:alpine contains NGINX_VERSION environment variable, like so: | |
| # ENV NGINX_VERSION 1.15.0 | |
| # Our NCHAN version | |
| ENV NCHAN_VERSION 1.1.15 | |
| # Download sources | |
| RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \ |
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
| MAKE := make --no-print-directory | |
| DESCRIBE := $(shell git describe --match "v*" --always --tags) | |
| DESCRIBE_PARTS := $(subst -, ,$(DESCRIBE)) | |
| VERSION_TAG := $(word 1,$(DESCRIBE_PARTS)) | |
| COMMITS_SINCE_TAG := $(word 2,$(DESCRIBE_PARTS)) | |
| VERSION := $(subst v,,$(VERSION_TAG)) | |
| VERSION_PARTS := $(subst ., ,$(VERSION)) |
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
| After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
| The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
| Database files have to be updated before starting the server, here are the steps that had to be followed: | |
| # need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
| brew unlink postgresql | |
| brew install [email protected] | |
| brew unlink [email protected] | |
| brew link postgresql |
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
| openssl rand -base64 6 | |
| openssl rand -hex 4 | |
| openssl rand -base64 8 | md5 | head -c8;echo | |
| openssl rand -base64 6 | |
| ping -c 1 yahoo.com |md5 | head -c8; echo |
NewerOlder