Skip to content

Update gravity-adv.sh#1

Merged
jacobsalmela merged 1 commit intopi-hole:masterfrom
dwin999:master
Jan 25, 2015
Merged

Update gravity-adv.sh#1
jacobsalmela merged 1 commit intopi-hole:masterfrom
dwin999:master

Conversation

@dwin999
Copy link
Contributor

@dwin999 dwin999 commented Jan 25, 2015

This works much faster.

This works much faster.
jacobsalmela added a commit that referenced this pull request Jan 25, 2015
90% speed improvement thanks to dwin999.
@jacobsalmela jacobsalmela merged commit a2575da into pi-hole:master Jan 25, 2015
@jacobsalmela
Copy link
Contributor

Could you explain--in detail--how your code works? It is definitely faster, but I want to understand how it works. Explain what each piece of code does. Thanks

@dwin999
Copy link
Contributor Author

dwin999 commented Feb 21, 2015

catting a file to stdin is much faster than looping over a file in bash.

cat /tmp/matter.txt | sort | uniq | sed '/^$/d' | I just copied your code.
awk -v "IP=$piholeIP" '{sub(/\r$/,""); print "address=/"$0"/"IP}' just formats the code to the dnsmasq format, removing any \r using awk regex.

@jacobsalmela
Copy link
Contributor

I'm just not too familiar with all of the awk stuff. I have really only used the most basic to print a column.

jacobsalmela pushed a commit that referenced this pull request Mar 29, 2015
Automatic IP detection with all locale
jacobsalmela pushed a commit that referenced this pull request Nov 15, 2015
jacobsalmela pushed a commit that referenced this pull request Nov 26, 2015
jacobsalmela pushed a commit that referenced this pull request Dec 6, 2015
jacobsalmela pushed a commit that referenced this pull request Jan 19, 2016
@Burdalfis Burdalfis mentioned this pull request Dec 3, 2016
4 tasks
@ghost ghost mentioned this pull request Jan 7, 2017
jacobsalmela pushed a commit that referenced this pull request Feb 21, 2017
dschaper pushed a commit that referenced this pull request Dec 9, 2017
@cassamajor cassamajor mentioned this pull request Apr 23, 2018
8 tasks
AzureMarker pushed a commit that referenced this pull request Jun 4, 2018
AzureMarker pushed a commit that referenced this pull request Jul 19, 2018
@wcentic wcentic mentioned this pull request Aug 12, 2018
AzureMarker pushed a commit that referenced this pull request Aug 16, 2018
Merge with current main development branch
@stan-qaz stan-qaz mentioned this pull request Jan 2, 2019
3 tasks
@Floppik Floppik mentioned this pull request Feb 27, 2019
@robdyck robdyck mentioned this pull request Feb 15, 2023
@Nukiver Nukiver mentioned this pull request Aug 11, 2024
saltman007web

This comment was marked as off-topic.

saltman007web

This comment was marked as abuse.

@enjunear enjunear mentioned this pull request Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants