Skip to content

Instantly share code, notes, and snippets.

View veysiertekin's full-sized avatar

Veysi Ertekin veysiertekin

View GitHub Profile
@ty4z2008
ty4z2008 / aliyun-oss.sh
Created December 4, 2019 09:44
aliyun oss uploader with curl
#!/usr/bin/env bash
#
# Replace below arguments before use
# OSS_ACCESS_KEY_ID 、OSS_ACCESS_KEY_SECRET、BUCKET、ENDPOINT、DIRECTORY
#
# This example will upload file to hangzhou Aliyun object stroage system
# Usage: ./oss.sh test.sh
#
echo "upload file $1"
@hakanilter
hakanilter / awslogs-setup.sh
Last active November 22, 2018 10:44
Installing AWS Cloudwatch Agent in Debian
sudo su
apt-get install -y libyaml-dev python-dev python3-dev python3-pip
pip3 install awscli-cwlogs
if [ ! -d /var/awslogs/bin ] ; then
mkdir -p /var/awslogs/bin
ln -s /usr/local/bin/aws /var/awslogs/bin/aws
fi
mkdir /opt/awslogs
cd /opt/awslogs
curl https://s3.amazonaws.com/aws-cloudwatch/downloads/latest/awslogs-agent-setup.py -O
import com.github.benmanes.caffeine.cache.Caffeine
import scala.concurrent.duration.Duration
import scalacache._
import scalacache.caffeine.CaffeineCache
object CacheApp extends App {
val intCache: Cache[Int] = new CaffeineCache[Int](Caffeine.newBuilder().build[String, Entry[Int]]()) with Predicate[Int] {
override def shouldCache: Int => Boolean = _ > 0 }
}
@davideicardi
davideicardi / ConditionalFlow.scala
Created June 29, 2018 14:09
Conditional Akka Stream Flow
import akka._
import akka.stream._
import akka.stream.scaladsl._
import akka.actor._
// WARNING: Ordering is not guaranteed.
// The problem with this Graph is that when splitting the flow
// we obtain 2 concurrent flows.
// The result of conditionalFlow can returns after another messages is processed in the brodcast.
// ie. If you have 10 messages from 0 to 9. Let's say that we run a conditional flow only for element 0.
@notwaldorf
notwaldorf / list.md
Last active January 13, 2024 11:09
Meownica's packing list

Meownica's packing list

I travel a lot so I'm down to like 30 minutes of packing per any kind of trip. I always bring one carry-on suitcase for any trips up to 2 weeks (that I never check in unless forced) -- I have an Away suitcase because it's got a built-in (removable) battery, and amazing wheels.

🚨

  • 🆔Wallet & Passport
  • 💧Travel water bottle
  • 💳Travel credit cards (don't pay foreign currency fees!)
  • 💳Insurance cards
  • 💵Local currency you have
  • 🚎Local public transport cards

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

ambari-server stop
ambari-agent stop
pkill -9 java
#################################
# Remove Packages
################################
yum -y remove ambari-\*
yum -y remove hcatalog\*
yum -y remove hive\*
MATCH (n)
OPTIONAL MATCH (n)-[r]-()
DELETE n,r;
CREATE (:Product {id: 1, name: 'Apple iPhone 6 128GB iOS 8 4.7" Touchscreen Factory Unlocked', price: 839.99});
CREATE (:Product {id: 2, name: 'HTC One M8 32GB Factory Unlocked Windows 8.1 Smartphone', price: 349.99});
CREATE (:Product {id: 3, name: 'DELL 15.6" Intel Core i7 1TB HDD Notebook', price: 649.99});
CREATE (:Product {id: 4, name: 'Canon EOS Rebel T5 EF-S 18-55mm IS II Digital SLR Kit US Warranty', price: 399.99});
CREATE (:Product {id: 5, name: 'Terralux TLF-TT-5 Tactical 5 Light 650 Lumens', price: 77.88});
CREATE (:Product {id: 6, name: 'Emergency One Person 3-month Food Storage Kit', price: 479.99});
@jashkenas
jashkenas / semantic-pedantic.md
Last active November 29, 2023 14:49
Why Semantic Versioning Isn't

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil