Skip to content

Instantly share code, notes, and snippets.

@ismarkunc
ismarkunc / function.php
Created March 2, 2021 10:50 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@ismarkunc
ismarkunc / sources.list
Created May 12, 2020 12:21 — forked from rohitrawat/sources.list
Ubuntu 16.04 Xenial default /etc/apt/sources.list
#deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
@ismarkunc
ismarkunc / install.sh
Created November 8, 2019 18:28
VPS install bash script for Ubuntu 16.04
# =================== YOUR DATA ========================
SERVER_NAME="some-server-name"
SERVER_IP="111.111.11.11"
USER="someuser"
SUDO_PASSWORD="secret-password-one"
MYSQL_ROOT_PASSWORD="secret-password-two"
@ismarkunc
ismarkunc / iptables.md
Last active August 30, 2016 17:37
Secure your web server over IP

UBUNTU/DEBIAN IP Tables (Firewall)

When setting up an Debian server, you'll want to establish basic security including a firewall to only allow certain types of requests, and to allow only certain types of responses. This code will:

  • Flush your current firewall
  • Because it's our server and we're not hosting other people's stuff (like a shared server), we'll allow all output
  • Allow input requests for SSH, Port 80 and 443 (Web and TLS (SSL))
  • Log bad requests with the prefix "iptables denied:"
  • Then save these rules to a file called /etc/iptables.up.rules
@ismarkunc
ismarkunc / flightplan-html.md
Created May 13, 2016 08:14 — forked from learncodeacademy/flightplan-html.md
Deploy HTML site with Flightplan

###Prerequesites

Install flightplan globally

npm install -g flightplan

Install flightplan in your project folder