Skip to content

Instantly share code, notes, and snippets.

View erdoukki's full-sized avatar
💭
I may be slow to respond.

Kerma Gérald erdoukki

💭
I may be slow to respond.
View GitHub Profile
@erdoukki
erdoukki / OpenWrt detect new device and send text message.md
Created July 6, 2021 17:53 — forked from jwalanta/OpenWrt detect new device and send text message.md
Detect new network devices connecting to OpenWrt and send text message
@erdoukki
erdoukki / 99-login-german-fon
Created July 6, 2021 09:04 — forked from dks77/99-login-german-fon
Telekom_FON Hotspot: auto-login bash script wget germany wispr client openwrt
#!/bin/sh
# place this file at: /etc/hotplug.d/iface/99-login-telekom_fon
# based on source: https://gist.github.com/cusspvz/3ab1ea9110f4ef87f0d2e1cd134aca67
#
# loginscript for german telekom_FON hotspot (NOT the general Telekom Hotspot)
# technic: uses HTTP POST formular; extract URLs from WIPSr
#
# Preparations
#!/bin/ash
# This script filters the logs and send it via mail
# Installation on openwrt
#- opkg update && opkg install diffutils
#- install and setup ssmtp (https://fleshandmachines.wordpress.com/2014/09/14/openwrt-automatic-email-sending/)
#- add it to crontab
# Rules
RULES="grep -v info"
@erdoukki
erdoukki / README.md
Created June 4, 2021 09:46 — forked from teffalump/README.md
OpenWRT adblock implementation

Others have recently developed packages for this same functionality, and done it better than anything I could do. Use the packages instead of this script:

Description

In its basic usage, this script will modify the router such that blocked addresses are null routed and unreachable. Since the address blocklist is full of advertising, malware, and tracking servers, this setup is generally a good thing. In addition, the router will update the blocklist weekly. However, the blocking is leaky, so do not expect everything to be blocked.

@erdoukki
erdoukki / sync-fail2ban.sh
Created March 2, 2021 12:42 — forked from klepsydra/sync-fail2ban.sh
Block globally reported hack attempts using your local iptables firewall rules
#!/bin/bash
## Update fail2ban iptables with globally known attackers.
## Actually, runs 100% independently now, without needing fail2ban installed.
##
## /etc/cron.daily/sync-fail2ban
##
## Author: Marcos Kobylecki <fail2ban.globalBlackList@askmarcos.com>
## http://www.reddit.com/r/linux/comments/2nvzur/shared_blacklists_from_fail2ban/
@erdoukki
erdoukki / hosting-on-github.md
Created February 26, 2021 16:13 — forked from TylerFisher/hosting-on-github.md
Basic steps for hosting on Github

Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level
@erdoukki
erdoukki / espressobin_armbian_wip_howto.md
Created September 30, 2020 12:16 — forked from lanefu/espressobin_armbian_wip_howto.md
Quick notes and howto for building and installing Armbian for espressobin

Espressobin

I haven't tried mainline kernel. just 4.4.x. Seems to work with Xenial and Jessie

pre-flight

make note of the MAC addresseses on the switch ports.. the 2 close together will be LAN1 and LAN2 in the OS. eth1addr and ethaddr2 in u-boot. The 3rd address will be for WAN in the OS aka ethaddr in u-boot

the WAN port is in-line with the SDcard slot on the board.... use that as your primary NIC for now.

building

Use my branch, or hopefully igor's once my merge request has been added. Standard armbian building expertise applies.

@erdoukki
erdoukki / iwchan.awk
Created September 26, 2020 06:40
Select wireless channel automatically
#!/usr/bin/awk -f
# Coded by: Vladislav Grigoryev <vg[dot]aetera[at]gmail[dot]com>
# License: GNU General Public License (GPL) version 3+
# Description: Select wireless channel automatically
function get_iwphy() {
cmd = "iw phy"
while(cmd | getline) {
if($0 ~ /^\s*Wiphy\s/)
@erdoukki
erdoukki / README
Created September 14, 2020 09:07 — forked from patrakov/README
Automatically reinstall OpenWRT packages after firmware upgrades
The script helps you restore all installed OpenWRT packages after upgrading the main firmware image via sysupgrade. It works
ONLY if the default firmware image provided by the OpenWRT project is sufficient to get connected to the Internet, but you
want some extra packages for additional functionality. In other words, it WILL NOT WORK if connecting to the Internet
requires installing extra packages (e.g., a kernel module for your LTE modem).
The script has been tested for upgrading from OpenWRT 18.06.1 to 18.06.2 and to a development snapshot, as well as between
development snapshots. On LEDE 17.01.x, "flock" is not a part of the default image, so has to be installed manually.
Initial setup:
@erdoukki
erdoukki / gist:e85a50c953c9b02675f4a16aca5c7680
Created September 14, 2020 07:35 — forked from jiananlu/gist:9258032
upgrade openwrt kernel and reinstall all packages manual

upgrade the system

Make sure you can ssh to the router by root and type in the command:

cd /tmp
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-mw4530r-v1-squashfs-sysupgrade.bin
sysupgrade -v openwrt-ar71xx-generic-mw4530r-v1-squashfs-sysupgrade.bin