Skip to content

Instantly share code, notes, and snippets.

View mraerino's full-sized avatar

Marcus Weiner mraerino

View GitHub Profile
use futures::{future, TryFuture};
use std::{marker::PhantomData, net::Ipv6Addr};
use warp::{hyper::StatusCode, reply, Filter, Rejection, Reply};
pub struct ApiBuilder;
pub struct ApiBuilderWithFilter<F, T> {
filter: F,
phantom: PhantomData<T>,
}
use http::uri::{PathAndQuery, Uri};
use std::{convert::TryInto, path::PathBuf};
#[derive(Clone)]
pub struct MockedTransport<T: Clone> {
inner: T,
mock_url: Uri,
}
impl<T> MockedTransport<T>
ssh_authorized_keys:
- github:mraerino
run_cmd:
- "connmanctl config ethernet_9600005a2ab2_cable --ipv6 manual 2a01:4f8:c17:304::1 64"
- "ip -6 route add default via fe80::1 dev eth0"
k3os:
data_sources:
- hetzner
{
"targets": [
{
"isStage": true,
"name": "Stage",
"variables": {
"`jEk@4|i[#Fk?(8x)AV.-my variable": [
"meine Variable",
0
]
@mraerino
mraerino / airfiber-mgmt-ipv6.md
Last active October 25, 2018 22:03
How to enable an IPv6 management address on a Ubiquiti AirFiber

Enabling IPv6 management address on AirFiber

In order to be able to have a management IPv6 address assigned on the br0 interface of a Ubiquiti AirFiber, there is a hacky way to do it.

Login via SSH to execute the commands

Steps

  • Restart bridge interface, so /proc/sys/net/ipv6/conf/br0 is available
  • Disable duplicate address detection on bridge
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.6
-- Dumped by pg_dump version 10.4 (Debian 10.4-2.pgdg90+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
---
AWSTemplateFormatVersion: '2010-09-09'
Resources:
distd3acn4q8n6gtuxcloudfrontnet:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
Aliases:
- staging.code4maus.app.wdr.cloud
PriceClass: PriceClass_100
@mraerino
mraerino / gatsby-node.js
Created July 15, 2018 18:35
GatsbyJS: Fetching the Graphql schema as soon as it is available and saving it into a local file in `.cache`
const path = require('path');
const request = require('request-promise-native');
const fs = require('fs').promises;
const delay = require('delay');
const { introspectionQuery } = require('graphql/utilities/introspectionQuery');
const maxRetries = 4
exports.onPostBootstrap = () => {
(async () => {
let remainingRetries = maxRetries;
<script type="module">
function parseImpl(parts, ...values) {
const templ = document.createElement('template');
templ.innerHTML = parts[0].concat(values.map((val, key) => val + parts[key+1]).join(''));
return templ.content;
}
</script>