Skip to content

Instantly share code, notes, and snippets.

View webdevsuperfast's full-sized avatar
🏠
Working from home

Rotsen Mark Acob webdevsuperfast

🏠
Working from home
View GitHub Profile
@webdevsuperfast
webdevsuperfast / Adguard.js
Created November 13, 2021 01:51 — forked from LeiHao0/Adguard.js
Batch add block list in Adguard Home
list = [
"https://raw.githubusercontent.com/PolishFiltersTeam/KADhosts/master/KADhosts.txt",
"https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Spam/hosts",
"https://v.firebog.net/hosts/static/w3kbl.txt",
"https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt",
"https://someonewhocares.org/hosts/zero/hosts",
"https://raw.githubusercontent.com/VeleSila/yhosts/master/hosts",
"https://winhelp2002.mvps.org/hosts.txt",
"https://v.firebog.net/hosts/neohostsbasic.txt",
"https://raw.githubusercontent.com/RooneyMcNibNug/pihole-stuff/master/SNAFU.txt",

Xiaomi 3C OpenWRT Install

Specifications:

  • CPU: MediaTek MT7628AN (575MHz)
  • Flash: 16MB
  • RAM: 64MB DDR2
  • 2.4 GHz: IEEE 802.11b/g/n with Integrated LNA and PA
  • Antennas: 4x external single band antennas
  • WAN: 1x 10/100M
@webdevsuperfast
webdevsuperfast / openwrt.sh
Created November 11, 2021 07:02
OpenWRT IPTables block devices based on MAC Address
#! /bin/sh
# List of MAC Addresses to drop
mac="XX:XX:XX:XX:XX:XX AA:AA:AA:AA:AA:AA"
set -- $mac
# while [ -n "$1" ]; do
while [ $# -gt 0 ]; do
echo "iptables -I FORWARD -m mac --mac-source $1 -j DROP">>/etc/firewall.user
shift
@webdevsuperfast
webdevsuperfast / convert.sh
Created October 13, 2021 01:53
Convert Apple Lossless to FLAC
#!/bin/sh
for f in *.m4a; do ffmpeg -i "$f" -c:a flac "${f%.m4a}.flac"; done
@webdevsuperfast
webdevsuperfast / cdparanoia.sh
Created October 13, 2021 01:05
Rip Audio CDs with CDParanoia & FFMpeg
#!/bin/sh
cdparanoia -Q 2>&1 |
grep "^ *[1-9]" |
sed -e 's/^ *\|\..*//g' |
while read t; do
cdparanoia $t - | ffmpeg -i pipe: -c:a 128k -ar 44100 -ac 2 -y "rip $t.mp3";
done
@webdevsuperfast
webdevsuperfast / doh.rsc
Created June 3, 2021 01:33 — forked from Lillecarl/doh.rsc
MikroTik Cloudflare anti phising DOH
{
/tool fetch url=https://curl.haxx.se/ca/cacert.pem
/certificate import file-name=cacert.pem passphrase=””
/ip firewall layer7-protocol
add name=security.cloudflare-dns.com regexp=security.cloudflare-dns.com
/ip dns
set allow-remote-requests=yes cache-max-ttl=1h servers=1.1.1.2,1.0.0.2,2606:4700:4700::1112,2606:4700:4700::1002 use-doh-server=https://security.cloudflare-dns.com/dns-query verify-doh-cert=yes
/ip firewall filter
add action=drop chain=output comment="drop dns output if not looking for cloudflare DOH servers." dst-port=53 layer7-protocol=!security.cloudflare-dns.com out-interface-list=WAN protocol=tcp
add action=drop chain=output comment="drop dns output if not looking for cloudflare DOH servers." dst-port=53 layer7-protocol=!security.cloudflare-dns.com out-interface-list=WAN protocol=udp
@webdevsuperfast
webdevsuperfast / functions.php
Last active April 14, 2021 01:10
FluentForms Server-side Facebook Conversions API
<?php
/**
* Functions
*
* @package Facebook Conversions API
* @since 1.0
* @link https://rotsenacob.com/
* @author Rotsen Mark Acob <rotsenacob.com>
* @copyright Copyright (c) 2020, Rotsen Mark Acob
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
@webdevsuperfast
webdevsuperfast / functions.php
Created April 14, 2021 01:07
Redirect posts within a date range to new URL
<?php
/**
* Redirect posts within a date range to new URL with wp_redirect()
* @url https://paulund.co.uk/get-posts-between-certain-dates-wordpress-rest-api
*/
add_action( 'template_redirect', function() {
$args = array(
'date_query' => array(
array(
'after' => 'November 1, 2020',
@webdevsuperfast
webdevsuperfast / README.md
Last active March 17, 2021 13:03
Various ways on creating WordPress backups without a plugin with SSH

Backup WordPress Sites without Plugin

Method 1

  • Make sure SSH is enabled on client server.
  • Run ssh username@websitename.com
  • Run mysqldump -u dbusername -p dbname > backup_dbname.sql
  • Once inside run rsync -avz public_html/ testservername@testserver.com:public_html/testfolder
  • Log in to your test server using SSH.
  • Navigate to the test site folder with cd public_html/subdomain-folder.
  • Run find . -type f -exec chmod 644 {} \; for files.
  • Run find . -type d -exec chmod 755 {} \; for directories.
@webdevsuperfast
webdevsuperfast / functions.php
Last active September 20, 2020 03:24
Validate US ZIP Code with Zippopotamus and Contact Form 7
<?php
/**
* Functions
*
* @package Twenty Twenty Child
* @since 1.0
* @link https://rotsenacob.com
* @author Rotsen Mark Acob <rotsenacob.com>
* @copyright Copyright (c) 2020, Rotsen Mark Acob
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License