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
deimos
Nov 30, 2006

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

HatfulOfHollow posted:

Today I found out that a job that moves some files to one of our servers has been writing them with the wrong permissions. The files contain sensitive data and are in a world readable directory but the files themselves have 062 permissions, meaning they are world writable but not readable. Outside of the obvious 'cat /dev/null > *' which is pretty bad, is there anything I should be worried about that users may have been able to do? Or are they pretty much restricted to wrecking the contents of the files? My main concern is if people somehow gained the ability to read the contents of the files. Is there anything screwy that can be done with those permissions to allow someone access to read the contents?

Obvious question, why can't you `chmod o-w -R *`?


HatfulOfHollow posted:

I can and the permissions issue has already been resolved. My question is whether or not anyone would have been able to somehow weasel their way into the files to read their contents with only write permissions. Because they were in this bad state for a few weeks, I'm concerned that this could have happened. I can't think of anything off the top of my head but figured I should ask anyway.

You're pretty much safe, except for possible data deletion/modification.

deimos fucked around with this message at 23:26 on Nov 1, 2007

Adbot
ADBOT LOVES YOU

deedee megadoodoo
Sep 28, 2000
Two roads diverged in a wood, and I, I took the one to Flavortown, and that has made all the difference.


deimos posted:

Obvious question, why can't you `chmod o-w -R *`?

I can and the permissions issue has already been resolved. My question is whether or not anyone would have been able to somehow weasel their way into the files to read their contents with only write permissions. Because they were in this bad state for a few weeks, I'm concerned that this could have happened. I can't think of anything off the top of my head but figured I should ask anyway.

hooah
Feb 6, 2006
WTF?

teapot posted:

If you use Nautilus, run once in a terminal:

code:
gconftool-2 -s /apps/nautilus/preferences/background_set --type boolean true

That didn't do it.

teapot
Dec 27, 2003

by Fistgrrl

hooah posted:

That didn't do it.

Is Nautilus running?

hooah
Feb 6, 2006
WTF?

teapot posted:

Is Nautilus running?

I'm not sure what you mean. Was it running when I put the command into the terminal? No. Is it running on startup? No. Unless it runs in the background that I'm not aware of.

jdonz
Jan 4, 2004

hooah posted:

I'm not sure what you mean. Was it running when I put the command into the terminal? No. Is it running on startup? No. Unless it runs in the background that I'm not aware of.

Try:
code:
ps -ef | grep nautilus
You should see:
code:
[joshua@jupiter ~]$ ps -ef | grep nautilus
joshua    9569  9540  0 08:20 pts/0    00:00:00 grep naut
joshua   24742     1  0 Oct22 ?        00:00:16 nautilus --no-default-window --sm-client-id default3
[joshua@jupiter ~]$

onionradish
Jul 6, 2006

That's spicy.
I just rescued a P2-500 before it hit the scrap bin and installed Kubuntu. Long time Win/DOS user, total UNIX n00b. Where do I go from here to actually learn how to use it beyond the pre-installed apps? I've gone through some of the links in the OP, but I'm not finding what I need. I'm looking for:

Good starting places for learning the fundamentals, and how things work together
I can noodle through the GUI and figure out the pre-installed/pre-configured user-friendly apps and tools. OpenOffice/Konqueror/etc -- easy and familiar. I'm looking for an overview of the stuff that's not Windows-like -- core UNIX things like using the shell, important directory structures (usr/bin), extensions, dependencies, user accounts, etc. Online or print suggestions desired.

Installing other software?
I'm used to "UNzip, run INSTALL.EXE." On UNIX, I'm lost. For example, several of my other boxes have TightVNC installed so I can do remote desktop access(*), and I'd like to be able to access this box through TightVNC too. I've used the Adept tool to install the TightVNC viewer and server. How do I actually launch the app now that it's installed? Or is it? I don't see it in the Kubuntu "start" menu equivalent, and clicking the vnc-related icons in /usr/bin isn't starting anything up either.

(*It's a lot more comfortable to remove access from my main system; if other remote desktops are better, and I'm a dope for using TightVNC, that's cool -- say so. Mock away, but please help me learn how to get this working, and then I can go off and install/reconfigure my other systems with a better solution.)

Prince John
Jun 20, 2006

Oh, poppycock! Female bandits?

http://www.tldp.org/guides.html

That's a good starting point. Introduction to Linux is a great place to start, followed by the command line tools summary. Bash beginners guide should probably be number three on the list.

Prince John fucked around with this message at 01:47 on Nov 3, 2007

teapot
Dec 27, 2003

by Fistgrrl

onionradish posted:

I just rescued a P2-500 before it hit the scrap bin and installed Kubuntu. Long time Win/DOS user, total UNIX n00b. Where do I go from here to actually learn how to use it beyond the pre-installed apps? I've gone through some of the links in the OP, but I'm not finding what I need. I'm looking for:

Good starting places for learning the fundamentals, and how things work together
I can noodle through the GUI and figure out the pre-installed/pre-configured user-friendly apps and tools. OpenOffice/Konqueror/etc -- easy and familiar. I'm looking for an overview of the stuff that's not Windows-like -- core UNIX things like using the shell, important directory structures (usr/bin), extensions, dependencies, user accounts, etc. Online or print suggestions desired.

As Col mentioned, there is a lot of Linux documentation at TLDP, that includes (though not necessarily identifies) things common for all Unix-like systems. I still don't know which "modern" book to recommend, I studied Unix a long, long time ago using G. Glass' "Unix for Programmers and Users" book. If you want to study development for Linux or any other Unix-like system, you aren't likely to avoid R. Stevens' "Unix Network Programming" and/or his "TCP/IP Illustrated".

quote:

Installing other software?
I'm used to "UNzip, run INSTALL.EXE." On UNIX, I'm lost.

Since most of software is open source, anything even remotely popular is very likely to be in your distribution's repository. With Kubuntu it will be Kynaptic or Synaptic, text-mode utilities "aptitude" or "apt", that download and install packages. When a package is not available for Ubuntu in either regular Ubuntu or third-party repositories, you can install it from source. In general, it's downloading a source archive (usually tar.gz or tar.bz2), unpacking it, and running

code:
./configure
make
sudo checkinstall
"sudo checkinstall" replaces more general "make install" by building a package so it can be uninstalled, upgraded or replaced with packaged version if/when it will be released.

Packages made for Linux usually don't contain bundled libraries because package manager is supposed to manage libraries as separate packages, and replace/upgrade them according to other packages' requirements. This allows to avoid "DLL hell", however it looks really unusual for the user, especially when they try to manually install package without a package management tool, only to receive the errors about missing dependencies.

quote:

For example, several of my other boxes have TightVNC installed so I can do remote desktop access(*), and I'd like to be able to access this box through TightVNC too. I've used the Adept tool to install the TightVNC viewer and server. How do I actually launch the app now that it's installed? Or is it? I don't see it in the Kubuntu "start" menu equivalent, and clicking the vnc-related icons in /usr/bin isn't starting anything up either.

(*It's a lot more comfortable to remove access from my main system; if other remote desktops are better, and I'm a dope for using TightVNC, that's cool -- say so. Mock away, but please help me learn how to get this working, and then I can go off and install/reconfigure my other systems with a better solution.)

TightVNC should work, however be aware that by default it runs a minimal session instead of the full environment. You can edit .vnc/xstartup file to change that.

Of course, there are things (such as 3D applications) that will not work or will look pretty bad over the network.

ColdPie
Jun 9, 2006

Ugh, I'm having a bit of a doozy here tonight. I'm trying to set my SVN server to automatically upload backups of the repositories to an FTP once a day. I spent about an hour wrestling with a stupid 5-line shell script file just to get the FTP program to put a date into a filename. Finally, the script inserts the date in the correct spot and everything is well, except I can't upload the files!

I'm using lftp, and it logs in and connects to the server just fine. When it tries to upload the file, it enters passive mode and sticks at "Opening data connection" saying, "Making data connection..." forever.

After a bit of research, my guess is that the port it's trying to connect across is blocked. Here's my network setup:

[Server] -> [Desktop (Bridged Connection)] -> Router -> Modem

The Desktop's bridged connection looks like this:
code:
#/etc/rc.conf
lo="lo 127.0.0.1"
eth0="eth0 0.0.0.0 promisc"
eth1="eth1 up"
br0="br0 192.168.2.5 netmask 255.255.255.0 broadcast 192.168.0.255"
INTERFACES=(lo eth0 eth1 br0)
code:
#/etc/conf.d/bridges
bridge_br0="eth0 eth1"
BRIDGE_INTERFACES=(br0)
The Desktop can connect to FTP and do file transfers just fine, so it seems to be the breaking point. The server has no problem downloading from anonymous FTP (for software updates, etc.), but uploading doesn't seem to be working.

I have no idea what I can do or where to go from here. Running Arch Linux on both desktop and server. Does anyone have any suggestions?

Thanks.

emf
Aug 1, 2002



I'm having a problem getting high resolution text mode consoles.

I have a desktop computer with a 1600x1200 LCD monitor, and recently a notebook with 1280x800 display. For the desktop, when I try to set the appropriate mode (796-799,834) on the grub boot line it says that it is not available. I've settled with using 1280x1024, but that looks like rear end. Now that I've got two LCD's that look like rear end in text mode, I've decided I want to do something about it, but I can't seem to find any solution; maybe I'm googling for the wrong thing.

Anyone have any insight?

George Wright
Nov 20, 2005

emf posted:

I'm having a problem getting high resolution text mode consoles.

I have a desktop computer with a 1600x1200 LCD monitor, and recently a notebook with 1280x800 display. For the desktop, when I try to set the appropriate mode (796-799,834) on the grub boot line it says that it is not available. I've settled with using 1280x1024, but that looks like rear end. Now that I've got two LCD's that look like rear end in text mode, I've decided I want to do something about it, but I can't seem to find any solution; maybe I'm googling for the wrong thing.

Anyone have any insight?

Not sure which flavor of linux you are running, but as root (or put sudo before) on a debian derivative you can run:

code:
dpkg-reconfigure xserver-xorg
Which will take you through the whole setup for your display settings, which you can manually select which resolutions you would like.

If it's a RHEL/Centos like system then I have no idea - I don't normally run a GUI on centos.

Hope it helps!

edit: Oh, console mode - not quite sure for that, sorry!

teapot
Dec 27, 2003

by Fistgrrl

emf posted:

I'm having a problem getting high resolution text mode consoles.

I have a desktop computer with a 1600x1200 LCD monitor, and recently a notebook with 1280x800 display. For the desktop, when I try to set the appropriate mode (796-799,834) on the grub boot line it says that it is not available. I've settled with using 1280x1024, but that looks like rear end. Now that I've got two LCD's that look like rear end in text mode, I've decided I want to do something about it, but I can't seem to find any solution; maybe I'm googling for the wrong thing.

Anyone have any insight?

1. vga=ask should give you the list of modes on boot.
2. How can a human being ask such a question and not mention the manufacturers and models of ANY HARDWARE INVOLVED? Is it a new tradition in this thread, to ask question in a way that makes them absolutely impossible to answer?

onionradish
Jul 6, 2006

That's spicy.

onionradish posted:

:words:
Col & teapot, thanks for the pointers...should get me started in the right direction!

emf
Aug 1, 2002



teapot posted:

1. vga=ask should give you the list of modes on boot.
2. How can a human being ask such a question and not mention the manufacturers and models of ANY HARDWARE INVOLVED? Is it a new tradition in this thread, to ask question in a way that makes them absolutely impossible to answer?
My bad, and I know better too.

1: I should have mentioned that vga=ask and that scanning for available modes during boot doesn't return the correct codes.

2: I didn't include hardware, because the problem doesn't seem hardware specific, and I didn't think it would help. I figured the problem, and thus solution were grub-centric. Although, since I haven't had any luck finding a solution I should have been more forthcoming.

The desktop machine currently has the NVIDIA GeForce 7050PV on-board a BIOSTAR TForce TF7050-M2 motherboard. My previous desktop with the same issue on the same display had a Radeon 9800 video card, and I forget the motherboard. The display itself is a Samsung SyncMaster 204B, and the problem exists for analog, DVI, and DVI adapted from HDMI connections.

The notebook is a Gateway(LOL) MT6457. For video, it uses an onboard Radeon Xpress 1150 IGP (detected by xorg as 1100). Its spec page is HERE

edit: I forgot to mention that for each system I'm using the binary drivers from the respective manufactures.

While setting up the laptop with Debian amd64 Testing, I ran into a font problem I've never had before. I installed KDE, and its default font antialiasing settings seem to use whatever Gnome is set to. I set Gnome to use full subpixel hinting, but when I make the change it didn't do anything onscreen, which is different than the behavior I'm used to. Eventually I manually edited the ~/.fonts.conf file and from then on, Gnome seemed to work fine, and KDE applications in KDE worked fine, but when I run a program which expects a gnome interface (like iceweasel) in KDE it looks like crap. When this happens I can run the Gnome Control Center application from KDE, twiddle the font settings, and the fonts will all be correct the next time the app is loaded. I've never had this much trouble with fonts on a fresh install before. What can I do to get things working?

edit2: I installed gtk-qt-engine, and the ability to re-theme Gnome applications works, but the text is still not rendered with subpixel hinting.

emf fucked around with this message at 04:57 on Nov 5, 2007

DEAD MAN'S SHOE
Nov 23, 2003

We will become evil and the stars will come alive
It seems that Ubuntu has changed how it handles fonts since Dapper, and after an upgrade, /etc/fonts/local.conf no longer works.
Just being there should be enough as /etc/fonts/fonts.conf points to this.

I don't have the resources to run gnome well, so gnome-control-center is out of the question for this as a fix.

edit: This is strange.

I moved /etc/fonts/local.conf somewhere safe, and ran dpkg-reconfigure fontconfig-config.
This yielded a change in subpixel hinting style - except that I had selected 'never' for subpixel rendering.

I moved local.conf back into /etc/fonts/ and hinting was turned back on full for all fonts, despite there being explicit instructions in local.conf to change hinting style/turn hinting off.

Its confusing

-------------------

ok, seems like it only gives a poo poo for ~/.fonts.conf - as your local user settings. I'm using a crappy hack to turn off all antialiasing:
code:
<fontconfig><match target="font"><edit mode="assign" name="antialias" ><bool>false</bool></edit></match></fontconfig>
But I just can't see what is wrong with this (as ~/.fonts.conf) , or what could stop it from working. It seems pretty legal to me

DEAD MAN'S SHOE fucked around with this message at 02:39 on Nov 5, 2007

Grigori Rasputin
Aug 21, 2000
WE DON'T NEED ROME TELLING US WHAT TO DO
I'm sure this has been addressed in the thread somewhere, but does anyone know how to get all the mouse buttons working for my logitech MX518 mouse? Bonus question: so that backspace navigates back for firefox? tHanks!

edit: ubuntu

Grigori Rasputin fucked around with this message at 02:12 on Nov 5, 2007

m3jsh
Sep 4, 2004
The EverFag
I wanted to reinstall my Debian system. I have my /home directories on a separate partition. I thought I could just reinstall the base system without affecting my other partition. I guess I unwittingly screwed up the other partition without knowing because now all my home dir files are gone.

What should I have done?

edit: Hold on looks like I'm an idiot and just need to mount the partition.

m3jsh fucked around with this message at 02:34 on Nov 5, 2007

Jesus Stick
Dec 14, 2004

Bomb Hills, Not Countries
Ok, I have a question that I'm sure has been covered, but I wouldn't even know what to search for...

I have 4 hard drives:
(2) 160 GB
(1) 80 GB
(1) 60 GB

I want to install Windows on one of the 160's, and Ubuntu 7.10 on the 80 GB. I want to be able to boot from either from when my computer starts up. How do I do this?

deimos
Nov 30, 2006

Forget it man this bat is whack, it's got poobrain!
1. make one of the 160s the C drive (this is for catering to lovely windows apps that assume there's a c: drive)
2. install window to the 160
3. install ubuntu to the 80
4. ???
5. Profit?

Ubuntu should automagically set up grub to boot both Windows and Ubuntu regardless of what drive they're installed in.

chizad
Jul 9, 2001

'Cus we find ourselves in the same old mess
Singin' drunken lullabies

Jesus Stick posted:

I want to install Windows on one of the 160's, and Ubuntu 7.10 on the 80 GB. I want to be able to boot from either from when my computer starts up. How do I do this?

deimos posted:

Ubuntu should automagically set up grub to boot both Windows and Ubuntu regardless of what drive they're installed in.

And if for some reason it doesn't, your BIOS may provide a less elegant but workable solution. Mine lets me specify multiple HDs in the boot order, and combined with the "select boot device" key provides a ghetto way to boot between multiple OSes installed in different drives.

yippee cahier
Mar 28, 2005

chizad posted:

And if for some reason it doesn't, your BIOS may provide a less elegant but workable solution. Mine lets me specify multiple HDs in the boot order, and combined with the "select boot device" key provides a ghetto way to boot between multiple OSes installed in different drives.

I actually think that's a more elegant way. Every drive has its own bootloader so you can pull your ubuntu drive and have windows come up without reinstalling the MBR.

\/\/\/
I think windows assigns letters by partition starting at primary master to secondary slave. Just install it on the primary master drive first and it should get assigned C:. You can leave the other drives in and should have them all in when you install ubuntu.

Shouldn't matter. Even if one was a slave, you wouldn't be using the master on that channel if you booted the OS of the slave.

yippee cahier fucked around with this message at 07:53 on Nov 5, 2007

Jesus Stick
Dec 14, 2004

Bomb Hills, Not Countries
As far as the C:/ drive thing, should I just remove the other drives, and format one of the 160's with Windows first, so it becomes the C: drive?

Edit: Also, they are all IDE drives. Do I set the two I want to be able to boot from as the two masters, or does it matter?

teapot
Dec 27, 2003

by Fistgrrl

emf posted:

My bad, and I know better too.

1: I should have mentioned that vga=ask and that scanning for available modes during boot doesn't return the correct codes.

2: I didn't include hardware, because the problem doesn't seem hardware specific, and I didn't think it would help. I figured the problem, and thus solution were grub-centric. Although, since I haven't had any luck finding a solution I should have been more forthcoming.


The desktop machine currently has the NVIDIA GeForce 7050PV on-board a BIOSTAR TForce TF7050-M2 motherboard. My previous desktop with the same issue on the same display had a Radeon 9800 video card, and I forget the motherboard. The display itself is a Samsung SyncMaster 204B, and the problem exists for analog, DVI, and DVI adapted from HDMI connections.
If you pass a mode to the kernel, grub does nothing but passing a command line to the kernel. So if you just add "vga=799" to the kernel's command line, any error message you receive will not be from grub -- grub is not even loaded at that point.

quote:

The notebook is a Gateway(LOL) MT6457. For video, it uses an onboard Radeon Xpress 1150 IGP (detected by xorg as 1100). Its spec page is HERE

edit: I forgot to mention that for each system I'm using the binary drivers from the respective manufactures.

While setting up the laptop with Debian amd64 Testing, I ran into a font problem I've never had before. I installed KDE, and its default font antialiasing settings seem to use whatever Gnome is set to. I set Gnome to use full subpixel hinting,
Font hinting and subpixel antialiasing are two different features of font rendering.

quote:

but when I make the change it didn't do anything onscreen, which is different than the behavior I'm used to. Eventually I manually edited the ~/.fonts.conf file and from then on, Gnome seemed to work fine, and KDE applications in KDE worked fine, but when I run a program which expects a gnome interface (like iceweasel) in KDE it looks like crap. When this happens I can run the Gnome Control Center application from KDE, twiddle the font settings, and the fonts will all be correct the next time the app is loaded. I've never had this much trouble with fonts on a fresh install before. What can I do to get things working?

edit2: I installed gtk-qt-engine, and the ability to re-theme Gnome applications works, but the text is still not rendered with subpixel hinting.

Do Gnome applications start working properly if you run /usr/lib/gnome-control-center/gnome-settings-daemon ?

emf
Aug 1, 2002



teapot posted:

If you pass a mode to the kernel, grub does nothing but passing a command line to the kernel. So if you just add "vga=799" to the kernel's command line, any error message you receive will not be from grub -- grub is not even loaded at that point.
Ah. That makes sense. So it would seem I would need to look for some kind of kernel module or something like that?

teapot posted:

Font hinting and subpixel antialiasing are two different features of font rendering.

Do Gnome applications start working properly if you run /usr/lib/gnome-control-center/gnome-settings-daemon ?
Yes, they seem to. I ran the program from the command line and it gave the following output:
code:
/usr/lib/control-center/gnome-settings-daemon

(gnome-settings-daemon:5750): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
<stdin>:130:14: warning: missing terminating ' character
<stdin>:130:14: warning: missing terminating ' character
<stdin>:130:14: warning: missing terminating ' character
<stdin>:130:14: warning: missing terminating ' character
<stdin>:130:14: warning: missing terminating ' character
Is that going to be a big deal, and will I have to run this every time?

Heran Bago
Aug 18, 2006



Really dumb question here.
I want to update from Edgy to Gusty with the Live CD. How do I do it without actually installing fresh over the partition? Or would it be better to do a fresh install than upgrade like with Windows?

teapot
Dec 27, 2003

by Fistgrrl

emf posted:

Ah. That makes sense. So it would seem I would need to look for some kind of kernel module or something like that?
Built-in vesafb is supposed to work with that.

quote:

Yes, they seem to. I ran the program from the command line and it gave the following output:
code:
/usr/lib/control-center/gnome-settings-daemon

(gnome-settings-daemon:5750): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
<stdin>:130:14: warning: missing terminating ' character
<stdin>:130:14: warning: missing terminating ' character
<stdin>:130:14: warning: missing terminating ' character
<stdin>:130:14: warning: missing terminating ' character
<stdin>:130:14: warning: missing terminating ' character
Is that going to be a big deal, and will I have to run this every time?

I have no idea what exactly happens. I have seen gnome-setting-daemon crashing if I had LANG=ru_RU.KOI8-R, yet it runs without problems if I have LANG=C, so I had to write a wrapper script for it. With KDE you probably can just add it to autostart. Check if it will run any other gnome services (gnome-screensaver, etc.), and disable them if you need to in gnome configuration.

GringoGrande
Jul 27, 2001
Nah...

Grigori Rasputin posted:

I'm sure this has been addressed in the thread somewhere, but does anyone know how to get all the mouse buttons working for my logitech MX518 mouse? Bonus question: so that backspace navigates back for firefox? tHanks!

edit: ubuntu
I'm using a MX518. Here is the relevant snippet from my /etc/X11/xorg.conf
code:
Section "InputDevice"
    Identifier     "Configured Mouse"
    Driver         "mouse"
    Option         "CorePointer"
    Option         "Device" "/dev/input/mice"
    Option         "ZAxisMapping" "4 5"
    Option         "Buttons" "10"
EndSection
Now all the buttons are working, although they do not work as they are supposed to and need to be remapped. This can be achieved by adding the following line to your .Xmodmap
code:
pointer = 1 2 3 4 5 8 9 6 7 10 11 12 13 14

Cowboy Mark
Sep 9, 2001

Grimey Drawer
I've been having trouble trying to do something a bit simple. Well two things:

I have a bunch of files
blah1.dat, blah2.dat, etc. in a directory. I want to create a directory for each file and then move that file into it.

eg. blah1.dat moves to /blah1/blah1.dat

I've tried all sorts of various ideas but don't really know which command or how I should do it.

Second is much simpler. I have a load of extensionless files in a directory. How do I recurse through them and add .txt onto the end of each one? I tried mv * *.txt as a blind stab in the dark. Again, googling is dificult when it's hard to describe the problem, I just get mountains of unrelated information.

teapot
Dec 27, 2003

by Fistgrrl

Cowboy Mark posted:

I've been having trouble trying to do something a bit simple. Well two things:

I have a bunch of files
blah1.dat, blah2.dat, etc. in a directory. I want to create a directory for each file and then move that file into it.

eg. blah1.dat moves to /blah1/blah1.dat

I've tried all sorts of various ideas but don't really know which command or how I should do it.

code:
for i in * 
do j="`echo $i | cut -d. -f1`"
mkdir "$j" && mv "$i" "$j"
done

quote:

Second is much simpler. I have a load of extensionless files in a directory. How do I recurse through them and add .txt onto the end of each one? I tried mv * *.txt as a blind stab in the dark. Again, googling is dificult when it's hard to describe the problem, I just get mountains of unrelated information.
Exactly the same mechanism:
code:
for i in *
do j="$i.txt"
mv "$i" "$j"
done

Scaevolus
Apr 16, 2007

Cowboy Mark posted:

Second is much simpler. I have a load of extensionless files in a directory. How do I recurse through them and add .txt onto the end of each one? I tried mv * *.txt as a blind stab in the dark. Again, googling is dificult when it's hard to describe the problem, I just get mountains of unrelated information.
If you find yourself renaming files a lot (or even occasionally), you might find ren (lets you do things like ren '*' '#1.txt') or rename (has some more advanced features) useful.

Also,
code:
for i in *
do j="$i.txt"
mv "$i" "$j"
done
can be replaced by
code:
for i in *
do mv "$i" "$i".txt
done

Only Shallow
Nov 12, 2005

show
I'm trying to set up an alias in zsh to convert a directory of mp3s to WMA for custom soundtracks on my xbox.

With a bit of googling I came up with
code:
for i in $(ls *.mp3); do ffmpeg -i "$i" -acodec wmav2 -ab 128 "$i".wma;done
When I run it in a directory with, for example, "03 Tomorrow Comes Today.mp3", it will try to convert "03", "Tomorrow", "Comes", and "Today.mp3". Am I not quoting or escaping something correctly?

Vanadium
Jan 8, 2005

`ls` just prints the filenames surrounded by whitespace that gets eaten by the shell. Your quoting is fine, it just happens too late - `ls` would have to quote. You should use `for i in *.mp3` instead.

Only Shallow
Nov 12, 2005

show
Perfect. I ended up with this:
code:
mkdir ~/Desktop/WMA/${PWD##*/}/;for i in *.mp3; do ffmpeg -i $i -acodec wmav2 -ab 128k -ar 44100 -ac 2 ~/Desktop/WMA/${PWD##*/}/$i.wma;done

Harokey
Jun 12, 2003

Memory is RAM! Oh dear!
rm -rf php-5.2.4
rm: Unable to remove directory php-5.2.4/ext/standard/tests: File exists
rm: Unable to remove directory php-5.2.4/ext/standard: File exists
rm: Unable to remove directory php-5.2.4/ext: File exists
rm: Unable to remove directory php-5.2.4: File exists


What the hell does this mean? I'm root.

Those folders all show up as empty when I use ls -l also I can't move the php-5.2.4 file either.

What gives? This is in Solaris 9 on a sparc machine by the way.

EDIT: It means umount the volume and fsck it because its screwed up, problem solved.

Harokey fucked around with this message at 20:58 on Nov 5, 2007

JoeNotCharles
Mar 3, 2005

Yet beyond each tree there are only more trees.
Is this on a networked filesystem? Is it a Windows filesystem or other non-Solaris, non-Linux filesystem?

If it's networked, you may not have permission to delete even if you're root on the local machine. If it's a non-native filesystem it may not deal correctly with unlinking files that are in use, so it would complain about deleting files in use the way Windows does instead of just making them invisible and getting rid of them when the last app closes them like Unix does.

Local Yokel
Mar 16, 2005

If the moonshine don't kill me, I'll live 'till I die.
I'd like a distro recommendation.

It will be on this machine:
http://www.amazon.com/Sony-PCV-RX650-Desktop-1-6-GHz-Pentium/dp/B0000631YE

But with a better video card, and a wireless card added in.
I feel like Ubuntu 7.10 is a little too heavy for this machine (or am I crazy?).

I'd like something that actually installs on the hard-drive, not something that runs only in ram.



Ideally, I'd like it to be able to run internet explorer so that I can stream video through Netflix, as I am unable to do that on my macs, and I don't want to go buy Windows XP or Vista for something so asinine.

Any recommendations?

Scaevolus
Apr 16, 2007

Local Yokel posted:

But with a better video card, and a wireless card added in.
I feel like Ubuntu 7.10 is a little too heavy for this machine (or am I crazy?).

I'd like something that actually installs on the hard-drive, not something that runs only in ram.

Ubuntu installs on the hard drive.

DevastatorIIC
Nov 13, 2006

Dvorak- Ubuntu- KDE- and Opera-fag

Local Yokel posted:

I feel like Ubuntu 7.10 is a little too heavy for this machine (or am I crazy?).

My laptop has those specs (Pentium M instead of 4), and runs Kubuntu fine. If you really want something lighter and faster, use Xubuntu.

Adbot
ADBOT LOVES YOU

teapot
Dec 27, 2003

by Fistgrrl

Local Yokel posted:

I'd like a distro recommendation.

It will be on this machine:
http://www.amazon.com/Sony-PCV-RX650-Desktop-1-6-GHz-Pentium/dp/B0000631YE

But with a better video card, and a wireless card added in.
I feel like Ubuntu 7.10 is a little too heavy for this machine (or am I crazy?).

I'd like something that actually installs on the hard-drive, not something that runs only in ram.
Ubuntu will work just fine.

quote:

Ideally, I'd like it to be able to run internet explorer so that I can stream video through Netflix, as I am unable to do that on my macs, and I don't want to go buy Windows XP or Vista for something so asinine.

Any recommendations?

You can install ies4linux on any Linux distribution, and it will run Internet Explorer. I have no idea if Netflix streaming is going to work in that configuration, however it either works on everything or doesn't on anything -- differences between distributions have very little effect on those applications.

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