http://www.shaunfreeman.co.uk/install-fail2ban-on-centos-6-with-plesk/
http://forum.parallels.com/showthread.php?72464-Shell-script-for-checking-mail-queue
http://www.devcu.com/forums/topic/274-locking-down-postfix-against-spam/
import { NgModule } from '@angular/core'; | |
import { CommonModule } from '@angular/common'; | |
import { JWT_OPTIONS, JwtInterceptor, JwtModule } from '@auth0/angular-jwt'; | |
import { AuthorizationService } from './authorization.service'; | |
import { environment } from '../../environments/environment'; | |
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; | |
import { RefreshTokenInterceptor } from './refresh-token-interceptor'; | |
function jwtOptionsFactory (authorizationService: AuthorizationService) { | |
return { |
<?php | |
namespace App\Models; | |
use Illuminate\Database\ConnectionInterface; | |
use Illuminate\Database\Eloquent\Builder; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Database\Eloquent\Relations\BelongsToMany; | |
class BelongsToManyInDifferentConnections extends BelongsToMany |
// convert 0..255 R,G,B values to binary string | |
RGBToBin = function(r,g,b){ | |
var bin = r << 16 | g << 8 | b; | |
return (function(h){ | |
return new Array(25-h.length).join("0")+h | |
})(bin.toString(2)) | |
} | |
// convert 0..255 R,G,B values to a hexidecimal color string | |
RGBToHex = function(r,g,b){ |
<?php | |
namespace App\Providers; | |
use Illuminate\Http\Request; | |
use Illuminate\Routing\Route; | |
use Illuminate\Support\ServiceProvider; | |
use App\Http\Middleware\CaptureRequestExtension; | |
class AppServiceProvider extends ServiceProvider |
<?php | |
// *** PHP script to automate nsupdate calls for dynamic dns updates. | |
// *** This script and a properly configured bind nameserver allows hosting | |
// *** of custom dyndns services, e.g. updating own domain from Fritzbox. | |
// *** usage: http://192.168.0.25/nsupdate.php?ns=ns0.mynameserver.de&domain=my.domain.de;my.domain2.de&newip=<ipaddr> | |
if (!isset($_SERVER['PHP_AUTH_USER'])) | |
{ | |
Header("WWW-Authenticate: Basic realm=\"Configurations-Editor\""); | |
Header("HTTP/1.0 401 Unauthorized"); |
<?php | |
/* | |
This function saved my life. | |
found on: http://www.sitepoint.com/forums//showthread.php?t=438748 | |
by: crvandyke | |
It takes an object, and when all else if/else/recursive functions fail to convert the object into an associative array, this one goes for the kill. Who would'a thunk it?! | |
*/ | |
$array = json_decode(json_encode($object), true); |
#!/bin/bash -xv | |
### Country list | |
# CHANGE WITH YOUR COUNTRIES | |
COUNTRIES="europe/france/guadeloupe europe/france/guyane europe/france/mayotte europe/france/martinique europe/france/reunion europe/france" | |
# SMALL SUBSET FOR TESTING: | |
COUNTRIES="europe/france/guyane europe/france/mayotte" | |
NOMINATIM="/var/www/Nominatim" | |
cd $NOMINATIM/data |
class API::V1::BaseController < ApplicationController | |
skip_before_filter :verify_authenticity_token | |
before_filter :cors_preflight_check | |
after_filter :cors_set_access_control_headers | |
def cors_set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Written on 2013-02-04 by Philipp Klaus <philipp.l.klaus →AT→ web.de>. | |
Check <https://gist.github.com/4707775> for newer versions. | |
Uses dnspython: install with `pip install dnspython3` | |
""" |