Skip to content

Instantly share code, notes, and snippets.

View christiangalsterer's full-sized avatar

Christian Galsterer christiangalsterer

View GitHub Profile

List top most used metrics

topk(20, count by (__name__, job)({__name__=~".+"}))

Bash into running container

docker exec -it <CONTAINER_ID> /bin/bash

Ash into running container

docker exec -it <CONTAINER_ID> /bin/ash

General

Install RPM locally without connecting to the internet

RUN yum localinstall --disablerepo=* -y <RPM_FILE>

Find last installs

rpm -qa --last

Undo last n commits. After running the command, you'll find the changes as uncommitted local modifications in your working copy.

git reset --soft HEAD~1

Undo last n commits. After running the command, the last changes are not longer available.

$ git reset --hard HEAD~1

base64 endoded username:password

echo -n 'username:password' | openssl base64

count files and folder following symbolic links

ls -LRX1 2>/dev/null | wc -l
#!/bin/sh
# Copyright 2015 Christian Galsterer
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@christiangalsterer
christiangalsterer / nvd_download.sh
Last active May 29, 2024 22:02
Script to download the National Vulnerability Database files from https://nvd.nist.gov
#!/bin/sh
# https://gist.github.com/christiangalsterer/5f55389b9c50c74c31b9
# Copyright 2015 Christian Galsterer
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@christiangalsterer
christiangalsterer / README.md
Last active December 16, 2019 20:28
Atlassian Jira: Number of issues in a Jira Query Language (JQL) search

Description

A Dashing widget to display the number of issues returned by a Jira Query Language (JQL) search. The number of issues will be displayed using the Numbers widget. This widget is a generalized version of the Atlassian Jira: Number of issues in a Jira filter query widget, which shows the number of issues for saved Jira filter.

Dependencies

The following dependencies are required. Please add them to your dashing gemfile.

gem 'jira-ruby', :require => 'jira'
@christiangalsterer
christiangalsterer / README.md
Last active June 4, 2020 21:46
Dashing Number of issues in Jira query

Description

A Dashing widget to display the number of issues returned by a Jira filter search. The number of issues will be displayed using the Numbers widget. See also the Atlassian Jira: Number of issues in a Jira filter query for a more generalised version which allows to run any JQL query directly from the widget.

Dependencies

The following dependencies are required. Please add them to your dashing gemfile.

gem 'jira-ruby', :require => 'jira'