Skip to content

Instantly share code, notes, and snippets.

View MartinBucko's full-sized avatar
💚
200 OK

Martin Bučko MartinBucko

💚
200 OK
View GitHub Profile
@MartinBucko
MartinBucko / openvpn-in-lxd.txt
Created May 15, 2018 17:43 — forked from wastrachan/openvpn-in-lxd.txt
OpenVPN in LXD Container
# On the host
=============
lxc config set openvpn raw.lxc 'lxc.cgroup.devices.allow = c 10:200 rwm'
lxc config device add openvpn tun unix-char path=/dev/net/tun
# In the container
==================
1. mknod /dev/net/tun c 10 200
image: someting/myclientfront
ENV:
ROOT_URL=https://testing.testdomain.com/
API_LOCAL_URL=http://myclientback/api
API_URL=https://testing.testdomain.com/api/
PORT=3000
Labels:
traefik.enable=true
@MartinBucko
MartinBucko / feathersjs-hook.js
Created January 18, 2019 15:54
Feathers JS hook example
// Use this hook to manipulate incoming or outgoing data.
// For more information on hooks see: http://docs.feathersjs.com/api/hooks.html
module.exports = function (options = {}) { // eslint-disable-line no-unused-vars
return async context => {
const { data } = context;
// Throw an error if we didn't get a text
if(!data.text) {
throw new Error('A message must have a text');
@MartinBucko
MartinBucko / moleculer-service.js
Last active January 20, 2019 02:57
moleculer service example template
'use strict';
module.exports = {
name: 'greeter',
/**
* Service settings
*/
settings: {},
@MartinBucko
MartinBucko / badips-ipset.sh
Created June 5, 2019 21:20 — forked from JadedDragoon/badips-ipset.sh
A script to create and update an ipset with ip addresses retrieved from the badips.com blacklist. (With just a little effort should work with url to any source of IPs separated by newlines)
#!/bin/bash
# Script for blocking IPs which have been reported to www.badips.com
# via ipsets.
#
# - THIS SCRIPT DOES NOT BLOCK ANYTHING -
# This script only updates ipsets with applicable data from
# badips.com. Actually blocking the ips in that ipset is left
# up to the user (so that you may do so however you prefer).
#
# Additionally, this script does not persist the ipsets through
@MartinBucko
MartinBucko / setup.sh
Created May 31, 2020 03:04 — forked from MakiseKurisu/setup.sh
Proxmox VE 6 GPU Passthrough
#!/bin/bash
# Reference guides:
# https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF
# https://pve.proxmox.com/wiki/Pci_passthrough
# https://pve.proxmox.com/wiki/Nested_Virtualization
# Remember to turn on SVM in BIOS and disable CSM
# Update packages
@MartinBucko
MartinBucko / index.html
Created November 3, 2020 05:19 — forked from chrisveness/index.html
JavaScript AES client/server interoperability test
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AES client/server test</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css">
<style>
body { font-size: 80%; padding: 1em; }
form { margin-top: 2em; }
label { display: inline-block; width: 6em; }
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@MartinBucko
MartinBucko / sp
Created January 13, 2021 06:00
Spotify Bus
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@MartinBucko
MartinBucko / Vagrantfile
Created February 17, 2021 10:27 — forked from russmckendrick/Vagrantfile
AWX Vagrant up
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos/7"
config.vm.provider :virtualbox do |v|
v.memory = 4048
v.cpus = 2