LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-27-2010, 12:03 AM   #1
zivs
Member
 
Registered: Jan 2005
Location: Ogre, Latvia
Distribution: Ubuntu 9.10
Posts: 72

Rep: Reputation: 15
Webpage access at specific times management program for Ubuntu


Hi,
I'm having here at home one quite addicted Farmville & similar game player which I would like to somewhat control in at least late night/early morning hours, which is why I'm once again asking for your help.

Was browsing a while around for a program which could be used as a webpage blocker for several hours (predefined time), but all I came up was either scripts which I don't understand (I myself can be counted as a newbie in Linux stuff) and don't want to risk blindly or just user account time manager (timekpr).

I found a great solution in my case for MacOS users called SelfControl, but as you can guess ... there's no Linux native client for that ...

So, my question is - is there any easy and understandable way to block specific webpages for a predefined time period (let's say, every morning from 03:00CET - 08:00CET)?

OS: Ubuntu 9.10
Computer knowledge of the farmer: Getting on Farmville and/or playing Gnome's Mahjongg is pretty much all.
 
Old 05-27-2010, 05:36 PM   #2
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48
Hmm.

You're a farmer and I'm a dude... :O)

You could do the following:

- create two batch files
- batch file one blocks the sites in question
- batch file two unblocks the lot
- have crontab execute batch file one at 3 AM
- have crontab execute batch file two at 9 AM

Not sure yet what to put in the batch files.... You could disable the full network access by killing eth0. But you could also use the batch files to change the file /etc/hosts

If in /etc/hosts a URL is listed, the Linux system will go there first. If in /etc/hosts a URL does nto exist, it starts consulting DNS-es. So if you put the line
Code:
127.0.0.1     www.gameplay.eu    gameplay.eu
in the hosts file, The site www.gameplay.eu is related to a non existing webpage on your local machine.

Another dirty trick is to mount a timer in front of your router. At 3 AM, the timer powers down the router and at 8 AM it applies power again.... Not handy if you phone with VOIP.
 
Old 05-28-2010, 03:36 PM   #3
zivs
Member
 
Registered: Jan 2005
Location: Ogre, Latvia
Distribution: Ubuntu 9.10
Posts: 72

Original Poster
Rep: Reputation: 15
Well, thanks for the reply, but there is a little problem - I myself am not really far away from being close to absolute newbie in Linux things, so creating batch files or scripts is definitely not the thing which I understand and can do without bunch of silly mistakes ...

If there would be an explanation (specifically for people who still don't know where is what and how is that working at all) on how to make those crontabs and other mentioned stuff, I'd like to try that one out!

P.S.
I have no router here - some time ago I asked for help to connect two computers together to Internet via one cable and through one computer ..

Last edited by zivs; 05-28-2010 at 03:38 PM.
 
Old 05-28-2010, 03:44 PM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Simpler solution:

My son asked me to change his Facebook password - at least until school finals were over

Just a thought .. PSM
 
  


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
Open and close a program at specific times in cron brgsousa Linux - Software 4 03-11-2009 09:09 AM
Why i can't access www.ubuntu.com webpage? khanh_coltech Ubuntu 5 10-24-2007 11:48 AM
Slackware program startup times slow compared to ubuntu vdemuth Slackware 27 04-19-2007 03:39 PM
Restrict access times for specific IP addresses? gjhicks Linux - Networking 11 11-02-2006 10:42 PM
Running a program at specific times only i666an SUSE / openSUSE 4 04-02-2006 07:49 AM

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

All times are GMT -5. The time now is 02:36 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