Skip to content

Instantly share code, notes, and snippets.

View selwynorren's full-sized avatar

Selwyn Orren selwynorren

View GitHub Profile
@selwynorren
selwynorren / gcal_link.php
Last active August 15, 2023 22:29 — forked from chrisknepper/gcal_link.php
PHP Google Calendar Link Generator
RewriteEngine On
# This will enable the Rewrite capabilities
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e. http://www.example.com/foo/ to https://www.example.com/ foo/
# The leading slash is made optional so that this will work either in httpd.conf or .htaccess context

elementaryOS Apps and Configs

This guide has been updated for elementaryOS v5.0+.

Enbale PPA support

sudo apt-get update
sudo apt-get -y install software-properties-common

Install original plank dock

@selwynorren
selwynorren / php_session_expire.php
Created October 10, 2019 10:27
PHP Session expire / Logout after time
<?php
//on pageload
session_start();
$idletime=60;//after 60 seconds the user gets logged out
if (time()-$_SESSION['timestamp']>$idletime){
session_destroy();
session_unset();
}else{
$_SESSION['timestamp']=time();
}
@selwynorren
selwynorren / send_email.php
Created July 30, 2018 17:51 — forked from davidnknight/send_email.php
PHP Send Mail (Plaintext and HTML)
<?php
/**
* Send email
* @param string|array $email
* @param object $from
* @param string $subject
* @param string $message
* @param string $headers optional
*/
function send_email($email, $from, $subject, $message, $headers = null)
@selwynorren
selwynorren / clean-prestashop-db.sql
Created February 1, 2017 09:42 — forked from julienbourdeau/clean-prestashop-db.sql
Clean PrestaShop database - Drop old and unless data
# Delete all logs
TRUNCATE ps_log;
# Delete old connection data (only used for stats)
# change 2016-02-01 00:00:00 according to you needs
DELETE c, cs
FROM ps_connections c
LEFT JOIN ps_connections_source cs ON (c.id_connections = cs.id_connections)
WHERE c.date_add < '2016-02-01 00:00:00';

Remove Sendmail from Ubuntu

This should help you completely uninstall Sendmail and all that comes with it.

First, stop the service (assuming it's running).

sudo /etc/init.d/sendmail stop

Uninstall sendmail and sendmail-bin