Skip to content

Instantly share code, notes, and snippets.

@celsoagra
celsoagra / touchegg.md
Last active March 8, 2017 02:38
configure touchegg

links

https://pplware.sapo.pt/informacao/ubuntu-ao-estilo-do-macos-instale-touchegg/ http://askubuntu.com/a/802218/661454

installation

sudo apt install touchegg

create file .xprofile

@celsoagra
celsoagra / light_keyboard.md
Last active March 8, 2017 00:52
turn lights on in keyboard

You should go to

sudo vim /sys/devices/platform/dell-laptop/leds/dell\:\:kbd_backlight/brightness (or can use nano)

and write 2 in the file, to turn on the lights

@celsoagra
celsoagra / minikubedelete
Created November 25, 2017 23:50 — forked from sharepointoscar/minikubedelete
Minikube - Delete all pods from default namespace
# delete all pods
kubectl delete --all pods --namespace=default
# deete all deployments
kubectl delete --all deployments --namespace=default
# delete all services
kubectl delete --all services --namespace=default
@celsoagra
celsoagra / KeycloakManager.java
Created December 11, 2017 17:12
Add users on Keycloak 3.1.0.Final
public class KeycloakManager {
private Keycloak keycloak;
/**
* Singleton method
* @param properties KeycloakProperties is a pojo to store configuration info
*/
public static KeycloakManager getInstance(KeycloakProperties properties) {
KeycloakManager manager = new KeycloakManager(properties);
@celsoagra
celsoagra / README.md
Created March 9, 2018 15:27 — forked from phillipgreenii/README.md
Running NPM Scripts through maven

I am in the process of introducing single page applications to where I work. For development, using node based build tools is much easier for the single page applications. However, the build process for our organization is based upon maven. Our solution started with the maven plugin frontend-maven-plugin. It worked great at first, but then we ran into a situation that I couldn't make work with it.

As stated before, at our organization, we have the older ecosystem which is maven and the newer ecosystem which is node. Our goal was to keep the hacking to a minimum. We did this by putting all of the hacks into a single super node based build file. This is what maven calls and the reason frontend-maven-plugin wasn't sufficient. The super node based build script calls all of the other build scripts by spawning npm run. Try as I might, I could not figure out how to make the spawn work. front-end-maven-plugin downloads npm

@celsoagra
celsoagra / index.html
Created September 21, 2018 18:50
AngularJS Stopwatch
<html ng-app="App">
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.js"></script>
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.10.0.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
</head>
<body ng-controller="MainCtrl">
<stopwatch title="Stopwatch #1" time="sharedTime"></stopwatch>
<div stopwatch title="Stopwatch #2" time="sharedTime"></div>
<hr />
@celsoagra
celsoagra / get_keycloak_access_token.sh
Created September 29, 2018 12:39 — forked from adixchen/get_keycloak_access_token.sh
Get Keycloak access token via curl and pretty print it with python
curl \
-d "client_id=myclient" \
-d "client_secret=40cc097b-2a57-4c17-b36a-8fdf3fc2d578" \
-d "username=user" \
-d "password=password" \
-d "grant_type=password" \
"http://localhost:8080/auth/realms/master/protocol/openid-connect/token"
@celsoagra
celsoagra / Vagrantfile
Last active October 9, 2018 03:29
Consul Installation
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# Servidor do Gestão DB
config.vm.define "consul" do |consul|
@celsoagra
celsoagra / docker.elk.sh
Last active January 26, 2019 16:21
Iniciando a pilha do ELK (docker)
docker run -d --name elastic -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "xpack.security.enabled=true" -e "discovery.type=single-node" elasticsearch:6.5.0
docker run -d --name kibana -p 5601:5601 --link elasticsearch:elasticsearch -e "ELASTICSEARCH_URL=http://elasticsearch:9200" -e "XPACK_SECURITY_ENABLED=true" -e "ELASTICSEARCH_USERNAME=elastic" -e "ELASTICSEARCH_PASSWD=changeme" -e XPACK_GRAPH_ENABLED=true -e XPACK_WATCHER_ENABLED=true -e XPACK_ML_ENABLED=true -e XPACK_MONITORING_ENABLED=true -e XPACK_MONITORING_UI_CONTAINER_ELASTICSEARCH_ENABLED kibana:6.4.1
docker run -d --name logstash --link elasticsearch:elasticsearch -e "XPACK.MONITORING.ELASTICSEARCH.URL=http://elasticsearch:9200" logstash:6.5.1
docker run -d --name elastichq --link elasticsearch:elasticsearch -p 5000:5000 elastichq/elasticsearch-hq:release-v3.5.0
curl -s -H "Content-Type: application/json" -XPOST http://localhost:9200/info/info/1 -d @fakedata.json
@celsoagra
celsoagra / app.js
Last active January 29, 2019 23:42
Example of JSTree
$(function () {
var data = [
{ "id" : "ajson1", "parent" : "#", "text" : "Simple root node" },
{ "id" : "ajson2", "parent" : "#", "text" : "Root node 2" },
{ "id" : "ajson3", "parent" : "ajson2", "text" : "Child 1" },
{ "id" : "ajson4", "parent" : "ajson2", "text" : "Child 2" },
];
$("#jstree").jstree({
"core" : {