Skip to content

Instantly share code, notes, and snippets.

View fcolista's full-sized avatar

Francesco Colista fcolista

View GitHub Profile
@fcolista
fcolista / fix-texlive.sh
Last active August 23, 2017 17:21
AlpineLinux: Fix LaTex
#!/bin/sh
#
# Simple script used to get the latest laTeX package working with Alpine
# It assumes that testing repository is already added.
# If not:
# echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && apk update
#
# (c) 2017 Francesco Colista
# Email: fcolista@alpinelinux.org
#
@fcolista
fcolista / icinga2-web-conf
Last active February 9, 2017 09:33
AlpineLinux: Icingaweb2 webserver config script
#!/bin/sh
#
#
# Script for automatic webserver setup for Icingaweb2, designed for Alpine Linux (https://www.alpinelinux.org)
# (c) 2017 Francesco Colista
# Email: fcolista@alpinelinux.org
#
icingaweb2_path="/usr/share/webapps/icingaweb2/public"
icingaweb2conf_path="/etc/icingaweb2"
@fcolista
fcolista / configure-metasploit-alpine.sh
Last active February 14, 2024 10:01
AlpineLinux: metasploit configuration script to run as ordinary user and DB configuration (postgresql). Updated for Alpine 3.19.
#!/bin/sh
#
# (c) 2024 Francesco Colista
# fcolista@alpinelinux.org
#
# Configure metasploit to run as $USER
#
_yn() {
case $(echo $1 | tr '[A-Z]' '[a-z]') in
@fcolista
fcolista / dmesgt
Created February 7, 2017 07:42
dmesg output date in a human readable way
#!/bin/sh
# It's better to have dmesg logging in a human readable way
base=$(cut -d '.' -f1 /proc/uptime);
seconds=$(date +%s);
dmesg | sed 's/\]//;s/\[//;s/\([^.]\)\.\([^ ]*\)\(.*\)/\1\n\3/' |
while read first; do
read second;
first=`date +"%d/%m/%Y %H:%M:%S" --date="@$(($seconds - $base + $first))"`;
printf "[%s] %s\n" "$first" "$second";
@fcolista
fcolista / update_tbs_module.sh
Created February 7, 2017 07:40
TBS module rebuild scripts for debian-based distro
#!/bin/sh
#
# (c) 2016 Francesco Colista
# Email: francesco [at] bsod.eu
#
# Script used to build TBS modules from upstream
echo
echo "**** Check first if linux-headers are installed ****"
@fcolista
fcolista / openvas-alpine-check-setup
Last active November 20, 2019 09:19
AlpineLinux: openvas scripts configuration
#!/bin/sh
# OpenVAS
# $Id$
# Description: Script for checking completeness and readiness
# of OpenVAS.
# Reviewed for Alpine Linux distribution by:
# Francesco Colista <fcolista@alpinelinux.org>
#
# Authors:
@fcolista
fcolista / build_tvheadend.sh
Created February 7, 2017 07:35
Tvheadend build script from git repo (debian-based)
#!/bin/sh
#
# (c) 2016 francesco@bsod.eu
# Simple script for building tvheadend with the latest git repo and ffmpeg static bindings
# Used to build WEBM profile on Live TV Web Player
#
check_if_installed() {
local PACKAGES="libavahi-client-dev zlib1g-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev build-essential git pkg-config libssl-dev bzip2 wget debhelper libcurl4-gnutls-dev liburiparser-dev"
for p in $PACKAGES; do
STATUS=$(dpkg-query -W -f='${Status} ${Version}\n' $p | awk '{print $3}')
@fcolista
fcolista / icinga2-db-conf
Last active February 8, 2017 17:26
AlpineLinux: Icingaweb2 database config script
#!/bin/sh
#
# Script for automatic Database setup for Icingaweb2, designed for Alpine Linux (https://www.alpinelinux.org)
# (c) 2017 Francesco Colista
# Email: fcolista@alpinelinux.org
#
configure_icinga2() {
db=$1
dbcaps=$(echo $db | cut -c1 | tr a-z A-Z)$(echo $db | cut -c2-)