Wikipedia:Reference desk/Archives/Computing/2013 March 11
Computing desk | ||
---|---|---|
< March 10 | << Feb | March | Apr >> | March 12 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
March 11
[edit]Locked down account, Mac OS X 10.5.8
[edit]I am ignorant about OS X, so bear with me. This is a question about Mac OS X 10.5.8. What I want to do is make an account that can log in, play media on iTunes from only one prearranged folder, and log out. I don't want it to be able to read anything but the one folder of media (and whatever else is necessary just to run iTunes), and I don't want it to be able to write on anything at all, not even the media folder. Is this even possible? What's the easiest way to do this? Can I do it just by making a Standard account with parental controls and then setting permissions? That is, can I set permissions even such that the account's Home folders are not writable by the account? --Atethnekos (Discussion, Contributions) 06:56, 11 March 2013 (UTC)
- You could certainly lock down the permissions on the media folder, and I'm not sure exactly how far parental controls go. But locking down the home directory may introduce some problems, as there's always going to be things it wants to write to, and I'm not sure without testing how it would respond. It sounds like you want more of a remote player... perhaps set up iTunes music sharing and play it that way from another device. Alternatively, I guess you could create a home directory on each startup that resides in ram, like a ramdisk or tmpfs (which is different in mac/bsd than it is in linux), and then any changes to it would revert on reboot.
- If you're not so concerned about the guest user writing files, and are worried about cpu integrity, ensure they don't have administrator access (i.e. they don't belong to the admin group, or any other critical ones), and change the permissions on the media folder/files to 755 and 644, or something along those lines. There may be more elegant solutions out there, but this seems like the naive approach. Shadowjams (talk) 17:37, 11 March 2013 (UTC)
- Thanks, ShJ. I thought of another possibility: Is there a way to set permissions so that the account can't read any removable media? If I could do that, then locking down write for even the home directory would be unnecessary, as there would be no way to add new media files. --Atethnekos (Discussion, Contributions) 20:21, 11 March 2013 (UTC)
- I'm going to betray my mac ignorance (even though I have one), but I'm not sure how it handles automounting. In some *nix distributions I see a specific group with mount privileges, so if you removed the guest account from that group it might work. The real test is to plug in a device and see what permissions it automounts it with (if it mounts it at all). It's certainly easy to restrict a device's permission at mount time, and I'm sure you can set those default options. The easiest way would be to create a group that can read those for all your users you want to read a usb key, then don't give it to your guest account and adjust the default permissions. So you'd do something like set the default automount permissions to gid stuff for your new group, and make sure "any" access wasn't allowed (0770 permissions) and ensure your guest account wasn't part of that group. I'm not sure, but it might be a dirty hack to just set permissions similarly on the /media folder and do the same group thing without messing with automount settings.
- Offhand I don't know exactly how you'd do that in osx but maybe someone else here does, and I may take a stab at it later. Shadowjams (talk) 21:03, 11 March 2013 (UTC)
- You've given me some good starting points to try stuff out. Even if I don't get an optimal solution, I'm sure I can put something together now. --Atethnekos (Discussion, Contributions) 23:14, 11 March 2013 (UTC)
- Offhand I don't know exactly how you'd do that in osx but maybe someone else here does, and I may take a stab at it later. Shadowjams (talk) 21:03, 11 March 2013 (UTC)
Substitution in Excel
[edit]Is there any way to do the equivalent of {{subst:}} in Microsoft Excel? -- Ypnypn (talk) 13:26, 11 March 2013 (UTC)
- Are you looking for Replace a formula with its result? — Sebastian 19:35, 11 March 2013 (UTC)
- Yes I was, thanks! -- Ypnypn (talk) 22:53, 11 March 2013 (UTC)
Led edge lit displays
[edit]Do all led edge lit displays have light leaking on the corners? Clover345 (talk) 15:29, 11 March 2013 (UTC)
- You can cover it with a black tape. 190.60.93.218 (talk) 15:53, 11 March 2013 (UTC)
- I meant light leaking onto the screen. Like if something darks on the screen, you can see some white light reflecting off it. — Preceding unsigned comment added by Clover345 (talk • contribs) 00:18, 12 March 2013 (UTC)
Unix: echo
[edit]This should be a simple question. Under Cygwin, I am trying to run the following shell script:
var1=a var2=b echo mycommand $var1 $var2
Expected output:
mycommand a b
Actual output:
bcommand a
Why is it putting the 'b' in front, instead of concatenating it? Thank you for your help! Undergeek2013 (talk) 15:39, 11 March 2013 (UTC)
- I think whatever editor you used for the script puts CRLF at the ends of lines (the Windows standard) instead of LF (the Unix standard). Any decent programmer's editor for Windows should have an option to use Unix line endings. -- BenRG (talk) 15:56, 11 March 2013 (UTC)
dos2unix file
for a quick fix. ¦ Reisio (talk) 16:07, 11 March 2013 (UTC)
- That's it! Thanks, the quick fix works. I'm now trying to see how to change this setting in Notepad++, preferably so it does that only for the extension '.sh'. Undergeek2013 (talk) 16:14, 11 March 2013 (UTC)
- You could probably tell it to use LF endings by default for new files, and preserve endings in existing files. ¦ Reisio (talk) 16:26, 11 March 2013 (UTC)
- Yes, I just found out how to do tell it to use LF endings here: http://stackoverflow.com/questions/8195839/choose-newline-character-in-notepad. According to http://superuser.com/questions/480104/notepads-pesky-eol-format-switching-how-to-remove-the-invisible-default, Notepad++ preserves the existing EOL characters. It's still not perfect, since I use Notepad++ also to create new files for Windows. But maybe I'll just use another editor for one of the two OSs. Thanks everyone for your answers, my question has been answered, I don't want to take any more of your time with this. Undergeek2013 (talk) 16:33, 11 March 2013 (UTC)
- A useful tool is the file command, which can detect the kind of line termination in a file. For files that end with the unix normal \n it'll say "ASCII text"; for those with the DOS \r\n it will say "ASCII text with CRLF line terminators". -- Finlay McWalterჷTalk 16:46, 11 March 2013 (UTC)
- Neat, thanks! Undergeek2013 (talk) 16:52, 11 March 2013 (UTC)
- You may want to use Unix newlines for all file types, since most Windows software can cope with it (Notepad is a notable exception). FWIW, you can change the EOL convention for the current file in Notepad++ with Edit → EOL Conversion, but you would need to remember to do that for every new file that needed CRLF endings. It's also possible to configure Cygwin to transparently convert line endings by using mount with the --text option, but it's probably a bad idea because a lot of Unix software assumes that text mode = binary mode. -- BenRG (talk) 18:38, 11 March 2013 (UTC)
Computer thinks external HD is a CD drive
[edit]I had one USB2 and two USB3 external drives on my computer (A Windows 8 system). Today I added a USB3 hub into one of the two USB3 ports and plugged one of the USB3 drives and a new USB3 external drive into the hub, all after unplugging the old USB2 drive. When I plugged the USB2 drive back in, it thinks it is a CD drive. (The three USB3 drives are all OK.) I tried unplugging it and plugging it back in - same thing. What is going wrong and can it be fixed? Bubba73 You talkin' to me? 23:03, 11 March 2013 (UTC)
- Well, I unplugged it and plugged it back in again, and this time it is right (and changed drive letters). Bubba73 You talkin' to me? 01:01, 12 March 2013 (UTC)Resolved