Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
I'm using a laptop with Gentoo 2.6.17 to play a game, but the harddrive won't stay spinning. The game constantly hangs while the hard drive spins down, only to spin up again a few seconds later.

I've messed with everything I could in the very limited bios of the laptop with the hopes of turning off all 'power saving' features that might encourage it to kill the HD as fast as possible, but even on AC power, it doesn't seem to change.

Googling this only returns people wanting to -turn off- their hard drive when not in use. My laptop is already very good at that. :(

Is there a clever way (maybe a program already exists) to keep the hard drive spinning while the game is going, or at least a manually toggleable solution?

Adbot
ADBOT LOVES YOU

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!

Digital Drifter posted:

hdparm -S0 /dev/hda should disable the drive spin down feature

:doh: Awesome, thank you. ( -B255 disables the power management entirely )

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
Is there a way to view or monitor individual core load in a Dual 3.6Ghz Xeon Gentoo environment? I would like to know if those four cores are actually being used at all.

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!

dfn_doe posted:

Go into 'top' then hit '1' to toggle 'SMP view'.

Ooooooh, didn't know top could do that. I'm at work today so I haven't had a bunch of time to look into it, but the top's help didn't reveal anything: is it possible to also see individual process load on the individual cores?

And a bonus question, are these statistics (just individual core load) available through snmp? I'll take some time to investigate this later myself, but it would be a timesaver if someone knew this off the top of their head!

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
I tried f and y, but as far as I can tell, displays a "Sleeping in Function" field which doesn't seem to be relevant. '[' does not seem to be a valid button anywhere, whether at the default view, or on the f screen for field selection.

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
I was in the shower and ended up thinking up something I keep wondering about.

I have a persistant world gameserver that runs on dual processor, dual core server (4 effective processors) but the server process is not a multithreaded application. It pretty much only makes one processor loaded, jumping to a different processor every so often. I was wondering about designating a process to run on a certain processor.

If I do only that, I would figure you get a very miniscule preformance increase associated with reduced overhead from switching processors. However, I am pretty sure I could get multiple instances of the server process running and have the in game 'world' spread across multiple server instances. There, I could assign 4 instances of the server each to it's own processor, and probably see a benefit there.

My last idea is just to start up multiple server instances without assigning processors (if that can even be done), and just let the scheduler do it's magic. That is probably the best idea anyway. >_>

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
What would cause grub to *poof* in a power outage, and what can I do to prevent it?

Reason I ask, is because I have a server collocated at a cheap but decent provider. Recently, their redundant power systems supposedly had a hiccup and caused every machine on that system to power cycle, including mine. However, mine did not come up, and according to their techs after a few hours of email tag, it appeared grub had to be reinstalled. They reinstalled it, and everything was back up and good. My grub.conf file was even still there.

Fast forward to today, my server is unreachable. A few pings make it seem like it's just my machine once again leading me to believe it's back to the same grub problem. Going back in my mind, I think I may have mounted the boot partition to look at the grub.conf file back when it was last restored and I may not have unmounted it.

Might that be the problem? If not, what else could be causing this?

(The only thing on the machine is Gentoo. According to the tech last time, none of the drives in it were bootable until he reinstalled grub.)

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
Apparently it just needed a reboot. I can't figure out WHY it needed a reboot. Nothing weird in /var/log/messages when it stopped aside from the clock being off by two hours and nptd complaining about it (which is fixed now). /shrug

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
Some lightweight utility (or other way) to track the amount of bandwidth used. SMTP+MRTG is already running on this server, but I am currently not getting counts of bandwidth used, just a rate counter (I figure the solution is pretty close already). I'd like something that could break it down by month automatically too.

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
Oh boy, both of these give me just what I'm looking for, thanks! (I went with vnStat and it's rocking out)

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
Is there a way to "screen" something AFTER you started it? Normally I am pretty good about putting long running processes in screen sessions so I can kill my ssh client and do other things if I have to. However, awhile ago I started running badblocks without screen on a big partition, but now I have to make some network changes do the machine I have the ssh client running on. I don't want to have to start badblocks over. Can it be done?

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
I want to add a very specific command to sudoers:
code:
kill -9 `ps -a | grep "abcdefg" | grep -v "grep" | awk '{ print $1 }'`
It should be runnable by anyone in group abcd, so I'm trying this line:
code:
# Allow members of group abcdto kill abcdefg
%abcd ALL = kill -9 `ps -a | grep "abcdefg" | grep -v "grep" | awk '{ print $1 }'`
Trying to close visudo reports an error on the line with the comment, however (it's definitely the line with the command, because if I comment it out then it doesn't complain). What is wrong?

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
Ah, thanks.

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
http://archive.ubuntu.com/ubuntu/dists/

What-in-hells. There is no /feisty/ directory. I'm trying to get a few simple packages like dhcp3-server installed on a soekris board and keep hitting snags. Intrepid Ibed would not install on it which is why I used feisty. Would it be safe to use a repository from before feisty (like Dapper) to get dhcp3-server? And in ubuntu, is editing /etc/apt/sources.list the 'proper' way to do that?

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
Ah thanks. I didn't know about old-releases. This is coming along swimmingly.

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
On using sed:

I'm trying to reformat some lines in a text file. First thing I need to do is change a date format. A line looks like:
code:
Wed Dec 16 17:09:05 PST 2009: SchedulingPortletView.jsp - name@email.com authenticated.
I want to change "Wed Dec 16 17:09:05 PST 2009" into "2009-12-16 17:09:05". Linux `date` does this nicely:
code:
# date --date='Wed Dec 16 17:09:05 PST 2009' '+%F %T'
2009-12-16 17:09:05
Therefore, I was going to try using date, sed, and sed's "&" to start replacing tokens. However, I can't quite get it to work.
code:
# echo "Wed Dec 16 17:09:05 PST 2009: SchedulingPortletView.jsp - name@email.com authenticated." | sed -e "s/.\{28\}/`date --date='&' '+%F %T'`/"
date: invalid date `&'
: SchedulingPortletView.jsp - [email]name@email.com[/email] authenticated.
It's not treating the ampersand how I would expect it. Two quick tests and show I'm almost there, but still something isn't quite right.
code:
# echo "Wed Dec 16 17:09:05 PST 2009: SchedulingPortletView.jsp - name@email.com authenticated." | sed -e "s/.\{28\}/`date --date='Wed Dec 16 17:09:05 PST 2009' '+%F %T'`/"
2009-12-16 17:09:05: SchedulingPortletView.jsp - name@email.com authenticated.

# echo "Wed Dec 16 17:09:05 PST 2009: SchedulingPortletView.jsp - name@email.com authenticated." | sed -e "s/.\{28\}/==&==/"
==Wed Dec 16 17:09:05 PST 2009==: SchedulingPortletView.jsp - name@email.com authenticated.
I've tried quite a few different mixes of escape characters, but still no luck. What am I missing?

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
Oh. Good point. Is there a way to execute shell commands within the scope of sed? I saw some reference to using $([command]) but haven't had any luck with that either. I don't know perl well enough to whip up something like this, and with a bash script I'd probably embed sed and fall into the same trap. :(

Adbot
ADBOT LOVES YOU

ExileStrife
Sep 12, 2004

Happy birthday to you!
Happy birthday to you!
If nothing else crops up, I'll do that. I probably led you on to believe I know a lot less about bash scripting than I actually do by highlighting my stubbornness to try to do this with one line here. If I can't do it in a sed one-liner (which I was shooting for), yes, some simple loops will work out in the end. Anyway, thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply