Skip to content

Instantly share code, notes, and snippets.

View ntung's full-sized avatar
🏠
Working from home

Tung Nguyen ntung

🏠
Working from home
View GitHub Profile
@ntung
ntung / kubectl-multi-version-brews.md
Created March 3, 2020 06:18 — forked from rdump/kubectl-multi-version-brews.md
kubectl multi-version brews (kubernetes-cli formula)

kubectl multi-version brews

We need to run multiple versions of kubectl for compatibility with various kubernetes clusters.

It's a bit easier to get and use multiple versions of kubectl using Homebrew than it is using Macports.

With brew, it's simple to:

  • Install a bunch of versions of kubectl (in the kubernetes-cli Formula)
  • Switch between them as needed
@androidfred
androidfred / javafx.md
Last active October 27, 2021 03:21
java.lang.ClassNotFoundException: javafx.util.Pair

java.lang.ClassNotFoundException: javafx.util.Pair happens because javafx.util.Pair and other classes from javafx.util are not included in OpenJDK. Options for resolving:

Switch class

Map.Entry<K, V> from java.util is similar to javafx.util.Pair.

Install java-openjfx

Install java-openjfx through your package manager. (or whatever means you used to install Java on your machine) Note that java-openjfx is compatible with OpenJDK8, not previous versions.

After installing java-openjfx, you may have to add it manually to your IDE SDK classpath. Eg in IntelliJ, you may have to go to Project Structure | SDKs | <select your SDK> | Classpath | + (the Classpath +, not the SDKs +) | and add /usr/lib/jvm/java-8-openjdk/jre/lib/ext/jfxrt.jar (which should be there now that java-openjfx has been installed) | OK

@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active January 6, 2024 22:04
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@nrollr
nrollr / Redis.sh
Created March 29, 2016 11:30
Install Redis via Homebrew
#!/bin/bash
brew install redis # Install Redis using Homebrew
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents # Enable Redis autostart
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist # Start Redis server via launchctl
# homebrew.mxcl.redis.plist contains reference to redis.conf file location: /usr/local/etc/redis.conf
redis-server /usr/local/etc/redis.conf # Start Redis server using configuration file, Ctrl+C to stop
redis-cli ping # Check if the Redis server is running
@Ladicek
Ladicek / maven-deploy-sources.sh
Created January 7, 2016 09:51
deploy *-sources.jar to internal Maven repository
#!/bin/bash
# successful "mvn clean install" or a variant thereof (e.g. -DskipTests)
# is typically required before running this script
REPOSITORY_ID=...
REPOSITORY_URL=...
mvn clean source:jar
@ishults
ishults / Grails_Groovy_Versions.txt
Last active February 9, 2023 18:04
List of Groovy versions for Grails
// Compiled by Igor Shults
// Last Updated: July 23, 2020
GRAILS GROOVY SOURCE
4.1.0 2.5.14 https://github.com/grails/grails-core/blob/v4.1.0/gradle.properties
4.0.4 2.5.6
4.0.3 2.5.6
4.0.2 2.5.6
4.0.1 2.5.6
4.0.0 2.5.6 https://github.com/grails/grails-core/blob/v4.0.0/build.gradle
@bennadel
bennadel / angularjs-modals.htm
Created March 23, 2015 12:19
Creating A Simple Modal System In AngularJS
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Creating A Simple Modal System In AngularJS
</title>
<link rel="stylesheet" type="text/css" href="./demo.css"></link>
@stefansundin
stefansundin / extract-attachments.py
Last active September 27, 2022 18:54
Extract attachments from emails that Gmail doesn't allow you to download. This is dumb. Please use Python >= 3.4.
#!/usr/bin/env python3
# Get your files that Gmail block. Warning message:
# "Anti-virus warning - 1 attachment contains a virus or blocked file. Downloading this attachment is disabled."
# Based on: https://spapas.github.io/2014/10/23/retrieve-gmail-blocked-attachments/
# Instructions:
# Go to your emails, click the arrow button in the top right, "Show original", then "Download Original".
# Move the files to the same directory as this program, then run it.
import sys
@johnpolacek
johnpolacek / .gitconfig
Last active March 22, 2024 05:51
My current .gitconfig aliases
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
st = status
aa = add -A .
@lukauskas
lukauskas / parse_sbml_stoichiometry.py
Last active June 7, 2021 04:12
Parse SBML stoichiometry matrix
from __future__ import print_function
import libsbml
import argparse
def _parser():
parser = argparse.ArgumentParser(description="Parse stoichiometry matrix of SBML file")
parser.add_argument('file', metavar="filename", type=argparse.FileType('r'),
help="Filename of SBML file to parse")