Skip to content

Instantly share code, notes, and snippets.

View afeish's full-sized avatar
🎯
Focusing

afeish afeish

🎯
Focusing
View GitHub Profile
@afeish
afeish / Netfilter-IPTables-Diagrams.md
Created April 8, 2022 02:53 — forked from nerdalert/Netfilter-IPTables-Diagrams.md
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@afeish
afeish / cell-tests.rs
Created December 1, 2021 06:24 — forked from jonhoo/cell-tests.rs
cell-refcell-rc
// these aren't _quite_ functional tests,
// and should all be compile_fail,
// but may be illustrative
#[test]
fn concurrent_set() {
use std::sync::Arc;
let x = Arc::new(Cell::new(42));
let x1 = Arc::clone(&x);
std::thread::spawn(move || {
@afeish
afeish / how-to.sh
Last active September 21, 2020 05:56 — forked from simonw/how-to.md
How to create a tarball of a git repository using "git archive"
# archive the entire repo
git archive --format=tar.gz -o fastone-upgrade-guide.tar.gz --prefix=fastone-upgrade-guide/ master
# archive the given directory[upgrade] of the repo
git archive --format=tar.gz -o fastone-upgrade-guide.tar.gz --prefix=fastone-upgrade-guide/ HEAD:upgrade/
@afeish
afeish / md-renderer.conf
Created September 12, 2018 10:49 — forked from max-lt/md-renderer.conf
Nginx config to render markdown files (client side)
location /__special {
internal;
allow all;
root /usr/share/nginx/html/__special;
}
location = /__md_file {
internal;
allow all;
@afeish
afeish / compile-nginx-from-source.sh
Created July 17, 2018 02:26 — forked from nurrony/compile-nginx-from-source.sh
All configuration files needed to install nginx on Ubuntu 16.04 Compile Nginx from source with nginx-rtmp-module, pagespeed and cache-purge module.
#change it to latest version
NPS_VERSION=1.11.33.0;
echo "Changing Directory to $HOME..."
cd $HOME;
echo "Nginx version to install: " && \
read NGINX_VERSION && \
echo "Downloading nginx-$NGINX_VERSION..." && \
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \
echo "Installing Nginx Dependencies..." && \
@afeish
afeish / cors-nginx.conf
Created July 10, 2018 03:21 — forked from alexjs/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
var iterations = Math.floor(values.length / 8);
var leftover = values.length % 8;
var i = 0;
if ( leftover > 0 )
{
do {
process( values[i++] );
} while ( --leftover > 0 );
}
do {
@afeish
afeish / mavenNotes.md
Created November 10, 2017 07:15 — forked from BDF/mavenNotes.md
Using the maven shade plugin on a Spring Boot application
  • Maven shade with Spring Boot

The goal was to create an uber-jar out of the Spring boot application. Following the directions given at Apache went very smoothly yet when I tried to execute the jar a large number of spring beans were missing and not getting loaded during runtime. For example, one of the beans not getting loaded was 'AutoConfigurationPackages'

jar -tvf name.jar | grep AutoConfigurationPackages showed that the class file was present in tha jar.

@afeish
afeish / OpenWithSublimeText3.bat
Created September 13, 2017 08:35 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f