Skip to content

Instantly share code, notes, and snippets.

View vadirajks's full-sized avatar

Vadiraj K.S vadirajks

View GitHub Profile
@vadirajks
vadirajks / gke-ingress-manged-tls.md
Created August 2, 2023 06:22 — forked from pydevops/gke-ingress-manged-tls.md
Create a GCP managed TLS certificate for the GKE ingress

GKE ingress in a nutshell

Solution #1 (ManagedCertificate CRD in GKE)

  • GKE with Google-managed SSL certificates
    • Use ManagedCertificate CRD to create a object.
    • Associate the ManagedCertificate object to an Ingress by adding an annotation networking.gke.io/managed-certificates to the Ingress. This annotation is a comma-separated list of ManagedCertificate resources, cert1,cert2,cert3 for example.

Solution #2 (Google Cloud SSL Certificate)

Assumption

@vadirajks
vadirajks / ubuntu-aliyun-mirrors.sh
Created March 20, 2023 11:56 — forked from wsvn53/ubuntu-aliyun-mirrors.sh
Change Ubuntu source to aliyun mirrors
#!/bin/bash
cat << EOF > /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

Resize splits more quickly EDIT

SHARE Tip 1215 Printable Monobook Previous Next created April 26, 2006 · complexity basic · author Robert & Bill · version 7.0

This tip is about how to resize Windows efficiently.

You can use the :resize command or its shortcut :res to change the height of the window. To change the height to 60 rows, use:

@vadirajks
vadirajks / client.yaml
Created December 24, 2022 10:20 — forked from HebertCL/client.yaml
Issue 5344
# This playbook was meant to be executed after provisioning.
# Initially client side certificates where created during
# image cooking, but soon figured out it would not work in
# the long run. When I changed it to post provision execution
# I found errors that mentioned certificates already existed
# and found the issue described in GitHub.
---
- hosts: all
become: yes
@vadirajks
vadirajks / 0-rsync.log
Created May 28, 2022 13:48 — forked from odyssey4me/0-rsync.log
Working with rsync and chown, with rsync and with Ansible's synchronize module. Playbook 1 only works for Ansible<2.3 and Playbook 2 works for Ansible 2.3+. The subtle difference was discovered in https://github.com/ansible/ansible/issues/23575 - for Ansible 2.3+ DO NOT QUOTE the rsync_opts.
root@foo:~# rm -rf test; mkdir test; touch test/test{1,2,3}; chown ubuntu test/test1; chown aptly test/test2; ls -al test/
total 8
drwxr-xr-x 2 root root 4096 Nov 30 10:47 .
drwx------ 11 root root 4096 Nov 30 10:47 ..
-rw-r--r-- 1 ubuntu root 0 Nov 30 10:47 test1
-rw-r--r-- 1 aptly root 0 Nov 30 10:47 test2
-rw-r--r-- 1 root root 0 Nov 30 10:47 test3
root@foo:~# rsync -avz --chown 'nginx:www-data' -e "ssh -i ~/.ssh/my.key" --verbose test root@bar:/tmp/
opening connection using: ssh -i "~/.ssh/my.key" -l root bar rsync --server -vvlogDtprze.iLsfx "--usermap=*:nginx" "--groupmap=*:www-data" . /tmp/ (13 args)
@vadirajks
vadirajks / Upgrade vim
Created February 23, 2022 08:00 — forked from yevrah/Upgrade vim
Update to Vim8 on Centos 7
################################################################################
# Method 1: Install using rpm packages (credit to DarkMukke)
#
rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
# WARNING: removing vim-minimal uninstalls `sudo` if you skip the second step
# make sure to at least run `yum install sudo`
yum -y remove vim-minimal vim-common vim-enhanced
@vadirajks
vadirajks / lvn.md
Created February 17, 2022 18:09 — forked from mtds/lvn.md
Linux Virtual Networking

Virtual Networking on Linux

In the Linux Kernel, support for networking hardware and the methods to interact with these devices is standardized by the socket API:

                +----------------+
                |   Socket API   |
                +-------+--------+
                        |
User space              |
@vadirajks
vadirajks / Dockerfile
Created November 14, 2021 08:14 — forked from ju2wheels/Dockerfile
Docker Dockerfile reference template
# Last updated: 08/24/2916
#
# Total instructions available: 18
#
# https://docs.docker.com/engine/reference/builder/
#
# You can use a .dockerignore file in the same context directory as
# your Dockerfile to ignore files in the context before sending them
# to the Docker daemon for building to speed up building.
@vadirajks
vadirajks / postgres-cheatsheet.md
Created September 5, 2021 16:10 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# /etc/screenrc
#
# This is the system wide screenrc.
#
# You can use this file to change the default behavior of screen system wide
# or copy it to ~/.screenrc and use it as a starting point for your own
# settings.