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
GuyGizmo
Feb 26, 2003

stupid babies need the most attention

admiraldennis posted:

Is this what you want?
Why, yes it is. Thank you!

In the spirit of teaching to fish as opposed to giving a fish, what exactly does the XB=${XA//./} line do?

Adbot
ADBOT LOVES YOU

Scaevolus
Apr 16, 2007

GuyGizmo posted:

In the spirit of teaching to fish as opposed to giving a fish, what exactly does the XB=${XA//./} line do?

http://tldp.org/LDP/abs/html/string-manipulation.html

${var//./} returns var with every instance of '.' replaced with nothing. ( ${var/./} would only replace the first period).

Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat

teapot posted:

Where do you get any prompts when working with Asterisk? Asterisk runs as a server, its scripts run in its own interpreter, and its console is completely asynchronous. The only program with prompts I used with Asterisk is a voice messages generator script I wrote as a frontend to Festival.

I don't mean prompts with in asterisk, but just command line prompts. For example:

apt-get install -y gcc

returns

Please insert the Ubuntu CD Version Flippity Flop 6.08
Press [enter] to continue...

Well, I don't have the Flippity Flop disk. But, it did infact download the package, but that's beside the point. It's waiting for me to push enter, but I don't have the disk. When I press enter, it just keeps asking over and over. I just need a way to quit the prompt and get back to a root shell or whatever the basic command prompt is.

admiraldennis
Jul 22, 2003

I am the stone that builder refused
I am the visual
The inspiration
That made lady sing the blues

GuyGizmo posted:

Why, yes it is. Thank you!

In the spirit of teaching to fish as opposed to giving a fish, what exactly does the XB=${XA//./} line do?

No problem.

What we're doing here is Bash string manipulation, specifically substring replacement. Spelled out, ${XA//./} is "replace all instances of '.' with '' in the variable $X1", the syntax being:

${str//substr/new}
Replace all matches of $substr with $new in $str.

${str/substr/new}
Replace first match of $substr with $new in $str.

See the bash manual or the link that Scaevolus posted for (much) more information.

deimos
Nov 30, 2006

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

Ericcorp posted:

I don't mean prompts with in asterisk, but just command line prompts. For example:

apt-get install -y gcc

returns

Please insert the Ubuntu CD Version Flippity Flop 6.08
Press [enter] to continue...

Well, I don't have the Flippity Flop disk. But, it did infact download the package, but that's beside the point. It's waiting for me to push enter, but I don't have the disk. When I press enter, it just keeps asking over and over. I just need a way to quit the prompt and get back to a root shell or whatever the basic command prompt is.

remove the CD ROM entries from /etc/apt/sources.list

Harokey
Jun 12, 2003

Memory is RAM! Oh dear!

Ericcorp posted:

I don't mean prompts with in asterisk, but just command line prompts. For example:

apt-get install -y gcc

returns

Please insert the Ubuntu CD Version Flippity Flop 6.08
Press [enter] to continue...

Well, I don't have the Flippity Flop disk. But, it did infact download the package, but that's beside the point. It's waiting for me to push enter, but I don't have the disk. When I press enter, it just keeps asking over and over. I just need a way to quit the prompt and get back to a root shell or whatever the basic command prompt is.

Ctrl+C will usually terminate the process (unless it catches it, but this usually isn't the case.)

MillDaKill
Aug 19, 2003

How could you Carl?
Question. I was looking at VPS hosting and saw that 1and1.com uses fedora core 4 on their virtual servers. I don't know much about Fedora but I was under the impression Core 4 is dead? Does anyone actively make security patches for Core 4?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Is there a way to get a directory listing to a text document (and add an http://www/path) so that I can easily use wget on another machine to grab every file on that list?

MillDaKill
Aug 19, 2003

How could you Carl?

fletcher posted:

Is there a way to get a directory listing to a text document (and add an http://www/path) so that I can easily use wget on another machine to grab every file on that list?

ls /path/to/dir | awk '{ print "http://www/path/" $1 }' > /path/to/file.txt

* "ls" will give you a directory listing for the /path/to/dir directory.

* "|" is called a pipe and it will send the standard output from the ls command and use it as the input to awk.

* "awk" is a very handy tool for processes text, I am not an expert with it, but I know a couple of things. I would suggest you read an online tutorial for some basic awk examples to get a better understanding.

* ">" will redirect the standard output from any program to a file, in this case we are redirecting the output from awk to /path/to/file.txt

MillDaKill fucked around with this message at 20:40 on Dec 4, 2007

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Awesome, thanks! I appreciate the explanation of each command too, it really helps!

Casual Racist
Aug 5, 2004

Repeat after me: I am not a pleasure unit.
Can anyone tell me how I can set up sshd to only allow people from my local network to access it, ie 192.168.2.xxx? I know I need to add some lines to the hosts.allow and hosts.deny, but I'm not sure how to add IP ranges.

covener
Jan 10, 2004

You know, for kids!

Casual Racist posted:

Can anyone tell me how I can set up sshd to only allow people from my local network to access it, ie 192.168.2.xxx? I know I need to add some lines to the hosts.allow and hosts.deny, but I'm not sure how to add IP ranges.

man 5 hosts_access

Scaevolus
Apr 16, 2007

MillDaKill posted:

ls /path/to/dir | awk '{ print "http://www/path/" $1 }' > /path/to/file.txt
That won't work if there are spaces in the filenames. Use $0 instead.

deimos
Nov 30, 2006

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

Casual Racist posted:

Can anyone tell me how I can set up sshd to only allow people from my local network to access it, ie 192.168.2.xxx? I know I need to add some lines to the hosts.allow and hosts.deny, but I'm not sure how to add IP ranges.

this is really a job for iptables, not ssh

MillDaKill
Aug 19, 2003

How could you Carl?

fletcher posted:

Awesome, thanks! I appreciate the explanation of each command too, it really helps!

This is probably a better way to do it, the code I gave you before will also list the directories which you probably don't want.

step 1
cd /dir/with/files

step 2
find . -maxdepth 1 -type f | awk -F '/' '{ print "http://www/path/" $2 }' > /path/to/file.txt

MonikaTSarn
May 23, 2005

I'm having a really weird problem at work, probably NFS or NIS related. We're running Fedora Core 4 as user workstations and centos 3.8 on our servers. We're using VMWare on the workstations to run windows xp as well.

Several times in the last months, the whole network came to a halt, and all computers slow down to a crawl. Its not predictable, I have no idea how to replicate it, and it usually goes away on its own after 10 minutes or so.
The problem seems to be portmap, which is using 100% cpu time on most machines. Anybody have an idea what could be causing this ? I tried google and couldn't find anybody ever mentioning a problem like this.

teapot
Dec 27, 2003

by Fistgrrl
I guess, massive packet loss in overloaded network can cause something like that, however it also may be a result of server not responding because of hardware problems or too much disk I/O. Does it correspond to the time when daily or weekly cron jobs run? Can you try to record network traffic on the server at those times?

MonikaTSarn
May 23, 2005

teapot posted:

I guess, massive packet loss in overloaded network can cause something like that, however it also may be a result of server not responding because of hardware problems or too much disk I/O. Does it correspond to the time when daily or weekly cron jobs run? Can you try to record network traffic on the server at those times?

Hm, we have an nfs server thats a bit overloaded at times, that might be it. Why would portmap use 100% cpu then - if its not getting any response it keeps retrying constantly and uses 100% cpu ? Not nice !
I thought we had some configuration problem causing this, some misbehaving server doing weird broadcasts or something. If this is the expected result of a swamped nfs server or network I guess I know where to look. Or I can at least blame the hardware and its not my problem anymore.

MonikaTSarn fucked around with this message at 10:31 on Dec 5, 2007

MillDaKill
Aug 19, 2003

How could you Carl?

MonikaTSarn posted:

I'm having a really weird problem at work, probably NFS or NIS related. We're running Fedora Core 4 as user workstations and centos 3.8 on our servers. We're using VMWare on the workstations to run windows xp as well.

Several times in the last months, the whole network came to a halt, and all computers slow down to a crawl. Its not predictable, I have no idea how to replicate it, and it usually goes away on its own after 10 minutes or so.
The problem seems to be portmap, which is using 100% cpu time on most machines. Anybody have an idea what could be causing this ? I tried google and couldn't find anybody ever mentioning a problem like this.

Sorry I don't have any answers for you but I had a question about Fedora Core 4 that I asked a couple days in this thread with no answer... Can you get any security patches for the Fedora Core 4 packages still? I saw that Fedora Legacy went under and I know Fedora only supports each release for about a year.

Evil Robot
May 20, 2001
Universally hated.
Grimey Drawer
Sometimes I have phantom users logged in to my Linux box because their connection drops without the box realizing it (i.e. they're on wireless). How can I as an admin log them out and thus close their running programs?

6174
Dec 4, 2004
I've got a directory that is roughly 60 gB that I'd like to backup on DVDRs. In the end I'd like the discs to be easy to access (ie mount the disc and then be able to pull off a single file). Is there some program that will divide up the data into disc image size chunks (and preferably create the disc images as well)? Of course the packing of the files into the image need not be optimal in any way. The naive way of just adding files until no more fit and then starting on the next chunk would be more than sufficient.

marcan
Sep 3, 2006
(:(){ :|:;};:)

Evil Robot posted:

Sometimes I have phantom users logged in to my Linux box because their connection drops without the box realizing it (i.e. they're on wireless). How can I as an admin log them out and thus close their running programs?

To kill all all processes owned by a user, use:
killall -u username

Follow that with a killall -9 -u username to make sure they're all really dead.

Harokey
Jun 12, 2003

Memory is RAM! Oh dear!
So I'm about 3 days into a fsck on a 500 gig drive with an ext3 filesystem. Is this normal? Should I be using a different file system maybe? Whats the best filesystem for an external drive?

Alowishus
Jan 8, 2002

My name is Mud

Harokey posted:

So I'm about 3 days into a fsck on a 500 gig drive with an ext3 filesystem. Is this normal? Should I be using a different file system maybe? Whats the best filesystem for an external drive?
Not normal. ext3 can take a while to fsck, but by "a while" I mean hours... even on 1TB+ filesystems.

3 days tells me something's physically wrong with that disk. Check 'dmesg' output for errors.

admiraldennis
Jul 22, 2003

I am the stone that builder refused
I am the visual
The inspiration
That made lady sing the blues
It takes far less time than that to fsck my 1.8TB array using ext3

Z-Bo
Jul 2, 2005
more like z-butt
I am reading: man mkfs.ext3(8) on Ubuntu Linux

It says:

man mkfs.ext3(8) posted:

-c Check the device for bad blocks before creating the file system.
If this option is specified twice, then a slower, read-write
test is used instead of a fast read-only test.

What is the advantage to a read-write test?

teapot
Dec 27, 2003

by Fistgrrl

Z-Bo posted:

I am reading: man mkfs.ext3(8) on Ubuntu Linux

It says:


What is the advantage to a read-write test?

Read-only test checks if recorded data is readable, so defects that affect the ability to write won't be detected. It's not uncommon for passive operation (reading) to succeed while active one (writing) fails. This is why it's possible for hard drives with few defects slowly appearing over the time to never lose data -- reading succeeds, write fails, drive's firmware relocates the sector, writes the same data at the new location completely transparently for the system (but it is recorded in SMART).

Harokey
Jun 12, 2003

Memory is RAM! Oh dear!
Here's all that was in dmesg:

code:
sd 8:0:0:0: Attached scsi disk sdb
sd 8:0:0:0: Attached scsi generic sg2 type 0
kjournald starting.  Commit interval 5 seconds
EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
EXT3 FS on sdb1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
Also this disc is brand new so it shouldn't be bad... right?

6174
Dec 4, 2004

6174 posted:

I've got a directory that is roughly 60 gB that I'd like to backup on DVDRs. In the end I'd like the discs to be easy to access (ie mount the disc and then be able to pull off a single file). Is there some program that will divide up the data into disc image size chunks (and preferably create the disc images as well)? Of course the packing of the files into the image need not be optimal in any way. The naive way of just adding files until no more fit and then starting on the next chunk would be more than sufficient.

To answer my own question, it appears that scdbackup is exactly what I was looking for.

edit: After using this at work today, I can attest that it is a very good option for simple backups.

6174 fucked around with this message at 23:11 on Dec 6, 2007

DR FRASIER KRANG
Feb 4, 2005

"Are you forgetting that just this afternoon I was punched in the face by a turtle now dead?
I just installed ubuntu last night and I've run into a snag using gnome-terminal to access a shell account:



It keeps my last-entered text in the input line (in a weird way I might add) until I clear it with the down arrow.

Here is my .screenrc from the shell account on silenceisdefeat.org. I think my buddy wrote it.

code:
shell /usr/local/bin/bash

vbell on
vbell_msg "-- beep =="

# need these to get xterm title working.
termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

# forgot what these do; also stole'em from the netternet
termcapinfo xterm 'VR=\E[?5h:VN=\E[?5l'
termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
termcapinfo xterm 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~'
termcapinfo xterm* be

# possibly need these to not garble up colors in irssi, for putty, on sd :x
#attrcolor b ".I"
#attrcolor i "+b"

# beep if inactive screen window beeps
bell_msg '^G'
Any ideas about this?

Wedge of Lime
Sep 4, 2003

I lack indie hair superpowers.

MonikaTSarn posted:

Hm, we have an nfs server thats a bit overloaded at times, that might be it. Why would portmap use 100% cpu then - if its not getting any response it keeps retrying constantly and uses 100% cpu ? Not nice !
I thought we had some configuration problem causing this, some misbehaving server doing weird broadcasts or something. If this is the expected result of a swamped nfs server or network I guess I know where to look. Or I can at least blame the hardware and its not my problem anymore.

Output from nfsstat will help you, high numbers under the retrans column indicate a saturated network. High levels of null calls are also bad.

You can look this up on the clients or the server for extra information. You might want to strace the portmap process when its running away to see what its doing.

I was going to suggest running a pstack against portmap but most linux binaries are stripped, therefore it wont give you useful information.

However, portmap is not actually serving nfs, its just providing port lookups for people who want to use rpc services from that system. If (during the 100% cpu portmap time period) you tcpdump and watch for rpc packets - portmap listens on port 111 tcp/udp. You will be able to see what rpc requests are coming in from the network.

teapot
Dec 27, 2003

by Fistgrrl

Bucket Joneses posted:

I just installed ubuntu last night and I've run into a snag using gnome-terminal to access a shell account:



It keeps my last-entered text in the input line (in a weird way I might add) until I clear it with the down arrow.

Here is my .screenrc from the shell account on silenceisdefeat.org. I think my buddy wrote it.

code:
shell /usr/local/bin/bash

vbell on
vbell_msg "-- beep =="

# need these to get xterm title working.
termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

# forgot what these do; also stole'em from the netternet
termcapinfo xterm 'VR=\E[?5h:VN=\E[?5l'
termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
termcapinfo xterm 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~'
termcapinfo xterm* be

# possibly need these to not garble up colors in irssi, for putty, on sd :x
#attrcolor b ".I"
#attrcolor i "+b"

# beep if inactive screen window beeps
bell_msg '^G'
Any ideas about this?
Are you running screen session on the remote shell account? What happens if you don't, or if you exit one session and start another one while connected from this terminal?

What happens if you comment out all termcapinfo lines before starting new screen session?

What OS is running on your remote shell account? What is the output of
code:
stty -a
when you enter it in your shell account connected from your box?

DR FRASIER KRANG
Feb 4, 2005

"Are you forgetting that just this afternoon I was punched in the face by a turtle now dead?

teapot posted:

Are you running screen session on the remote shell account? What happens if you don't, or if you exit one session and start another one while connected from this terminal?

I am running it in screen and when I run irssi without screen the problem does not exist.

quote:

What happens if you comment out all termcapinfo lines before starting new screen session?

I just did that and it seems to have fixed it. Thanks.

Hello ubuntu!

http://www.iamserio.us/files/loonix.png

EDIT: now it's screwing up again. Dammit.

DR FRASIER KRANG fucked around with this message at 23:26 on Dec 7, 2007

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
So I actually have Internet included where I live. I was given a Linksys WUSB54GSC nub to connect to the Internet. It works fine in Windows, which is where I'm currently posting from. However, I also dual boot in Ubuntu 7.10 and cant' for the life of me get it to work. I've tried looking at ubuntuforums.org and even making a thread, but it just gets pushed down pages from everyone else having wireless problems.

I tried this long ndiswrapper tutorial but when I run ndiswrapper -l it says invalid driver.

I'm thinking of reformatting/restructuring my ext/ntfs partitions, so if someone's advice is to start with a reinstallation of Ubuntu from scratch, I wouldn't have a problem with it.

do it
Jan 3, 2006

don't tell me words don't matter!
I'm really not understanding permissions. I'm trying to make a folder (Docs) and all folders under it readable/writable/deletable by the user "blake," but the folder is owned by "data" - The user "data" also needs read/write access to the folder. Shouldn't I just be able to "chmod u+rwx Docs"?

covener
Jan 10, 2004

You know, for kids!

do it posted:

I'm really not understanding permissions. I'm trying to make a folder (Docs) and all folders under it readable/writable/deletable by the user "blake," but the folder is owned by "data" - The user "data" also needs read/write access to the folder. Shouldn't I just be able to "chmod u+rwx Docs"?

That helps the owner, but you have two users to worry about IIRC.

You can create a new group that contains both users, change the group ownership recursively, and set existing folders to setgid (g+s) (this means new files will be owned by the shared secondary group instead of blake or data's primary group.

MrBlandAverage
Jul 2, 2003

GNNAAAARRRR
The syslog on my server is filled with thousands of repeats of this:
code:
Uhhuh. NMI received for unknown reason 2d on CPU 0.
Dazed and confused, but trying to continue
Do you have a strange power saving mode enabled?
I have Slackware 10.2 with an updated 2.6 kernel. Hardware is an Athlon XP 1700+ and a Soyo Dragon KT333 Plus motherboard with 512MB of DDR. This just started happening recently. It doesn't seem to be interfering with anything or causing any crashes, as it does for the other people whose forum posts appear when I google this message. Is this something I should be worried about? Any ideas for potential causes?

teapot
Dec 27, 2003

by Fistgrrl

The Merkinman posted:

So I actually have Internet included where I live. I was given a Linksys WUSB54GSC nub to connect to the Internet. It works fine in Windows, which is where I'm currently posting from. However, I also dual boot in Ubuntu 7.10 and cant' for the life of me get it to work. I've tried looking at ubuntuforums.org and even making a thread, but it just gets pushed down pages from everyone else having wireless problems.

I tried this long ndiswrapper tutorial but when I run ndiswrapper -l it says invalid driver.

I'm thinking of reformatting/restructuring my ext/ntfs partitions, so if someone's advice is to start with a reinstallation of Ubuntu from scratch, I wouldn't have a problem with it.
What is it with people and reinstalling the OS whenever they so anything wrong?

Why don't you just reinstall ndiswrapper, and this time give it the Windows driver for the USB wireless adapter like the countless howtos tell you to do?

Or get a supported wireless adapter?

Or post, what hardware do you actually have?

Seriously, what the hell? I understand that "How to install a driver for Linksys WUSB54GSC wireless adapter?" it's a legitimate question, however the way you have expressed it sounds more like "I have installed Ubuntu, and it doesn't automatically detect a piece of hardware, even though I didn't even give it a driver disk -- this Linux thing is not working out for me, I want to post how much it sucks, and how I am going to not use it anymore!!!!111ONE!".

Did you really expect Ubuntu forums to copy the answers into a separate thread to each and every person who did not bother searching for ndiswrapper installation instructions?

teapot
Dec 27, 2003

by Fistgrrl

MrBlandAverage posted:

The syslog on my server is filled with thousands of repeats of this:
code:
Uhhuh. NMI received for unknown reason 2d on CPU 0.
Dazed and confused, but trying to continue
Do you have a strange power saving mode enabled?
I have Slackware 10.2 with an updated 2.6 kernel. Hardware is an Athlon XP 1700+ and a Soyo Dragon KT333 Plus motherboard with 512MB of DDR. This just started happening recently. It doesn't seem to be interfering with anything or causing any crashes, as it does for the other people whose forum posts appear when I google this message. Is this something I should be worried about? Any ideas for potential causes?

Can be pretty much any kind of hardware failure. You can check if memtest will show any errors, however if it does, most likely it's motherboard and not memory problem. Your setup is pretty old, I wouldn't be surprised it has dried/exploded capacitors or is physically falling apart.

Adbot
ADBOT LOVES YOU

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

teapot posted:

What is it with people and reinstalling the OS whenever they so anything wrong?
I've never done that, but I'd heard that suggested for other people in the threads on wireless I've seen.

teapot posted:

Why don't you just reinstall ndiswrapper, and this time give it the Windows driver for the USB wireless adapter like the countless howtos tell you to do?

I did, I tried drivers supplied in some howtos, drivers from Linksys' site, and drivers from the CD that came with the adapter

teapot posted:

Or get a supported wireless adapter?

Because like I said, I didn't buy this adapter in the first place, and I'd like to see if I can get this one to work before buying another one.

teapot posted:

Or post, what hardware do you actually have?
I'm terribly sorry I'm not omniscient in Linux and realized that all of my hardware needed to be listed.

ASUS A8N-SLI Premium Mobo
AMD Athlon 64+ 3200
1GB RAM
2 IDE HDs, 160GB Maxtor, 160 Seagate

teapot posted:

Seriously, what the hell? I understand that "How to install a driver for Linksys WUSB54GSC wireless adapter?" it's a legitimate question, however the way you have expressed it sounds more like "I have installed Ubuntu, and it doesn't automatically detect a piece of hardware, even though I didn't even give it a driver disk -- this Linux thing is not working out for me, I want to post how much it sucks, and how I am going to not use it anymore!!!!111ONE!".

Did you really expect Ubuntu forums to copy the answers into a separate thread to each and every person who did not bother searching for ndiswrapper installation instructions?

I don't know where all that aggression is coming from. I'm pretty sure I mentioned I did try some howtos, which, as you know would entail getting drivers. I also never went on some rant about how much Linux sucks or that I'm not going to use it anymore. If that were the case, I wouldn't bother asking for help to get the wireless to work.

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