Skip to content

Instantly share code, notes, and snippets.

🔭

Gilad Peleg pgilad

🔭
Block or report user

Report or block pgilad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pgilad
pgilad / docker-compose-opt.service
Created Aug 17, 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")
@pgilad
pgilad / popular-git-message.sh
Created Feb 9, 2019
Get most popular commit message and strip JIRA prefix tag
View popular-git-message.sh
@pgilad
pgilad / DataProcessor.java
Created Jan 8, 2019
Example of Hot/Cold producer when you toggle refCount/autoConnect
View DataProcessor.java
public static void main(String[] args) throws InterruptedException {
final Flux<Long> longFlux = Flux.interval(Duration.ofSeconds(1))
.doOnSubscribe(e -> log.info("SUBSCRIBE"))
.doOnTerminate(() -> log.info("TERMINATE"))
.doOnComplete(() -> log.info("COMPLETE"))
.doOnCancel(() -> log.info("CANCEL"))
.doOnNext(s -> log.info("NEXT {}", s))
.replay()
.refCount(2, Duration.ofSeconds(1));
@pgilad
pgilad / Dockerfile
Last active Jan 2, 2019
Dockerfile to create a zip for AWS Lambda code based on Python 2.7 and Pipenv
View Dockerfile
FROM amazonlinux:latest
RUN yum -y update && yum install -y gcc python-devel zip which
RUN curl https://bootstrap.pypa.io/get-pip.py | python -
RUN pip install pipenv
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV SOURCE_DIR lambdas
@pgilad
pgilad / Deployment.java
Last active Jan 24, 2019
Example of how to patch a deployment image on Kubernetes using Java client
View Deployment.java
package com.blazemeter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.kubernetes.client.ApiClient;
import io.kubernetes.client.ApiException;
import io.kubernetes.client.Configuration;
import io.kubernetes.client.apis.AppsV1beta1Api;
import io.kubernetes.client.models.AppsV1beta1Deployment;
@pgilad
pgilad / DataSender.java
Last active Dec 26, 2018
DataSender using Netty Reactive Client
View DataSender.java
package data;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.netty.ByteBufFlux;
import reactor.netty.http.client.HttpClient;
import reactor.retry.Retry;
import settings.Settings;
You can’t perform that action at this time.