Skip to content

Instantly share code, notes, and snippets.

View joyoyoyoyoyo's full-sized avatar
🏴
supporting my community

Angel Ortega joyoyoyoyoyo

🏴
supporting my community
  • InterMedia Advertising
  • SoCal / Remote / LA / IE
View GitHub Profile
@joyoyoyoyoyo
joyoyoyoyoyo / animalexample.thrift
Created August 29, 2019 03:28 — forked from myhrvold/animalexample.thrift
Thrift Example: Service-Oriented Architecture at Uber Engineering
struct Animal {
1: i32 id
2: string name
3: string sound
}
exception NotFoundException {
1: i32 what
2: string why
}
@joyoyoyoyoyo
joyoyoyoyoyo / docker-compose.yml
Created August 27, 2019 07:28 — forked from noemi-dresden/docker-compose.yml
Complete compose file for monitoring spark on prometheus
version: "3.1"
services:
spark-master:
image: bde2020/spark-master:2.4.0-hadoop2.7
container_name: spark-master
ports:
- "8080:8080"
- "7077:7077"
environment:
- INIT_DAEMON_STEP=setup_spark
@joyoyoyoyoyo
joyoyoyoyoyo / .gitconfig
Created August 17, 2019 08:34 — forked from berngp/.gitconfig
dot.gitconfig
[user]
name = Your Name
email = your.name@mail.com
[color]
ui = true
[core]
excludesfile = ~/.gitignore_global
editor = /usr/local/bin/mvim -f
@joyoyoyoyoyo
joyoyoyoyoyo / spark-yarn-emr-client.rb
Created August 11, 2019 15:13 — forked from tamizhgeek/spark-yarn-emr-client.rb
Chef Recipe for remote spark-submit setup to YARN running on Amazon EMR
# setup for the hadoop + spark env for airflow
remote_file "/home/airflow/spark.tgz" do
source "/remote/spark/download/url"
owner "airflow"
group "airflow"
mode '0755'
not_if { File.exists?("/home/airflow/spark.tgz") }
end
@joyoyoyoyoyo
joyoyoyoyoyo / helper.gradle
Created July 31, 2019 11:22 — forked from matthiasbalke/helper.gradle
Gradle resolveDependencies Task
// found here: http://jdpgrailsdev.github.io/blog/2014/10/28/gradle_resolve_all_dependencies.html
task resolveDependencies {
doLast {
project.rootProject.allprojects.each { subProject ->
subProject.buildscript.configurations.each { configuration ->
resolveConfiguration(configuration)
}
package net.atos.sparti.pub
import java.io.PrintStream
import java.net.Socket
import org.apache.commons.pool2.impl.{DefaultPooledObject, GenericObjectPool}
import org.apache.commons.pool2.{ObjectPool, PooledObject, BasePooledObjectFactory}
import org.apache.spark.streaming.dstream.DStream
class PooledSocketStreamPublisher[T](host: String, port: Int)

Notes of a Crafter

fundamental conditions of the classic architecture: firmitas, utilitas and venustas

Design Patterns

Abstract Factory
Adapter
Bridge
Builder
Chain of Responsibility
@joyoyoyoyoyo
joyoyoyoyoyo / 01-deserialization_exception.md
Created July 25, 2019 04:40 — forked from tjcelaya/01-deserialization_exception.md
kryo serialization bug, based off of java-manta-examples/src/main/java/ClientEncryptionServerMultipart.java

If you run App.java with the "all" argument you should get no errors. "all-with-serialization" also works because the pointer-to-native-memory that gets serialized is still valid as long as the JVM doesn't terminate.

If you run App.java once with "initiate" and then subsequently with "complete" you will receive the following exception only if libnss is in use:

Exception in thread "main" com.esotericsoftware.kryo.KryoException: Error during Java deserialization.
Serialization trace:
sessionRef (sun.security.pkcs11.Session)
session (sun.security.pkcs11.SessionKeyRef)
sessionKeyRef (sun.security.pkcs11.P11Key$P11SecretKey)
@joyoyoyoyoyo
joyoyoyoyoyo / Main.java
Created July 25, 2019 04:40 — forked from davidecavestro/Main.java
H2 serialization performance test
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
package com.twitter.ads.batch.experimental.amedina.storm.exprolluprt;
import java.util.List;
import org.apache.thrift.TDeserializer;
import org.apache.thrift.protocol.TBinaryProtocol;
import com.twitter.ads.logging.AdEngagementLogEntry;
import com.twitter.ads.realtime.exprolluprt.ExpRollupRTEngKey;