Skip to content

Instantly share code, notes, and snippets.

@thekalinga
thekalinga / Kafka commands.md
Created April 6, 2019 13:34 — forked from vkroz/Kafka commands.md
Kafka frequent commands

Kafka frequent commands

Assuming that the following environment variables are set:

  • KAFKA_HOME where Kafka is installed on local machine (e.g. /opt/kafka)
  • ZK_HOSTS identifies running zookeeper ensemble, e.g. ZK_HOSTS=192.168.0.99:2181
  • KAFKA_BROKERS identifies running Kafka brokers, e.g. KAFKA_BROKERS=192.168.0.99:9092

Server

Start Zookepper and Kafka servers

@thekalinga
thekalinga / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Created July 12, 2018 07:15 — forked from Brainiarc7/VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

Installing Nvidia Graphics Driver and Cuda on Ubuntu

Remove any previously installed Nvidia drivers

$ sudo apt-get remove --purge nvidia-*
$ sudo apt-get autoremove
$ sudo apt-get autoclean

You can choose to install CUDA drivers from .deb file or .run file

Installing Nvidia Graphics Driver and Cuda on Ubuntu

Remove any previously installed Nvidia drivers

$ sudo apt-get remove --purge nvidia-*
$ sudo apt-get autoremove
$ sudo apt-get autoclean

You can choose to install CUDA drivers from .deb file or .run file

@thekalinga
thekalinga / README.md
Created May 20, 2018 23:40 — forked from bollwyvl/README.md
RevealJS SVG fragment presenter

SVG fragment builds for reveal.js

Basic use case

  • make an SVG (maybe in inkscape)
    • save it someplace reveal.js can find it (maybe next to your presentation)
    • figure out how to identify them (maybe use named layers)
  • in reveal.js/index.html
    • add reveal-svg-fragment.js as a dependency
    • in a <section> of reveal.js markup
  • add data-svg-fragment="" to something, e.g.
@thekalinga
thekalinga / google_art_project.rb
Created March 6, 2017 08:00 — forked from ionas/google_art_project.rb
Google Art Project fullsize image downloader. Specify the page URL and the tiles are downloaded, stitched and trimmed.
# Google Art Project fullsize image downloader.
# By Henrik Nyh <http://henrik.nyh.se> 2011-02-05 under the MIT license.
# Requires Ruby and ImageMagick.
#
# Usage e.g.:
# ruby google_art_project.rb http://www.googleartproject.com/museums/tate/portrait-of-william-style-of-langley-174
#
# You can specify multiple URLs on the command line, separated by space.
# Or you can specify no URLs on the command line and instead list them at the end of this file, one on each line,
# with "__END__" before the list.
@thekalinga
thekalinga / README.md
Created January 23, 2017 13:09 — forked from boennemann/README.md
Pushing new releases of a legacy version with semantic-release

If you have a package where a lot of people are still using a legacy version of it you might want to keep pushing (security-)fixes to that "branch".

Let's say the "latest" version of your package is "5.4.0", but there is as significant amount of people still using "4.7.4" – the last version you released before doing "5.0.0".

You found a critical bug in "5.4.0" and push it as out as "5.4.1", but it applies to "4.7.4" as well and so you want to do "4.7.5".

Assuming you have semantic-release already set up, you can follow these steps to get that "4.7.5" legacy support release out.

  1. Go to the relevant commit: git checkout v4.7.4
  2. Create a new branch from it: git checkout -b 4.x (You can choose any branch name, just make sure to use the same in step 3)
@thekalinga
thekalinga / build.gradle
Created July 1, 2016 10:35 — forked from kolorobot/build.gradle
Spring Boot with overridden Spring Version (with dependency management)
buildscript {
ext {
springBootVersion = '1.2.5.RELEASE'
}
ext['spring.version'] = '4.2.1.RELEASE'
repositories {
mavenCentral()
}
@thekalinga
thekalinga / sfphp.vcl
Created May 13, 2016 15:50 — forked from mtougeron/sfphp.vcl
Varnish VCL for Apr 9, 2013 SFPHP Meetup
# VCL for Varnish - How to cache your dynamic pages
# SFPHP.org Apr 9, 2013
# See: https://github.com/varnish/libvmod-header
# This varnish mod allows us to easily manipulate the Set-Cookie responses
import header;
probe varnish_probe {
.url = "/ping";
.timeout = 2s;
@thekalinga
thekalinga / indian.districts.geocoded.pincode.json
Created September 25, 2015 21:19 — forked from prashnts/indian.districts.geocoded.pincode.json
Indian District's GeoCoded Pin Code Data
{
"_description: Name of City, or Town": {
"State": "The Indian State under which this City/Town exists.",
"GeoCode": [
"Latitude",
"Longitude"
],
"PinCodes": [
"All",
"The",