Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Tung Nguyen V. N. ntung

🏠
Working from home
View GitHub Profile
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active Aug 5, 2020
how to delete a git tag locally and remote
View git-tag-delete-local-and-remote.sh
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active Jul 26, 2020
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry
View 1_kubernetes_on_macOS.md

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

@ishults
ishults / Grails_Groovy_Versions.txt
Last active Jul 23, 2020
List of Groovy versions for Grails
View Grails_Groovy_Versions.txt
// Compiled by Igor Shults
// Last Updated: July 23, 2020
GRAILS GROOVY SOURCE
4.1.0 3.0.5 https://github.com/grails/grails-core/blob/v4.1.0/build.gradle
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
@nrollr
nrollr / Redis.sh
Created Mar 29, 2016
Install Redis via Homebrew
View Redis.sh
#!/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
@jbub
jbub / squash-commits.sh
Created Jun 12, 2013
git squash last two commits into one
View squash-commits.sh
git rebase --interactive HEAD~2
# we are going to squash c into b
pick b76d157 b
pick a931ac7 c
# squash c into b
pick b76d157 b
s a931ac7 c
@digitaljhelms
digitaljhelms / gist:3099010
Created Jul 12, 2012
Squash the first two commits in a git repository's history
View gist:3099010

The scenario

Your repository has two commits:

$ git log --oneline
957fbfb No, I am your father.
9bb71ff A long time ago in a galaxy far, far away....
@miebach
miebach / git-log-pretty
Last active Jun 2, 2020
pretty git log graph with coloured branches
View git-log-pretty
# Visualizing branch topology in git on the commandline
git log --graph --oneline --full-history --all
git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"
# With colors in Bash:
git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"
@kdabir
kdabir / get_content.groovy
Created Feb 22, 2012
get content from url and write to a file in groovy
View get_content.groovy
// saving from url to a file (append)
new File("output.xml") << new URL ("http://some.url/some/path.xml").getText()
@ntung
ntung / kubectl-multi-version-brews.md
Created Mar 3, 2020 — forked from rdump/kubectl-multi-version-brews.md
kubectl multi-version brews (kubernetes-cli formula)
View kubectl-multi-version-brews.md

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
@stefansundin
stefansundin / extract-attachments.py
Last active Jan 29, 2020
Extract attachments from emails that Gmail doesn't allow you to download. This is dumb. Please use Python >= 3.4.
View extract-attachments.py
#!/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 email
You can’t perform that action at this time.