Skip to content

Instantly share code, notes, and snippets.

View thimslugga's full-sized avatar
:octocat:

Adam Kaminski thimslugga

:octocat:
View GitHub Profile
@thimslugga
thimslugga / README.md
Created January 13, 2020 15:58 — forked from Informatic/README.md
cloud-init "nocloud" networking setup

cloud-init is absolute cancer. Its code is horrible. It has no documentation at all.

It took me 5 fucking hours to figure out how to properly configure networking on recent cloud-init (Ubuntu 16.04 cloud image) with local datasource.

It's not mentioned anywhere you need to provide dsmode: local. (but only if you need network-config, besides that everything is fine; someone below noted that -m flag does the same thing, good to know) Of course nobody needs documentation for network-config format either. (cloudinit/net/__init__.py is a protip, enjoy the feces dive)

Oh, and by the way - no, it's not possible to provide network-config to uvt-kvm without patching shit.

@thimslugga
thimslugga / .gitignore
Created January 13, 2020 15:58 — forked from smoser/.gitignore
cloud-init ubuntu nocloud example with network config
*.img
*.raw
@thimslugga
thimslugga / 00-clamav-notes.sh
Created January 8, 2020 15:03 — forked from AfroThundr3007730/00-clamav-notes.sh
My notes on getting ClamAV working on CentOS 7
# How to get ClamAV working on CentOS 7
yum -y install epel-release && yum -y update
yum -y install clamav clamav-data clamav-scanner clamav-scanner-systemd clamav-server clamav-server-systemd clamav-unofficial-sigs clamav-update
# Add /etc/clamd.d/freshclam.conf
# Add /usr/lib/systemd/system/clamav-freshclam.service
systemctl enable clamav-freshclam.service && systemctl start clamav-freshclam.service
@thimslugga
thimslugga / appify
Created November 20, 2019 16:40 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_adisk._tcp</type>
<txt-record>sys=waMa=0,adVF=0x100</txt-record>
<txt-record>dk0=adVN=Time Capsule,adVF=0x82</txt-record>
</service>
<service>
#!/bin/bash
# https://gist.github.com/koenpunt/40c0b042c453a1add0e8
#
# Check if the user is in the right group
# and afterwards retrieve the SSH public key from LDAP
# Logs directly in Syslog
# requires ldap-utils
#
# sshd_config for OpenSSH 6.2 or higher:
#
@thimslugga
thimslugga / Bash project
Created October 4, 2019 12:32 — forked from sarvsav/Bash project
Bash project directory structure
├── bin => Contains binary of your project
├── docs => Contains documentation and future aspects about your project
│ └── ToDo => ToDo List of your project
├── etc => Add configuration files under this directory
│ └── imdb-xplorer.cfg => Configuration file
├── LICENSE => Add license for your project
├── logs => This directory contains logs about behaviour of your script
│ └── imdb-xplorer.log => log file
├── README.md => Contains how to install, and use your project
├── setup.sh => install the project on your machine
@thimslugga
thimslugga / .ssh_config
Created September 24, 2019 14:05 — forked from andyvanee/.ssh_config
Fix unix_listener too long for Unix domain socket
Host *
ControlPath ~/.ssh/control/%C
ControlMaster auto
@thimslugga
thimslugga / README.md
Created September 8, 2019 14:05 — forked from RichardBronosky/README.md
Using cloud-init for cloudless provisioning of Raspberry Pi

Installing cloud-init on a fresh Raspbian Lite image

This is a work in Progress!

Purpose

This mainly demonstrates my goal of preparing a Raspberry Pi to be provisioned prior to its first boot. To do this I have chosen to use the same cloud-init that is the standard for provisioning servers at Amazon EC2, Microsoft Azure, OpenStack, etc.

I found this to be quite challenging because there is little information available for using cloud-init without a cloud. So, this project also servers as a demonstration for anyone on any version of Linux who may want to install from source, and/or use without a cloud. If you fall into that later group, you probably just want to read the code. It's bash so everything I do, you could also do at the command line. (Even the for loop.)

@thimslugga
thimslugga / dns_server.py
Created August 7, 2019 15:11 — forked from samuelcolvin/dns_server.py
requires python 3.5+ and dnslib, see https://github.com/samuelcolvin/dnserver for full/better implementation
from datetime import datetime
from time import sleep
from dnslib import DNSLabel, QTYPE, RD, RR
from dnslib import A, AAAA, CNAME, MX, NS, SOA, TXT
from dnslib.server import DNSServer
EPOCH = datetime(1970, 1, 1)
SERIAL = int((datetime.utcnow() - EPOCH).total_seconds())