Skip to content

Instantly share code, notes, and snippets.

View billz's full-sized avatar
🤖
Processing

Bill Zimmerman billz

🤖
Processing
View GitHub Profile
@billz
billz / lighttpd.conf
Last active February 21, 2024 21:43
lighttpd v1.4.69 default config
server.modules = (
"mod_indexfile",
"mod_access",
"mod_alias",
"mod_redirect",
)
server.document-root = "/var/www/html"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
@billz
billz / common.sh
Last active November 25, 2023 11:57
#!/bin/bash
#
# RaspAP installation functions
# Author: @billz <billzimmerman@gmail.com>
# Author URI: https://github.com/billz/
# License: GNU General Public License v3.0
# License URI: https://github.com/raspap/raspap-webgui/blob/master/LICENSE
# You are not obligated to bundle the LICENSE file with your RaspAP projects as long
# as you leave these references intact in the header comments of your source files.
@billz
billz / wpa_write.php
Last active September 20, 2023 16:33
<?php
$ssid = "my_ssid";
$network['passphrase'] = "my_passphrase";
$wpa_file = fopen('/tmp/wifidata', 'w');
if (strlen($network['passphrase']) >=8 && strlen($network['passphrase']) <= 63) {
unset($wpa_passphrase);
unset($line);
exec('wpa_passphrase '. ssid2utf8( escapeshellarg($ssid) ) . ' ' . escapeshellarg($network['passphrase']), $wpa_passphrase);
#!/bin/bash
# Author URI: https://github.com/billz/
# Use /dev/random to generate a strong random passphrase.
# If pronounceable, but less secure, passphrases are desired, install gpw (sudo apt install gpw)
# and replace it with: gpw 1 24
readonly HOSTAPD="/etc/hostapd/hostapd.conf"
readonly PASSPHRASE=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 32 ; echo '')
echo "Your new passphrase is: ${PASSPHRASE}"
UPDATE_URL="https://raw.githubusercontent.com/billz/raspap-webgui/master/"
wget -q ${UPDATE_URL}/installers/common.sh -O /tmp/raspapcommon.sh
source /tmp/raspapcommon.sh
function update_system_packages() {
install_log "Updating sources"
sudo apt-get update || install_error "Unable to update package list"
}
function install_dependencies() {