Skip to content

Instantly share code, notes, and snippets.

@kzltp
kzltp / does a matching rule exist in that chain.arf
Last active June 10, 2023 04:49
docker iptables bad rule (does a matching rule exist in that chain )
WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a matching rule exist in that chain?).
1-) The firewalld application is updated.
yum update firewalld
2-) Firewalld rule is added.
firewall-cmd --zone=public --permanent --add-masquerade
3-) And reload firewall
@fffonion
fffonion / main.cpp
Created June 30, 2020 09:20
Read Xiaomi Mijia temperature and humidity sensor 2 (LYWSD03MMC) from ESP32
#include <Arduino.h>
#include <BLEDevice.h>
BLEClient *pClient;
BLEScan *pBLEScan;
#define SCAN_TIME 10 // seconds
bool connected = false;
@shnam7
shnam7 / gist:953d19da155ecb32b4a2923589d6748d
Last active February 9, 2025 16:04
PlatformIO - Changing default projects location in vscode
1. Open PlatformIO terminal: Press <Ctrl>+P and type "platformIO: Net Terminal"
2. In the PlatformIO terminal, execute following command
> platformio settings get projects_dir # check current default location
> platformio settings set projects_dir "New Directory"
3. short command
> pio settings get projects_dir
> pio settings set projects_dir "New Directory"
@reinvanoyen
reinvanoyen / terminal-prompt-git-branch-zsh.md
Last active November 10, 2025 14:32
Add Git Branch Name to Terminal Prompt (MacOS zsh)

Add Git Branch Name to Terminal Prompt (zsh)

Updated for MacOS with zsh

  • Catalina
  • Big Sur
  • Monterey
  • Ventura
  • Sonoma

screenshot

@Daniel-dk
Daniel-dk / espNow_broadcast
Created November 28, 2017 17:40
ESP-Now broadcast example
/**
ESPNOW - Basic communication - Broadcast
Date: 28th September 2017
Original Author: Arvind Ravulavaru <https://github.com/arvindr21>
modified by Daniel de kock
Purpose: ESPNow Communication using Broadcast
Resources: (A bit outdated)
a. https://espressif.com/sites/default/files/documentation/esp-now_user_guide_en.pdf
@jessfraz
jessfraz / boxstarter.ps1
Last active November 15, 2025 02:44
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:

The current kernel/drivers of Fedora 24 do not support the Wifi chip used on my Mac Book Pro. Proprietary Broadcom drivers are packaged and available in the rpmfusion repo.

Verify that your card is a Broadcom using: lspci -vnn -d 14e4:

Sample output:

02:00.0 Network controller [0280]: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)

Install

Install the rpmfusion repo, note only "nonfree" is required, as the Broadcom Driver is proprietry: http://rpmfusion.org/

@xeoncross
xeoncross / index.php
Created March 8, 2012 17:31
Tiny, SMTP client in PHP
<?php
/*
This is a very tiny proof-of-concept SMTP client. Currently it's over 320 characters (if the var names are compressed). Think you can build one smaller?
*/
ini_set('default_socket_timeout', 3);
$user = 'you@gmail.com';
$pass = '';
$host = 'ssl://smtp.gmail.com';