Skip to content

Instantly share code, notes, and snippets.

## Install perf in docker container
### ubuntu 18.4
### kernel 4.14.173-137.229.amzn2.x86_64
docker exec -it {containerid} sh
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.173.tar.xz && tar -xf ./linux-4.14.173.tar.xz && cd linux-4.14.173/tools/perf/ && apt -y install flex bison && make -C . && make install
./perf
./perf list
./perf bench mem all
@mloayzagahona
mloayzagahona / config
Created January 21, 2022 17:59 — forked from pksunkara/config
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
[sendemail]
smtpencryption = tls
@mloayzagahona
mloayzagahona / ec2-ansible.yml
Created June 1, 2020 21:25 — forked from initcron/ec2-ansible.yml
provision ec2 instance with ansible with user-data
# link: http://allandenot.com/devops/2015/01/31/provisioning-ec2-hosts-with-ansible.html
---
- name: Provision EC2 Box
local_action:
module: ec2
key_name: "{{ ec2_keypair }}"
group_id: "{{ ec2_security_group }}"
instance_type: "{{ ec2_instance_type }}"
image: "{{ ec2_image }}"
@mloayzagahona
mloayzagahona / Immutable Data Types with Jackson and Lombok.md
Created February 7, 2019 15:56 — forked from eeichinger/ Immutable Data Types with Jackson and Lombok.md
Example tests and notes for making Jackson work with Lombok

Examples for getting Jackson and Lombok to work together to create immutable data types.

Demonstrates use of:

  • Nullable Types
  • Optional
  • immutable java.util.List
  • immutable array
  • validating custom types on instantiate/unmarshalling
  • use & customize Lombok-@Builder with Jackson
@mloayzagahona
mloayzagahona / Deserialization.scala
Created January 5, 2019 15:48 — forked from ramn/Deserialization.scala
Object serialization example in Scala
import java.io._
@SerialVersionUID(15L)
class Animal(name: String, age: Int) extends Serializable {
override def toString = s"Animal($name, $age)"
}
case class Person(name: String)
// or fork := true in sbt
/**
*
*/
package com.xyz.topology.netflow.beam;
import java.util.Properties;
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.io.DatumReader;
import org.apache.avro.io.DecoderFactory;
@mloayzagahona
mloayzagahona / register_schema.py
Created December 4, 2018 19:03 — forked from aseigneurin/register_schema.py
Register an Avro schema against the Confluent Schema Registry
import os
import sys
import requests
schema_registry_url = sys.argv[1]
topic = sys.argv[2]
schema_file = sys.argv[3]
aboslute_path_to_schema = os.path.join(os.getcwd(), schema_file)
@mloayzagahona
mloayzagahona / sam_streams.scala
Created September 19, 2018 20:01 — forked from adriaanm/sam_streams.scala
Playing with Java 8 Stream from Scala 2.11.5
// $ scala-2.11.5 -Xexperimental
// Original Java 8 version: http://winterbe.com/posts/2014/07/31/java8-stream-tutorial-examples/
scala> import java.util.{Arrays, List, ArrayList}
scala> import java.util.stream.{Stream, IntStream}
// List<String> myList = Arrays.asList("a1", "a2", "b1", "c2", "c1");
scala> val myList = Arrays.asList("a1", "a2", "b1", "c2", "c1")
@mloayzagahona
mloayzagahona / .bash_profile
Created June 14, 2018 03:27 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@mloayzagahona
mloayzagahona / README.md
Created April 6, 2018 17:27 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run: