1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv to manually rebuild the font cache
| #!/bin/bash | |
| # extract all postgres databases from a sql file created by pg_dumpall | |
| # this script outputs one .sql file for each database in the original .sql file | |
| # unless you pass the name of a database in the dump | |
| if [ $# -lt 1 ] | |
| then | |
| echo "Usage: $0 <postgresql sql dump> [dbname]" >&2 | |
| exit 1 | |
| fi |
| #!/bin/bash | |
| # extract all postgres databases from a sql file created by pg_dumpall | |
| # this script outputs one .sql file for each database in the original .sql file | |
| # unless you pass the name of a database in the dump | |
| if [ $# -lt 1 ] | |
| then | |
| echo "Usage: $0 <postgresql sql dump> [dbname]" >&2 | |
| exit 1 | |
| fi |
| # DEBUGGING HACK | |
| $t->app->hook(before_dispatch => sub { # for request | |
| my $c = shift; | |
| return unless $ENV{APP_DEBUG}; | |
| print "*** Request body = ".$c->tx->req->body."\n"; | |
| print "*** Request headers = ".$c->tx->req->content->headers->to_string."\n"; | |
| print "*** End of headers\n"; | |
| }); | |
| $t->app->hook(after_dispatch => sub { # for response |
1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv to manually rebuild the font cache
| #!/bin/bash | |
| # | |
| # This script configures WordPress file permissions based on recommendations | |
| # from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
| # | |
| # Author: Michael Conigliaro | |
| # | |
| WP_OWNER=changeme # <-- wordpress owner | |
| WP_GROUP=changeme # <-- wordpress group | |
| WP_ROOT=/home/changeme # <-- wordpress root directory |
Thanks to this article by Christoph Berg
Directories and files
~/| # Oracle XE requires a swap file of at least twice the size of physical memory | |
| # see https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-centos-6 | |
| # check current swap file | |
| swapon -s | |
| # check available space | |
| df | |
| # setup 2GB swap file | |
| dd if=/dev/zero of=/swapfile bs=1024 count=2048k |
| #!/bin/sh | |
| ## backup each mysql db into a different file, rather than one big file | |
| ## as with --all-databases. This will make restores easier. | |
| ## To backup a single database simply add the db name as a parameter (or multiple dbs) | |
| ## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is | |
| ## Create the user and directories | |
| # mkdir -p /var/backups/mysql/databases | |
| # useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup | |
| ## Remember to make the script executable, and unreadable by others |
| sudo apt-get install libmoose-perl libtemplate-perl libmoosex-types-path-class-perl libdatetime-perl libdatetime-format-w3cdtf-perl libtemplate-plugin-html-strip-perl libdata-guid-perl |
| #!/usr/bin/env bash | |
| # script to check website status (online/ofline) | |
| while read site | |
| do | |
| if wget -p "$site" -O /dev/null &>/dev/null; then | |
| echo "$site is up" | |
| else | |
| # action to do if website offline | |
| echo "[$(date +%d-%m-%Y:%H:%M:%S)] $site is not reachable." | ./slack-post.sh |