Skip to content

Instantly share code, notes, and snippets.

:octocat:

Ruan Bekker ruanbekker

Block or report user

Report or block ruanbekker

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
@ruanbekker
ruanbekker / clean-up-boot-partition-ubuntu.md
Created May 17, 2019 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@ruanbekker
ruanbekker / letsencrypt-docker.md
Created May 9, 2019
Generate Letsencrypt Certificate with Docker
View letsencrypt-docker.md
mkdir letsencrypt
docker run -ti --rm -v "$(pwd)"/letsencrypt:/etc/letsencrypt \
certbot/certbot --manual --preferred-challenges dns certonly -d sub.domain.com
@ruanbekker
ruanbekker / go
Created Apr 25, 2019 — forked from CarterTsai/go
golang s3 PutObject
View go
package main
import (
"bytes"
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
)
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
View javascript_cheatsheet.md

Arrays

Define array:

> var dict = [];

Append dictionary to array:

@ruanbekker
ruanbekker / golang_build_guide.md
Last active Apr 21, 2019
Golang Building Guide
View golang_build_guide.md

Operating System and Platform

Mac

GOOS GOARCH
darwin 386
darwin amd64
darwin arm
darwin arm64
@ruanbekker
ruanbekker / create_slack_webhook.md
Last active Apr 18, 2019
Create a Webhook in Slack
View create_slack_webhook.md

Slack Webhooks

Configuration for Slack Webhooks

Configuration

Head over to:

  • https://{your-team}.slack.com/apps/manage/custom-integrations

Select Incoming Webhooks:

@ruanbekker
ruanbekker / rest_api.go
Created Apr 17, 2019
Rest API in Golang
View rest_api.go
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/rs/xid"
)
View drone_cli_examples.md

On Golang:Alpine:

docker run -it golang:alpine sh
apk update && apk add curl openssh

My Server is running on 0.8.6

View influx_queries.md

Write to InfluxDB:

$ curl  -i -XPOST "http://influxdb:8086/write?db=foo" \
  --data-binary 'events2 title="my-title",text="test-text",tags="my-tags",woof=true'

InfluxDB Queries:

You can’t perform that action at this time.