Skip to content

Instantly share code, notes, and snippets.

View taveek's full-sized avatar
☁️

Tavee Khunbida taveek

☁️
View GitHub Profile
@taveek
taveek / query_activedirectory.py
Created June 8, 2022 09:27 — forked from DiegoQueiroz/query_activedirectory.py
Python-LDAP Query Active Directory Example (with paged results to prevent ldap.SIZELIMIT_EXCEEDED exception)
# -*- coding: utf-8 -*-
# requires python-ldap (usually pip install python-ldap)
# But this package requires OpenLDAP libraries, so it is a pain to install it on Windows.
# So, if you're on Windows, I recomment to use pre-compiled binaries with this command (virtualenv supported):
# pip install https://download.lfd.uci.edu/pythonlibs/h2ufg7oq/python_ldap-3.1.0-cp37-cp37m-win_amd64.whl
import ldap
from ldap.controls import SimplePagedResultsControl
@taveek
taveek / rancher-keycloak-idp-configuration.md
Created May 13, 2022 02:31 — forked from PhilipSchmid/rancher-keycloak-idp-configuration.md
Rancher v2.X KeyCloak Authentication Backend Configuration

Rancher v2.X KeyCloak Authentication Backend Configuration

Ranchers official documentation about how to configure the Rancher <> KeyCloak setup is fine but definitely not sufficient to successfully configure it (https://rancher.com/docs/rancher/v2.x/en/admin-settings/authentication/keycloak/). That's the reason why here every single required step is documented down here.

KeyCloak Configuration

I simply use the default master realm for the Rancher client. Nevertheless, it would sometimes absolutely make sense to use a custom KeyCloak realm.

  1. Login as admin on https://keycloak.example.com/. Important: It's crucial that in KeyCloak the same username exists as you use as admin user on Rancher. Since I just use the admin account in this guide, this prerequisite is already achieved.
  2. Create a new client under https://keycloak.example.com/auth/admin/master/console/#/realms/master/clients
    • Client ID: https://rancher.example.com/v1-saml/keycloak/saml/metadata
@taveek
taveek / tmux_cheatsheet.markdown
Created September 9, 2021 12:26 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

K8s RBAC user creation

CertificateSigningRequest

generate key - certificate signing request

export USER_NAME=user1
openssl genrsa -out $USER_NAME.key 2048
openssl req -new -key $USER_NAME.key -out $USER_NAME.csr 
@taveek
taveek / FutureExample.scala
Created September 12, 2019 04:19
ตัวอย่างการใช้งาน Future ใน Scala อย่างง่าย และการสร้าง ExecutionContext
package example
import scala.concurrent.duration.Duration
import scala.concurrent.{ Future, Await }
//import scala.concurrent.ExecutionContext.Implicits.global
object Hello extends Greeting with App {
Prog.debug("Starting Main")
val futureA = Prog.taskA()
val futureB = Prog.taskB()
@taveek
taveek / app-status.sh
Created June 5, 2018 03:00
JBOSS standalone operation scripts
#!/bin/bash
JBOSS_HOME=/usr/local/share/jboss
$JBOSS_HOME/bin/jboss-cli.sh -c --controller=localhost:9999 --command="cd deployment,cd myapp.war, read-attribute status" --user=app1 --password=password
@taveek
taveek / gist:c4304ad6631c2c9639e17b3c2292ba2a
Created May 9, 2018 15:30
Generate Angular component with inline style and template and no spec file
ng g c sample --inline-style --inline-template --no-spec
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.8.0/jasmine.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.8.0/jasmine.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.8.0/jasmine-html.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.8.0/boot.js"></script>
<script type="text/javascript">
</script>
</head>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>TooDoo Web Application</display-name>
</web-app>
@taveek
taveek / pom.xml
Last active December 29, 2015 12:49
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sck</groupId>
<artifactId>TooDoo</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>TooDoo Maven Webapp</name>
<url>http://maven.apache.org</url>