Skip to content

Instantly share code, notes, and snippets.

View tamalsaha's full-sized avatar
🎢
Building. Learning. Improving.

Tamal Saha tamalsaha

🎢
Building. Learning. Improving.
View GitHub Profile
@tamalsaha
tamalsaha / users.md
Created February 27, 2017 04:20 — forked from philips/users.md
Kubernetes Third-Party Resource Users

Please comment below if you are using Kubernetes Third-Party Resources and I will add you to the list.

Known Users:

@tamalsaha
tamalsaha / translate.go
Created May 4, 2017 07:42 — forked from hvoecking/translate.go
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@tamalsaha
tamalsaha / gist:46dc6d331dcc8b998a1d95788febea96
Created December 15, 2017 08:25
git clone all remote branches locally
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do
git branch --track ${branch#remotes/origin/} $branch
done
#!/bin/bash
# SPDX-License-Identifier: MIT
## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
#
# Lockable script boilerplate
@tamalsaha
tamalsaha / remove-docker-containers.md
Created April 15, 2018 05:50 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
@tamalsaha
tamalsaha / 01_pkcs12-cacerts-workaround.sh
Created June 22, 2018 08:19 — forked from mikaelhg/01_pkcs12-cacerts-workaround.sh
Workaround for java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
# Ubuntu 18.04 and various Docker images such as openjdk:9-jdk throw exceptions when
# Java applications use SSL and HTTPS, because Java 9 changed a file format, if you
# create that file from scratch, like Debian / Ubuntu do.
#
# Before applying, run your application with the Java command line parameter
# java -Djavax.net.ssl.trustStorePassword=changeit ...
# to verify that this workaround is relevant to your particular issue.
#
# The parameter by itself can be used as a workaround, as well.

In a terminal start a server.

$ python -m SimpleHTTPServer 8000

In another terminal set up the cgroups freezer.

@tamalsaha
tamalsaha / jessfraz.md
Created July 30, 2018 08:11 — forked from acolyer/jessfraz.md
Containers, operating systems and other fun things from The Morning Paper
@tamalsaha
tamalsaha / papers.md
Created July 30, 2018 08:12 — forked from jhertz/papers.md
Security Papers I Like

In absolutely no order

@tamalsaha
tamalsaha / addition_to_sys.sql
Created December 10, 2019 04:19 — forked from lefred/addition_to_sys.sql
MySQL Group Replication extra functions and views to sys schema
USE sys;
DELIMITER $$
CREATE FUNCTION IFZERO(a INT, b INT)
RETURNS INT
DETERMINISTIC
RETURN IF(a = 0, b, a)$$
CREATE FUNCTION LOCATE2(needle TEXT(10000), haystack TEXT(10000), offset INT)