- Run
yum install postgresql-server postgresql-contrib
; installs PostgreSQL and some utilities - Run
postgresql-setup initdb
; sets up the default config - Near line ~82 in
/var/lib/pgsql/data/pg_hba.conf
, change the method from ident to md5 on thehost
lines - Run
systemctl start postgresql
to start the SQL server - Run
systemctl enable postgresql
to enable it as a service - Setup created a postgres "root" user called
postgres
you can become that user withsudo -i -u postgres
- You can get a SQL prompt with
psql
; exit SQL prompt by typing\q
- Postgres user also has the
createuser
andcreatedb
commands available; by default, it matches user accounts and database names by the user account that is accessing it. So you will likely need to add a user and a db named after an existing UNIX account.
Install build packages from repos. You will probably need EPEL.
~ # yum install git gcc gcc-c++ libxml2-devel pkgconfig openssl-devel bzip2-devel curl-devel libpng-devel libjpeg-devel libXpm-devel freetype-devel gmp-devel libmcrypt-devel mariadb-devel aspell-devel recode-devel autoconf bison re2c libicu-devel postgresql-devel
For Ubuntu this looks something like:
~ # apt install autoconf bison libpq-dev libxml2-dev apache2-dev systemtap-sdt-dev openssl pkg-config libssl-dev libcurl4-openssl-dev libbz2-dev libgdbm-dev libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev libfreetype6-dev libicu-dev libiodbc2-dev libxslt1-dev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this makes sure every user has these files, so we can easily add keys | |
mkdir /etc/skel/.ssh | |
touch /etc/skel/.ssh/authorized_keys | |
chmod 700 /etc/skel/.ssh | |
chmod 600 /etc/skel/.ssh/authorized_keys | |
# edit /etc/adduser.conf: set DIR_MODE to 0751 | |
# disable password login for ssh now | |
# if you used keys instead of a password on digital ocean, this is already done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From "A simple unix/linux daemon in Python" by Sander Marechal | |
# See http://stackoverflow.com/a/473702/1422096 | |
# | |
# Modified to add quit() that allows to run some code before closing the daemon | |
# See http://stackoverflow.com/a/40423758/1422096 | |
# | |
# Joseph Ernest, 2016/11/12 | |
import sys, os, time, atexit | |
from signal import signal, SIGTERM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use latest'; | |
import parser from 'rss-parser'; | |
module.exports = function(context, req, res) { | |
// we could probably easily allow the user to supply their subreddit of choice | |
// but kitties are wholesome, so lets leave it at that | |
parser.parseURL('https://www.reddit.com/r/cats/.rss', function(err, parsed) { | |
// the messages aren't helpful, IMHO but at least you'll know if it breaks | |
if(err) { res.writeHead(500, {}); res.end(err.message); return; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
The methods are in the order worked on: | |
First, what is a palindrome? How can tell if something `is_palindromic`? | |
Generate numbers with N `digits`. Abuse the fact that | |
intval('non numeric string') == 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This installs a multi tenant Nginx setup with PHP FPM 7.1 and MariaDB | |
# it is suitable for Laravel 5.5 | |
# THIS IS NOT A SCRIPT PER SE! | |
# THE COMMENTS MAY HAVE INSTRUCTIONS TOO! | |
# USING: Digital Ocean's vanilla Ubuntu 16.04 droplet | |
#---------------------------------------------------------- | |
# SECURITY CONCERNS | |
#---------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import json | |
import sys | |
import os | |
from collections import OrderedDict | |
""" | |
QJson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Copyright 2017-2018 Derrek Bertrand <[email protected]> | |
* Copyright 2018 CollabCorp Group | |
* | |
* License: MIT | |
*/ | |
use Exception; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Copyright 2017-2018 Derrek Bertrand <[email protected]> | |
* Copyright 2018 CollabCorp Group | |
* | |
* License: MIT | |
*/ | |
use Exception; |
OlderNewer