Skip to content

Instantly share code, notes, and snippets.

View magnusnordlander's full-sized avatar

Magnus Nordlander magnusnordlander

View GitHub Profile
@magnusnordlander
magnusnordlander / sniffer.yaml
Created April 6, 2024 22:10
ESPHome based sniffer
esphome:
name: open-lcc-sniffer
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
@magnusnordlander
magnusnordlander / README.md
Last active July 19, 2023 10:50
Vanmoof SA5 Certificate exporter

Requirements

  • node
  • @noble/ed25519
  • axios

How to use

  1. Update the last line of keypair-generator.js to use your Vanmoof account details.
  2. Run node keypair-generator.js > bikecredentials.txt
#!/bin/bash
function dce {
if [[ -f .maincontainer ]]; then
docker-compose exec $(cat .maincontainer) $*
else
echo "Could not find .maincontainer file"
fi
}
@magnusnordlander
magnusnordlander / docker-compose.yml
Last active August 11, 2017 16:44
Segfault in PHP 7.1.7
version: '2'
services:
mysql:
image: mysql
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: foo

Recept från Unga Humanisters läger

Torsdag middag

Kött: Helstekt fransyska, serveras med ugnsrostade rotfrukter, tzatziki och en grönsallad

Vegetariskt: Stekt aubergine och zucchini och fetaost, serveras med ugnsrostade rotfrukter, tzatziki och en grönsallad

Fredag lunch

Kött: Tagliatelle al ragu alla bolognese
(Köttfärsgryta med tomat)

@magnusnordlander
magnusnordlander / screenshot.js
Created August 21, 2012 07:45
Take a screenshot with PhantomJS
var system = require('system');
//create new webpage object
var page = new WebPage();
//load the page
page.open(system.args[1], function (status) {
//fire callback to take screenshot after load complete
page.render(system.args[2]);
//finish
@magnusnordlander
magnusnordlander / lighttpd-rewrite.conf
Created January 9, 2012 23:14
Lighty Rewrite for Symfony2
# If you're having trouble creating a good rewrite for Symfony2 apps in Lighttpd, this seems to do the charm. It even works with query string parameters.
url.rewrite-if-not-file = (
"^/(?!app_[dev|test]+\.php/)[^\?]*(\?.*)?$" => "/app.php$1"
)
@magnusnordlander
magnusnordlander / AnnotatedPizza.php
Created November 17, 2011 10:54
Mongo ODM Samples
<?php
namespace SymfonySE\Documents;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
/**
* @MongoDB\Document
*/
class Pizza
/**
* Find/Show an Especie entity.
*
* @Route("/search", name="individuos_showby")
*
*/
public function searchAction()
{
if (!$this->get('request')->query->has('query'))
{
<?php
class ProgressiveController
{
public function progressiveAction($some_id)
{
$response = new ProgressiveResponse();
$response->setHead("Some static data (maybe from twig), or an ESI tag, or whatever");