Unable to load image

(Request) Pihole With Button

https://rdrama.net/h/slackernews/post/188267/contest-5000mb-reward-whats-in-the

A user asked me the below.

Hey, did you use any guides for setting up your pie hole and/or installing the button?

Was interested in making one of these as well.

Any tips or w/e would be appreciated, thanks!

This was my response. which is probably definitely rslurred but w/e

!codecels roast me


No Guides, but happy to give tips, and follow ups where things are unclear.

Button is pretty cool for sure... but you can do everything you need to do from your computer and phone.

A pihole does not protect you unless you set it up as your DNS on your router.

I would also recommend setting up a vpn to your home network using openvpn that way you can take your protection on the go, itll protect you from getting throttled by your cell phone provider too

Parts

Config Pi

Code

  • Look its probably right... but how you set this thing up makes a difference

  • Put this on your Pi maybe call it buttonscript.js

  • {YOUR USER HERE} needs to be swapped out for the user you created

const fs = require('fs');

const Gpio = require('onoff').Gpio;

const { exec } = require('child_process');

// GPIO pin number

const buttonPin = 17;

const logFilePath = '/home/{YOUR USER HERE}/buttonscript.log';

// Setup the button GPIO as input

const button = new Gpio(buttonPin, 'in', 'falling', { debounceTimeout: 200 });

// Function to disable Pi-hole blocking for 5 minutes

function disablePiHole() {

const timestamp = new Date().toISOString();

const logMessage = [${timestamp}] Button pressed. Disabling Pi-hole for 5 minutes...;

console.log(logMessage);

fs.appendFile(logFilePath, logMessage + '\n', (err) => {

if (err) {

 console.error('Error writing to log file:', err);

}

});

exec('pihole disable 5m');

}

// Add event listener to the button

button.watch(disablePiHole);

// Cleanup GPIO on process exit

process.on('SIGINT', () => {

button.unexport();

process.exit();

});

Service

  • This thing needs to start back up when power fails so you need to set it up to do that

  • go here cd /etc/systemd/system/

  • run this to create it sudo nano buttonscript.service

[Unit]

Description=Button Script

After=network.target

[Service]

ExecStart=/usr/bin/node /home/{YOUR USER HERE}/buttonScript.js > /home/{YOUR USER HERE}/buttonscript.log 2>&1

WorkingDirectory=/home/{YOUR USER HERE}/

Restart=always

User={YOUR USER HERE}

[Install]

WantedBy=multi-user.target

  • save and exit nano

  • run this sudo systemctl enable buttonscript.service

  • run this sudo systemctl start buttonscript.service

Circuit

https://i.rdrama.net/images/169043665549889.webp

https://i.rdrama.net/images/16904366556798973.webp

  • find your pinout, I am showing a 4b there are others

  • 3.3 to a rail on the + side of the breadboard at the top using these wires https://www.amazon.com/dp/B01EV70C78

  • in that top rail, put the resistor in

  • resistor to the left hand side on maybe the top row of the breadboard

  • gpio 17 to left side on that row using these wires https://www.amazon.com/dp/B01EV70C78

  • button to left side on that row use the breadboard wires there

  • other terminal on the button to the right side of the breadboard

  • ground to right side on that row using these wires https://www.amazon.com/dp/B01EV70C78

Package to suit, and your done

26
Jump in the discussion.

No email address required.

>Monolithic kernel

>systemD

>GPIO

>Internet

>wireless

>ssh

Massive attack surface right there

Jump in the discussion.

No email address required.

What do you recommend, oh wise one?

Jump in the discussion.

No email address required.

I like pfSense. :marseylaying:

I installed it on some shit box, and it works great! It runs on some paranoid BSD variant, and I never have any performance issues. Plenty of configuration options too.

Jump in the discussion.

No email address required.

Opnsense supremacy shall never be questioned.


Read what I wrote above. Now picture in your head that I put a /s at the end. Good job sweaty! :marseygigaretard:

Jump in the discussion.

No email address required.

:#marseyxd:

Let's see how they're doing....

>load up old comparison .txt file...

>https://wiki.opnsense.org/manual.html

>404 Not Found

:marseyemojirofl:

I remember it being the same thing but with less features and a smaller community for help.

Jump in the discussion.

No email address required.

It’s the same thing pretty much now but it’s been long enough that they both have a community.

All I really know is I have https://shop.opnsense.com/product/dec750-opnsense-desktop-security-appliance/ for my internet accessible services and it’s fricking awesome.


Read what I wrote above. Now picture in your head that I put a /s at the end. Good job sweaty! :marseygigaretard:

Jump in the discussion.

No email address required.

That's good to hear. When I looked at OPNsense, it seemed like it was just starting out.

Jump in the discussion.

No email address required.

Linky all the things plz

Jump in the discussion.

No email address required.

This whole thing was about dns blackholing for the lay person with a button in case you wanna hit that sales link for amazon.

I assume pf sense intergrates that feature? Does it do ddns and opev vpn too?

Jump in the discussion.

No email address required.

I mean... you open up its webpage like any other router and install it. But thanks for helping out the tards. :marseythumbsup:

Yeah and yeah. You can pretty much do whatever you want because it runs on BSD, and it's got a company maintaining and developing features.

Jump in the discussion.

No email address required.

GNU Hurd

:#brainletchair::#braincube:

Jump in the discussion.

No email address required.

>Gpio + wireless

If they are close enough for that then the below is happening

https://i.rdrama.net/images/169046474511137.webp

>le linux system architecture is stupid

BSD STAN.... WE GOT A BSD STAN OVER HERE. See no one cares

https://i.rdrama.net/images/16904653377758646.webp

>ssh

They would have to be smartarded to open 22 inbound considering this sits in the network

>Internet exists

Ok !r-slurs ill go live in a cave now

Jump in the discussion.

No email address required.

They would have to be smartarded to open 22 inbound considering this sits in the network

I think there was a website that showed how many open piholes there were on the internet. That was funny.

Jump in the discussion.

No email address required.

That's probably crap ISP router configuration I don't even trust that

Jump in the discussion.

No email address required.

BSD

That's not free as in freedom software. I would never use that

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.