I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.
if ufw is not installed by default be sure to install it first.
| -- gets all fields from a hash as a dictionary | |
| local hgetall = function (key) | |
| local bulk = redis.call('HGETALL', key) | |
| local result = {} | |
| local nextkey | |
| for i, v in ipairs(bulk) do | |
| if i % 2 == 1 then | |
| nextkey = v | |
| else | |
| result[nextkey] = v |
| CREATE OR REPLACE FUNCTION insta5.next_id(OUT result bigint) AS $$ | |
| DECLARE | |
| our_epoch bigint := 1314220021721; | |
| seq_id bigint; | |
| now_millis bigint; | |
| shard_id int := 5; | |
| BEGIN | |
| SELECT nextval('insta5.table_id_seq') %% 1024 INTO seq_id; | |
| SELECT FLOOR(EXTRACT(EPOCH FROM clock_timestamp()) * 1000) INTO now_millis; |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
| # | |
| # Name: nginx-tls.conf | |
| # Auth: Gavin Lloyd <[email protected]> | |
| # Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating | |
| # | |
| # Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related | |
| # to SSL/TLS are omitted here. | |
| # | |
| # Example: https://www.ssllabs.com/ssltest/analyze.html?d=gav.sh | |
| # |
| long date = 1407869895000L; // August 12, 2014, 8:58PM | |
| // August 12, 2014 (default) | |
| DateUtils.formatDateTime(this, date, 0); | |
| // Aug 12, 2014 (default with abbreviated month) | |
| DateUtils.formatDateTime(this, date, DateUtils.FORMAT_ABBREV_MONTH); | |
| // August 12 (date without year) | |
| DateUtils.formatDateTime(this, date, DateUtils.FORMAT_NO_YEAR); |
| import android.graphics.Bitmap; | |
| import android.graphics.drawable.BitmapDrawable; | |
| import android.graphics.drawable.Drawable; | |
| import java.io.ByteArrayOutputStream; | |
| /** | |
| * Sketch Project Studio | |
| * Created by Angga on 12/04/2016 14.27. | |
| */ | |
| public class AppHelper { |
| <?php | |
| /** | |
| * Функция склонения числительных в русском языке | |
| * | |
| * @param int $number Число которое нужно просклонять | |
| * @param array $titles Массив слов для склонения | |
| * @return string | |
| **/ | |
| $titles = array('котик', 'котика', 'котиков'); | |
| function declOfNum($number, $titles) |
| var crypto = require('crypto'); | |
| // the Base64 encoded Google Play license key / Base64-encoded RSA public key from the Google Play Dev Console | |
| var publicKey = "ABCEDF1234...."; | |
| /** sample | |
| { | |
| "orderId":"12999763169054705758.1371079406387615", | |
| "packageName":"com.example.app", | |
| "productId":"exampleSku", |