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
teapot
Dec 27, 2003

by Fistgrrl

Bubba Ho-Tep posted:

the network manager for GNOME says that wireless is in "roaming mode", but I've never dealt with wireless so I'm unsure as to what that means.

It means that card is set to use "any" ESSID, so it will automatically talk to the first access point it will find. If you completely remove any static configuration for that card from Network Manager, Network Manager applet will give you in its menu the list of found access points and let you choose.

Adbot
ADBOT LOVES YOU

Crush
Jan 18, 2004
jot bought me this account, I now have to suck him off.
Is it possible to go through a file and find the highest (greatest) first number, and of those lines find the highest second number, and of those lines find the lowest third number and then finally the lowest fourth number?

Like, would I be able to find '720 352 0 62' out of the file below? Say it goes through the file and sees that 720 is the greatest first number on a line, then of the lines that have 720 as the highest first number, it sees that 352 is the highest number in the second column, and of those lines, it finds the lowest third number, and of those lines the lowest fourth number.

code:
-704 -464 714 474
-704 -464 714 474
-704 -464 714 474
0 0 358 212
64 0 328 210
96 80 320 168
176 160 288 124
304 240 236 84
368 288 202 68
432 320 180 66
464 352 170 62


592 352 126 62
624 352 90 62
640 352 76 62
656 352 58 62
688 352 32 62
704 352 16 62
704 352 14 62
704 352 10 62
704 352 10 62
704 352 10 62
704 352 10 62
704 352 10 62
704 352 10 62
704 352 10 62
704 352 10 62
704 352 10 62
704 352 10 62
704 352 10 62
704 352 10 62
720 352 0 62
720 108 0 62
i know this sounds confusing :smithicide:

Accipiter
Jan 24, 2004

SINATRA.

Crush posted:

Is it possible to go through a file and find the highest (greatest) first number, and of those lines find the highest second number, and of those lines find the lowest third number and then finally the lowest fourth number?

Like, would I be able to find '720 352 0 62' out of the file below?

Probably not the most efficient solution, but it works.

cat foo.txt | perl -e 'my $cnt = 0; while (<>) { if ($_ !~ /^$/) { ($cola[$cnt],$colb[$cnt],$colc[$cnt],$cold[$cnt]) = split(/\s/,$_); $cnt++; } } @cola = sort {$b <=> $a} (@cola); @colb = sort {$b <=> $a} (@colb); @colc = sort {$a <=> $b} (@colc); @cold = sort {$a <=> $b} (@cold); print $cola[0] . " " . $colb[0] . " " . $colc[0] . " " . $cold[0] . "\n";'

This assumes, of course, your file is named foo.txt.

Accipiter fucked around with this message at 21:58 on Oct 9, 2007

Crush
Jan 18, 2004
jot bought me this account, I now have to suck him off.
AWESOME! Worked. Thanks!

Crush fucked around with this message at 22:02 on Oct 9, 2007

FasterThanLight
Mar 26, 2003

teapot posted:

Your camera is out of focus. Adjust it.
Pretty sure thats not it. Being out of focus shouldn't make me appear blue and the blue sky behind me appear yellow-orange. I don't think this camera has any manual focus capabilities anyway.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

FasterThanLight posted:

Pretty sure thats not it. Being out of focus shouldn't make me appear blue and the blue sky behind me appear yellow-orange. I don't think this camera has any manual focus capabilities anyway.

You'd be shocked. A lot of cheap webcams have extreme chromatic variation in their optics, and compensate by post-processing the output of the CCD because firmware is significantly cheaper than glass. It's also not uncommon to see automatic white balance code fail completely in lighting conditions the camera wasn't designed for, with similar effects.

Scaevolus
Apr 16, 2007

Crush posted:

Is it possible to go through a file and find the highest (greatest) first number, and of those lines find the highest second number, and of those lines find the lowest third number and then finally the lowest fourth number?

code:
cat foo.txt | sort -g

Accipiter
Jan 24, 2004

SINATRA.

Scaevolus posted:

code:
cat foo.txt | sort -g

I went nuts through the sort man page looking at options convinced there was a better way to do it, and couldn't come up with one.

Accipiter fucked around with this message at 13:40 on Oct 10, 2007

Steve French
Sep 8, 2003

Scaevolus posted:

code:
cat foo.txt | sort -g

That doesn't handle the following, if I'm reading the question right:
code:
100 99 99 99
100 100 99 99
100 100 99 100
100 100 100 99
100 100 100 100
Your solution gives:
code:
100 100 100 100
100 100 100 99
100 100 99 100
100 100 99 99
100 99 99 99
Seems to me he would instead want the following order:
code:
100 100 99 99
100 100 99 100
100 100 100 99
100 100 100 100
100 99 99 99
And specifically, the line he wants is "100 100 99 99".

Crush
Jan 18, 2004
jot bought me this account, I now have to suck him off.

Steve French posted:

That doesn't handle the following, if I'm reading the question right:
code:
100 99 99 99
100 100 99 99
100 100 99 100
100 100 100 99
100 100 100 100
Your solution gives:
code:
100 100 100 100
100 100 100 99
100 100 99 100
100 100 99 99
100 99 99 99
Seems to me he would instead want the following order:
code:
100 100 99 99
100 100 99 100
100 100 100 99
100 100 100 100
100 99 99 99
And specifically, the line he wants is "100 100 99 99".

This is correct, thanks to everyone though for the help. Accipiter's works fine for me

brae
Feb 2, 2006
I couldn't see a way to get sort to do it either. For grins, here's one in awk:

foo.awk posted:

code:
($1 > max[1]) ||
   ($1 == max[1] && $2 > max[2]) ||
   ($1 == max[1] && $2 == max[2] && $3 < max[3]) ||
   ($1 == max[1] && $2 == max[2] && $3 == max[3] && $4 < max[4]) {
     maxline = $0
     max[1] = $1; max[2] = $2; max[3] = $3; max[4] = $4
}

END {
  print maxline
}

code:
$> awk -f foo.awk foo.txt

Scaevolus
Apr 16, 2007

Steve French posted:

That doesn't handle the following, if I'm reading the question right:

Oh, sorry, I misread the problem specification :downs:

Neslepaks
Sep 3, 2003

teapot posted:

/home/someuser/replacechars.sh script (should be executable):
...

This is terrible advice, teapot. He'll have to re-check a zillion times with a magnifying glass to catch all of it, and it's a huge job. The right answer is iconv(1).

Also I think Ubuntu and other modern distributions come with a script that does this already, but the name escapes me.

haunted bong
Jun 24, 2007


teapot posted:

It means that card is set to use "any" ESSID, so it will automatically talk to the first access point it will find. If you completely remove any static configuration for that card from Network Manager, Network Manager applet will give you in its menu the list of found access points and let you choose.

Awesome. So I don't have to do iwlist scan then?

Jack Fool
Feb 16, 2003

bol posted:

We're doing the same thing with PCI compliance. sudosh + single sign on (we're doing AD integration) works quite well. Dump those syslogs to a server somewhere running Splunk and you'll be laughing.

I will look into this Splunk and see if we can make use of it. The setup here is weird, the 'Tech Support/Customer Service' group is a different division than Operations, yet they still need access to server logs for whatever reason. I have to find a way to let them view said logs without giving them actual access to the PCI environment. Splunk, Avast, some web frontend maybe.

Jonny 290 posted:

I'll admit it - I'm a longtime root abuser - but I've given up su/root in favor of sudo. Saves time (i've linked 'sd' to sudo for speed) and I can recap everything I do by grepping auth.log. Good poo poo, for sure, and I'm kicking myself for not complying sooner.

Sudosh is the next step beyond `sudo [-u username] command`. It's similar to `sudo bash -login` in that it drops you into a new shell (you pick the shell), EXCEPT you can play back everything in the shell keystroke by keystroke, as if you had a camcorder pointed at the terminal. The logs it keeps are surprisingly small, even if you leave the sudosh shell running all day.

I think most distros have it as an extra at this point, but Dag's roll for rhel4 was pretty good, too. It's easy to just compile it from a tarball anyway. There's nothing about it that is strictly PCI, but I can't recommend it highly enough for any setup that requires multiple user shell access and auditing.

Prince John
Jun 20, 2006

Oh, poppycock! Female bandits?

Bubba Ho-Tep posted:

Awesome. So I don't have to do iwlist scan then?

Correct. Network manager will do it all graphically, assuming its working. (nm-applet to show the icon in the system tray if its not there already)

teapot
Dec 27, 2003

by Fistgrrl

Neslepaks posted:

This is terrible advice, teapot. He'll have to re-check a zillion times with a magnifying glass to catch all of it, and it's a huge job. The right answer is iconv(1).

When translating to ASCII iconv can at best omit everything it doesn't know how to map. The script is pretty useful in that situation -- it finds everything that is not ASCII, and applies whatever conversion is defined, so if produces output, even if the file name remains the same, there is something that should be converted.

Neslepaks
Sep 3, 2003

teapot posted:

When translating to ASCII iconv can at best omit everything it doesn't know how to map. The script is pretty useful in that situation -- it finds everything that is not ASCII, and applies whatever conversion is defined, so if produces output, even if the file name remains the same, there is something that should be converted.

But he wanted ISO 8859-1 converted to UTF-8. :confused:

teapot
Dec 27, 2003

by Fistgrrl

Neslepaks posted:

But he wanted ISO 8859-1 converted to UTF-8. :confused:

As I understood it, he wanted a lossy conversion to ASCII, so file names will look the same everywhere.

Exi7wound
Aug 22, 2004

LOGANO
Remember my name... you'll be screaming it later.
Forgive me for such a pedantic question, but are there any nifty multiplayer games for linux, Debian in particular?

I'd love to hear about a jewel in the ascii rough. I'm bored with MOO/MUSH types. There's got to be something else out there right?

Prince John
Jun 20, 2006

Oh, poppycock! Female bandits?

It's not ascii, but Bzflag is pretty good fun in multiplayer.

rikshot
Jan 8, 2006
I'm trying to install Gentoo on my HP Compaq 6820s laptop and it won't create the eth0 network interface even though lspci lists the network card/chip correctly and the e1000 module is loaded correctly.

Anyone have any tips to solve this? Is it even possible to install Gentoo on this laptop?

Alowishus
Jan 8, 2002

My name is Mud
What do you mean, "won't create?" When e1000 is loaded, what do you see in dmesg? What does your /etc/conf.d/net look like? Did you symlink net.eth0 into /etc/init.d? When you try to start the network, what error do you see?

yippee cahier
Mar 28, 2005

rikshot posted:

I'm trying to install Gentoo on my HP Compaq 6820s laptop and it won't create the eth0 network interface even though lspci lists the network card/chip correctly and the e1000 module is loaded correctly.

Anyone have any tips to solve this? Is it even possible to install Gentoo on this laptop?

I recently switched from gentoo.

What you have to do is copy or make a symbolic link to /etc/init.d/net.lo called /etc/init.d/net.eth0

The init scripts will create an interface with that name and by default use DHCP unless specified differently in /etc/conf.d/net

Oh yeah, don't forget to run
code:
rc-update add net.eth0 default

Crusader
Apr 11, 2002

Exi7wound posted:

Forgive me for such a pedantic question, but are there any nifty multiplayer games for linux, Debian in particular?

I'd love to hear about a jewel in the ascii rough. I'm bored with MOO/MUSH types. There's got to be something else out there right?

Are you just looking for console/text games? There's scores of commercial and open source titles for Linux.

rikshot
Jan 8, 2006

Alowishus posted:

What do you mean, "won't create?" When e1000 is loaded, what do you see in dmesg? What does your /etc/conf.d/net look like? Did you symlink net.eth0 into /etc/init.d? When you try to start the network, what error do you see?

Well as I said I am trying to install Gentoo from the minimal install CD and its quite difficult without a internet connection. ifconfig does not list eth0 and dmesg has only this:

Intel(R) PRO/1000 Network Driver - version 7.2.9-k4
Copyright (c) 1999-2006 Intel Corporation.

No error messages or anything like that.

Exi7wound
Aug 22, 2004

LOGANO
Remember my name... you'll be screaming it later.

Crusader posted:

Are you just looking for console/text games? There's scores of commercial and open source titles for Linux.

Doesn't have to be text/console. I've enjoyed FreeCiv and am wondering what else is out there that wasn't an option or is so much better on a Linux box.

Thanks for the suggestions.

Scaevolus
Apr 16, 2007

Exi7wound posted:

Doesn't have to be text/console. I've enjoyed FreeCiv and am wondering what else is out there that wasn't an option or is so much better on a Linux box.

Thanks for the suggestions.

Battle for Wesnoth gets pretty high ratings, although turn-based games aren't my type.

http://happypenguin.org has information on games for Linux, browse through the highest ranked ones and try a few out.

Crush
Jan 18, 2004
jot bought me this account, I now have to suck him off.

Scaevolus posted:

Battle for Wesnoth gets pretty high ratings, although turn-based games aren't my type.

http://happypenguin.org has information on games for Linux, browse through the highest ranked ones and try a few out.

Ever heard of Cube2/Sauerbraten?

do it
Jan 3, 2006

don't tell me words don't matter!
Is it possible to speed up Samba any way? I'm experiencing slower than expected speeds when trying to get video files off of my server which is on the same network. It also takes a long rear end time to connect to the share.

Deezul
Jan 1, 2005

Not Diesel
I have Ubuntu installed on a slave IDE, Windows on a SATA. By default the first boot device is the IDE slave, how would I add the windows onto grub, and make it always ask which to boot from?

rookieone
May 25, 2004

A small town never forgets

Crush posted:

Ever heard of Cube2/Sauerbraten?

They're fun even though they are pretty limited community/players wise. It's like a Quake1/Quake2 style quick online game. Graphics look good though and you always have to applaud their efforts for putting out a real crossplatform game.

But with Quake3 running in Linux without a problem (same counts for UT, its successors and all other Quake1/2/3 engine games) there isn't much sense in playing Cube/Sauerbraten games.

Actually there are quite a few deathmatch style games for linux out there if you look around a bit (say on linuxgaming etc.)

deimos
Nov 30, 2006

Forget it man this bat is whack, it's got poobrain!

Deezul posted:

I have Ubuntu installed on a slave IDE, Windows on a SATA. By default the first boot device is the IDE slave, how would I add the windows onto grub, and make it always ask which to boot from?

Add:
code:
title           Windows NT/2000/XP (loader)
root            (hd0,0)
savedefault
makeactive
chainloader     +1
to /boot/grub/menu.lst near the end, then run update-grub. Grub should already ask you for which kernel to use. If it doesn't, menu.lst is fairly well commented on Ubuntu.

Deezul posted:

The Ubuntu install is hd0, and the Windows is on sda0, should the root be sda0,0 for the windows title?

No, grub doesn't care about whether it is IDE or SATA, just the order of booting.
/dev/sda will most likely be hd0 and /dev/hda will be hd1. Remember this because if you install another SATA HD you might have to fix your menu.lst.

deimos fucked around with this message at 15:05 on Oct 13, 2007

Deezul
Jan 1, 2005

Not Diesel
The Ubuntu install is hd0, and the Windows is on sda0, should the root be sda0,0 for the windows title?

teapot
Dec 27, 2003

by Fistgrrl

Deezul posted:

The Ubuntu install is hd0, and the Windows is on sda0, should the root be sda0,0 for the windows title?

GRUB uses BIOS disk numbering (hddevice,partition) with device and partition numbering starting from 0, so no. Depending on the BIOS handling of IDE and SATA one of the devices will be hd0, the othe hd1, so if your entry for Linux has (hd0,partition) , entry for Windows should be (hd1,0) , and if (most likely) it's (hd1,partition) , Windows is on (hd0,0) .

deimos
Nov 30, 2006

Forget it man this bat is whack, it's got poobrain!

teapot posted:

GRUB uses BIOS disk numbering (hddevice,partition) with device and partition numbering starting from 0, so no. Depending on the BIOS handling of IDE and SATA one of the devices will be hd0, the othe hd1, so if your entry for Linux has (hd0,partition) , entry for Windows should be (hd1,0) , and if (most likely) it's (hd1,partition) , Windows is on (hd0,0) .

Ohh yeah, about this, if I am mistaken and hd1 is Windows, then yo might have to map the drives or Windows will get mighty confoozled (grub with Windows involves a lot of trial and error).

My entry above with mapping added:
code:
title           Windows NT/2000/XP (loader)
root            (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
savedefault
makeactive
chainloader     +1
Again, this is only necessary if you boot windows from grub after configuring it and it just craps up on you for no apparent reason.

Deezul
Jan 1, 2005

Not Diesel
Is the numbering of the harddrives based off the boot order in the bios or some other way?

Prince John
Jun 20, 2006

Oh, poppycock! Female bandits?

Sorry for posting this, but the man pages for sed and awk are a bit overwhelming.

I have a file that contains a list of files in the following format:

code:
/media/disk-1/backup/foo/bar: filename
where bar is the name of the folder that the file is in. I would like to end up with a list of nothing but the proper filename so I can execute cp on them line by line. The exact folder location changes throughout the file.

I need to remove ": " from each line and replace it with "/" however the following command predictably doesn't work:

code:
sed -e 's/: ///' list2 > list3
presumably because the characters I need to use require being quoted or similar. I have tried quoting the two expressions with double and single ticks but with no effect.

I can't see anything in the man page about special characters - can someone help me out with this? Thanks!

Prince John fucked around with this message at 17:14 on Oct 13, 2007

yippee cahier
Mar 28, 2005

Deezul posted:

Is the numbering of the harddrives based off the boot order in the bios or some other way?

I think by default it is when grub is installed.

Read this:
http://www.gnu.org/software/grub/manual/html_node/Device-map.html

Adbot
ADBOT LOVES YOU

covener
Jan 10, 2004

You know, for kids!

Col posted:


code:
sed -e 's/: ///' list2 > list3
presumably because the characters I need to use require being quoted or similar. I have tried quoting the two expressions with double and single ticks but with no effect.

should be obvious that the forward slashes need escaping, and anything with a reserved meaning in th regex; Or use a different character to separate the parms

code:
$ echo /media/disk-1/backup/foo/bar: filename | sed -e 's/: /\//'
/media/disk-1/backup/foo/bar/filename
$ echo /media/disk-1/backup/foo/bar: filename | sed -e 's@: @/@'
/media/disk-1/backup/foo/bar/filename

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