Skip to content

Instantly share code, notes, and snippets.

@iamdual
iamdual / addsite.sh
Last active April 3, 2023 18:12
Simple Control Panel
#!/bin/bash
set -e
TEMPLATE="${TEMPLATE:-addsite.tmpl}"
PHP_VERSION="${PHP_VERSION:-8.2}"
SUDO_SUPPORT="${SUDO_SUPPORT:-1}"
# Set prefix for sudo if it is necessary
SUDO=''
if [ $SUDO_SUPPORT == "1" ] && [ "$EUID" -ne 0 ]; then
@iamdual
iamdual / Readme.md
Created April 23, 2021 13:12 — forked from cunneen/Readme.md
Install Open GApps In Android Emulator

Introduction

This works to install Open GApps into the Android Emulator, working around the issue where the system partition is too small.

With it, I can get Google Play installing into the emulator. Tested on KitKat (API 19), Lollipop (API 21) and Oreo (API 27).

It's tested on MacOS.

Instructions

@iamdual
iamdual / must-contain.regex
Last active September 14, 2020 13:32
Must contain at least X in regular expressions
# At least one digit, at least one lowercase and uppercase letter, at least one special char:
((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\-+.$*?!@#%=&_]).+)
# At least one digit, at least one lowercase and uppercase letter, at least one special char, string length between 8 and 64:
((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\-+.$*?!@#%=&_]).{8,64})
@iamdual
iamdual / server.php
Last active June 28, 2020 18:48
Built-in PHP server skeleton for development environment
<?php php_sapi_name() === "cli-server" or die("Development only.");
$__config = [
"document_root" => __DIR__ . "/public/",
"default_file" => "index.php"
];
if (is_file($__config["document_root"].$_SERVER["REQUEST_URI"])) {
header("Content-type: " . mime_content_type($__config["document_root"].$_SERVER["REQUEST_URI"]));
readfile($__config["document_root"].$_SERVER["REQUEST_URI"]);
@iamdual
iamdual / DateClockTemp.ino
Last active May 18, 2020 12:50
Date, clock and temperature example for Arduino Nano
/*
* Required Libraries:
* https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
* https://github.com/sparkfun/BMP180_Breakout
* https://github.com/msparks/arduino-ds1302
*/
#include <Wire.h>
#include <SFE_BMP180.h>
#include <DS1302.h>
@iamdual
iamdual / e5330.pl
Created November 17, 2018 00:17
Huawei E5330 Broadband Router API Requests
#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
use XML::Simple;
use MIME::Base64;
use Data::Dumper;
use Date::Format;
@iamdual
iamdual / archiver.py
Last active November 17, 2018 00:26
Entire Site Archiver By sitemap.xml
#!/usr/bin/python
import sys, requests
from xml.dom.minidom import parseString
from user_agent import generate_user_agent
if len(sys.argv) <= 1:
print("Usage: ./archiver.py <sitemap_url>")
sys.exit(0)