Skip to content

Instantly share code, notes, and snippets.

View joesan's full-sized avatar
🎯
Focusing

Joesan joesan

🎯
Focusing
View GitHub Profile
@joesan
joesan / git-status.sh
Created December 12, 2022 05:24
Git Status on Subfolders Recursively
find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} && cd {} && git status -s && echo)' \;
@joesan
joesan / git-tag-delete.txt
Created November 1, 2022 09:24
Delete All Git Tags Locally and Remote
Step 1: Delete all Local Tags
```
git tag | xargs git tag -d
```
Step 2: Delete all Remote Tags
```
git ls-remote --tags --refs origin | cut -f2 | xargs git push origin --delete
/* The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or
* her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.
*
* You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
*
* In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may
* have in the work or in how the work is used, such as publicity or privacy rights.
* Unless expressly stated otherwise, the person who associated a work with this deed makes no warranties about the work,
* and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law.
* When using or citing the work, you should not imply endorsement by the author or the affirmer.
@joesan
joesan / PYTHON_DEFAULT.md
Last active November 4, 2021 11:57 — forked from patrickmmartin/PYTHON_DEFAULT.md
update-alternatives for python3 on Ubuntu

Ubuntu 20.04 Playing with Python versions

Loads of solutions exist, but for changing the system default, alias is not the way to go.

$ update-alternatives --list python update-alternatives: error: no alternatives for python

@joesan
joesan / k8s-pi.md
Created April 21, 2018 18:52 — forked from alexellis/k8s-pi.md
K8s on Raspbian

Kubernetes on (vanilla) Raspbian Lite

Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system called Raspbian. This means you can carry on using all the tools and packages you're used to with the officially-supported OS.

Pre-reqs:

  • You must use an RPi 2 or 3 for use with Kubernetes
  • I'm assuming you're using wired ethernet (Wi-Fi also works, but it's not recommended)

Master node setup

@joesan
joesan / gist:e740e60cf9f04850590109d1d41b9abb
Created April 20, 2018 19:26 — forked from jordelver/gist:3139365
How to write an image file to an SD card under Mac OS X (for Raspberry Pi)

Find the SD card device

In this case, the SD card is /dev/disk4. DO NOT get this wrong or you may destroy all the data on the wrong disk/card/drive.

diskutil list

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *160.0 GB   disk0

1: EFI 209.7 MB disk0s1

@joesan
joesan / linecounter
Created August 22, 2017 05:32
Count the Number of lines in a recursive way
find . -name "*.scala" -print | xargs wc -l
@joesan
joesan / docker_build.sh
Last active January 2, 2023 10:11
Scala script from within a Bash
#!/bin/sh
exec scala "$0" "$@"
!#
/***
scalaVersion := "2.11.11"
libraryDependencies ++= Seq(
"com.typesafe" % "config" % "1.3.1"
)
@joesan
joesan / sbt-utilities
Created May 15, 2017 20:59
Ignore Tests when Running SBT
sbt 'set test in Test := {}' clean assembly
@joesan
joesan / WiFiConnector.scala
Last active February 2, 2017 21:15
Programatic WiFi Connectivity
object WiFiConnector extends App {
if (System.getProperty("os.name").contains("Mac"))
scanMac()
else
scanWindows()
def scanWindows() = {
val builder = new ProcessBuilder(