Skip to content

Instantly share code, notes, and snippets.

@gamersalpha
gamersalpha / tail.php
Created October 2, 2017 19:43 — forked from deizel/tail.php
PHP log tail example
<?php
if (isset($_GET['ajax'])) {
session_start();
$handle = fopen('/private/var/log/system.log', 'r');
if (isset($_SESSION['offset'])) {
$data = stream_get_contents($handle, -1, $_SESSION['offset']);
echo nl2br($data);
} else {
fseek($handle, 0, SEEK_END);
$_SESSION['offset'] = ftell($handle);
@gamersalpha
gamersalpha / debug-dnsmasq.sh
Created January 2, 2018 21:01 — forked from shuhaowu/debug-dnsmasq.sh
Debug dnsmasq by logging its queries
#!/bin/bash
echo 'log-queries' > /etc/dnsmasq.conf
service network-manager restart
tail -f /var/log/syslog
@gamersalpha
gamersalpha / twotwo-wayland.sh
Last active January 27, 2019 09:21 — forked from SteveClement/twotwo-wayland.sh
Enlightenment 22 build script for Ubuntu/Debian with Wayland support.
#!/bin/bash
# vi: ts=4:sw=4:et
#
# twotwo.sh
# This script allows you to install/update Enlightenment 22 git version on
# Ubuntu 18.04 or Debian buster (testing), or remove E22 git from your system.
# ********************************************************************
# * This version builds enlightenment with wayland. *
# * That means this requires a very recent Ubuntu or Debian version. *
# * This may not work properly! You've been warned! *