Skip to content

Instantly share code, notes, and snippets.

@burningTyger
burningTyger / moodle_on_do.md
Last active September 20, 2023 03:07
How To Install Moodle via git with Postgres, Nginx and PHP on an Ubuntu 16.04 VPS

How To Install Moodle via git with Postgres, Nginx and PHP on an Ubuntu 16.04 VPS

Introduction

Moodle is a common online learning platform used in many educational settings around the world. This tutorial aims at giving admins a solid and speedy foundation for serving moodle to a small to medium sized institution. The setup focuses on simple maintenance and fast updates.

Prerequisites

  • Create a small droplet with Ubuntu 16.04 (64Bit is great)
  • Follow the tutorial on setting up Ubuntu 16.04
  • git should be installed by default
@burningTyger
burningTyger / testports.sh
Created March 7, 2016 10:06 — forked from enginefeeder101/testports.sh
Test outgoing open ports
#!/bin/bash
task(){
LC_ALL=C nc -vzw5 portquiz.net $1 2>&1 | grep -v 'Connection timed out'
}
N=50 # Specify number of ports to check at once
(
for port in {1..65535}; do # Specify port range to check here
((i=i%N)); ((i++==0)) && wait
@burningTyger
burningTyger / upgrade_moodle.sh
Created January 11, 2016 08:06
This is my upgrade script for moodle. Has worked flawlessly for the last two years.
# depending on where you keep your moodle files this is how I'm doing it.
# works on any branch, for major upgrade you need to run this file a last time on the current branch
# then cd into the moodle dir and `git branch` into the newer version in order to get
# the latest updates. Then run the script again to activate.
cd /usr/share/nginx/html/moodle
sudo -u www-data php /usr/share/nginx/html/moodle/admin/cli/maintenance.php --enable;git pull
sudo -u www-data php /usr/share/nginx/html/moodle/admin/cli/upgrade.php
sudo -u www-data php /usr/share/nginx/html/moodle/admin/cli/maintenance.php --disable
sudo -u www-data php /usr/share/nginx/html/moodle/admin/cli/cron.php;cd
call plug#begin('~/.vim/plugged')
Plug 'kien/ctrlp.vim'
Plug 'ervandew/supertab'
Plug 'scrooloose/syntastic'
Plug 'bronson/vim-trailing-whitespace'
Plug 'bling/vim-airline'
Plug 'airblade/vim-gitgutter'
Plug 'slim-template/vim-slim'
Plug 'pangloss/vim-javascript'
require "delegate"
module X
def initialize(*)
super
__getobj__.class.instance_methods(false).each do |meth|
define_singleton_method(meth) { __getobj__.send(meth) || "Is nil"}
end
end
end
@burningTyger
burningTyger / mdb2sql
Created October 21, 2015 21:35
use mdbtools to convert mdb to sql
#!/bin/bash
# found this here: http://stackoverflow.com/questions/5722544/how-can-i-convert-an-mdb-access-file-to-mysql-or-plain-sql-file
#
# Create DB like this: CREATE DATABASE xyc;
# To invoke it simply call it like this:
# ./mdbconvert.sh accessfile.mdb mysqldatabasename
TABLES=$(mdb-tables -1 $1)
MUSER="root"
@burningTyger
burningTyger / autossh.service
Last active October 18, 2015 19:56 — forked from thomasfr/autossh.service
Systemd service for autossh
# use this if you have a systemctl --user script. Runs it as a user.
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
@burningTyger
burningTyger / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@burningTyger
burningTyger / README
Last active August 29, 2015 14:18 — forked from rwest/README
These two files should help you to import passwords from mac OS X keychains to 1password.
Assumptions:
1) You have some experience with scripting/are a power-user. These scripts worked for me
but they haven't been extensively tested and if they don't work, you're on your own!
Please read this whole document before starting this process. If any of it seems
incomprehensible/frightening/over your head please do not use these scripts. You will
probably do something Very Bad and I wouldn't want that.
2) You have ruby 1.9.2 installed on your machine. This comes as standard with Lion, previous
versions of OS X may have earlier versions of ruby, which *may* work, but then again, they
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
<h1 class="text-center login-title">Sign in to continue to Bootsnipp</h1>
<div class="account-wall">
<img class="profile-img" src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120"
alt="">
<form class="form-signin">
<input type="text" class="form-control" placeholder="Email" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>