Skip to content

Instantly share code, notes, and snippets.

View fxkraus's full-sized avatar
🎯
Focusing

Felix Kraus fxkraus

🎯
Focusing
View GitHub Profile
@fxkraus
fxkraus / debian-install-megacli.md
Last active March 10, 2024 10:20
Install LSI MegaCli .deb package on Debian/Ubuntu

download

wget https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

unzip

unzip 8-07-14_MegaCLI.zip
@fxkraus
fxkraus / index.html
Created June 22, 2021 19:26
Love heart animation using CSS3 & JavaScript
<div id="header-plugin"></div>
<div class="bg_heart"></div>
@fxkraus
fxkraus / haproxy_maintenance.conf
Last active December 15, 2020 17:37 — forked from sts/haproxy_maintenance.conf
HAProxy Maintenance Page
#
# Proof of concept for a HAProxy maintenance mode
#
#
# Control the maintenance page during runtime using the stats socket:
#
# To put the whole site in maintenance mode (for all IPs):
# > add acl #0 0.0.0.0/0
#
# To exclude your own ip, so you are able to test things out:
@fxkraus
fxkraus / autopgsqlbackup
Created July 27, 2018 09:44 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@fxkraus
fxkraus / build_cross_gcc
Last active October 7, 2017 11:11 — forked from preshing/build_cross_gcc
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@fxkraus
fxkraus / notify.sh
Created August 8, 2017 09:55 — forked from jehiah/notify.sh
email notify at system boot time
#!/bin/bash
#
# *************************************************
# chkconfig: 2345 99 99
# description: notify email address on system boot.
# *************************************************
# Installing:
# 1) save as /etc/rc.d/init.d/notify
# 2) set the desired email address in "MAILADD" variable
# 3) chmod a+w /etc/rc.d/init.d/notify
@fxkraus
fxkraus / check_swap_paging_rate.sh
Last active August 8, 2017 07:13 — forked from jehiah/check_swap_paging_rate.sh
Nagios Monitor for the rate pages are swapped in/out
#!/bin/bash
# Show the rate of swapping (in number of pages) between executions
OK=0
WARNING=1
CRITICAL=2
UNKNOWN=-1
EXITFLAG=$OK
WARN_THRESHOLD=1
@fxkraus
fxkraus / postgres_queries_and_commands.sql
Created July 20, 2017 17:56 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@fxkraus
fxkraus / ubuntu-luks-encrypted-usb-drive.md
Last active July 7, 2017 07:26
Ubuntu LUKS encrypted usb backup partition

Encrypted

Install required packages

sudo apt-get update && sudo apt-get install -y cryptsetup

Overwrite existing partition table (optional)

@fxkraus
fxkraus / postgresql_create_ro_user.sql
Created July 4, 2017 15:35
PostgreSQL: Create read-only database user/role
CREATE USER username WITH PASSWORD 'the_password';
GRANT CONNECT ON DATABASE the_database TO username;
GRANT USAGE ON SCHEMA public TO username;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO username;
-- has to be executed while connected to the actual database
\c the_database
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO the_database;
GRANT SELECT ON ALL TABLES IN SCHEMA public to the_database;