Skip to content

Instantly share code, notes, and snippets.

View FnTm's full-sized avatar

Janis Peisenieks FnTm

  • Whimsical Inc.
  • Riga
View GitHub Profile
@FnTm
FnTm / rbenv.Dockerfile
Created March 31, 2020 07:23
Installing ruby via rbenv inside Debian Docker image
#jnlp-slave is based on slave, which in turn is based on scm-stretch debian 9.8
FROM jenkins/jnlp-slave:latest-jdk11
USER jenkins
# ==== Everything above this line is just to set an example context. Meaning - not important ====
# Install Local ruby
RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv \
&& echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc \
@FnTm
FnTm / gist:1fb733bf40f664ed9176620a7e244572
Created February 12, 2019 08:39
Read ECS, Amazon Linux 2 docker logs, and filter them to be coming from docker daemon itself
journalctl -u docker.service --since "2019-02-12 07:45:00" _TRANSPORT=stdout + OBJECT_EXE=docker
@FnTm
FnTm / scout2_results_reducer.bash
Created December 14, 2018 10:00
This script parses a Scout2 output to produce a summary with findings reduced and grouped based on their level
# This script parses a Scout2 output to produce a summary with findings reduced and grouped based on their level
tail -n +2 scout2-report/inc-awsconfig/aws_config.js \ Fri Dec 14 11:51:04 2018
| jq '.services[].findings | with_entries( select(.value | has("flagged_items") ) ) | with_entries( select(.value.flagged_items >0 ) ) | select(keys | length >0) | map(select(.flagged_items>0))' \
| jq -s '. | flatten | group_by(.level) |map({"level": .[0].level, value: map(.flagged_items) | add})'
@FnTm
FnTm / check.bash
Last active November 7, 2018 11:00
Checking what the Java Runtime DNS TTL property is
# Changing the cache TTL to something bigger might be useful, and this command let's you check what it's currently at
jrunscript -e "print(java.security.Security.getProperty(\"networkaddress.cache.ttl\"))"
# And this let's you check that value for a docker image
docker run -it openjdk:8u151 /bin/bash -c 'jrunscript -e "print(java.security.Security.getProperty(\"networkaddress.cache.ttl\"))"'