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 / Failing.Tech.md
Last active November 21, 2022 17:35
Failing Tech
@diegopacheco
diegopacheco / git-diff-patch-apply.md
Last active November 5, 2018 18:25
Git: Create and Apply Patches

Create a PATCH from DIFF

git remote add remote_other https://github.com/user/some.git
git remote -v
git fetch remote_other
git diff --no-prefix remote_other/master..master > 01.patch

Apply a PATCH from DIFF

git apply --stat 01.patch
Caso tenham problemas pra rodar e/ou instalar o mysql, rodem os comandos abaixo um por um e é sucesso:
Desinstalando:
sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
sudo apt-get autoremove -y
sudo apt-get autoclean
rm -rf /etc/mysql
Instalando corretamente:
sudo apt-get update
@diegopacheco
diegopacheco / glances.md
Last active July 30, 2018 18:14
Glances Python Monitoring Tool

Install

sudo pip3 install --upgrade pip
pip3 install glances

Run

glances

Run on the browser

@diegopacheco
diegopacheco / jetty-thread.limit.md
Last active February 10, 2021 14:53
How to Limit Threads in Jetty 9.4
@diegopacheco
diegopacheco / jmx-jetty-9.4-standalone.md
Created July 30, 2018 07:02
How to enable JMX on Jetty 9.4 Standalone

Just 1 time

java -jar {$jetty.home}/start.jar --add-to-start=jmx
vim start.ini
--exec
-Xshare:off
@diegopacheco
diegopacheco / jmxsh.md
Last active July 30, 2018 06:56
how to use jmxsh
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jmxsh/jmxsh-R5.jar
java -jar jmxsh-R5.jar -h localhost -p 7094
jmx_list
@diegopacheco
diegopacheco / cql-trace-cassandra.md
Last active July 13, 2018 00:15
Perf Trace in Cassandra

Tracing Queries

bin/cqlsh
tracing on
select * from cluster_test.test where key='1';
bin/cqlsh  
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.2 | CQL spec 3.4.4 | Native protocol v4]
@diegopacheco
diegopacheco / replace-dead-node-cass3x.md
Last active August 1, 2018 20:34
Replace Dead Node Cassandra 3.x

Install Cass 3.x in 3 nodes

https://gist.github.com/diegopacheco/2c36ba8bca1c3a2e44c5f422357a060e

Steps

1. bin/nodetool status (Copy the IP_ADDRESS of the node down(DN) that you want to replace.
2. Edit conf/cassandra.yaml change rpc_address and listen_address(to new node ip .i.e: $(hostname -i) 
3. (OPTIONAL -  If you DONT have DNS) Assuming you ARE using DNS for seeds there is no need to change the seeds ips(otherwise you need change the ip there)
4. vim conf/cassandra-env.sh -> JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=IP_DEAD_NODE_REPLACE_HERE_STEP_1"