Skip to content

Instantly share code, notes, and snippets.

View jkeam's full-sized avatar
🍻

Jon Keam jkeam

🍻
View GitHub Profile
@kincl
kincl / imageset-config-4.12.yaml
Last active April 17, 2024 14:01 — forked from johnsimcall/imageset-config.yaml
oc-mirror imageset-config.yaml for OpenShift Virtualization and OpenShift Data Foundations
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
local:
path: ./
mirror:
platform:
channels:
# Get odo for linux
$ curl -OL https://mirror.openshift.com/pub/openshift-v4/clients/odo/v2.0.0/odo-linux-amd64 && mv odo-linux-amd64 odo && chmod u+x odo
$ export PATH=$PATH:$(pwd)
$ odo version
# Use git to check out the .NET Core application
$ git clone https://github.com/redhat-developer/s2i-dotnetcore-ex
$ cd s2i-dotnetcore-ex/app
$ git checkout dotnetcore-3.1
@dudash
dudash / kn-select
Last active April 13, 2021 20:46
Flip between versions of the Knative CLI easily
#!/bin/bash
# Simple script to help configuring which kn CLI to use when you
# have a need to keep multiple versions and switch between them.
# Install and notes:
# 1. put this in /usr/local/bin and chmod +x
# 2. keep all the versions of kn in the /Applications directory
# 3. name kn executables with corresponding version - e.g. /Applications/kn-0.14.0
@tonykhbo
tonykhbo / remote_crc.md
Last active June 19, 2020 03:01 — forked from tmckayus/remote_crc.md
Running 'crc' on a remote server

Overview: running crc on a remote server

This original document shows how to deploy an OpenShift instance on a server using CodeReady Containers (crc) that can be accessed remotely from one or more client machines (sometimes called a "headless" instance). This provides a low-cost test and development platform that can be shared by developers. Deploying this way also allows a user to create an instance that uses more cpu and memory resources than may be available on his or her laptop.

While there are benefits to this type of deployment, please note that the primary use case for crc is to deploy a local OpenShift instance on a workstation or laptop and access it directly from the same machine. The headless setup is configured completely outside of crc itself, and supporting a headless setup is beyond the mission of the crc development team. Please do not ask for changes to crc to support this type of deployment, it will only cost the team time as they politely decline :)

The original gist by Roberto ha

@kirillshevch
kirillshevch / rails_new_options_help.md
Last active April 8, 2024 15:24
List of "rails new" options to generate a new Rails 7 application

Run rails new --help to see all of the options you can use to create a new Rails application:

Output for Rails 7+

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-namespace], [--no-skip-namespace]              # Skip namespace (affects only isolated engines)
@npearce
npearce / install-docker.md
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@pat
pat / thinking_sphinx.yml
Last active April 23, 2022 03:49
Thinking Sphinx Configuration
# Extended configuration for Thinking Sphinx can be stored in the
# config/thinking_sphinx.yml file within your application (this file was
# previously known as config/sphinx.yml in TS v1/v2).
#
# Many settings from Sphinx itself can be set here, and they'll flow through to
# the appropriate section of the generated configuration. However, some are
# used for Thinking Sphinx behaviour, and so those are documented here first.
#
# Configuration is grouped by environment, just like config/database.yml in a
# standard Rails application.
@soulmachine
soulmachine / jwt-expiration.md
Last active April 9, 2024 04:12
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@tuxfight3r
tuxfight3r / curl_notes.txt
Last active February 16, 2023 12:44
openshift rest api login / json patch via curl
#Login to openshift and retrieve token
curl -u admin -kv -H "X-CSRF-Token: xxx" \
'https://master.cluster.local:8443/oauth/authorize?client_id=openshift-challenging-client&response_type=token'
#It should give you a bearer token like this
https://master.cluster.local:8443/oauth/token/implicit#access_token=aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4&expires_in=86400&scope=user%3Afull&token_type=Bearer
TOKEN="aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4"
#Get a configmap named configmaptest