Skip to content

Instantly share code, notes, and snippets.

View fail2ban centos config
[DEFAULT]
# Ban hosts for one hour:
bantime = 36000
# Override /etc/fail2ban/jail.d/00-firewalld.conf:
banaction = iptables-multiport
[sshd]
enabled = true
@molayli
molayli / app.js
Created Jul 7, 2020
autoload vue single file components
View app.js
// source : https://github.com/laravel/laravel/blob/v5.8.3/resources/js/app.js
const files = require.context('./', true, /\.vue$/i);
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
View bl.txt
download.cyanogenmod.org
g.cn
thepiratebay.se
e.crashlytics.com
settings.crashlytics.com
crashlytics
resolver.msg.xiaomi.net
ad-sdk.altamob.xiaoying.co
adash.m.taobao.com
nav.cn.ronghub.com
@molayli
molayli / rsync-preserve-ownership.sh
Created Sep 28, 2018
rsync preserve www-data ownership
View rsync-preserve-ownership.sh
rsync -avz --chown=www-data:www-data --exclude=tmp/ SRC DEST
@molayli
molayli / GetRSSFeed.html
Last active Feb 11, 2017 — forked from cmbaughman/GetRSSFeed.js
Parse RSS feed as JSON from client using Google API
View GetRSSFeed.html
<html>
<head>
<title>GetRSSFeed</title>
</head>
<body>
<div id="target"></div>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" ></script>
<script>
var rssUrl = "http://www.exploit-db.com/rss.xml";
@molayli
molayli / helpers.php
Created Oct 11, 2016
Laravel redirect without return statment
View helpers.php
<?php
//.....
if(!function_exists('freeRedirect')){
function freeRedirect($to = '/'){
throw new \Illuminate\Http\Exception\HttpResponseException(redirect($to));
}
View resetDualMonitor.bat
taskkill.exe /IM DualMonitor.exe /F
start "" "%programfiles(x86)%\Dual Monitor\DualMonitor.exe"
exit
@molayli
molayli / base_url.php
Created Feb 7, 2016
find the website base url dynamically
View base_url.php
/**
* @param bool $fullBase
* @return string
*/
function baseUrl($fullBase=false){
$scriptName = $_SERVER['SCRIPT_NAME'];
$parts = explode('/',$scriptName);
array_pop($parts);
@molayli
molayli / opendns_updater.rb
Created Jan 13, 2016
simple ruby script to update OpenDNS
View opendns_updater.rb
require 'net/http'
require 'openssl'
hostname = 'HOSTNAME_TO_UPDATE'
username = 'USERNAME_HERE'
password = 'PASSWORD_HERE'
puts "=================================="