Skip to content

Instantly share code, notes, and snippets.

@lcherone
lcherone / htaccessCRUD.class.php
Last active September 4, 2018 05:20
PHP .htaccess CRUD class
<?php
/**
* .htaccess writer CRUD class
*
* @author Lawrence Cherone
* @version 1.00
*/
class htaccessCRUD
{
public $file;
@lcherone
lcherone / gist:6b0e04d6bc6eb8306f20
Last active August 29, 2015 14:10
Random A1phaNumEr1c infinite length string function
<?php
echo passgen(20); //K4YFnMW5muf0kZTMl6h3
function passgen($length = 20)
{
// define base string - add multiplex to pad to an infinate length
$alpha = str_repeat(
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
intval($length + 1)
);

Keybase proof

I hereby claim:

  • I am lcherone on github.
  • I am lcherone (https://keybase.io/lcherone) on keybase.
  • I have a public key whose fingerprint is 3741 7D7C 39BA F498 393C 700D 968E 8ABC 3112 189E

To claim this, I am signing this object:

@lcherone
lcherone / cloud9-lamp.sh
Last active May 8, 2018 15:11
Cloud9 / C9 SDK - Bash script which installs Cloud9 SDK, with Apache2 (rewrite, headers enabled), PHP7, MariaDB, Git, Composer, nodejs, npm and start on boot crontab.
#!/bin/bash
# Set envioroment, for cloud-init
set -e
export DEBIAN_FRONTEND=noninteractive
export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin'
export HOME='/root'
# upon launch wait for internet connection
echo "Waiting for network connection."
@lcherone
lcherone / disposable-email-provider-domains
Last active December 26, 2021 19:02
List of disposable email provider domains
0815.ru
0815.ru0clickemail.com
0815.ry
0815.su
0845.ru
0clickemail.com
0-mail.com
0wnd.net
0wnd.org
10mail.com
@lcherone
lcherone / instal-lamp.sh
Last active September 16, 2017 18:35
LAMP - Apache2 (rewrite, headers enabled), PHP7, MariaDB, Git, Composer, nodejs, npm
#!/bin/bash
#
set -e
export DEBIAN_FRONTEND=noninteractive
source /etc/environment && export PATH && export HOME='/root'
# Set working vars, change these to suit
#
# Application Name
@lcherone
lcherone / lxc-autostart.sh
Last active September 20, 2017 04:03
LXD apply autostart [true|false] to all containers and default profile.
#!/bin/bash
#
# Apply autostart to all containers and default profile.
# - Especially handy if containers have their own autostart value.
# - Could be used for any config value with a tweek.
#
# ask
while true; do
@lcherone
lcherone / lxc-stop.sh
Created September 20, 2017 04:15
LXD stop all running containers
#!/bin/bash
#
# Stop all running containers
#
# stop running containers
for container in $(lxc list volatile.last_state.power=RUNNING -c n --format csv); do
lxc stop "$container"
done
@lcherone
lcherone / lxc-start.sh
Created September 20, 2017 04:16
LXD Start all stopped containers
#!/bin/bash
#
# Start all stopped containers
#
# stop running containers
for container in $(lxc list volatile.last_state.power=STOPPED -c n --format csv); do
lxc start "$container"
done
@lcherone
lcherone / lxc-exec-all.sh
Created September 20, 2017 04:30
LXD run command in all running containers
#!/bin/bash
#
# Run command in all running containers
# Usage: $ ./lxc-exec-all.sh apt update && apt upgrade
#
for container in $(lxc list volatile.last_state.power=RUNNING -c n --format csv); do
lxc exec "$container" "$@"
done