LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-24-2018, 05:23 PM   #1
nex
LQ Newbie
 
Registered: Jul 2018
Posts: 2

Rep: Reputation: Disabled
Unhappy Block distracting websites using the kernel


I have a problem with procrastinating on websites such as youtube. The usual cures, like a browser extension or
Code:
/etc/hosts
are way too gentle - I just end up disabling them.

An ideal solution would be impossible to disable, but I'll settle for super annoying to disable. In the very least it should require a restart, which I think is doable.

Since such a solution would be not unlike malware, and since root can undo anything root does, I'm looking for a kernel level solution. I'm willing to jump into light kernel development for this. What I need from you is:
  • pointers on whether it's viable
  • implementation ideas
  • where to begin learning

Perhaps an approach would be to make a (regular userland) process unkillable, and then this process could do the blocking (e.g. by watching over hosts) and prevent unblocking (e.g. by preventing kernel switching). If there's a way to approximate immutable storage (leveraging the unkillable process), then it could overpower a reboot.
 
Old 07-24-2018, 07:45 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,011

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
You need an arms length solution.

Any scheme that you try locally can fail. You need a disinterested third party.

You need a Rube Goldberg machine to poke you when you spend too much time on youtube.
 
Old 07-28-2018, 10:30 AM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
iptables is a kernel level solution. But if you learn it well enough to write rules, you'll know it well enough to turn it off. Maybe you could get a managed router/switch/firewall, make rules to block the sites in question, and then have someone else set the PW on the device. Then you'd have to switch the network cables around to get past it.
 
Old 07-28-2018, 02:41 PM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
One is too many and a 1000 never enough.

Just say "no".
Catch yourself there? just leave. Do better "next time"
Write it down on a 3x5 card. "Don't go to youtube"

Only you are uniquely qualified to put an end to a bad habit, or a Time Waster.
The effort to write a kernel patch/whatevs is likely considerably more than some self-discipline?
Try it for a day. Make a promise to "not do 'that'" for just 1 day.
Even discipline takes "practice".

FD7,GU8
 
Old 07-28-2018, 09:15 PM   #5
nex
LQ Newbie
 
Registered: Jul 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
You need an arms length solution.

Any scheme that you try locally can fail. You need a disinterested third party.

You need a Rube Goldberg machine to poke you when you spend too much time on youtube.
Why do you think making a process unkillable from the kernel like I suggested wouldn't work?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to block ALL websites except 2 glenn69 Linux - Networking 8 12-12-2019 12:56 PM
How to block websites? cusri2004 Linux - Newbie 1 12-26-2010 10:07 PM
block certain websites in konqueror rcrummett Linux - Networking 3 12-31-2006 04:29 AM
How to block specific Websites? alfredh SUSE / openSUSE 3 06-24-2006 05:17 AM
how to block websites .. huno Linux - Software 5 04-22-2004 08:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 04:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration