Skip to content

Instantly share code, notes, and snippets.

@molayli
molayli / opendns_updater.rb
Created January 13, 2016 13:08
simple ruby script to update OpenDNS
require 'net/http'
require 'openssl'
hostname = 'HOSTNAME_TO_UPDATE'
username = 'USERNAME_HERE'
password = 'PASSWORD_HERE'
puts "=================================="
@molayli
molayli / base_url.php
Created February 7, 2016 16:39
find the website base url dynamically
/**
* @param bool $fullBase
* @return string
*/
function baseUrl($fullBase=false){
$scriptName = $_SERVER['SCRIPT_NAME'];
$parts = explode('/',$scriptName);
array_pop($parts);
@molayli
molayli / resetDualMonitor.bat
Created September 28, 2016 08:01
reset DualMonitor
taskkill.exe /IM DualMonitor.exe /F
start "" "%programfiles(x86)%\Dual Monitor\DualMonitor.exe"
exit
@molayli
molayli / helpers.php
Created October 11, 2016 13:36
Laravel redirect without return statment
<?php
//.....
if(!function_exists('freeRedirect')){
function freeRedirect($to = '/'){
throw new \Illuminate\Http\Exception\HttpResponseException(redirect($to));
}
@molayli
molayli / GetRSSFeed.html
Last active February 11, 2017 21:50 — forked from cmbaughman/GetRSSFeed.js
Parse RSS feed as JSON from client using Google API
<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 / rsync-preserve-ownership.sh
Created September 28, 2018 10:00
rsync preserve www-data ownership
rsync -avz --chown=www-data:www-data --exclude=tmp/ SRC DEST
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 / app.js
Created July 7, 2020 13:30
autoload vue single file components
// 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));
[DEFAULT]
# Ban hosts for one hour:
bantime = 36000
# Override /etc/fail2ban/jail.d/00-firewalld.conf:
banaction = iptables-multiport
[sshd]
enabled = true
@molayli
molayli / youtube-shorts.txt
Created December 28, 2023 11:13
youtube-shorts
www.youtube.com##ytd-guide-renderer a.yt-simple-endpoint path[d^="M10 14.65v-5.3L15 12l-5 2.65zm7.77-4.33"]:upward(ytd-guide-entry-renderer)
www.youtube.com##ytd-mini-guide-renderer a.yt-simple-endpoint path[d^="M10 14.65v-5.3L15 12l-5 2.65zm7.77-4.33"]:upward(ytd-mini-guide-entry-renderer)
www.youtube.com##ytd-browse[page-subtype="home"] .ytd-thumbnail[href^="/shorts/"]:upward(ytd-rich-item-renderer)
www.youtube.com##ytd-browse[page-subtype="subscriptions"] .ytd-thumbnail[href^="/shorts/"]:upward(ytd-grid-video-renderer,ytd-rich-item-renderer)
www.youtube.com##ytd-search .ytd-thumbnail[href^="/shorts/"]:upward(ytd-video-renderer)
www.youtube.com##ytd-browse[page-subtype="subscriptions"] ytd-video-renderer .ytd-thumbnail[href^="/shorts/"]:upward(ytd-item-section-renderer)
www.youtube.com##ytd-watch-next-secondary-results-renderer .ytd-thumbnail[href^="/shorts/"]:upward(ytd-compact-video-renderer,ytd-shelf-renderer)
www.youtube.com##ytd-browse[page-subtype="trending"] .ytd-thumbnail[href^="/shorts/"]:upward(yt