Skip to content

Instantly share code, notes, and snippets.

@uarun
uarun / delete_eaDir.sh
Created June 19, 2023 22:33
Delete Synology NAS @eadir directories
find . -name '@eaDir' -type d -print0 | xargs -0 rm -rfv
@uarun
uarun / babun_tab_completion.md
Created September 3, 2018 23:20
Fix for Babun Tab completion

Babun Tab Completion

If babun tab completion stops working, then do the following:

$ cd
$ compinit
$ cp .zcompdump .zcompdump-$HOSTNAME-$ZSH_VERSION
@uarun
uarun / 01_IncreaseReplicationFactor.md
Last active February 28, 2023 09:03
Increase replication factor for __consumer_offsets Kafka topic

Increasing replication factor for a topic

  1. Create a custom reassignment plan (see attached file inc-replication-factor.json). In this case we are going from replication factor of 1 to 3.

  2. Run Kafka partition reassignment script:

    kafka-reassign-partitions --zookeeper $ZOOKEEPER_CONNECT \
        --reassignment-json-file /home/liquidnt/inc-replication-factor.json  \
        --execute
    
  3. Verify if the assignment was successful

@uarun
uarun / MacOS_RecoveryDisk.md
Last active December 28, 2017 05:37
How to Create a Mac OS Sierra Recovery Disk

MacOS (Sierra) Recovery Disk

Prerequisites

USB drive with atleast 5 GB of storage

Steps

  1. Download MacOS Sierra from the App Store (cancel out of the installation)
  2. Open Finder and navigate to Applications directory
@uarun
uarun / btcpx.sh
Created November 30, 2017 16:52
Command Line Bitcoin Price checker
curl --silent -H "User-Agent: sh-winkdex-app" "https://winkdex.com/api/v0/price" | jq .price/100
@uarun
uarun / free_monads.md
Last active April 8, 2018 11:36
Free Monad Resources

Online Resources to Learn Free Monads

Videos

Composable application architecture with reasonably priced monads - Rúnar Bjarnason

Composable application architecture with reasonably priced monads

Programs as Values - Rob Norris

@uarun
uarun / java_download.md
Created January 26, 2016 17:57
Downloading Java JDK from the command line

Downloading JDK

Using wget

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz

Using curl

curl -v -j -k -L -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz > jdk-7u79-linux-x64.tar.gz
@uarun
uarun / visualvm.md
Last active April 26, 2016 04:39
Profiling a remote host using VisualVM

Remote VisualVM

Start RMI registry

$ rmiregistry -J-Djava.rmi.server.codebase=file:$JAVA_HOME/lib/tools.jar

Create Policy file for jstatd

  • Create a file named jstatd.all.policy
  • With the following contents:
@uarun
uarun / build.gradle
Created September 3, 2014 01:49
Resolving version conflicts with Gradle
allprojects { project ->
configurations.all {
resolutionStrategy {
//... Fail eagerly on version conflict (includes transitive dependencies)
//... For e.g. multiple different versions of the same dependency (group and name are equal)
failOnVersionConflict()
//... Force certain versions of dependencies (including transitive)
force libraries.scala_library
@uarun
uarun / logback.xml
Last active October 6, 2015 15:11
Slick 2.0 - Enabling SQL Statement Logging
<logger name="scala.slick.jdbc.JdbcBackend.statement" level="DEBUG" />