Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
On Sunday 28 February 2010 04.57:36 ubiquitous1980 wrote: If I have logged in through sudo such as $ sudo su, when I then use man pages, they are covered in ESC. This does not occur when using normal user accounts or the root account through su. Wondering what is going on. Thanks. And I have the exact opposite on one of my rigs. Viewing man pages as a normal user and it get cluttered with ESC..., but view the same page after doing a 'sudo su -' everything is OK. -- Dan Johansson, http://www.dmj.nu *** This message is printed on 100% recycled electrons! ***
Re: [gentoo-user] Is there a lock daemon for managing file locking on an NFS server? [SOLVED]
Neil Walker wrote: Amit Dor-Shifer wrote: e.g. 'lockd'? If so, which ebuild installs it? I abandoned nfs quite a while ago but, afaik, file locking is handled internally by the kernel. Be lucky, Neil http://www.neiljw.com rpc.lockd was removed starting of nfs-utils-1.1.0 (~May 2007). http://sourceforge.net/project/shownotes.php?group_id=14release_id=507588 Thanks to everyone who helped pointing me at the right direction. Amit
Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
ubiquitous1980 wrote: If I have logged in through sudo such as $ sudo su, when I then use man pages, they are covered in ESC. This does not occur when using normal user accounts or the root account through su. Wondering what is going on. Thanks. Q: Have you tried ... su - (the dash is important since it will read the environment for root login otherwise the environment will be the same as for current user). http://lists.debian.org/debian-security/2006/07/msg00059.html Best regards Peter K
Re: [gentoo-user] Re: Manual pages (man pages) have ESC all through them when having used sudo.
On Sun, 28 Feb 2010 13:06:43 +0800, ubiquitous1980 wrote: Some ENV variables are unset by sudo. You can alter that behaviour in /etc/sudoers. I have Defaults:%wheel !env_reset and don't see this. But anyway, sudo su makes zero sense :P sudo su makes sense if you want to use the root account while having the root account locked. The root account is hardly locked if you can log into it with sudo su (or sudo screen) but sudo -s or sudo -i make more sense in this situation. -- Neil Bothwick Politicians are like nappies Both should be changed regularly, and for the same reason signature.asc Description: PGP signature
Re: [gentoo-user] Re: Manual pages (man pages) have ESC all through them when having used sudo.
Neil Bothwick wrote: On Sun, 28 Feb 2010 13:06:43 +0800, ubiquitous1980 wrote: Some ENV variables are unset by sudo. You can alter that behaviour in /etc/sudoers. I have Defaults:%wheel !env_reset and don't see this. But anyway, sudo su makes zero sense :P sudo su makes sense if you want to use the root account while having the root account locked. The root account is hardly locked if you can log into it with sudo su (or sudo screen) but sudo -s or sudo -i make more sense in this situation. localhost ubiquitous1980 # passwd -l root Password changed. localhost ubiquitous1980 # exit exit ubiquitous1...@localhost ~ $ su Password: su: Authentication failure ubiquitous1...@localhost ~ $ sudo su Password: Your account has expired; please contact your system administrator su: User account has expired (Ignored) localhost ubiquitous1980 #
Re: [gentoo-user] Re: Who believes in cylinders?
On Saturday 27 February 2010 18:20:24 Etaoin Shrdlu wrote: On Saturday 27 February 2010, BRM wrote: Stage 1 focuses solely on loading Stage 2, and has historically been limited to a total size[1] to 512 bytes, It's actually less than that, because the first 64 bytes of sector 0 contain the partition table, so the maximum size of a stage1 bootloader is 510 - 64 = 446 bytes. Yep, that's why dd if=/dev/sda of=~/partition_table.img bs=446 count=1 will make you a nice back up of your partition table, while bs=512 will back up your complete MBR. -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
pk wrote: ubiquitous1980 wrote: If I have logged in through sudo such as $ sudo su, when I then use man pages, they are covered in ESC. This does not occur when using normal user accounts or the root account through su. Wondering what is going on. Thanks. Q: Have you tried ... su - (the dash is important since it will read the environment for root login otherwise the environment will be the same as for current user). http://lists.debian.org/debian-security/2006/07/msg00059.html Best regards Peter K With sudo su - the man pages do not have ESC throughout. I have learned sudo su from my ubuntu days and I am only guessing that this is bad practice and that the correct command is $ sudo su - Thanks Damien
Re: [gentoo-user] Re: dev-libs/libgamin-0.1.10-r2 fails to emerge on a multilib profile
On Saturday 27 February 2010 21:45:13 Arttu V. wrote: On 2/27/10, Mick michaelkintz...@gmail.com wrote: On Saturday 27 February 2010 19:04:09 walt wrote: On 02/27/2010 10:04 AM, Mick wrote: Hi All, I am trying to install Gentoo on a i7 x86_64 arch machine and libgamin fails when I try to emerge syslog-ng (it's a dependency of it). This is my first 64bit machine, so I am not sure if I have made more mistakes than usual (LOL). This is the error: libtool: link: x86_64-pc-linux-gnu-gcc -shared .libs/gamin.o -Wl,-rpath -Wl,/var/tmp/portage/dev-libs/libgamin-0.1.10-r2/work/gamin-0.1.10/lib gam in/.libs ../libgamin/.libs/libgamin-1.so /usr/bin /usr/sbin /bin /sbin ^ -lpthread -march=core2 -msse4 -mcx16 -msahf -Wl,-O1 -Wl,-soname -Wl,_gamin.so -o .libs/_gamin.so /usr/bin: file not recognized: Is a directory Cool, a new libtool trick. It's trying to link an object file with a directory? Dunno where the real error is, but I'd start with the old shotgun approach by running lafilefixer --justfixit and see if it helps. That was my first thought too. I ran lafixer and revdep-rebuild after emerging these and the error shown above came up. grep for pkg-config inside the config.log (and maybe build.log as well). I'm betting on pkg-config not being found, although the ebuild seems to list it as a dependency. (Maybe your chroot settings affect the path?) IIRC another package did the same for me some months ago (sorry, can't remember which). If it couldn't find pkg-config it would still complete configure phase without errors -- but cflags and libs variables that were supposed to be filled with various `pkg-config --libs foo` outputs were in fact filled with the paths from which pkg-config was searched for (in vain) during configuration. And IIRC the result looked nearly identical to the situation here. Thanks Arttu V. I will look at this when I boot next - I am trying to chainload the new install from Windows 7 to see if the error repeats outside the chroot and it is a struggle so far. Do you recall what your fix was? -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
ubiquitous1980 wrote: http://lists.debian.org/debian-security/2006/07/msg00059.html With sudo su - the man pages do not have ESC throughout. I have learned sudo su from my ubuntu days and I am only guessing that this is bad practice and that the correct command is $ sudo su - No need to guess. Messing with superuser privileges without a proper superuser environment (paths etc.) is considered bad from a security point of view; for instance, an malicious application could be installed in your user home dir, prepend the path to this to your local user $PATH and whenever you do su (without -) you could invoke this app with superuser privileges... So to summarize: The link above (debian.org) explains it quite well and yes, I would say it's a bad habit to omit -. :-) Best regards Peter K
Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
pk wrote: ubiquitous1980 wrote: http://lists.debian.org/debian-security/2006/07/msg00059.html With sudo su - the man pages do not have ESC throughout. I have learned sudo su from my ubuntu days and I am only guessing that this is bad practice and that the correct command is $ sudo su - No need to guess. Messing with superuser privileges without a proper superuser environment (paths etc.) is considered bad from a security point of view; for instance, an malicious application could be installed in your user home dir, prepend the path to this to your local user $PATH and whenever you do su (without -) you could invoke this app with superuser privileges... So to summarize: The link above (debian.org) explains it quite well and yes, I would say it's a bad habit to omit -. :-) Best regards Peter K Thanks for your explanation and I will remember this lesson.] Thanks, Damien
Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
pk wrote: ubiquitous1980 wrote: http://lists.debian.org/debian-security/2006/07/msg00059.html With sudo su - the man pages do not have ESC throughout. I have learned sudo su from my ubuntu days and I am only guessing that this is bad practice and that the correct command is $ sudo su - No need to guess. Messing with superuser privileges without a proper superuser environment (paths etc.) is considered bad from a security point of view; for instance, an malicious application could be installed in your user home dir, prepend the path to this to your local user $PATH and whenever you do su (without -) you could invoke this app with superuser privileges... So to summarize: The link above (debian.org) explains it quite well and yes, I would say it's a bad habit to omit -. :-) Best regards Peter K Investigated this further... With su, PATH=/sbin:/bin:/usr/sbin:/usr/bin With sudo su, PATH=/sbin:/bin:/usr/sbin:/usr/bin With sudo su -, PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.4:/usr/lib64/subversion/bin This final PATH is the same as my user's account. I thought that this would be the other way around, and that with $ sudo su - I would expect the normal root path as to prevent a malicious program settinga path and allowing execution without identifying its specific location at the CLI. Perhaps I am confused. Thanks Damien
Re: [gentoo-user] power management cannot change LCD brightness
Am Sonntag 28 Februar 2010 schrieb Xi Shen: hi, my system is gentoo amd64, kde 4.3. my laptop is thinkpad t61. after some configure in the kernel, and reboot with the new kernel, i can use the Fn+Home, and Fn+End to change the brightness of my lcd. but when i tried to change the lcd brightness by dragging the handle on the 'power management' tool, nothing happens. what else should i configure? It has never worked here, though I’m satisfied that I can use Fn+Crsr up/down, which works on the HW level (even at boot). -- Gruß | Greetings | Qapla' Never argue with an idiot. He brings you down to his level, then beats you with experience. signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Re: Manual pages (man pages) have ESC all through them when having used sudo.
On Sun, 28 Feb 2010 18:48:56 +0800, ubiquitous1980 wrote: The root account is hardly locked if you can log into it with sudo su (or sudo screen) but sudo -s or sudo -i make more sense in this situation. localhost ubiquitous1980 # passwd -l root Password changed. localhost ubiquitous1980 # exit exit ubiquitous1...@localhost ~ $ su Password: su: Authentication failure ubiquitous1...@localhost ~ $ sudo su Password: Your account has expired; please contact your system administrator su: User account has expired (Ignored) localhost ubiquitous1980 # What's your point? -- Neil Bothwick Windoze95 Quote: Why is the Pentium 166 so fast? - Its for booting faster, if Windows crashed again. signature.asc Description: PGP signature
Re: [gentoo-user] Re: KDE4 applications are spamming stderr to death
On Sun, 28 Feb 2010 01:11:31 +0100, Volker Armin Hemmann wrote: The same annoying thing. What is doing `kdebugdialog`? you can turn messages on and off. Turn all of them off (there is a switch for that) you are are spared all the crap. Maybe some of the crap, you still get QT messages. Try running Konqueror with everything turned off. -- Neil Bothwick Q How many screws are there in a lesbians coffin? A None. It's all tongue and groove. signature.asc Description: PGP signature
Re: [gentoo-user] power management cannot change LCD brightness
Frank Steinmetzger wrote: Am Sonntag 28 Februar 2010 schrieb Xi Shen: hi, my system is gentoo amd64, kde 4.3. my laptop is thinkpad t61. after some configure in the kernel, and reboot with the new kernel, i can use the Fn+Home, and Fn+End to change the brightness of my lcd. but when i tried to change the lcd brightness by dragging the handle on the 'power management' tool, nothing happens. what else should i configure? It has never worked here, though I???m satisfied that I can use Fn+Crsr up/down, which works on the HW level (even at boot). -- Gru?? | Greetings | Qapla' Never argue with an idiot. He brings you down to his level, then beats you with experience. Hi, fisrt see if proc and your kernel has it right, do: cat /proc/acpi/video/GFX0/DD02/brightness should give something like levels: 13 25 38 50 63 75 88 100 current: 13 if that works, check permissions on the file and try to echo a level number to it.. echo 13 /proc/acpi/video/GFX0/DD02/brightness it it changes then its down to the app, check the use flags of the app, and see whats missing. good luck -- Regards, Roundyz
Re: [gentoo-user] [SOLVED] Re: dev-libs/libgamin-0.1.10-r2 fails to emerge on a multilib profile
On Saturday 27 February 2010 21:45:13 Arttu V. wrote: On 2/27/10, Mick michaelkintz...@gmail.com wrote: On Saturday 27 February 2010 19:04:09 walt wrote: On 02/27/2010 10:04 AM, Mick wrote: Hi All, I am trying to install Gentoo on a i7 x86_64 arch machine and libgamin fails when I try to emerge syslog-ng (it's a dependency of it). This is my first 64bit machine, so I am not sure if I have made more mistakes than usual (LOL). This is the error: libtool: link: x86_64-pc-linux-gnu-gcc -shared .libs/gamin.o -Wl,-rpath -Wl,/var/tmp/portage/dev-libs/libgamin-0.1.10-r2/work/gamin-0.1.10/lib gam in/.libs ../libgamin/.libs/libgamin-1.so /usr/bin /usr/sbin /bin /sbin ^ -lpthread -march=core2 -msse4 -mcx16 -msahf -Wl,-O1 -Wl,-soname -Wl,_gamin.so -o .libs/_gamin.so /usr/bin: file not recognized: Is a directory Cool, a new libtool trick. It's trying to link an object file with a directory? Dunno where the real error is, but I'd start with the old shotgun approach by running lafilefixer --justfixit and see if it helps. That was my first thought too. I ran lafixer and revdep-rebuild after emerging these and the error shown above came up. grep for pkg-config inside the config.log (and maybe build.log as well). I'm betting on pkg-config not being found, although the ebuild seems to list it as a dependency. (Maybe your chroot settings affect the path?) IIRC another package did the same for me some months ago (sorry, can't remember which). If it couldn't find pkg-config it would still complete configure phase without errors -- but cflags and libs variables that were supposed to be filled with various `pkg-config --libs foo` outputs were in fact filled with the paths from which pkg-config was searched for (in vain) during configuration. And IIRC the result looked nearly identical to the situation here. Here's what I managed to find: There is not pkg-config in /var/tmp/portage/dev-libs/libgamin-0.1.10- r2/work/gamin-0.1.10/config.log and I couldn't find it in the emerge log either. So, I went back to plan B. I configured the Windows 7 boot loader to chainload GRUB and booted into the new system. It had no problem compiling and installing libgamin and now it is installing syslog-ng. Perhaps this was related to the sysrescue-cd environment, I haven't tried all this with the Gentoo CD. -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Re: FreeNX password vs. ssh-key
u can use nxclient w/VNC protocol. The server shall then invoke a local vnc server, log into it with a local nx client, and let you log into the local client. That way you get nx's performance over a VNC connection (sort-of). Amit I'm just wandering if it is possible to connect to existing user session not generating a new session.
Re: [gentoo-user] Re: Manual pages (man pages) have ESC all through them when having used sudo.
Neil Bothwick wrote: On Sun, 28 Feb 2010 18:48:56 +0800, ubiquitous1980 wrote: The root account is hardly locked if you can log into it with sudo su (or sudo screen) but sudo -s or sudo -i make more sense in this situation. localhost ubiquitous1980 # passwd -l root Password changed. localhost ubiquitous1980 # exit exit ubiquitous1...@localhost ~ $ su Password: su: Authentication failure ubiquitous1...@localhost ~ $ sudo su Password: Your account has expired; please contact your system administrator su: User account has expired (Ignored) localhost ubiquitous1980 # What's your point? That you stated that the root account was hardly locked if I can sudo su into it. If you take me as truthful, then you can see that I have done exactly that: locked the account and sudo su'ed into it. I think you already knew that was possible, so I am countering the semantics of the issue.
[gentoo-user] How to get KMS to set the screen resolution to that of the external monitor attached to the laptop.
Is there a way to get KMS to set the resolution to 1680 x 1050 so that I have more real estate on my external monitor. At present, the external monitor is not getting full use with parts of it blacked out to make the resolution of the laptop's screen. Thanks, Damien
Re: [gentoo-user] Re: Who believes in cylinders?
On Sun, 28 Feb 2010 13:10:02 +0100, Mick wrote about Re: [gentoo-user] Re: Who believes in cylinders?: On Saturday 27 February 2010 18:20:24 Etaoin Shrdlu wrote: On Saturday 27 February 2010, BRM wrote: Stage 1 focuses solely on loading Stage 2, and has historically been limited to a total size[1] to 512 bytes, It's actually less than that, because the first 64 bytes of sector 0 contain the partition table, so the maximum size of a stage1 bootloader is 510 - 64 = 446 bytes. Yep, that's why dd if=/dev/sda of=~/partition_table.img bs=446 count=1 will make you a nice back up of your partition table, Actually, it will backup your primary bootstrap code. Try: dd if=/dev/sda of=~/partition_table.img bs=1 skip=446 count=64 Note that you will need to be root or in the disk group (or equivalent on your system), so that you have access to /dev/sda as a raw device file. [As ever, sudo is your friend.] Also note that this backup will only contain the primary partitions and any extended partition on that disk; all the logical drives within the extended partition are mapped by secondary partition tables in their local bootstrap records (LBRs). This makes for a more complicated process to backup the complete partition table for the disk. Worse still, all of my machines have at least 4 hard drives -- some as many as 7. So this process has to be repeated for each physical disk. Many years ago I wrote an OS/2 program to handle all of this. Perhaps I should blow the dust off it, convert it to use POSIX functions and publish it as FOSS. while bs=512 will back up your complete MBR. True. -- Regards, Dave [RLU #314465] == dwn...@ntlworld.com (David W Noon) == signature.asc Description: PGP signature
Re: [gentoo-user] Re: FreeNX password vs. ssh-key
BTW, am I the only-one who can't get x2go to build? amit0 ~ # emerge -av x2goserver These are the packages that would be merged, in order: Calculating dependencies / * Please fix your package (net-misc/x2gosessionadministration-2.0.1.10) to not use kde.eclass /usr/portage/local/layman/nx/net-misc/x2gosessionadministration/x2gosessionadministration-2.0.1.10.ebuild: line 22: need-kde: command not found * Please fix your package (net-misc/x2gohostadministration-2.0.1.4) to not use kde.eclass /usr/portage/local/layman/nx/net-misc/x2gohostadministration/x2gohostadministration-2.0.1.4.ebuild: line 19: need-kde: command not found * Please fix your package (net-misc/x2gouseradministration-2.0.1.8) to not use kde.eclass /usr/portage/local/layman/nx/net-misc/x2gouseradministration/x2gouseradministration-2.0.1.8.ebuild: line 18: need-kde: command not found * Please fix your package (net-misc/x2gogroupadministration-2.0.1.4) to not use kde.eclass /usr/portage/local/layman/nx/net-misc/x2gogroupadministration/x2gogroupadministration-2.0.1.4.ebuild: line 19: need-kde: command not found * Please fix your package (net-misc/x2gosystemadministration-2.0.1.5) to not use kde.eclass /usr/portage/local/layman/nx/net-misc/x2gosystemadministration/x2gosystemadministration-2.0.1.5.ebuild: line 18: need-kde: command not found ... done! emerge: there are no ebuilds to satisfy net-misc/x2gokdebindings. (dependency required by net-misc/x2goserver-3.0.1.1 [ebuild]) (dependency required by x2goserver [argument]) Amit Nikos Chantziaras wrote: On 02/27/2010 01:52 AM, Joseph wrote: I'm installing Freenx and it will not install unless I enable in sshd_conf UsePAM yes (password authentication) What is the use use of ssh-key if I have to enable PAM? FreeNX does not support SSH keys. It only uses one for its control user. For an NX-based client/server that supports SSH keys, you might want to look at x2go instead. Furthermore, FreeNX seems to be quite inactive upstream (last update in 2008.) x2go is in the nx overlay.
Re: [gentoo-user] Re: Manual pages (man pages) have ESC all through them when having used sudo.
On Sun, 28 Feb 2010 22:03:36 +0800, ubiquitous1980 wrote: That you stated that the root account was hardly locked if I can sudo su into it. If you take me as truthful, then you can see that I have done exactly that: locked the account and sudo su'ed into it. I think you already knew that was possible, so I am countering the semantics of the issue. My point was that if you can get into it, it is not truly locked. You have prevented one means of accessing it, but not totally locked it. Anyway, sudo -i/s is a cleaner way of opening a root session IMO. -- Neil Bothwick Nothing is illegal if one hundred businessmen decide to do it. signature.asc Description: PGP signature
[gentoo-user] Re: Manual pages (man pages) have ESC all through them when having used sudo.
On 02/27/2010 08:32 PM, Dan Cowsill wrote: On Sat, Feb 27, 2010 at 10:57 PM, ubiquitous1980nixuser1...@gmail.com wrote: If I have logged in through sudo such as $ sudo su, when I then use man pages, they are covered in ESC. This does not occur when using normal user accounts or the root account through su. Wondering what is going on. Thanks. Kind of curious about this myself. It has just been a minor annoyance to me for the last couple of years, but it seems to show up only when logged onto root. There are several environment variables that affect the output of man, e.g. PAGER, LESS, LESSCOLOR, LESSOPEN, LESSIGNORE, the contents of ~/.lessfilter and probably other things I can't remember. Any of those might be different for root.
[gentoo-user] segfault on startup scripts with new install
I am booting into a new system and this is what I'm getting: :-( = * Remounting root filesystem read/write ... [OK] /sbin/rc: line 385: 1515 Segmentation fault ( local retval=; local myservice=${service}; profiling name /etc/init.d/${service}; retval=$?; if [[ ${retval} -ne 0 ]]; then eerror Failed to source /etc/init.d/${service}; return ${retval}; fi; local conf=$(add_suffix /etc/conf.d/${service}); [[ -e ${conf} ]] source ${conf}; conf=$(add_suffix /etc/rc.conf); [[ -e ${conf} ]] source ${conf}; start ) * Failed to start /etc/init.d/checkroot * One or more critical startup scripts failed to start! /sbin/functions.sh: line 207: 1541 Segmentation fault splash critical /dev/null * Please correct this and reboot ... Give root password for maintenance (or type Control-D to continue): = This is on a multi-reiser4 partition installation. What has gone wrong with it? -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] How to get KMS to set the screen resolution to that of the external monitor attached to the laptop.
Am 28.02.2010 15:05, schrieb ubiquitous1980: Is there a way to get KMS to set the resolution to 1680 x 1050 so that I have more real estate on my external monitor. At present, the external monitor is not getting full use with parts of it blacked out to make the resolution of the laptop's screen. Thanks, Damien As far as I know there is no solution for that. All my researchs showed that KMS at this time can't handle two different framebuffer resolutions in that matter that both displays use the full panel. Greetings Sebastian
Re: [gentoo-user] Re: Who believes in cylinders?
Many years ago I wrote an OS/2 program to handle all of this. Perhaps I should blow the dust off it, convert it to use POSIX functions and publish it as FOSS. Why reinvent the wheel? Just use 'sfdisk -d'. andrea
Re: [gentoo-user] Is cpufrequtils needed these days?
On Sonntag 28 Februar 2010, Mick wrote: As I am working my way through this new box I am not sure if cpufrequtils is necessary for the kernel to manage the CPU. Is this still necessary, no. I have never needed it. or is the kernel itself clever enough to manage the hardware directly these days? yes, it is. Just use the ondemand governor.
[gentoo-user] Multi-file search replace of text
Hi there, If I want to automagically replace text in a file, I can use `sed`. I don't believe that `sed` can be invoked in such a way to change the file in place, therefore two commands are necessary: $ sed 's/Project Gutenberg/Wordsworth Classics/' foo bar $ mv bar foo $ Using `grep` I can search *recursively* through directories to find the text I'm looking for. EG: `grep -R Gutenberg ~` I would like to find every instance of $foo in a directory hierarchy and replace it with $bar. Is there any tool that will combine all these operations for me? If not, what is the best way to string together grep and sed so that they'll do what I want? Many thanks for reading, Stroller.
Re: [gentoo-user] Multi-file search replace of text
On Sunday 28 February 2010, Stroller wrote: If I want to automagically replace text in a file, I can use `sed`. I don't believe that `sed` can be invoked in such a way to change the file in place, therefore two commands are necessary: $ sed 's/Project Gutenberg/Wordsworth Classics/' foo bar $ mv bar foo $ Have a look at sed's -i option. Using `grep` I can search *recursively* through directories to find the text I'm looking for. EG: `grep -R Gutenberg ~` I would like to find every instance of $foo in a directory hierarchy and replace it with $bar. Is there any tool that will combine all these operations for me? If not, what is the best way to string together grep and sed so that they'll do what I want? A starting point could be (after you make a backup of the whole tree) find /basedir -type f -exec sed -i 's/foo/bar/g' {} +
Re: [gentoo-user] Is cpufrequtils needed these days?
On Sunday 28 February 2010 18:52:02 Volker Armin Hemmann wrote: On Sonntag 28 Februar 2010, Mick wrote: As I am working my way through this new box I am not sure if cpufrequtils is necessary for the kernel to manage the CPU. Is this still necessary, no. I have never needed it. or is the kernel itself clever enough to manage the hardware directly these days? yes, it is. Just use the ondemand governor. Kewl, thanks - I already am. :-) -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Re: Who believes in cylinders?
On Sun, 28 Feb 2010 20:10:02 +0100, Andrea Conti wrote about Re: [gentoo-user] Re: Who believes in cylinders?: Many years ago I wrote an OS/2 program to handle all of this. Perhaps I should blow the dust off it, convert it to use POSIX functions and publish it as FOSS. Why reinvent the wheel? Just use 'sfdisk -d'. No reinvention required: I already have an old wheel in the garage. There are already several Linux programs that can display partition tables, and present them in a manner more useful than a dd of some bytes from the MBR: fdisk, sfdisk, parted, etc. Mine would simply be another. -- Regards, Dave [RLU #314465] == dwn...@ntlworld.com (David W Noon) == signature.asc Description: PGP signature
Re: [gentoo-user] How to get KMS to set the screen resolution to that of the external monitor attached to the laptop.
On Sun, Feb 28, 2010 at 9:05 AM, ubiquitous1980 nixuser1...@gmail.com wrote: Is there a way to get KMS to set the resolution to 1680 x 1050 so that I have more real estate on my external monitor. At present, the external monitor is not getting full use with parts of it blacked out to make the resolution of the laptop's screen. Thanks, Damien A person named Duncan running Gentoo can be found on the KDE mailing list. There is a thread about this on that list and I think there was a solution.
Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
On Sun, Feb 28, 2010 at 7:28 AM, pk pete...@coolmail.se wrote: ubiquitous1980 wrote: http://lists.debian.org/debian-security/2006/07/msg00059.html With sudo su - the man pages do not have ESC throughout. I have learned sudo su from my ubuntu days and I am only guessing that this is bad practice and that the correct command is $ sudo su - No need to guess. Messing with superuser privileges without a proper superuser environment (paths etc.) is considered bad from a security point of view; for instance, an malicious application could be installed in your user home dir, prepend the path to this to your local user $PATH and whenever you do su (without -) you could invoke this app with superuser privileges... So to summarize: The link above (debian.org) explains it quite well and yes, I would say it's a bad habit to omit -. :-) 7 years ago a veteran Linux user taught me to always use su - for the very reason you stated.
Re: [gentoo-user] Multi-file search replace of text
On 28 Feb 2010, at 19:06, Etaoin Shrdlu wrote: On Sunday 28 February 2010, Stroller wrote: ... $ sed 's/Project Gutenberg/Wordsworth Classics/' foo bar $ mv bar foo $ Have a look at sed's -i option. Using `grep` I can search *recursively* through directories to find the text I'm looking for. EG: `grep -R Gutenberg ~` I would like to find every instance of $foo in a directory hierarchy and replace it with $bar. ... A starting point could be (after you make a backup of the whole tree) find /basedir -type f -exec sed -i 's/foo/bar/g' {} + Many thanks - that looks great! My only concern is that it is unreliable enough that you state the need to backup first. ;) Stroller.
Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
On Sun, Feb 28, 2010 at 03:56:13PM -0500, stosss wrote: On Sun, Feb 28, 2010 at 7:28 AM, pk pete...@coolmail.se wrote: ubiquitous1980 wrote: http://lists.debian.org/debian-security/2006/07/msg00059.html With sudo su - the man pages do not have ESC throughout. ?I have learned sudo su from my ubuntu days and I am only guessing that this is bad practice and that the correct command is $ sudo su - No need to guess. Messing with superuser privileges without a proper superuser environment (paths etc.) is considered bad from a security point of view; for instance, an malicious application could be installed in your user home dir, prepend the path to this to your local user $PATH and whenever you do su (without -) you could invoke this app with superuser privileges... So to summarize: The link above (debian.org) explains it quite well and yes, I would say it's a bad habit to omit -. :-) 7 years ago a veteran Linux user taught me to always use su - for the very reason you stated. Actually, you are safe with either su - (without sudo) or sudo -i. sudo su - is chaining su - on top of sudo, and is redundant because sudo -i and su - do the same thing afaik. William pgpS4XXUTGw4P.pgp Description: PGP signature
Re: [gentoo-user] Re: Manual pages (man pages) have ESC all through them when having used sudo.
On Sunday 28 February 2010 07:06:43 ubiquitous1980 wrote: Nikos Chantziaras wrote: On 02/28/2010 05:57 AM, ubiquitous1980 wrote: If I have logged in through sudo such as $ sudo su, when I then use man pages, they are covered in ESC. This does not occur when using normal user accounts or the root account through su. Wondering what is going on. Thanks. Some ENV variables are unset by sudo. But anyway, sudo su makes zero sense :P sudo su makes sense if you want to use the root account while having the root account locked. Some, like Ubuntu, do it for security reasons. Not sure if they are valid, but I thought I would put this little problem out there for someone to make comment on. I use sudo su a lot,a nd make it available to other root users on my servers. It all makes perfect sense it the context of: 1. The password for the root account is secret. Changing it is a real ball- ache, something not undertaken lightly. 2. The password is know to very very few persons, and ideally would be kept in a locked safe needing signed CTO approval to open it. 3. I have a provisioning system that deploys user, their keys and password hashes. 4. The person running sudo su is authorized to do so, so he gets root. There's an audit trail too as not just anyone can get to my remote sysloggers. 5. When someone leaves, in the old days we had to manually change 100+ root passwords, and of course always forget at least one. Now I run one command on my user provisioning system and within 30 minutes that person's access is gone, and I can guarantee a) it's gone everywhere b) there are no back doors 6. Not all OSes out there support sudo -i So in the context of multi-admin servers, sudo su (or sudo -i if you will) make perfect sense, and su far less so. -- alan dot mckinnon at gmail dot com
Re: [gentoo-user] Multi-file search replace of text
On Sunday 28 February 2010, Stroller wrote: A starting point could be (after you make a backup of the whole tree) find /basedir -type f -exec sed -i 's/foo/bar/g' {} + Many thanks - that looks great! My only concern is that it is unreliable enough that you state the need to backup first. ;) The problem is that with such a command it's very easy to screw up hundreds or thousands of files (depending how many you have in the directory tree) in a non-reversible way, for example due to a slight error in the sed command. Hence the suggestion of backing up before trying. Alternatively, you can supply an extension to the -i option, as in -i.bak for example, to have sed create backup copies of the changed files (which you can then remove when you've made sure the changes have been successful).
Re: [gentoo-user] Re: [OT] attach a perl script to daemon services
On Saturday 27 February 2010 20:40:17 Harry Putnam wrote: In the back of my mind there was a reason on opensolaris, that the script would fail if the fifo was empty... Then once data comes the script isn't listening. Or syslog won't write or something similar. I also have an opensolaris box that will be using this same script. I don't want to back up and relocate all that right now... Not sure I have it remembered right either, it seems just easier to have the script check before trying to start (for portability). Solaris syslog can write to named pipes but no so readily as linux syslog. Not sure of the details now. The rest of your post seems adequately answered elsewhere. FWIW, Solaris syslogd is like other basic tools on Solaris: standards compliant in that it caters for the lowest common denominator that comprises Unix. Which is to say, almost always useless for real work. I tossed syslogd on Solaris long long ago and migrated everything to syslog- ng. The nice thing about syslog-ng is that it actually *works*, and does so predictably. -- alan dot mckinnon at gmail dot com
Re: [gentoo-user] Multi-file search replace of text
On Sun, Feb 28, 2010 at 4:41 PM, Stroller strol...@stellar.eclipse.co.uk wrote: On 28 Feb 2010, at 19:06, Etaoin Shrdlu wrote: On Sunday 28 February 2010, Stroller wrote: ... $ sed 's/Project Gutenberg/Wordsworth Classics/' foo bar $ mv bar foo $ Have a look at sed's -i option. Using `grep` I can search *recursively* through directories to find the text I'm looking for. EG: `grep -R Gutenberg ~` I would like to find every instance of $foo in a directory hierarchy and replace it with $bar. ... A starting point could be (after you make a backup of the whole tree) find /basedir -type f -exec sed -i 's/foo/bar/g' {} + Many thanks - that looks great! My only concern is that it is unreliable enough that you state the need to backup first. ;) Why are you concerned about a backup? It is always good to do backups before changing things. You never know when something might go wrong. ;)
Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
On Mon, Mar 01, 2010 at 12:16:14AM +0200, Alan McKinnon wrote: sudo su and su have a fundamental difference, vital in corporate networks: The former uses the user's password for authentication and sudoers for authorization. The latter uses knowledge of the root password for authorization and authentication. See my other post in this thread. Actually, what you just said about sudo su applies only to sudo. When you run sudo su, what you are doing is running sudo then authenticating to it, and running su, as root, after you authenticate to sudo. On the work servers I enforce sudo su Actually, you could just have people use sudo -i or sudo -s if they want a shell with root access. If they want to run a program with root privileges and the root environment, they can use sudo -i command. William pgpWv3MMggLMv.pgp Description: PGP signature
Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
On Sunday 28 February 2010 23:27:57 William Hubbs wrote: 7 years ago a veteran Linux user taught me to always use su - for the very reason you stated. Actually, you are safe with either su - (without sudo) or sudo -i. sudo su - is chaining su - on top of sudo, and is redundant because sudo -i and su - do the same thing afaik. sudo su and su have a fundamental difference, vital in corporate networks: The former uses the user's password for authentication and sudoers for authorization. The latter uses knowledge of the root password for authorization and authentication. See my other post in this thread. On the work servers I enforce sudo su OTOH, sudo su is indeed pretty pointless on a single-user machine. I never bother with sudo on this gentoo notebook for instance. -- alan dot mckinnon at gmail dot com
Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
On Monday 01 March 2010 00:57:17 William Hubbs wrote: On Mon, Mar 01, 2010 at 12:16:14AM +0200, Alan McKinnon wrote: sudo su and su have a fundamental difference, vital in corporate networks: The former uses the user's password for authentication and sudoers for authorization. The latter uses knowledge of the root password for authorization and authentication. See my other post in this thread. Actually, what you just said about sudo su applies only to sudo. When you run sudo su, what you are doing is running sudo then authenticating to it, and running su, as root, after you authenticate to sudo. You misunderstand my intent. To get root via sudo, you authenticate using the user's Unix account. The emphasis here is on what sudo does, not the intricate subtleties of what it does with the subsequent su, or any other variation of the same. I don't want to start a pointless semantic argument on this, just realize it's all about sudo and the following su is a mere example (other things could have sufficed, I used that one) On the work servers I enforce sudo su Actually, you could just have people use sudo -i or sudo -s if they want a shell with root access. If they want to run a program with root privileges and the root environment, they can use sudo -i command. William Don't read my post as literally meaning they must type the 7 characters sudo su. Read it more as use any feature of sudo you feel like to get a root shell, but you must use sudo. As opposed to using su alone. -- alan dot mckinnon at gmail dot com
[gentoo-user] Re: segfault on startup scripts with new install
On 02/28/2010 07:56 AM, Mick wrote: I am booting into a new system and this is what I'm getting: :-( * Failed to start /etc/init.d/checkroot This is on a multi-reiser4 partition installation. What has gone wrong with it? Just a guess, but have you installed sys-fs/reiser4progs or something equivalent? I vaguely recall that the fsck program for reiserfs is in that package -- but my recollection is pretty vague at this point.
Re: [gentoo-user] Dual booting Dell with Windows 7
On 17 February 2010 10:31, Willie Wong ww...@math.princeton.edu wrote: On Wed, Feb 17, 2010 at 06:58:16AM +, Mick wrote: On Wednesday 17 February 2010 01:12:08 Peter Humphrey wrote: On Monday 15 February 2010 23:45:23 Mick wrote: If I were to [tell] GRUB to chainload W7 [which} should I point it to? Dell's partition 2 which has the boot flag, or the main W7 OS partition 3? The one with W7 on it, I should have thought, as that's the one you want to start. Why not just try it? And when you find out which partition is which, why not set the bootable flag on the right one? I.e. the one with grub in it. I am not sure that I would want to do this. I recall that MSWindows used to be and it possible still is rather sensitive with needing the boot flag on its partition. Linux on the other hand is a more advanced OS which does not care where the boot flag is. If you were to go with the GRUB - W7 route, I don't think just trying out the two configurations (don't change boot flags, just try each partition) would've hurt. The worst that I can imagine is an error thrown about OS not found. Nope. I mean use the Windows 7 bootloader as the primary bootloader to chainload GRUB from the Gentoo partition. The MSWindows stays in the MBR as it is now, the GRUB is installed in the Gentoo /boot partition. MSWindows bootloader chainloads GRUB. I wish you good luck with your project. PPS. I am making some progress with this (at least in terms of googling) and will report back as soon as I have achieved this MSWindows -- chainloading -- Gentoo thing. Please do write a page on the Wiki (or at least a summary of what you did to this mailing list). This will be some handy information to have. I have now succeeded at achieving what I wanted: to use the Windows 7 boot manager (bootmgr.exe) which is the successor to NTLDR to chainload GRUB from it and so leave the Windows installation intact (at least until the warranty expires) ;-) I very briefly detail here the steps that I followed - if you need more please contact me and I will help if I can, or if I get some time I will sign up to edit a Wiki page. First the necessary WARNING: You can render your MSWindows OS unbootable and without an installation CD things can get hairy. So research the necessary steps to recover a borked MSWindows boot system using the facilities offered by the OEM *before* you start and use partimage to make a back up, just in case. There's two or three gotchas that make this more difficult than chainloading GRUB from NTLDR.exe under Win2k and WinXP: 1. Disk and partition signatures in the MBR are used by Vista and Windows 7 to find the active boot partition of MSWindows. If you move that partition then its disk offset changes and you start getting errors like winload.exe. is missing or corrupt, when what has actually happened is that the drive ID (partition signature) has changed and BCD doesn't know about it. 2. OEMs use additional partitions to save installation images for recovery purposes and they often mark these as active boot partitions. The boomgr and BCD is consequently installed there as part of the installation script - but it doesn't clearly tell you this in the BCD file (that's the new boot.ini) unless you can decipher partition ID signatures. Remove that recovery partition to save space and your MSWindows won't boot again. 3. Windows 7 uses BitLocker on the IPL in the MBR and this may introduce additional complications - you mess with the MBR and then kiss goodbye to booting your MSWindows bloatware again. My solution worked by editing the BCD file using the native editor provided by MSWindows, the bcdedit command. The winload.exe (which partly replaces NTLDR) is thereafter used normally to launch an image of the GRUB partition boot record and that of course knows where to jump to launch your Gentoo. There's no need for 3rd party boot managers - there are two or three available like Neogrub which should do the same job by offering you a GUI, but if you are capable enough to install Gentoo then you can easily find your way around the BCD file with bcdedit.exe. The main steps to achieve this solution are: 1. Install GRUB in your Linux /boot partition and capture an image of the partition boot record (it must be unmouted at the time): dd if=/dev/sda5 of=boot.lnx bs=512 count=1 2. Copy the boot.lnx file to C:\boot.lnx 3. Launch cmd.exe as administrator and call bcdedit /v which will show you something like this: C:\Windows\system32bcdedit /v Windows Boot Manager identifier {9dea862c-5cdd-4e70-acc1-f32b344d4795} device partition=\Device\HarddiskVolume2 path\bootmgr description Windows Boot Manager locale en-US inherit {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e} default
Re: [gentoo-user] Dual booting Dell with Windows 7
On Sun, Feb 28, 2010 at 11:51:21PM +, Mick wrote: Please do write a page on the Wiki (or at least a summary of what you did to this mailing list). This will be some handy information to have. I have now succeeded at achieving what I wanted: to use the Windows 7 boot manager (bootmgr.exe) which is the successor to NTLDR to chainload GRUB from it and so leave the Windows installation intact (at least until the warranty expires) ;-) rest snipped Wow. Awesome. Posts like this are why I absolutely love this mailing list. Thanks for putting this together. W -- Willie W. Wong ww...@math.princeton.edu Data aequatione quotcunque fluentes quantitae involvente fluxiones invenire et vice versa ~~~ I. Newton
Re: [gentoo-user] Manual pages (man pages) have ESC all through them when having used sudo.
On Mon, 1 Mar 2010 01:07:21 +0200, Alan McKinnon wrote: Don't read my post as literally meaning they must type the 7 characters sudo su. Read it more as use any feature of sudo you feel like to get a root shell, but you must use sudo. As opposed to using su alone. The problem with this in your situation is that you only get a log entry when the user switches to root, not for whatever they do in that root shell, whereas having them run each command with sudo logs every action they take as root. Or do you have a way of auditing the commands run from the root shell? -- Neil Bothwick Press button to test: release to detonate. signature.asc Description: PGP signature
[gentoo-user] Re: [OT] attach a perl script to daemon services
Alan McKinnon alan.mckin...@gmail.com writes: FWIW, Solaris syslogd is like other basic tools on Solaris: standards compliant in that it caters for the lowest common denominator that comprises Unix. Which is to say, almost always useless for real work. A little turn towards OT: so what are using your opensolaris machines for? The advantages of zfs?