Skip to content

Instantly share code, notes, and snippets.

@gnomeria
gnomeria / IntervalSearchTree.kt
Created October 7, 2018 05:33
Rough kotlin Interval Search Tree implementation
/**
* Kotlin rough reimplementation of Robert Sedgewick and Kevin Wayne Interval Search Tree
* from Java. The value is stored as a list of values, that will be added on key collision
*
* https://algs4.cs.princeton.edu/93intersection/IntervalST.java.html
*/
/******************************************************************************
* Compilation: javac IntervalST.java
* Execution: java IntervalST
@gnomeria
gnomeria / settings.json
Created December 27, 2018 05:46
VS Code Settings for Javascript prettier
{
"eslint.validate": [{
"language": "html",
"autoFix": true
},
{
"language": "vue",
"autoFix": true
},
{
ssh -vvvi ~/.ssh/id.pem -D 9000 -fCNTq user@HOST
@gnomeria
gnomeria / ecmwf_precip_s3_downloader.sh
Last active June 30, 2019 19:06
ECMWF Precipitation 1 Hour - S3 Shell Script Downloader With Aria2
#!/bin/bash
type=$1
startY=$(($2))
endY=$(($3))
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
function ctrl_c() {
@gnomeria
gnomeria / installcdo.sh
Last active July 1, 2019 21:18 — forked from mainvoid007/installcdo.sh
install cdo with grib2, hdf5, netcdf4
#!/bin/bash
# Institut für Wetter- und Klimakommunikation GmbH / Qmet
# O. Maywald <maywald@klimagipfel.de>
# This should install CDO with grib2, netcdf and HDF5 support. Note that the binaries are in /opt/cdo-install/bin.
# For further information look:
# http://www.studytrails.com/blog/install-climate-data-operator-cdo-with-netcdf-grib2-and-hdf5-support/
# docker-command
@gnomeria
gnomeria / find_file_size.sh
Last active September 4, 2019 19:35
Find git file sizes
git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| awk '/^blob/ {print substr($0,6)}' \
| sort --numeric-sort --key=2 \
| cut --complement --characters=13-40 \
| numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
@gnomeria
gnomeria / command.sh
Created September 4, 2019 19:34
Rewrite history by removing files/folders
git filter-branch -f --index-filter 'git rm -r --cached --ignore-unmatch main vendor/' HEAD

Keybase proof

I hereby claim:

  • I am gnomeria on github.

  • I am gnomeria (https://keybase.io/gnomeria) on keybase.

  • I have a public key ASAhbee8_qTEEGua4nx0QR8lKcEYzVKBpNl_J6jcqlJxxwo

log4j.debug=false
# Default level is INFO
log4j.rootLogger=INFO,StdoutErrorFatal,StdoutWarn,StdoutInfo,StdoutDebug,StdoutTrace
# and for com.some.package.* log with debug
log4j.logger.com.some.packager=DEBUG
log4j.appender.StdoutErrorFatal=org.apache.log4j.ConsoleAppender
log4j.appender.StdoutErrorFatal.layout=org.apache.log4j.PatternLayout
@gnomeria
gnomeria / aws cwl snippets
Last active November 29, 2019 08:49
AWS Cloudwatch Query Snippets
# Parse api-gateway log pattern for space separated message cloudwatch
fields @timestamp
| parse '* - - "*" * * * - * * * *' as ip, timestamp, method, route, http, req_id, req_latency, code, req_size
| filter code = 200
| sort @timestamp desc
| limit 20
# Parse with filter on field with regex
fields @timestamp
| parse '* - - "*" * * * - * * * *' as ip, timestamp, method, route, http, req_id, req_latency, code, req_size