We need to use docker-machine to handle USB ports inside the docker.
- Install docker-machine: https://docs.docker.com/machine/install-machine/
- Docker version: 18.09.2, build 6247962
- Install virtualbox >= 6.0
| cmake_minimum_required(VERSION 3.5) | |
| project(example LANGUAGES CXX) | |
| set(CMAKE_CXX_STANDARD 11) | |
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | |
| find_package(GTest REQUIRED) | |
| include_directories(${GTEST_INCLUDE_DIRS}) |
| #!/bin/bash | |
| # Author: Kel Graham | |
| # Date: 2022-05-19 | |
| # Purpose: Increase the replication factor of one or more topics, using only | |
| # a connection to the Kafka broker (no Zookeeper, REST APIs etc) | |
| # and the standard kafka-topics, kafka-reassign-partitions scripts | |
| # that come with Kafka. | |
| # |
We need to use docker-machine to handle USB ports inside the docker.
| # Copy of https://gist.github.com/antonio/4586456 | |
| # With a modification to collect all the branch names so we can make one git request | |
| # Set DRY_RUN=1 to get an echo of the command | |
| # Format that works with `git log --since`, e.g. 2018-01-01 | |
| date=$1 | |
| branches= | |
| for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do |
| package utils | |
| import org.apache.spark.rdd.RDD | |
| import org.apache.spark.sql.types.StructType | |
| import org.apache.spark.sql.{DataFrame, Row} | |
| import org.specs2.matcher.{Expectable, Matcher} | |
| import org.specs2.mutable.Specification | |
| /** | |
| * Utility class to compare DataFrames and Rows inside unit tests |
| class CasandraSpec extends FunSuite | |
| with Eventually | |
| with BeforeAndAfterAll | |
| with LocalSparkContext | |
| with EmbeddedCassandra | |
| with Logging{ | |
| val testKeyspace = "test1" | |
| val testTable = "table1" | |
| var conn: CassandraConnector = _ |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
| #!/bin/sh | |
| date=$1 | |
| for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do | |
| if [[ "$(git log $branch --since $date | wc -l)" -eq 0 ]]; then | |
| if [[ "$branch" =~ "origin/" ]]; then | |
| local_branch_name=$(echo "$branch" | sed 's/^origin\///') | |
| if [[ "$DRY_RUN" -eq 1 ]]; then | |
| echo "git push origin :$local_branch_name" |