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
@tomazzaman
tomazzaman / class-developer-import.php
Created March 31, 2015 18:03
Import JSON into WordPress
<?php
// Published under GPL
// tutorial here: https://codeable.io/community/how-to-import-json-into-wordpress/
class Developer_Import {
public function __construct() {
add_action( 'wp_ajax_import_developer', array( $this, 'import_developer' ) );
@hucklesby
hucklesby / dabblet.css
Created October 18, 2013 23:02
Fit caption to the width of any image
/**
* Fit caption to the width of any image
*/
.captioned-figure {
display: table;
table-layout: fixed;
}
.captioned-figure img {
margin-bottom: 10px;
border: 0;

Installing ipFire on a Raspberry Pi 3 b+

Sharp language ahead, but i was infuriated at getting openWRT to work before this. Go away if you're easily offended.

Step 1: Download ipFire

I have mirrored the version I've been using for this guide. Though i encourage you to download the latest one.

Mirror: https://drive.google.com/open?id=1u--Ynws2FTW4X1oycYXp2xOZ4B8pvRt6

@florido
florido / .zsh_plugins.txt
Created January 14, 2019 14:40
ZSH setup and plugins I use with http://getantibody.github.io/
# Bundles from the default repo (robbyrussell's oh-my-zsh).
robbyrussell/oh-my-zsh folder:plugins/git
robbyrussell/oh-my-zsh folder:plugins/github
robbyrussell/oh-my-zsh folder:plugins/heroku
robbyrussell/oh-my-zsh folder:plugins/lein
robbyrussell/oh-my-zsh folder:plugins/command-not-found
# robbyrussell/oh-my-zsh folder:plugins/common-aliases
robbyrussell/oh-my-zsh folder:plugins/autojump
robbyrussell/oh-my-zsh folder:plugins/compleat
@techslides
techslides / form3.js
Created October 16, 2014 21:01
HTML Form POST Submit via Ajax to Node.js
// Load the http module to create an http server.
var http = require('http');
// Create a function to handle every HTTP request
function handler(req, res){
var form = '';
if(req.method == "GET"){
@YagoLopez
YagoLopez / deep-search-javascript-object.js
Last active January 8, 2023 10:02
Deep search javascript object
/* Attribution: http://techslides.com/how-to-parse-and-search-json-in-javascript */
//return an array of objects according to key, value, or key and value matching
function getObjects(obj, key, val) {
var objects = [];
for (var i in obj) {
if (!obj.hasOwnProperty(i)) continue;
if (typeof obj[i] == 'object') {
objects = objects.concat(getObjects(obj[i], key, val));
} else
@braian87b
braian87b / mwan-config.sh
Last active June 30, 2023 12:53
/etc/config/mwan
# My documentation:
#
# Important: this works well on OpenWRT 15.05.1, on newer versions there was some breaking changes, for example, the wan ifaces have ipv6 capability and now are named with letters ("wan, wanb... , wanc" instead of "wan, wan2... wan3" so wanb6 means 2nd wan ipv6.): https://github.com/openwrt/packages/blob/master/net/mwan3/files/etc/config/mwan3
#
# We have Interfaces, Members, Policyes y Rules:
#
# Interfaces: Allows to identify the wan interface, we just need to have it enabled`
# the others parameters are only to track if the interface it is up or down.
#
# Members: Can be defined in some metric and weight, both values will be important ambos when used in policyes.
@himalay
himalay / auto-dns.sh
Last active July 9, 2023 13:14
[Pi-hole auto DNS switch] The script automatically switches the DNS servers between Pi-hole and Cloudflare based on Pi-hole DNS Server status. #pihole #openwrt
#!/bin/sh
# The script automatically switches the DNS servers between Pi-hole and Cloudflare based on Pi-hole DNS Server status.
TARGET=192.168.0.7 # Pi-hole
FALLBACK_A=1.1.1.1 # Cloudflare
FALLBACK_B=1.0.0.1 # Cloudflare
function set_fallback_dns() {
echo $(date)
@braian87b
braian87b / mwan3-notes.md
Last active October 22, 2023 12:33
How to get MWAN3 Working Properly on OpenWRT / LEDE

In experience to get a proper working multiple wan configuration using mwan3 starting from scratch you should:

Important: this works well on OpenWRT 15.05.1, on newer versions there was some breaking changes, for example, the wan ifaces have ipv6 capability and now are named with letters ("wan, wanb... , wanc" instead of "wan, wan2... wan3" so wanb6 means 2nd wan ipv6.): https://github.com/openwrt/packages/blob/master/net/mwan3/files/etc/config/mwan3

The official documentation seems to be very detailed and up to date, I recommend reading those first: https://openwrt.org/docs/guide-user/network/wan/multiwan/mwan3 but I recommend to give a look at my config file below, since my approach for policyes is very nice.

First of all: Activate conntrack, docs says that is important and neccesary to get MWAN3 work properly, and it is needed to reboot: