Showing posts with label pennmush. Show all posts
Showing posts with label pennmush. Show all posts

Preventing constant reboots on a network

For some weird reason, I found that my router (Netgear WNR3500L) (or my connection) was giving me problems...every so often it my LAN connection would completely reset and require me to reboot the computer, just to get the webserver back online (it would become completely unreachable via No-IP DNS -and- the external IP address..some 5xx connection reset error or something).

Recently I found that the problem was my router. The DHCP server built into it has a set lease time of what my connection says is 24 hours, although it only lasts about 12. I found a workable solution, yet it was rather annoying. I set up my Telnet server to automatically shut down every 12 hours, as well as the client that was accessing it. On top of that, I used Windows Scheduler to run reboot.cmd a minute after the server was shut down, and then used TweakUI to automatically log me back in, plus another command-line script that would autolock the computer after logging in. This way all the applications would be preloaded, but the computer would still be secured.

Got all that?

1. Telnet shutdown
2. Telnet client shutdown
3. Computer shutdown and reboot
4. Autologin (starting all the servers up again)
5. Autolock

DHCP is renewed, the connection is reset, and 100% accessible over the web.

The Telnet server is called PennMUSH, which is a Multi-User RPG engine which uses the common MUSHCode language to program.

For archival purposes, here's the detailed setup:

PennMUSH:
@@
@listen Shutdown Machine = ^-*: @switch [or([strmatch(%0,00)],[strmatch(%0,12)])] = 1,{@wizwall Shutting down.;@dump;@wait 30=@shutdown};@@ * is passed from the clock hourly as timefmt($H) <= The 24-hour hour code.


MUSHClient:
<timers
muclient_version="4.70"
world_file_version="15"
date_saved="2011-04-05 14:32:04"
>
<timer enabled="y" hour="00" minute"1" second="0.00" offset_second="0.00" send_to="12" at_time="y" >
<send>DoCommand Save("")
DoCommand Exit("")</send>

</timer>
<timer enabled="y" hour="12" minute="1" second="0.00" offset_second="0.00" send_to="12"
at_time="y" >
<send>DoCommand Save("")
DoCommand Exit("")</send>
</timer>
</timers>

reboot.cmd:
@echo off
echo Shutting down
shutdown.exe -f -r -t 30


autolock.cmd:
@echo off
echo Locking computer
rundll32.exe user32.dll, LockWorkStation
Scheduled Tasks:
Add one task to run reboot.cmd. Copy the event within the single task and schedule them to run at 12:02 am and 12:02 pm.
Complicated enough? I figured out a MUCH easier solution
Ctrl Panel>Network Connections>Local Area Connection>Internet Protocol (TCP/IP)>IP Address: 192.168.0.2, Subnet: 255.255.255.0, Gateway: 192.168.0.1, DNS: 192.168.0.1

In essence, setting a static IP behind the router turned of the DHCP lease time for this connection.

I had to do a bit of tweaking in the router config, like releasing the reserved IP for both the laptop (which was using 161.0.0.2) and the server computer (which was using 161.0.0.3) and reserve the first to the server computer based on its MAC. This way the router won't try to assign my manually-entered IP address to another computer and cause an IP conflict error (which can happen).

I've now had the server on for a day and a half (turning off all of this automatic shutdown-reboot stuff) and everything has continued to run with success!

11-27-09

Wowee!! So I get comments from people I don't know at all. Now THAT'S something. And I also had a request to turn on 'Blogger Follow,' which I think is crazy. I like simplicity. Little mandatory pictures all over the place make for clutter. But in light of popular demand, fine. I'll do that.

On a similar note, I'm going to remove the Daily Dilbert, even though it's cool. It takes way too long to load and it's again a big blob of mess at the top of every page. So goodbye, even though it's cool.

On yet ANOTHER note: PennMUSH - I've been looking at the idea of sql control within Penn. I've never gotten MySQL to work properly, so I've never gotten website packages such as Wiki or Mambo to install. But Penn allows for other database types such as postgresql and sqlite. I'm grabbing the packages for those. Oh..postgre is 40MB, but sqlite is like 500K. So guess which one I'm grabbing on a dialup connection.

Anyhow, I'm not sure HOW I'll use it, but I want to at least try to make a db work with Penn, just to see if I can.

What else? Sister and I've been home all week, as Dad and Mom went to Estes Park for their anniversary (29th). So it's been a time of Star Trek and boredom. Well, not so much boredom. There's plenty to do, but it's not all FUN. Anyway, they're coming home later this afternoon I think.

Good note about my computer re-image: I've finally installed all updates and software back to what it was, minus a few things I never used. Of course, I've always had problems with bootup and things, and I've always meant to isolate the problem child, but I never have. And with this re-image, I STILL didn't. I've a few large software packages I always install, such as Photoshop, DVDit, MS Office, Messenger, etc.. and always somewhere between then and the next re-image, either bootup takes forever or the computer freezes for the first five minutes after connecting to the Internet. So I'm not sure who the culprit is, even now. But we'll see if I can't catch it this time.