Skip to content

Instantly share code, notes, and snippets.

Milo Jennings facelordgists

Block or report user

Report or block facelordgists

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Count of files in each
# Count of files in each sub-directory
find . -maxdepth 1 -mindepth 1 -type d -exec sh -c 'echo "$(find "{}" -type f | wc -l)" {}' \; | sort -nr
## Output example
# 1128 ./wordpress-seo
# 676 ./wp-ses
# 618 ./css-javascript-toolbox
# 423 ./gravityforms
# 394 ./wp-usertrack
## Install from private_html folder
wp plugin install ../private_html/ --activate --force --skip-plugins --skip-themes
wp theme install ../private_html/ --activate --force --skip-plugins --skip-themes
## Install from S3
wp plugin install --activate --force --skip-plugins --skip-themes
wp theme install --activate --force --skip-plugins --skip-themes
wp plugin install --activate --force --skip-plugins --skip-themes
wp plugin install --activate --force --skip-plugins --skip-themes
View get-all-plugin-data.php
function get_all_plugin_data(){
$all_plugins = get_plugins();
$list_of_all_plugins = array();
foreach ($all_plugins as $path => $data) {
$parts = explode('/', $path);
$slug = $parts[0];
$list_of_all_plugins[$slug] = array(
'Slug' => $slug,
'path' => $path,

Call it like so manually or periodically from cron (because you might forget):

tmux-session save

It will write to ~/.tmux-session. Restore them after reboot like so:

tmux-session restore


1) Configure the wp-config.php

As follows:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

1. General Stuff


An image is a set of layers. When you start an image, it becomes a running container. You can have many running containers of the same image.

An instance of an image is called a container.

The image is the recipe, the container is the cake. You can make as many cakes as you like with a given recipe. A stopped container is a cake in the freezer.

View list files every 2
#monitor files in "webserver-access" folder
watch ls -l webserver-access
#taken from here:
cd /Users/milojennings/Library/Application\ Support/Steam/steamapps/common/Starbound/storage
ln -s /Users/milojennings/Dropbox/User\ Account\ Settings/Starbound/player player
ln -s /Users/milojennings/Dropbox/User\ Account\ Settings/Starbound/universe universe

Modified version of the code found in this post

{% set export = blog_recent_posts('2099729350', 200) %} 
{% for content in export %} "{{ $root.DOUBLE_LEFT_CURLY_BRACE }}|forceescape }}","{{ $root.DOUBLE_LEFT_CURLY_BRACE }} content.slug|forceescape|replace('blog/', '') }}","{{ $root.DOUBLE_LEFT_CURLY_BRACE }} content.publish_date_localized|forceescape }}","{{ $root.DOUBLE_LEFT_CURLY_BRACE }} content.post_body|replace('"','""')|forceescape|escape_jinjava }}","{{ $root.DOUBLE_LEFT_CURLY_BRACE }} content.featured_image }}","{{ $root.DOUBLE_LEFT_CURLY_BRACE }} content.blog_post_author }}","{{ $root.DOUBLE_LEFT_CURLY_BRACE }} content.topic_list|forceescape|replace('[', '')|replace(']', '') }}" <br>
{% endfor %}
{% endif %}
facelordgists /
Last active Sep 3, 2019
Curl a website from one server to another within a private network, such as a gateway to appserver or loadbalancer to appserver.
# -H sets the header
# -v includes the header information
# /dev/null pipes the contents of the page output into a blackhole
curl -v http://<server-host_or_ip>/ -H "Host:" > /dev/null
# Example
curl -v https://localhost/ -H "Host:" > /dev/null
curl -v http://appserver-4/ -H "Host:" > /dev/null
curl -v http://appserver-4/ -H "Host:" > /dev/null
You can’t perform that action at this time.