Skip to content

Instantly share code, notes, and snippets.

View kmpm's full-sized avatar

Peter Magnusson kmpm

View GitHub Profile
@kmpm
kmpm / renamings.psm1
Last active September 28, 2020 07:31
if (Get-Module renamings) { return }
<#
.SYNOPSIS
Add parent folder as prefix to all files matching $pattern
.DESCRIPTION
Recursively, from current directory, searches for all files matching the provided pattern.
It then renames those files so that the filename gets a prefix that is name of the parent
@kmpm
kmpm / adding-pixel-to-raspbian-lite.md
Last active March 23, 2024 19:31
Adding PIXEL to Raspbian Lite

Adding PIXEL/GUI to Raspbian Lite

These 'notes' were primarily intended for my own consumption but since there have been surprisingly many comments to it over the years I wanted to do some updates and clarifications. Thanks for all comments.

These instructions will require you to have connection to internet from your pi, WiFi, Ethernet or by some other means like a 3G USB dongle or something.

Preparations

@kmpm
kmpm / README-KVM.md
Created January 11, 2017 10:27
KVM virtualisation tricks

Show guest IPs

virsh net-list
virsh net-dhcp-leases <net-name>
@kmpm
kmpm / raspberry-pi-jessie.md
Last active February 22, 2018 16:17
My Raspberry Pi Jessie notes

My Raspberry Pi (Raspbian Jessie) Notes

All this was made on an RPi 3 running raspbian lite.

Locale

English with Swedish formatting of numbers, dates, times, Monday as first day of week etc.

wget http://www.stacken.kth.se/~auno/en_SE
sudo cp en_SE /usr/share/i18n/locales/en_SE
@kmpm
kmpm / _zabbix-ubuntu-setup.md
Last active August 24, 2016 10:17
Zabbix >= 3.0

How to install zabbix (~3.0) server/client/proxy on Ubuntu 16.04

This will assume that you are to be using MySQL for all databases.

Zabbix Client

@kmpm
kmpm / README.md
Last active August 22, 2016 14:09
Zabbix Stuff

DNS Test

This requires config for zabbix agent as well as the dnstest.php script somewhere on the path, for example /usr/local/bin/dnstest.php.

Content for /etc/zabbix/zabbix_agent.d/userparameter_dnstest.conf

These should work with docker >1.9

Sizes

Containers and volumes

for d in `docker ps -a -q`; do
    d_name=`docker inspect -f {{.Name}} $d`
    echo "========================================================="
 docker ps -a -s --format "{{.Names}} ($d) container size: {{.Size}}" -f "id=$d"

Recepies with NetSH

ARP

netsh interface ipv4 show neighbors

@kmpm
kmpm / README.md
Last active September 12, 2018 13:19
Various information and links for using Lowrance sl2 files and nmea data for creating depth charts.
@kmpm
kmpm / name2utf8.sh
Created October 6, 2015 07:13
Linux filename encoding
#!/bin/bash
# list of encodings to try. (max 10)
enc=( latin1 windows-1252 )
while IFS= read -rd '' file <&3; do
base=${file##*/} dir=${file%/*}
# if converting from utf8 to utf8 succeeds, we'll assume the filename is ok.
iconv -f utf8 <<< "$base" >/dev/null 2>&1 && continue