Skip to content

Instantly share code, notes, and snippets.

@xoyabc
xoyabc / ansible-vault.md
Created June 20, 2018 17:54
Ansible-vault example

Ansible vault example

New in Ansible 1.5, “Vault” is a feature of ansible that allows keeping sensitive data such as passwords or keys in encrypted files, rather than as plaintext in your playbooks or roles. These vault files can then be distributed or placed in source control. To enable this feature, a command line tool, ansible-vault is used to edit files, and a command line flag –ask-vault-pass or –vault-password-file is used. Alternately, you may specify the location of a password file or command Ansible to always prompt for the password in your ansible.cfg file. These options require no command line flag usage.

Requirements

@nicman23
nicman23 / upgrade
Created April 21, 2018 06:34
Openwrt upgrade script
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
start_service() {
if [ -e /root/.upgrade ]
then exit
else touch /root/.upgrade
fi
@enzanki-ars
enzanki-ars / update-ffmpeg-rpi.sh
Last active December 4, 2023 21:36
Install/Update FFmpeg with hardware acceleration on the Raspberry Pi
#!/bin/bash
# #########################################################
#
# WW WW AAA RRRRRR NN NN IIIII NN NN GGGG
# WW WW AAAAA RR RR NNN NN III NNN NN GG GG
# WW W WW AA AA RRRRRR NN N NN III NN N NN GG
# WW WWW WW AAAAAAA RR RR NN NNN III NN NNN GG GG
# WW WW AA AA RR RR NN NN IIIII NN NN GGGGGG
#
@eloo
eloo / node_exporter.default
Last active November 26, 2024 11:21
Init.d script for prometheus node exporter
# Set the command-line arguments to pass to the server.
ARGS='-web.listen-address=:9100 -collector.diskstats.ignored-devices="^(ram|loop|fd)\\d+$"'
# Prometheus-node-exporter supports the following options:
# -collector.diskstats.ignored-devices="^(ram|loop|fd|(h|s|v|xv)d[a-z])\\d+$": Regexp of devices to ignore for diskstats.
# -collector.filesystem.ignored-mount-points="^/(sys|proc|dev)($|/)": Regexp of mount points to ignore for filesystem collector.
# -collector.ipvs.procfs="/proc": procfs mountpoint.
# -collector.megacli.command="megacli": Command to run megacli.
# -collector.ntp.server="": NTP server to use for ntp collector.
# -collector.textfile.directory="": Directory to read text files with metrics from.
@danifr
danifr / Arch_Linux_guide.md
Created June 4, 2016 17:18
Arch Linux guide: the always up-to-date Arch Linux tutorial (by Swapnil Bhartiya from muktware.io)

Find the original article written by Swapnil Bhartiya here: http://www.muktware.io/arch-linux-guide-the-always-up-to-date-arch-linux-tutorial/

Arch Linux guide: the always up-to-date Arch Linux tutorial

Download the latest ISO image of Arch Linux. Once you have downloaded the image it’s time to create a bootable USB drive. If you are on a Linux or Mac OS machine, you can use the ‘dd’ utility. If you are on a Windows system then you will have to use tools such as Rufus or USBWriter. If you have Cygwin installed on your Windows machine, then you can also use the ‘dd’

{
"id": 1,
"title": "Spark Prometheus",
"originalTitle": "Spark Prometheus",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": false,
"sharedCrosshair": false,
@charypar
charypar / group_vars
Last active December 16, 2024 11:02
Deploying SSL keys securely with Ansible (code)
---
ssl_certificates:
- certificate_src: secure.example.com.pem
certificate_dest: /etc/ssl/certs/secure.example.com.pem
key_src: secure.example.com.protected.key
key_dest: /etc/ssl/private/secure.example.com.protected.key
key_stripped: /etc/ssl/private/secure_example.com.key
key_password: "{{ssl_passphrase}}"
@mattiaslundberg
mattiaslundberg / arch-linux-install
Last active February 10, 2025 13:16
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@saihtaM
saihtaM / tv_grab_url-setup.py
Last active August 7, 2024 07:39
TVHeadend tv_grab_url - with automatic setup script for Linux Newbies.
#!/usr/bin/env python
# coding=utf-8
import os
import sys,stat
import urllib2
installto = "/usr/bin/tv_grab_url"
def replace_line(file_name, line_num, text):
#Stolen from http://stackoverflow.com/questions/4719438/editing-specific-line-in-text-file-in-python
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)