Skip to content

Instantly share code, notes, and snippets.

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

Richard Capraro rcapraro

🏠
Working from home
View GitHub Profile
package io.saagie.application
import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.module.kotlin.kotlinModule
import io.fabric8.kubernetes.api.model.Namespaced
import io.fabric8.kubernetes.api.model.ObjectMetaBuilder
import io.fabric8.kubernetes.client.CustomResource
import io.fabric8.kubernetes.client.CustomResourceList
import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.fabric8.kubernetes.client.Watcher
@rcapraro
rcapraro / mongo-docker.bash
Created November 2, 2017 15:07 — forked from davideicardi/mongo-docker.bash
Running mongodb inside a docker container (with mongodb authentication)
# Create a container from the mongo image,
# run is as a daemon (-d), expose the port 27017 (-p),
# set it to auto start (--restart)
# and with mongo authentication (--auth)
# Image used is https://hub.docker.com/_/mongo/
docker pull mongo
docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth
# Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception)
# add a root user
@rcapraro
rcapraro / gist:7eb45a306c778a4c9a7d22fd8d5def2e
Created July 12, 2017 07:27 — forked from dedy-purwanto/gist:11312110
Bulk remove iTerm2 color schemes.
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist
@rcapraro
rcapraro / README.md
Last active May 25, 2018 16:51
Keycloak sandbox

Docker images

Postgres docker image

docker run --name postgres -e POSTGRES_DATABASE=keycloak -e POSTGRES_USER=keycloak -e POSTGRES_PASSWORD=password -e POSTGRES_ROOT_PASSWORD=root_password -d postgres

Keycloak docker image

docker run --name keycloak --link postgres:postgres -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin jboss/keycloak-postgres

Obtain a token

curl --data "grant_type=password&client_id=curl&username=richard&password=password" http://localhost:8080/auth/realms/master/protocol/openid-connect/token

To clear containers:
docker rm -f $(docker ps -a -q)
To clear images:
docker rmi -f $(docker images -a -q)
To clear volumes:
@rcapraro
rcapraro / README.md
Last active April 1, 2022 13:50 — forked from steve-jansen/README.md
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/rcapraro/a9ebd4db4d1bfe45b02f89aabd6595a3/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@rcapraro
rcapraro / Git + P4merge
Created October 14, 2015 14:16
Setup P4merge as Git merge and diff tool
git config --global diff.tool p4merge
git config --global difftool.p4merge.cmd 'p4merge.exe $LOCAL $REMOTE'
git config --global difftool.prompt false
git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge.exe $BASE $LOCAL $REMOTE $MERGED'
git config --global mergetool.prompt false
git config --global mergetool.trustExitCode false
git config --global mergetool.keepBackup false
@rcapraro
rcapraro / delete_old_sonar_projects.py
Created September 23, 2015 14:09
Deletes old sonar projects (last analysis date older than 60 days)
import json
import requests
import iso8601
import pytz
from datetime import datetime, timedelta
url_projects = 'http://srvpic.intra.sada.fr:9000/sonar/api/resources'
url_delete = 'http://srvpic.intra.sada.fr:9000/sonar/api/projects/destroy'
@rcapraro
rcapraro / git-prompt.lua
Created May 15, 2015 15:30
Git-aware prompt for NYAGOS
set{
PROMPT='$e[36;40;1m$P$e[37;1m'
}
local git_branch = function()
local path = nyagos.getwd()
repeat
if nyagos.access(nyagos.pathjoin(path, '.git'), 0) then
break
end