Skip to content

Instantly share code, notes, and snippets.

View NiKiZe's full-sized avatar

Christian I. Nilsson NiKiZe

View GitHub Profile
@NiKiZe
NiKiZe / start_wwan.sh
Created September 2, 2021 19:19
Start MC7700 LTE on Raspberry Pi
#!/bin/bash
# Connect a Raspberry Pi to LTE using MC7700 Mini PCI Modem with adapter to USB-C
sudo qmicli -d /dev/cdc-wdm0 -p --wds-stop-network
sudo cat /sys/class/net/wwan0/qmi/raw_ip
sudo ip link set dev wwan0 down
# Enable OS Raw IP Mode setting (not persistent)
sudo su -c "echo Y > /sys/class/net/wwan0/qmi/raw_ip"
sudo qmicli -d /dev/cdc-wdm0 -p --device-open-net="net-raw-ip|net-no-qos-header" --wds-start-network="ip-type=6" --client-no-release-cid
@NiKiZe
NiKiZe / dnsmasq.conf
Last active January 27, 2024 06:16
Trying to chainload iPXE with full feature set from a lesser featured one. dnsmasq ProxyDHCP edition
# Known working dnsmasq version 2.85 config for iPXE proxydhcp usage
# things to replace:
# * 10.1.1.0 - your subnet
# * eth0 - interface to listen on, or switch to bind-dynamic
# * 10.1.1.2 - your tftp server ip
# * http://gentoo.ipxe.se/boot.ipxe - script to run once inside iPXE
# Debug logging
log-debug
# coding=utf-8
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import datetime
import sys
import time
import threading
import traceback
import SocketServer
@robinsmidsrod
robinsmidsrod / dhcpd.conf
Last active June 11, 2024 13:10
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN (private network)
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active November 7, 2024 12:23
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@jasny
jasny / linkify.php
Last active May 26, 2024 20:40
PHP function to turn all URLs in clickable links
<?php
/**
* Turn all URLs in clickable links.
*
* @param string $value
* @param array $protocols http/https, ftp, mail, twitter
* @param array $attributes
* @return string
*/
public function linkify($value, $protocols = array('http', 'mail'), array $attributes = array())