As root, install fetchmail
$ apt-get install fetchmail
Check if fetchmail has SSL support: if you see something like "libssl.so.0" then yours has it
$ ldd /usr/bin/fetchmail
[AccountInformation] | |
real_name=Your Real Name | |
nickname=Account name | |
service_provider=OTHER | |
ordinal=0 | |
imap_username=tophost.username | |
imap_remember_password=true | |
smtp_remember_password=true | |
prefetch_period_days=14 | |
imap_host=pop.yourdomain.tld |
<?php | |
/* Block Spam Comments - BEGIN */ | |
/* source: http://davidwalsh.name/wordpress-comment-spam */ | |
add_action( 'wp_footer', 'catch_new_comment_submit' ); | |
add_filter( 'preprocess_comment', 'preprocess_new_comment' ); | |
function catch_new_comment_submit(){ | |
global $post; | |
if( comments_open( $post->ID ) && (is_single() || is_page()) ){ ?> | |
<script type="text/javascript"> | |
window.onload = function() { 'use strict'; |
Create authentication SSH-Kegen key on local/client host
cd ~ && ssh-keygen -t rsa
You could skip passphrase.
From host1, create .ssh directory on remote host via ssh
# Detailed answer | |
curl -s -A "Googlebot/2.1 (+http://www.google.com/bot.html)" -D - YOUR_URL -o /dev/null | |
# Short answer | |
curl -sL -A "Googlebot/2.1 (+http://www.google.com/bot.html)" -w "%{http_code} %{url_effective}\\n" "YOUR_URL" -o /dev/null | |
# Other crawlers: http://www.useragentstring.com/pages/Crawlerlist/ |
/** | |
* Creates a "logging" schema with an "history" table where are stored records in JSON format | |
* | |
* Requires PostgreSQL >= 9.3 since data is stored in JSON format | |
* | |
* Credits: http://www.cybertec.at/2013/12/tracking-changes-in-postgresql/ | |
*/ | |
/* Create a schema dedicated to logs */ | |
CREATE SCHEMA logging; |
[user] | |
name = Cris | |
email = [email protected] | |
[alias] | |
# move into existing branch | |
co = checkout | |
# move into current development brach: change branch name | |
cod = checkout develop | |
# create new branch and move into it | |
cob = checkout -b |
For the KISS principle, you can opt for the factory function pattern (aka closures) instead of use classes.
// Typings definition (stripped out at complie time):
type MyObject = {
readonly aPublicMethod: () => void;
readonly anotherPublicMethod: (anArgument: any) => any;
};
type MyObjectFactory = (aDependencyInstance: any, anotherDependencyInstance: any) => MyObject;
import stream from 'mithril/stream' | |
import * as Stream from 'mithril/stream' | |
export type StatePatch<S> = (state: S) => S | |
export type AppState = { | |
step: string | |
} | |
export type AppActions = { |
const SIZES = ['B', 'KB', 'MB', 'GB', 'TB'] | |
const bytesToSizeString = (bytes) => { | |
if (!+bytes || bytes < 0) { | |
return `0 ${SIZES[0]}` | |
} | |
const i = Math.floor(Math.log(bytes) / Math.log(1024)) | |
return `${parseInt((bytes / Math.pow(1024, i)), 10)} ${SIZES[i]}` | |
} |