Skip to content

Instantly share code, notes, and snippets.

@ishchegl
ishchegl / jarsearch.sh
Last active August 7, 2018 12:06
List all the JARs in local Maven repository containing specified class.
#!/bin/bash
# List all the JARs in local Maven repository containing specified class.
#
# Usage: ./jarsearch.sh CLASSNAME
CLASSNAME="$1"
MAVEN_LOCAL_REPO="$HOME/.m2"
find "$MAVEN_LOCAL_REPO" -name "*.jar" | xargs -I{} bash -c "jar -tf {} | grep -q /${CLASSNAME}.class && echo {}"
@ishchegl
ishchegl / print_hex.c
Last active April 11, 2017 07:11
Print HEX in C
#include <stdio.h>
#include <string.h>
#define MAX_DATA_LEN 1024
static unsigned char hex_string[MAX_DATA_LEN];
static inline char convert_to_printable(char c)
{
return c < 32 || c > 126 ? '.' : c;