As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
// Copyright (c) 2019 Leonardo Faoro. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io/ioutil" |
info, err := os.Stat(fileName) | |
if err != nil { | |
return err | |
} | |
if info.IsDir() { | |
message := fmt.Sprintf(` | |
Sorry, I can't upload a whole directory. | |
Try: | |
$ tar -cvf %s.tar %s/ | |
$ ncrypt %s.tar |
// From return client's real public IP address from http request headers. | |
func From(r *http.Request) string { | |
// Fetch header value | |
xRealIP := r.Header.Get("X-Real-IP") | |
xForwardedFor := r.Header.Get("X-Forwarded-For") | |
// If both empty, return IP from remote address | |
if xRealIP == "" && xForwardedFor == "" { | |
var remoteIP string |
package main | |
import ( | |
"fmt" | |
"github.com/gorilla/mux" | |
"net/http" | |
) | |
func signupHandler(w http.ResponseWriter, request *http.Request) { |
package httpLogger | |
import ( | |
"log" | |
"net/http" | |
"os" | |
"strings" | |
"time" | |
"git.vlct.io/vaultex/vaultex/internal/realip" |
{ | |
/* Keybindings for emacs emulation. Compiled by Jacob Rus. | |
* | |
* This is a pretty good set, especially considering that many emacs bindings | |
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and | |
* perhaps a few more, are already built into the system. | |
* | |
* BEWARE: | |
* This file uses the Option key as a meta key. This has the side-effect | |
* of overriding Mac OS keybindings for the option key, which generally |
// CreditCardRegex is the pattern used to identify a credit card PAN. | |
var CreditCardRegex = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$" | |
var rxCreditCard = regexp.MustCompile(CreditCardRegex) | |
var rxNotNumber = regexp.MustCompile("[^0-9]+") | |
// IsCreditCard checks if the string is a credit card. | |
func IsCreditCard(s string) bool { | |
sanitized := rxNotNumber.ReplaceAllString(s, "") | |
if !rxCreditCard.MatchString(sanitized) { | |
return false |
FROM golang:alpine as builder | |
WORKDIR /build | |
COPY . . | |
RUN apk update && apk upgrade && \ | |
apk add git gcc | |
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \ | |
go install -gcflags "-N -l" ./cmd/... | |
FROM alpine:latest | |
RUN apk update && apk add ca-certificates && \ |
apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: batch-sql-backup | |
spec: | |
schedule: "* */60 * * *" | |
concurrencyPolicy: Forbid | |
jobTemplate: | |
spec: | |
template: |