Skip to content

Instantly share code, notes, and snippets.

View ricardodestro's full-sized avatar

RICARDO DESTRO ricardodestro

View GitHub Profile
@ricardodestro
ricardodestro / EXAMPLE_NEO4J.md
Last active October 4, 2016 13:04
NEO4J Example

FIAP NEO4J

NEO4J example script

This excercise was created from FIAP - MBA - Solution Architect

#####Create Social Network Node##### CREATE (Facebook:SocialNetwork { name:'Facebook'}) CREATE (Twitter:SocialNetwork { name:'Twitter'})

@ricardodestro
ricardodestro / logstalgia.md
Last active May 19, 2016 16:34
Logstalgia - Exemple of use with N servers

#LOGSTALGIA#

http://logstalgia.io/

#####EXAMPLE FOR WINDOW WITH CYGWIN RUNNING ONE MORE THAN SERVERS#####

ssh <USER>@<REMOTE_IP> -C tail -f <LOG_PATH> >> /tmp/log1.tmp | 
ssh <USER>@<REMOTE_IP2> -C tail -f <LOG_PATH> >> /tmp/log2.tmp | 
ssh <USER>@<REMOTE_IP3> -C tail -f <LOG_PATH> >> /tmp/log3.tmp | 

tail -q -f /tmp/log1.tmp /tmp/log2.tmp /tmp/log3.tmp |

@ricardodestro
ricardodestro / TOP 10 Directory Usage
Last active September 2, 2016 13:57
LINUX COMMANDS
# TOP 10 DIRECTORY USAGE
du -a -h /usr/local | sort -n -r | head -n 10
/**
* Normaliza string
*
* @param s
* @return
*/
public static String normalize(String s) {
return Normalizer.normalize(s, Form.NFD).toLowerCase().replaceAll("\\p{P}", "").replaceAll("\\s+", "-")
.replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
}
@ricardodestro
ricardodestro / rundeck_clean_history.groovy
Last active September 19, 2017 17:48
Rundeck Clean Execution History
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1')
import groovy.json.JsonSlurper
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.Method
/**
* Script to clean Rundeck's Executions History
*
* Change Api Policy permition to allow execution delete
@ricardodestro
ricardodestro / gist:74f64a035acac250bd5741641e078923
Created September 25, 2017 19:14
NETSTAT TCP STATUS COUNT
netstat -an | awk '/tcp/ {print $6}' | sort | uniq -c
@ricardodestro
ricardodestro / gist:f971386534dca4b48a978dba9d140c8b
Created November 29, 2017 19:31
ElasticSearch - Graylog - Templates - Heap - Health
GET _all
GET _cat/nodes?h=heap*&v
GET _cluster/health
GET _cluster/health?level=indices
GET _cluster/health?level=shards
GET _cluster/settings
GET _cluster/health?wait_for_status=green
@ricardodestro
ricardodestro / gist:f488ed6e661ba85c245783aa2b156055
Created February 23, 2018 19:14
Linux - Install certificate
openssl x509 -inform DER -in YOUR_CERTIFICATE.cer -out YOUR_CERTIFICATE.crt
Go to /usr/local/share/ca-certificates/
Create a new folder, i.e. "sudo mkdir school"
Copy the .crt file into the school folder
Make sure the permissions are OK (755 for the folder, 644 for the file)