Skip to content

Instantly share code, notes, and snippets.

@0not
0not / etc_rc.local
Created December 20, 2023 21:24
rc.local file to setup dnsmasq on r7800 router
#!/bin/sh -e
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
# Use dhcp hosts for dns lookup
echo "Updating /etc/dnsmasq.conf"
grep -qF "addn-hosts" /etc/dnsmasq.conf || echo "addn-hosts=/tmp/dhcpd_hostlist" >> /etc/dnsmasq.conf
@0not
0not / functions_to_object_methods.php
Created March 10, 2015 07:21
User on reddit wanted to access methods defined via an object that is created by loading that file.
<?php
// http://www.reddit.com/r/webdev/comments/2yg649/saving_php_file_as_object/
// Class that keeps track of objects
class ImaginaryConversion {
public $functions;
// Constructor is called when the class is instantiated with the new keyword
public function __construct($filename) {
// Return all defined functions
$before = get_defined_functions();
@0not
0not / euler_decay.hs
Last active August 29, 2015 14:16
Numerically and analytically solve the radioactive decay problem (dN/dt = -kN) and plot the results.
module Main where
import Graphics.EasyPlot
dt = 0.001 -- Timestep
tau = 0.05 -- Decay constant
n0 = 1000 -- Initial number of particles
main = do
plot X11 $ [Data2D [Title "Euler", Color Red, Style Lines] [] numerical,