Skip to content

Instantly share code, notes, and snippets.

View MaskyS's full-sized avatar
🖋️

Kifah Meeran MaskyS

🖋️
View GitHub Profile
@MaskyS
MaskyS / Setting up https in Wordpress & adding Cloudflare.md
Created October 11, 2020 09:25
Here's how to set up https/ssl and Cloudflare and redirect www to non-www quickly on digitalocean's 1-click Wordpress app/droplet.

I was setting up HTTPS/SSL on a new Wordpress site that I'd installed via DigitalOcean's 1-Click App, but it took a while because of some amateur mistakes leading to infinite redirects and other HTTP errors. Here's how I did it, just in case I forget and have to setup another WP site.

1. Point your domain name to your droplet IP.

  • On your domain registrar (or Cloudflare if you've already set it up to manage your DNS), add 2 A-records as specified on DO:
A | @ | your.droplet.ip
A | www | your.droplet.ip

2. SSH into droplet and run the setup

import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@MaskyS
MaskyS / error-dump.txt
Created November 3, 2018 09:48
Http headers are being sent twice.
The website encountered an unexpected error. Please try again later.
RuntimeException: Failed to start the session because headers have already been sent by "/var/www/html/vendor/symfony/http-foundation/Response.php" at line 1284. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 141 of vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php).
Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (Line: 164)
Drupal\Core\Session\SessionManager->startNow() (Line: 118)
Drupal\Core\Session\SessionManager->start() (Line: 57)
Symfony\Component\HttpFoundation\Session\Session->start() (Line: 240)
Drupal\big_pipe\Render\BigPipe->performPreSendTasks() (Line: 295)
Drupal\big_pipe\Render\BigPipe->sendContent(Object) (Line: 112)
Drupal\big_pipe\Render\BigPipeResponse->sendContent() (Line: 373)
Symfony\Component\HttpFoundation\Response->send() (Line: 20)
@MaskyS
MaskyS / main.dart
Last active November 25, 2022 05:35
An example showing how we can tap on a ListTile to open a PopUpMenuButton in Flutter.
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(
// Title
title: "Example App",
// Home
home: new ListTileWithPopupMenuButton()
));
}
@MaskyS
MaskyS / vim_phpcs_drupal_syntastic.txt
Last active December 23, 2017 08:37 — forked from komlenic/vim_phpcs_drupal_syntastic.txt
Installing drupal code standards in vim + syntastic
# Install vim syntastic (and php) first.
# Download the Drupal coder module. You could do this via other methods but git is nice.
# You can place this wherever, but take note of where you placed it. Something like
# /usr/local/src might be good.
git clone --branch 8.x-2.x http://git.drupal.org/project/coder.git
# Install php code sniffer (phpcs). Using pear.
pear install PHP_CodeSniffer
# Test if phpcs was installed correctly.
@MaskyS
MaskyS / HelloWorld.php
Created December 14, 2017 07:15
Tradtional Start
<?php
echo 'Hello World';
diff --git a/src/ssl.c b/src/ssl.c
index 3fb0f4d..07e6c95 100644
--- a/src/ssl.c
+++ b/src/ssl.c
@@ -283,6 +283,9 @@ SslInitializeCTX(SSL_PROPERTIES *psProperties, char *pcError)
#ifdef SSL_OP_NO_TLSv1_1
| SSL_OP_NO_TLSv1_1
#endif
+#ifdef SSL_OP_NO_TLSv1_2
+ | SSL_OP_NO_TLSv1_2
Patch:
/*
diff --git a/src/ssl.c b/src/ssl.c
index 3fb0f4d..07e6c95 100644
--- a/src/ssl.c
+++ b/src/ssl.c
@@ -283,6 +283,9 @@ SslInitializeCTX(SSL_PROPERTIES *psProperties, char *pcError)
#ifdef SSL_OP_NO_TLSv1_1