Skip to content

Instantly share code, notes, and snippets.

View tlongren's full-sized avatar
🎯
Focusing

Tyler Longren tlongren

🎯
Focusing
View GitHub Profile
@tlongren
tlongren / hardenUbuntu.sh
Created August 21, 2022 19:07 — forked from lrobert/hardenUbuntu.sh
Ubuntu Base Server Configuration/Hardening Script
#!/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 August 21, 2022 19:07 — forked from duan-li/initial_lamp.sh
Ubuntu 14.04 LTS apache php-fpm setup
#!/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 / README.md
Last active November 15, 2022 02:48 — forked from simonesestito/README.md
Server setup script

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 / portainer-dokku.md
Last active February 20, 2022 04:06 — forked from woudsma/portainer-dokku.md
TLS secured TCP exposed Docker daemon on Dokku host - setup

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 / flash-all.sh
Last active December 15, 2020 03:25 — forked from npjohnson/flash-all.sh
#!/bin/sh
# Copyright 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/bin/sh
# Copyright 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@tlongren
tlongren / dashboard.yml
Last active February 13, 2018 17:24 — forked from kantord/dashboard.yml
dashboard "Food":
- h1 text: Food
- h2 text: By caloric content
- 3 columns:
- rows:
- h3 text: Bananas
- pie chart: {
"columns": [
["Protein", 5], ["Sugar", 10], ["Other carbs", 40], ["Fat", 1]
]
@tlongren
tlongren / insert-posts.php
Created September 22, 2016 08:50
WordPress: Insert a post into WordPress from an external script
<?php
// Load WordPress
require_once 'path/to/www/wp-load.php';
require_once ABSPATH . '/wp-admin/includes/taxonomy.php';
// Set the timezone so times are calculated correctly
date_default_timezone_set('Europe/London');
// Create post
@tlongren
tlongren / pug-bomb.php
Created February 2, 2016 04:38 — forked from retgef/pug-bomb.php
Pug Bomb API Endpoint WordPress Plugin
<?php
/*
Plugin Name: Pug Bomb API Endpoint
Description: Adds an API endpoint at /api/pugs/$n_pugs
Version: 0.1
Author: Brian Fegter
Author URL: http://coderrr.com
*/
class Pugs_API_Endpoint{
@tlongren
tlongren / soliloquy-reload-page-on-navigation-click.php
Last active August 29, 2015 14:19 — forked from n7studios/soliloquy-reload-page-on-navigation-click.php
Soliloquy - Reload Page on Navigation Click and Go to Slider Container
<?php
/**
* Plugin Name: Soliloquy - Reload Page on Navigation Click and Scroll to Slider Container
* Plugin URI: https://longren.io/soliloquy-reload-page-on-navigation-click-and-scroll-to-slider-container
* Version: 1.0
* Author: Tyler Longren
* Author URI: https://longren.io/
* Description: Reloads the entire Page when the next or previous arrows are clicked, or the pager navigation is used. The correct slide is injected into the URL and scrolls to the slider container.
*
* Based on the original plugin from Tim Carr (http://www.n7studios.co.uk). This simply takes the user to the slider after the page reload, good for sliders at the end of posts/pages.