Skip to content

Instantly share code, notes, and snippets.

@bmaupin
bmaupin / remove-local-deb-files.sh
Created February 28, 2019 20:30
Remove installed .deb files in local directory
# List the packages to be removed
for file in *.deb; do echo $file | cut -d _ -f 1; done | sort -u
# Purge them
sudo dpkg --purge $(for file in *.deb; do echo $file | cut -d _ -f 1; done | sort -u)
@bmaupin
bmaupin / free-database-hosting.md
Last active April 7, 2025 08:42
Free database hosting
@bmaupin
bmaupin / en_SE
Last active March 17, 2025 18:17
en_SE locale
escape_char /
comment_char %
% This file was generated by taking the LC_TIME section from en_US and
% replacing date/time representation with that of sv_SE from the glibc
% locale sources
% (http://sourceware.org/git/?p=glibc.git;a=tree;f=localedata/locales;hb=HEAD)
% (https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html)
% This file is part of the GNU C Library and contains locale data.
@bmaupin
bmaupin / extract-java-exceptions-in-graylog.md
Created November 2, 2018 15:38
Extract Java exceptions in Graylog

Get exceptions in search results

Regular expressions used in searches seem to search the extracted search "terms," which you can see by clicking on any particular message, then click the down arrow > Show terms of .... For this reason, "exception" needs to be lower-case:

message:/([a-z0-9\.]+exception)/

Extract exceptions as a field

  1. Create a new rule
@bmaupin
bmaupin / create-graylog-power-user-role.md
Last active April 4, 2022 18:56
Create Graylog power user role

http://docs.graylog.org/en/latest/pages/users_and_roles/permission_system.html

This will create a power user role that has permissions to do searches and create/edit dashboards (it's not necessary to include permissions already in the Reader role because Graylog will by default assign that role to all users):

curl -v -XPOST -u 'ADMIN:PASSWORD' -H 'Content-Type: application/json' 'http://graylog.example.org:9000/api/roles' -d '{"name":"Power user","description":"Dashboard and search permissions","permissions":["dashboards:create","dashboards:edit:*","dashboards:read:*","searches:absolute","searches:keyword","searches:relative"],"read_only":false}'

(Replace ADMIN, PASSWORD, and the URL as appropriate)

Here's the un-minified JSON for the Power user role:

@bmaupin
bmaupin / openshift-3.10-jenkins-java-not-found-fix.md
Last active October 26, 2018 15:59
OpenShift 3.10 Jenkins java not found fix

Problem:

Using the Jenkins app from the OpenShift v3.10 catalog (oc new-app jenkins-persistent) fails with the following error in the logs:

/usr/libexec/s2i/run: line 472: exec: java: not found

Solution

  1. Edit the build config for the jenkins app
  2. Under Images uncheck Deploy images from an image stream tag
@bmaupin
bmaupin / install-postman.sh
Created October 18, 2018 15:56
Install Postman on Linux
# https://stackoverflow.com/a/43723749/399105
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
rm postman.tar.gz
sudo ln -s /opt/Postman/Postman /usr/bin/postman
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman