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
Modern Pragmatist
Aug 20, 2008
I have a question regarding renaming directories that are referenced in /etc/fstab

When I initially set up my box a couple years ago, I decided that it would be a great idea to create a separate partition for all of my multimedia that I share via samba with my home network. Initially I assigned a path for the partition (e.g. /sambashare/music), now I am wanting to change the path to something else (/music).

The main partition information in /etc/fstab is:

/dev/hda2 / reiserfs acl,user_xattr 1 1
/dev/hda3 /home reiserfs acl,user_xattr 1 2
/dev/hda4 /sambashare/music vfat users,gid=users,umask=0002,utf8=true 0 0
/dev/hda1 swap swap defaults 0 0


/dev/hda4 is the one that I would like to change the directory. How can I go about doing this without losing any of my data that exists on the partition?

It always makes me nervous fooling around with partitions with data on the drive but this has been driving me nuts. Thanks.

Adbot
ADBOT LOVES YOU

Modern Pragmatist
Aug 20, 2008

ShoulderDaemon posted:

I'll assume you want to move that mount to /foo. All these steps should be done as root.

First, mkdir /foo to create the target mountpoint.
Second, umount /sambashare/music to unmount the filesystem.
Third, edit /etc/fstab and change /sambashare/music to /foo.
Fourth, mount /foo to remount the filesystem.
Fifth, rmdir /sambashare/music to remove the old mountpoint.

Thank you very much for the fast reply. Worked great. Now I have learned something new.

Modern Pragmatist
Aug 20, 2008
So I have a question that I feel is so basic that I must be overlooking something...

I am attempting to compile a program which requires the mpcdec lib. I have installed this library both through yast as well as from source, but the ./configure script of the program i am trying t compile is not able to detect the library

So just to test things, when compiling the library from source I set the prefix myself:

code:
/usr/local/lib/libmpcdec
I used LDFLAGS as specified in the ./configure --help output for libraries located in non-standard locations

So, I define the variable:

code:
LDFLAGS=-L/usr/local/lib/libmpcdec
The configure script still does not recognize the library. Are there any suggestions or is there something that I am overlooking?

Thanks in advance

Modern Pragmatist
Aug 20, 2008

JoeNotCharles posted:

Then you want LDFLAGS=-L/usr/local/lib/libmpcdec/lib and INCLUDES=-I/usr/local/lib/libmpcdec/include.

This is exactly what I wanted to know. Thanks.

Modern Pragmatist
Aug 20, 2008

Gumball Dad posted:

I've looked around but find mostly stuff about PHP and MySQL.

Your script that you are going to write to perform the query is going to be written in PHP. As mentioned above (^^^) Apache just hosts that script it doesn't perform queries on its own.

There are tons of tutorials on using PHP to query MySQL. You can always use the online PHP manual(http://www.php.net/manual/en/).

Modern Pragmatist
Aug 20, 2008

Phat_Albert posted:

How do I set them as world readable/writable?

code:
sudo chmod o+rw filename
Edit: I just realized that you may be asking how to get to "filename" on the external drive?

If so, you can check in /mount

if you don't see it there, then you can do this:

code:
sudo mkdir /mount/usb
then

code:
mount /dev/sdb1 /mount/usb
Assuming that your external drive is represented by /dev/sdb1

If it isn't, then you can use:

code:
dmesg | more
and near the end it will have info on the mount point for your USB drive

you could then chmod your files as above:

code:
sudo chmod o+rw /mount/usb/filename

Modern Pragmatist fucked around with this message at 21:13 on Nov 14, 2008

Modern Pragmatist
Aug 20, 2008

NZAmoeba posted:


code:
[carsftp@ce-bastion ~]$ ssh-keygen -q -f ~/.ssh/id_dsa -t dsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
[carsftp@ce-bastion ~]$ cd ~/.ssh
[carsftp@ce-bastion .ssh]$ cat id_dsa.pub >> ~/.ssh/authorized_keys
[carsftp@ce-bastion .ssh]$ exit
logout
Connection to 10.111.128.19 closed.
[carsaite@sf2266]> (/appl/cars_ite/cars)
 
[carsaite@sf2266]> (/appl/cars_ite/cars)
sftp carsftp@10.111.128.19
Connecting to 10.111.128.19...
carsftp@10.111.128.19's password:
Permission denied, please try again.
carsftp@10.111.128.19's password:

You have to run keygen on carsaite@sf2266 and then copy the public key to carsftp@ce-bastion and add it to authorized_keys on carsftp@ce-bastion. Keep the private key on carsaite@sf2266.

Above you created the key on carsftp@ce-bastion and putting it in authorized_keys on carsftp@ce-bastion, thus giving it access to itself.

Modern Pragmatist fucked around with this message at 03:28 on Dec 19, 2008

Modern Pragmatist
Aug 20, 2008

Kai was taken posted:

So if I'm SSH'd as bob@10.10.10.10 and I navigate into a directory, and I want to copy file.ext to my personal computers desktop, how exactly would the syntax of that command work?

Open another terminal and issue (from your local computer):
code:
scp bob@10.10.10.10:/pathtofile/file /path/to/local/target
Does the same command apply if I wanted to copy an entire directory?
code:
scp -r bob@10.10.10.10:/path/to/remote/directory /path/to/local/target
You could use this command to go the other direction (call scp on remote):
code:
 scp -r /path/to/remote/directory bob@99.99.99.99:/path/to/mac/target
(This last assumes that either the computer you are SSH'ing into is on your local network, or your personal computer has a public IP address that will be accessible from the remote computer)

Edit: nvm

Modern Pragmatist fucked around with this message at 04:44 on Feb 7, 2009

Modern Pragmatist
Aug 20, 2008

KS posted:

sed 's/[a-z,A-Z,-,=,,., ]*\([0-9]*\)/ \1/'

How the heck do I delimit the hyphen to make it work?

code:
sed 's/[-,a-z,A-Z,=,,., ]*\([0-9]*\)/ \1/'
Place the hyphen at the beginning of the group

Modern Pragmatist fucked around with this message at 21:39 on Feb 9, 2009

Modern Pragmatist
Aug 20, 2008

skipdogg posted:

I've got a basic html website that just stopped displaying the graphics. I restarted apache, and verified the graphics are in teh /var/www/<site>/ folder. This just stopped working a few days ago... and no settings I'm aware of have changed.

Try Viewing Source and then copying the <img> src and paste into the browser's address bar to show the image alone (without the page).

Did you check permissions of the images?

Modern Pragmatist
Aug 20, 2008

skipdogg posted:

code:
[root@xxxxxx blocked]# ls -l
total 32
-rw-r--r--  1 root root 1882 Jan  3  2007 xxxxxlogo.gif
-rw-r--r--  1 root root 1165 Mar 18  2007 index.html
-rw-r--r--  1 root root  153 Jan  3  2007 mail.gif
-rw-r--r--  1 root root 3004 Jan  3  2007 xxxxwarning.gif


Try replacing src of <img> tags with the full path (<img src="http://127.0.0.1/site/xxxxxlogo.gif"/>) just to test that.

Also, could you post the relevant portion of index.html?

Modern Pragmatist
Aug 20, 2008

cannibustacap posted:

I'd like to run a Linux distro in conjunction with my Windows Vista set up.
Any way to make this happen?

Get VMWare Player Here

Create virtual machine file (vmx) using this site

Download Distro ISO

Run vmx file using VMware player, and mount the ISO and install.

Modern Pragmatist
Aug 20, 2008

cannibustacap posted:

I am wondering, are there any other pre-made Distro ISO's that come with Apache and MYSQL and all that already set up?

You can always download a VMware Application which is basically a virtual machine that somebody else configured. You can find them here

cannibustacap posted:

How do you run the Virtual Machine software in Full Screen Mode? I am using VMware (free).

I have currently have a system running VMware Player (Free) and here is a screen shot complete with Maximize button.

Modern Pragmatist
Aug 20, 2008
I am attempting to use regular expressions to identify two unique identifiers on either side of a series of bytes from a binary file.

Here is what I am passing for the regular expression strings:

"\x01\x20\x5F\xE0.*\x01\x20\x61\xE0"
"\x01\x20\x00\xE1.*\x05\x20\x00\x00"

I want the first be able to identify, \x01\x20\x5F\E0XXXXXXXXXXXXXXXXXXXXXXXXXX\x01\x20\x61\xE0
and similarly for the second.

The first one performs just as expected but the second one is unable to find a match although i have ensured that a match does exist.

Any help would be appreciated.

Modern Pragmatist
Aug 20, 2008

covener posted:

paste output of pcretest

I actually was able to sort it out. The ".+" of the second one was getting hung on a newline character and not advancing far enough to detect the ending bytes.

Modern Pragmatist
Aug 20, 2008
What is the easiest way to programatically determine the physical device for a given mount point.

Know: /media/FLASHDRIVE
Want: /dev/sdb

I know that I could parse out the output from "df" but I was wondering if there was a more elegant solution.

Modern Pragmatist
Aug 20, 2008

Zom Aur posted:

mount.

cat /proc/mounts could also work, but it's messier.

Great thanks. Exactly what I was looking for.

Modern Pragmatist
Aug 20, 2008

teamdest posted:

Does anyone have a recommendation for a music server with a web interface that can run on a headless server? I've got a Debian box running as a file server, with SABnzbd+ on it as well, but I'd like to also make it so that rather than just sharing my music and playing it locally in winamp I can connect to it remotely from any computer and play music as if it were a music repository. I don't know if this request makes any sense, I'm basically asking if there's software that creates a dedicated "music" server separate from Samba.

I personally prefer MPD. There are a large number of clients and web interfaces designed for it, and it allows streaming of your music over a network.

It is somewhat a pain taking care of all the dependencies but once it is setup it is definitely worth it.

Modern Pragmatist
Aug 20, 2008
So I have a linux box running Red Hat that I set the hostname (polly) during installation. I later changed the hostname to "pterodactyl" (I forget the exact way that I went about this). The problem is that on my network, "polly" points to the server but "pterodactyl" does not.

/etc/hosts
code:
127.0.0.1      pterodactyl.local         pterodactyl
/etc/sysconfig/network
code:
NETWORKING=yes
HOSTNAME=pterodactyl
code:
$ hostname
results in
code:
pterodactyl
code:
$ nslookup 10.0.0.102
results in:
code:
Server:         10.0.0.1
Address:        10.0.0.1#53

102.0.0.10.in-addr.arpa name = polly.
I am at a loss for what to do next to force my new hostname to take effect.

Modern Pragmatist
Aug 20, 2008

CoderCat posted:

Also, it's worth it to grep through /etc for any other references to the old host name:
code:
# grep polly -R /etc

This worked. There was a random config file with the offending hostname. Thanks for your help.

Modern Pragmatist
Aug 20, 2008
At work we use an NAS and there are several cases where a dynamic link would be ideal. Normally I would SSH into the box and setup the links; however, there is no shell access to the box. Is there any way to generate the equivalent of a dynamic link of a file without shell access?

Modern Pragmatist
Aug 20, 2008

FISHMANPET posted:

The underlying file system has to support it first of all, and if it does you can just mount the file system on *nix client and make the links there.

Wow. I guess I should have tried that first. I figured that links used some sort of memory addressing that would be specific to each client.

Now to figure out how to have Windows users not accidentally delete a linked file because they think there are two copies...

Modern Pragmatist
Aug 20, 2008
So this is absolutely driving me crazy. I just installed Ubuntu 10.04 and I need to schedule apache2, cups, and samba services to all start at startup. I have the correct links in /etc/rc5.d pointing to the appropriate files in /etc/init.d/

I have read that Ubuntu is in the process of switching to Upstart, so I attempted to create .conf files in /etc/init that startup the services, however these scripts are not executed.

If someone could point me in the right direction I would be most appreciative.

Modern Pragmatist
Aug 20, 2008

FISHMANPET posted:

I'm pretty sure Ubuntu does all that stuff for you when you install the packages.

That's what I thought too. However, it is not starting those services.

Modern Pragmatist
Aug 20, 2008

Crush posted:

I know this has got to be an incredibly easy thing for most of you, but I am a little lost on how to make a script that: Checks to see if a certain process is running, if it is - send a command, if it isn't - send a command, and then stop running.

Any help?

Well poo poo. Looks like I was beaten 10x over, but here it is anyhow. I guess the advantage here is that you can perform process-specific commands.

code:
#! /bin/bash

PROGRAM="firefox"
PIDS=$((ps -e) | grep $PROGRAM | awk 'BEGIN {FS=" "}{print $1}')

if [ ${#PIDS} == 0 ]; then
    echo "$PROGRAM isn't Running"
    # Send Command Here
else
    echo "$PROGRAM is Running"
    echo "Process IDs:"

    for id in $PIDS; do
        echo $id
        # Perform process specific action here
    done
fi

Modern Pragmatist
Aug 20, 2008

ExcessBLarg! posted:

I have perhaps an atypical but interesting use case. Often times for work I'm running various scripted jobs 24/7 and they have the tendency to occasionally fail for whatever reason. When they do I get an SMS.

May I ask how you go about setting up SMS notification of script termination?

Modern Pragmatist
Aug 20, 2008

enotnert posted:

All phones can recieve txts as an email. . . for instance say my phone number was 555-555-5555 and I was on alltel, looking up the info I would find that sending an email to 5555555555@alltell.net would let me email txts to the phone.

You just tell your job to email on failure to that address.

You guys are lifesavers. Can't believe I never thought of this.

Modern Pragmatist
Aug 20, 2008
Say a website has the following source:
code:
<crapTag>stuff</crapTag>
<theGoodStuff>Parameter: Value</theGoodStuff>
<otherCrap></otherCrap>
I want to use the command line to extract the parameter value pair.

I know that I need to use curl and grep:
code:
curl --silent 'http://www.url.com' | grep "theGoodStuff"
However, I'm not sure what to pipe it to next to search through that particular line and grab the parameter value pair. I could do something like using perl to remove the tags, then split the remainder at the colon, but I'm sure there's a more elegant solution. (case in point, the pgrep example from a while back)

Modern Pragmatist
Aug 20, 2008

Luke Johnson posted:

Huh, awk can use more than one character as a delimiter.
code:
curl --silent 'http://www.url.com' |awk -F[\>\<] '/theGoodStuff/ {print $3}'
efb; I give myself an F for speed but an E for elegance. "Sed"? Ha! awk supremacy.

You are both amazing thanks. Obviously all the coffee that I have consumed today has affected my ability to think clearly.

Modern Pragmatist
Aug 20, 2008

MachinTrucChose posted:

Found what the problem was. Windows Explorer had cached the username/password for the share1 user from a previous session I did. It wasn't even the same OS, I reinstalled the Debian VM, but it had the same IP and username.

I found this out by creating a second Debian account and used that in smb.conf, and Windows Explorer finally prompted me for credentials. But here's the problem: even though I didn't check "remember my credentials," Windows Explorer appears to have done so, because if I close it and then navigate to the private share again, it lets me right in. Deleting the connection using the net use /delete command doesn't make it forget the password either, I can still navigate back to the share without being asked for credentials.

The plot thickens. :crossarms: But at least I know it's not my Samba configuration.

Edit: it's just not going to work. I'll just have a public read-only share, and use SCP for private stuff. fu,w.

I usually just map the samba share and in that dialog there is an option to "connect using a different user". This basically forces it to forget. Unfortunately, windows won't let you authenticate with multiple users to the same share so you can't have Z:/ mapped as the public share while at the same time be able to access the private stuff via a different username.

Modern Pragmatist
Aug 20, 2008
I have a raid1 array setup using a discrete RAID controller (since Ubuntu doesn't play nicely with Intel's integrated controller). I need to migrate my system to a single 1 TB drive. When I just plug one of the RAID member disks directly into the motherboard, it considers it to be a degraded array since it is getting flagged as a member disk still. This is an issue since ubuntu won't boot from the disk in this way (since it's using this integrated controller).

What is the best way to clone all of my data to a new HD with the exception of whatever data flags the disk as a RAID array disk?

Modern Pragmatist
Aug 20, 2008

Kaluza-Klein posted:

This isn't really a linux question, but where else would I ask?

The lady friend has to read/study lots of power point presentations for class. She wants to be able to print them out.

Seemingly easy, but she is never given the real power point files, just access to an "online" version of the presentation, which is a frameset. An index of all the slides is in the frame on the left, and the "slides" appear in the large frame on the right.

I could print out the right-hand frame over and over while loading each slide, but that is going to get old very quickly. Also, ideally there would be multiple slides per printed page.

I have been googling for a script or any tips on how to do this, but I am not coming up with anything.

Any ideas?

When you right click on the slide on the right does it provide a context menu that indicates that it is an image? If so, I would imagine that they use a fairly standard naming scheme such as "slide1.jpg" etc.

If so, you could devise a script to use wget to pull all the slides as images.

Modern Pragmatist
Aug 20, 2008
I'm the only Linux user in a mostly Windows work environment. I have several services that are used around the lab including smb, ssh, and svn. The problem is that none of the computers are able to ping my computer using my hostname. When I ping my IP address instead, it works fine. I could technically go around and put an entry in everyone's hosts file since I have a static IP, but there has to be another way.

I believe that the computers are using UDP broadcast for their hostname lookup but I'm not sure what settings I haven't toggled just right to get them to recognize my computer via hostname.

Any help would be greatly appreciated.

I am running Fedora 14

Modern Pragmatist
Aug 20, 2008

bort posted:

Is your nmbd daemon running? chkconfig --list nmb or service nmb status

That will let clients resolve your hostname using NetBIOS.

e: extra d

Interesting. For some reason it wasn't running. When I toggle that it works. Now, to add it as a startup task I should be able to do:

code:
chkconfig --levels 3 nmb on
right? It doesn't seem to actually start it.

The other option is rc.local but that's kinda messy. Any ideas?

Modern Pragmatist
Aug 20, 2008
Looks like everything is working just dandy for now. Thanks for the help. I'll keep my fingers crossed that it continues to function as expected.

Modern Pragmatist
Aug 20, 2008
Is there any good reference for how linux deals with the /etc/hosts file?

I have ubuntu on a laptop and I frequently connect to a server at home via samba. I can connect using my public static IP. When I am home, I prefer to connect via the internal IP because I have a gigabit LAN and the transfers are a ton faster. If I connect via the external IP from home, it is about 5MBps because it has to be routed through my ISP's system so I can't take advantage of my gigabit network.

What are the effects of making my hosts file:

code:
int.ern.al.ip          zeus
ext.ern.al.ip         zeus
Basically what I want is to see if it can't connect to the internal IP and if that fails then default to the external IP. As a result, when I'm at home it will connect via the local network otherwise it will use the slower but guaranteed external access.

Is this an acceptable solution?

I don't really want to use two different hostnames because this is coded into a variety of background jobs that complete periodic transfers etc.

Modern Pragmatist
Aug 20, 2008
My network is this:
pre:
                        +-------------------+
                        |   Cable Modem     |
                        +-------------------+
                                 ||      
                                 \/      
                        +-------------------+
                        |  Wireless Router  |
                        +-------------------+
                            |       
                            |  
+---------------+           |                                 +--------------+
|  Time Machine |---+   +-------------------+             +---|  File Server |
+---------------+   |   |                   |             |   +--------------+
                    |---|      Switch       |-------------|
+---------------+   |   |                   |             |   +--------------+
|  Workstation  |---+   +-------------------+             +---|     HTPC     |
+---------------+                                             +--------------+
The File Server is the one that I want to access it. I have one IP from my ISP.

I hadn't thought of writing a script to check my location. I could always turn that into a cronjob.

Everthing on my side of the Modem is gigabit. So when I connect via the public IP it goes outside of the network then back in.

Modern Pragmatist
Aug 20, 2008

enotnert posted:

You know, I was thinking about asking this. . . but he's trying to resolve in his hosts file for some inane reason.

I'm not limiting it to the hosts file. I was just assuming that would be the easiest way to do it. Setting my router up to act as a DNS serve may actually work.

Modern Pragmatist
Aug 20, 2008
The other day I noticed that the hard disk light on my computer is constantly on (doesn't blink). Is there a utility that allows me to monitor actual reads/writes to the disk so I can figure out if something is actually writing to it or the light is getting incorrect signals?

Adbot
ADBOT LOVES YOU

Modern Pragmatist
Aug 20, 2008

Bob Morales posted:

code:
iostat -d 1

Awesome. Thanks. Looks like it's just the light since there is no activity.

VVVV Well I'll be damned. That is quite useful. Thanks.

Modern Pragmatist fucked around with this message at 16:06 on Apr 20, 2011

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