Skip to content

Instantly share code, notes, and snippets.

View blurayne's full-sized avatar

Markus Geiger blurayne

View GitHub Profile
* coreutils*
`-- coreutils package
`-- chcon - Change file SELinux security context. - relabeling
`-- runcon - Run command with specified SELinux security context. - runtime
`-- ... - Other tools which have nothing to do with SELinux. -
* policycoreutils*
`-- policycoreutils package
`-- sestatus - SELinux status tool. - debugging
`-- fixfiles - Fix file SELinux security contexts. - relabeling
@outcoldman
outcoldman / dbhist.sh
Created July 19, 2017 21:53
DBHist: bash history in sqlite
# The MIT License
# SPDX short identifier: MIT
# Further resources on the MIT License
# Copyright 2017 Denis Gladkikh (https://www.outcoldman.com/en/archive/2017/07/19/dbhist/)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
const puppeteer = require('puppeteer');
class Webpage {
static async generatePDF(url) {
const browser = await puppeteer.launch({ headless: true }); // Puppeteer can only generate pdf in headless mode.
const page = await browser.newPage();
await page.goto(url, { waitUntil: 'networkidle', networkIdleTimeout: 5000 }); // Adjust network idle as required.
const pdfConfig = {
path: 'url.pdf', // Saves pdf to disk.
format: 'A4',
@Riebart
Riebart / userdata.sh
Created January 10, 2018 16:51
EC2 user data for setting up an EC2 instance with SSM and deploying into an ECS cluster.
#!/bin/bash
# Install the SSM agent:
# Ref: https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-startup-linux.html
cd /tmp
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
sudo start amazon-ssm-agent
echo ECS_CLUSTER="ECS_CLUSTER_NAME" >> /etc/ecs/ecs.config
export PATH=/usr/local/bin:$PATH
@filipenf
filipenf / convert-and-test.sh
Last active March 28, 2023 20:39
Script to convert an ansible vault into a yaml file with encrypted strings
#!/bin/bash
#Vault password is 1
echo "Converting vault to yaml format:"
ansible-vault decrypt --output - vault | python ./convert_vault.py > new-vault.yml
echo "Decrypting a variable from the converted vault"
ansible localhost -i localhost, -e @new-vault.yml -m debug -a 'var=secret' --ask-vault-pas
#!/bin/bash
# This is an updated version of the aws-install-ssm-agent
# script that supports SUSE.
function die() {
echo "$@, exiting." >&2
exit 1
}
@pydoh
pydoh / pybrowser.py
Last active December 29, 2023 17:02 — forked from kklimonda/pybrowser.py
A minimal Gtk+/Webkit based browser in Python
#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# Python imports
import sys
# Gtk imports
from gi.repository import Gtk, Gdk, WebKit
@RagedUnicorn
RagedUnicorn / cloud_init_debugging.md
Last active January 22, 2025 12:55
Debugging tipps when working with cloud-init

Cloud-Init Debugging

Cloud-init combined with terraform can be a powerful tool to provision instances on startup. Debugging scripts that are run by cloud-init however are not the easiest to debug.

Logs

Usually on an Ubuntu machine a lot of what is happening can be found in the syslog

cat /var/log/syslog
@Caellian
Caellian / backup.sh
Created August 3, 2018 04:41
Backup & Restore scripts - arch, partclone, zstd
if [ "$EUID" -ne 0 ]
then
echo -e "\033[0;33mWARNING:\033[0m This script requires root privileges!"
fi
if [ $# -ne 2 ]
then
echo -e "\033[0;31mERROR:\033[0m Image name and/or drive not given in arguments!"
echo "Usage:"
echo -e "\t\033[1;31mbackup <image name> <drive>\033[0m"
@paulcalabro
paulcalabro / mmr_tcx_downloader.py
Last active May 8, 2023 18:28
This script downloads Training Center XML (TCX) files from MapMyRun
#!/usr/bin/env python3
from getpass import getpass
from requests import request
###########################################
# Prompt the user for required information.
###########################################
print('\n' + ('*' * 25) + ' Required Information: ' + ('*' * 25))