Encourage children to use the net more 4 learning with Pihole 5beta

栏目: IT技术 · 发布时间: 6年前

内容简介:I keep hearing about school closings and wonder how I can "encourage" my son and daughter to spend a little less time on social media and more time learning during school hours if their middle school closes.Original post on reddit..With the awesome per cli

I keep hearing about school closings and wonder how I can "encourage" my son and daughter to spend a little less time on social media and more time learning during school hours if their middle school closes.

Original post on reddit.. https://www.reddit.com/r/pihole/comments/fg5fht/how_to_encourage_your_children_to_use_the/

With the awesome per client features of Pi-hole 5.0 beta it will now be possible to add the ability to periodically block sites and unlock them after points are earned on khan academy, typing club or any site that has a web scrapable point system.

Goal: After 2 hours, block 2 or 3 sites that my 13 year old uses the most. Unblock those sites once they have earned 1 point on Typing Club or Khan Academy.

I will update this readme as I do this tonight.

https://github.com/1stOctet/YouWillUnderstandWhenYouAreOlder

Setup

  • Create an account on typing club or khan academy as a parent. Do not use a LINKED facebook or LINKED google account to log in.

  • For this to work you need to create an "old school" email login. This is important because we will have a nodejs script that will log in as you to check your child's account for points.

  • After you create an account as a parent, create a sub account for the child. Note typing club doesn't have a parent and a child account.

  • Todo (Explain how to install Linux on a raspberry pi or old computer)

  • Todo (Explain how to install pi-hole and upgrade to pi-hole 5.0 beta)

  • sudo apt install nodejs npm git

  • npm i puppeteer

  • npm i get-stdin

  • git clone https://github.com/1stOctet/YouWillUnderstandWhenYouAreOlder.git

Currently using this guide https://github.com/pi-hole/docs/blob/release/v5.0/docs/database/gravity/example.md to understand how to flip a site from blocked to not blocked via the "Raw database instructions"

Look at database-script1.sh first before running. Trust but verify.

  • sudo bash database-script1.sh

  • Todo (Explain how to figure out what your child's ip address is using the pi-hole web interface)

Please first modify the database-script2.sh file and change 222.222.222.222 ip to your child's ip address.

  • sudo bash database-script2.sh

Look at database-script3.sh first before running. Trust but verify.

  • sudo bash database-script3.sh

Please first modify the database-script3.sh to include the domains you want to block.

  • sudo bash database-script4.sh

This script is unecessary if you use the pi-hole web interface to link the domains to a group. If it doesn't make sense to you, please use the pi-hole gui. Be sure to edit this file for the number of domains you are blocking periodically to ensure your child goes to Harvard.

  • sudo bash database-script5.sh

-Todo (add database-script6.sh to disable the blacklisted domains so that they work until the cronjob enables them)

All the functionality is here.

#Tomorrow night I will add the basic crontab scripts.

  • Run a cronjob every 4 hours that enables the blacklisted domains. After sleeping for 20 seconds, do a point check to create user-typingclub-last.txt file and user-khanacademy-last.txt files. Create a file user-YouWillUnderstandWhenYouAreOlder.txt to signal to the other cronjob that sites are being blocked for that user(s).

  • If user-YouWillUnderstandWhenYouAreOlder.txt exists, this means the sites are blocked. We need to frequently check khan academy and typing club to see if 1 point has been earned.

  • When the point checking cronjob runs every minute, it will output a user-typingclub-current.txt file and a user-khanacademy-current.txt file. Using bash it will check if those files are diffent than user-typingclub-last.txt file and user-khanacademy-last.txt file. If they are different, this means the child has earned at least 1 point. Disable the blocking. If the files are the same, delete user-typingclub-current.txt and user-khanacademy-current.txt

  • Todo (It is unecessary to frequently check for points if the user's ip address has not sent a DNS request in the last 15 minutes. Some education sites will not like so many logins to check points all night. Figure out the table to determine if the user has sent a DNS query in the last 15 minutes. Ignore the apple / google domains that run often at night.


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

三位一体

三位一体

[美]迈克尔·马隆 / 黄亚昌 / 浙江人民出版社 / 2015-4 / 98.90

[内容简介] ●本书讲述了罗伯特•诺伊斯、戈登•摩尔和安德鲁•格鲁夫如何缔造了世界上最重要公司的故事。公司的“外交家”诺伊斯被视为圣父、“思想家”摩尔被视为圣灵、“行动家”格鲁夫被视为圣子,这个三位一体的组合创下了企业管理中的奇迹,开创了一个价值万亿美元的产业,将一家初创企业打造成为千亿美元量级的巨型公司。 ●本书作者迈克尔•马隆在接触空前数量的企业档案的基础上,揭示了英特尔公司无处不......一起来看看 《三位一体》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

随机密码生成器
随机密码生成器

多种字符组合密码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器