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 / etc-hosts-on-win.md
Created March 5, 2019 06:26 — forked from zenorocha/etc-hosts-on-win.md
/etc/hosts on Windows

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file

notepad

@erdoukki
erdoukki / nginx-ssl-proxy.md
Created April 4, 2020 15:48 — forked from SamEureka/nginx-ssl-proxy.md
NGINX SSL Reverse Proxy, w/ fail2ban, letsencrypt, and iptables-persistent

Installing NGINX SSL Reverse Proxy, w/ fail2ban, letsencrypt, and iptables-persistent.

The steps outlined here make many assumptions about both your operating environment and your understanding of the Linux OS and services running on Linux. I am using the current LTS Ubuntu distribution 16.04 running in the cloud on a DigitalOcean Droplet. These steps should work just fine if followed closely and in order... but you know sh!& never works out the way you plan in Linux. I offer some troubleshooting advice, Google and Stack are your friends ask them for help.
(Entered on your local workstation)
  1. ssh-add <path-to-ssh-key> and enter key passphrase when prompted. // ex path... /users/you/.ssh/id_rsa_digital-ocean
  2. ssh root@<server-url-or-IP> // should login without prompting for passphrase
(Entered on your remote server)
  1. adduser and follow prompts
@erdoukki
erdoukki / bandwidth.sh
Created July 27, 2020 19:26 — forked from 2xyo/bandwidth.sh
Realtime Bandwidth monitor
#!/bin/bash
clear
declare -i rxnow txnow txlast rxlast
while true
do
chain=`ifconfig $1|grep bytes`
rxnow=`echo $chain | cut -d ":" -f2 | cut -d " " -f1`
txnow=`echo $chain | cut -d ":" -f3 | cut -d " " -f1`
@erdoukki
erdoukki / Arduino Yun (Linino) on OpenWrt
Created August 20, 2020 20:13 — forked from probonopd/Arduino Yun (Linino) on OpenWrt
Install Arduino Yun (Linino) software on OpenWrt on 3rd-party devices. TODO: Fully automate install and/or use Linino rootfs image and/or build own firmware using OpenWrt Image Generator. CAVEATS: I have not yet found out how to make the Bridge use Serial (USB) instead of Serial1 (HardwareSerial) for the Leonardo. I have asked a question about t…
opkg install luci-lib-json luci rng-tools usbutils avrdude avahi-daemon
# If rng-tools is not installable, then install it by hand from e.g., http://download.linino.org/linino_distro/linino_dev/latest/packages/rng-tools_3-2_ar71xx.ipk
# Edit your /etc/opkg.conf, add
src/gz barrier_breaker http://download.linino.org/dogstick/all-in-one/latest/packages/
# Comment out your earlier src/gz
opkg update
opkg list|grep bridge
@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
@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 / 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 / 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 / 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 / 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/