Skip to content

Instantly share code, notes, and snippets.

View ctwoprod's full-sized avatar

Roberto Fernandez ctwoprod

View GitHub Profile
@ctwoprod
ctwoprod / playground
Created May 26, 2025 14:55
Playground
Cloud VM: Vercell, Heroku
DB: https://www.db-fiddle.com/
Dashboard data / visualization: https://app.flourish.studio/
Java: https://dev.java/playground/
Nodejs / JS: https://stackblitz.com/edit/node-99aw1w?file=index.js https://playcode.io/new
Python: https://python-playground.netlify.app
Go: https://go.dev/play/
Custom API Mock (json, WS etc.): https://dummyjson.com
Kafka: https://gauravsalvi.com/projects/kafka-online-test/
Serverless data platform: https://upstash.com/ (ex. redis)
@ctwoprod
ctwoprod / kafka-cheat-sheet.md
Created May 24, 2019 12:45 — forked from ursuad/kafka-cheat-sheet.md
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 ...

pipeline {
// run on jenkins nodes tha has java 8 label
agent { label 'java8' }
// global env variables
environment {
EMAIL_RECIPIENTS = '[email protected]'
}
stages {
stage('Build with unit testing') {
@ctwoprod
ctwoprod / nginx-tuning.md
Created May 16, 2018 07:54 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@ctwoprod
ctwoprod / how-to-squash-commits-in-git.md
Created April 29, 2018 16:32 — forked from patik/how-to-squash-commits-in-git.md
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@ctwoprod
ctwoprod / send_json_sqs.py
Last active April 9, 2018 12:31
send queue to sqs using python
#!/usr/bin/python
import boto3
# Create SQS client
sqs = boto3.client('sqs',region_name='ap-southeast-1')
queue_url = 'https://sqs.ap-southeast-1.amazonaws.com/862498237182/test-paywalletuser-sqs'
# Send message to SQS queue
@ctwoprod
ctwoprod / Python3 Virtualenv Setup.md
Created April 3, 2018 16:09 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@ctwoprod
ctwoprod / devops_training.txt
Created March 29, 2018 01:30 — forked from ssmythe/devops_training.txt
Training materials for DevOps
======
Videos
======
DevOps
What is DevOps? by Rackspace - Really great introduction to DevOps
https://www.youtube.com/watch?v=_I94-tJlovg
Sanjeev Sharma series on DevOps (great repetition to really get the DevOps concept)
@ctwoprod
ctwoprod / jenkins-aws-docker.sh
Created March 27, 2018 16:15 — forked from ramitsurana/jenkins-aws-docker.sh
Setting up jenkins,docker and git pipeline
## Install Jenkins
$ sudo yum update
$ sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
$ sudo rpm --import http://pkg.jenkins-ci.org/redhat-stable/jenkins-ci.org.key
$ sudo yum install jenkins
$ sudo service jenkins start
$ sudo chkconfig jenkins on
## Install Docker (Amazon EC2 Container Service)
@ctwoprod
ctwoprod / simple.conf
Last active March 24, 2018 10:48
logstash config mysql
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost:3306/sample"
jdbc_user => "root"
jdbc_password => "adminmysql"
# The path to our downloaded jdbc driver
jdbc_driver_library => "/Users/robertofernandez/libs/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
# our query
schedule => "*/2 * * * *"