Skip to content

Instantly share code, notes, and snippets.

View marceloserpa's full-sized avatar
🇧🇷
coding... :D

Marcelo Serpa marceloserpa

🇧🇷
coding... :D
View GitHub Profile
@diegopacheco
diegopacheco / localstack-aws-linux.md
Last active April 12, 2018 23:28
Run Localstack(Mock AWS Apis) local with Gnome Ubuntu Linux 17.10

Install and Run

sudo pip install localstack
sudo localstack start --docker

Use

@coco98
coco98 / kube-registry.yaml
Created May 2, 2017 16:31
Docker registry on minikube
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry
version: v0
spec:
replicas: 1
@diegopacheco
diegopacheco / jmap-heap-dump-java.md
Last active August 21, 2018 18:55
How to Create a Heap Dump in java?
jmap -dump:format=b,file=cheap.bin <pid>
jhat cheap.bin
@diegopacheco
diegopacheco / jmx-jvm-linux.md
Last active July 30, 2018 07:55
How to List JMX linux?
wget http://repo.typesafe.com/typesafe/releases/cmdline-jmxclient/cmdline-jmxclient/0.10.3/cmdline-jmxclient-0.10.3.jar
java -jar cmdline-jmxclient-0.10.3.jar - localhost:7199

Sample for CASS

java -jar  cmdline-jmxclient-0.10.3.jar - localhost:7199 java.lang:type=Threading ThreadCount
java -jar cmdline-jmxclient-0.10.3.jar - localhost:7199 java.lang:type=ClassLoading LoadedClassCount

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@diegopacheco
diegopacheco / remote-jmx-jetty-ec2-aws.md
Last active July 30, 2018 06:57
Remote JMX Jetty 8 on Linux - Ubuntu Linux to AWS EC2 / Amazon Linux?

Summary

  1. Not 100% sure if is really needed Chnage the hostname (https://gist.github.com/diegopacheco/56a0fd87626406337caea0ff15f49850) and create a route53 public dns (but I did it)
  2. we need change etc/jetty-jmx.xml
  3. We need to add configs to start.ini
  4. we need have a tunnel ssh
  5. we can acess via jvisualvm or jconsole service:jmx:rmi://127.0.0.1:10002/jndi/rmi://127.0.0.1:10001/jettyjmx
#1 
@ursuad
ursuad / kafka-cheat-sheet.md
Last active June 17, 2025 10:00
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

@pmauduit
pmauduit / collectd.conf
Last active July 30, 2018 09:09 — forked from ajayverghese/collectd.conf
Sample collectd configuration to fetch jetty and jvm metrics for monitoring (and send to graphite)
LoadPlugin java
<Plugin "java">
JVMArg "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"
LoadPlugin "org.collectd.java.GenericJMX"
<Plugin "GenericJMX">
# Garbage collector information
<MBean "garbage_collector">
ObjectName "java.lang:type=GarbageCollector,*"
@bueckl
bueckl / wget
Last active December 10, 2025 09:05
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
@marcosvidolin
marcosvidolin / kill_port_process.sh
Last active June 8, 2021 10:34
Linux: How to list and kill a process using a port
# to list all ports that are used
sudo netstat -ntlp | grep LISTEN
# you can obtain a specific port using the following command
sudo netstat -ntlp | grep :8080
# when you execute the command above you will see something like that
tcp 0 0 0.0.0.0:27370 0.0.0.0:* LISTEN 4394/skype
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 2216/dnsmasq
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 4912/cupsd