Skip to content

Instantly share code, notes, and snippets.

Avatar
🔭

Gilad Peleg pgilad

🔭
View GitHub Profile
@pgilad
pgilad / docker-volume-prune.sh
Created May 4, 2020
Docker volume prune with until workaround (filter for --until isn't supported)
View docker-volume-prune.sh
#!/usr/bin/env bash
set -euo pipefail
volumes=$(docker volume ls --filter dangling=true --quiet)
if [[ -z "$volumes" ]]; then
echo "No dangling volumes found"
exit 0
fi
@pgilad
pgilad / install-package.sh
Created Nov 22, 2019
Install a pip package using Poetry and use pre-release version
View install-package.sh
# An example on how to install poetry preview version
$ pipx install poetry --pip-args="--pre"
@pgilad
pgilad / hostname.fish
Created Nov 2, 2019
Update mac names
View hostname.fish
set -l name Gilad-MBP-Personal
sudo scutil --set ComputerName $name
sudo scutil --set LocalHostName $name
sudo scutil --set HostName $name
dscacheutil -flushcache
sudo reboot
@pgilad
pgilad / .vimrc
Created Oct 27, 2019
Securely support `modelines` in Vim
View .vimrc
" https://github.com/numirias/security/blob/master/doc/2019-06-04_ace-vim-neovim.md#patches
if has('patch-8.1.1366')
set modelines=5
set nomodelineexpr
set modeline
else
set nomodeline
endif
@llbbl
llbbl / fix_openssl_catalina.sh
Last active Oct 12, 2020
fix missing openssl files in catalina
View fix_openssl_catalina.sh
#!/bin/bash
echo 'update brew'
brew update
echo 'upgrade brew'
brew upgrade
@pgilad
pgilad / docker-compose-opt.service
Last active Aug 19, 2019
Docker Compose Pi3 Applications Service
View docker-compose-opt.service
# File: /etc/systemd/system/docker-compose-opt.service
[Unit]
Description=Docker Compose Opt Service
Requires=docker.service network-online.target
After=docker.service network-online.target
[Service]
WorkingDirectory=/opt/applications
Type=oneshot
@pgilad
pgilad / apache-zeppelin.rb
Created Jul 14, 2019
Apache Zeppelin Brew Formula 0.7.3 (for AWS Glue compatibility)
View apache-zeppelin.rb
class ApacheZeppelin < Formula
desc "Web-based notebook that enables interactive data analytics"
homepage "https://zeppelin.apache.org"
url "http://archive.apache.org/dist/zeppelin/zeppelin-0.7.3/zeppelin-0.7.3-bin-all.tgz"
sha256 "7e657df51ecfd4aad39d42f8578409692244d36b2da92b5dbd3b6957b829bf58"
head "https://github.com/apache/zeppelin.git"
bottle :unneeded
def install
@pgilad
pgilad / get-token.fish
Last active Jun 8, 2019
Get k8s dashboard token for dashboard
View get-token.fish
#!/usr/bin/env fish
kubectl -n kube-system describe secrets (kubectl -n kube-system get secrets | awk '/clusterrole-aggregation-controller/ {print $1}') | awk '/token:/ {print $2}'
@pgilad
pgilad / kube-resources.sh
Created Jun 6, 2019
Get ALL resources in k8s namespace
View kube-resources.sh
#!/bin/bash
kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found
@pgilad
pgilad / DemoController.java
Last active Mar 6, 2019
Supporting files for my blog post on remote jmx Spring Boot debugging
View DemoController.java
package com.example.demo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
@RestController
public class DemoController {
@GetMapping("/ping")
You can’t perform that action at this time.