Skip to content

Instantly share code, notes, and snippets.

View dwdraju's full-sized avatar

Raju Dawadi dwdraju

View GitHub Profile
@dwdraju
dwdraju / install-golang.md
Created October 22, 2018 10:02
Install GO on Ubuntu 16.04

Get Golang version: https://golang.org/dl/

wget https://dl.google.com/go/go1.11.1.linux-amd64.tar.gz
tar -xvf go1.11.1.linux-amd64.tar.gz
sudo mv go /usr/local
@dwdraju
dwdraju / k8s-log-viewer-role.yml
Created October 19, 2018 16:02
Kubernetes RBAC for Log Viewer
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: user-log-reader
namespace: default
rules:
- apiGroups:
- ""
resources:
- pods
@dwdraju
dwdraju / config.json
Last active February 5, 2022 13:31
Vault Config File (/etc/vault/config.json)
disable_cache = true
disable_mlock = true
ui = true
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = 0
tls_cert_file = "/etc/letsencrypt/live/vault.example.com/fullchain.pem"
tls_key_file = "/etc/letsencrypt/live/vault.example.com/privkey.pem"
}
storage "file" {
@dwdraju
dwdraju / vault.service
Created October 7, 2018 16:48
vault systemd servce
[Unit]
Description=vault service
Requires=network-online.target
After=network-online.target
ConditionFileNotEmpty=/etc/vault/config.json
[Service]
EnvironmentFile=-/etc/sysconfig/vault
Environment=GOMAXPROCS=2
Restart=on-failure
@dwdraju
dwdraju / k8s-pod-log-viewer.md
Last active October 1, 2018 11:15
Kubernetes Pod Log Viewer Access
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: log-reader
  namespace: default
rules:
- apiGroups:
    - ""
 resources:
@dwdraju
dwdraju / speech_api.sh
Created September 13, 2018 09:49 — forked from bretmcg/speech_api.sh
Call the Google Cloud Speech API from command line
#!/bin/bash
# This is not an official Google product.
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@dwdraju
dwdraju / mysql-join.md
Last active September 6, 2018 09:24
mysql Join

INNER JOIN: returns rows when there is a match in both tables.

LEFT JOIN / LEFT OUTER JOIN: returns all rows from the left table, even if there are no matches in the right table.

RIGHT JOIN / RIGHT OUTER JOIN: returns all rows from the right table, even if there are no matches in the left table.

FULL JOIN / FULL OUTER JOIN / OUTER JOIN: returns rows when there is a match in one of the tables.

SELF JOIN: is used to join a table to itself, as if the table were two tables, temporarily renaming at least one table in the SQL statement.

@dwdraju
dwdraju / php-load.php
Created August 28, 2018 11:53
Generate php load
<?php
$x = 0.0001;
for ($i = 0; $i <= 1000000; $i++) {
$x += sqrt($x);
}
echo "OK!";
?>
@dwdraju
dwdraju / pg-permission.md
Created August 19, 2018 10:27
Postgres permission error - solution

Error message

could not create lock file "postmaster.pid": Permission denied 
HINT: The file seems accidentally left over, but it could not be removed. Please remove the file by hand and try again. postmaster.pid

Solution

@dwdraju
dwdraju / .gitlab-ci.yml
Created August 13, 2018 16:14 — forked from jlis/.gitlab-ci.yml
AWS ECS and ECR deployment via Docker and Gitlab CI
image: docker:latest
variables:
REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME>
REGION: eu-central-1
TASK_DEFINTION_NAME: <TASK DEFINITION NAME>
CLUSTER_NAME: <CLUSTER NAME>
SERVICE_NAME: <SERVICE NAME>
services: