Re: [CentOS] Getting the return value of the last command run
On Mon, May 30, 2011 at 10:38 AM, Dotan Cohen dotanco...@gmail.com wrote: All commands return a value, usually 0 if run properly. For instance, try: $ ls echo done $ lsd echo done The echo command is only executed if the ls command exited successfully. If one did not add the echo command with the after a command, how can he determine if the command exited successfully? You can check the return code. $ ls $ echo $? 0 (usually) indicates success. - Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Sorting by date
On Mon, Feb 28, 2011 at 3:35 PM, erikmccaskey64 erikmccaske...@zoho.com wrote: How could I get the output where the newest file is at the top? man ls, -t sort by modification time HTH, ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] iptables nat table rules
On Tue, Feb 8, 2011 at 1:36 PM, Carlos S neu...@gmail.com wrote: I am forwarding traffic on port 8080 to port 80 with following rule. # iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 8080 -j REDIRECT --to-port 80 # iptables-save However, I am unable to add it directly in /etc/sysconfig/iptables. I think it is used only for filter table and not nat table. So where do nat table rules go? Any help? IIANM, *filter, *nat, and *mangle demark the beginning of rules for the respective tables in the iptables file. If you don't have any rules for a given table, you may not have that marker. HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Unable to connect to wireless network
On Fri, Feb 4, 2011 at 11:15 AM, Jatin daveyja...@gmail.com wrote: Hi CentOS users Hi Jatin I just installed the CentOS 5.5 version on my toshiba laptop. I did the configuration that i had for the wireless settings but still i could not connect to my home wireless network. So someone please guide me on how i can connect my laptop to my wireless home network. I opened a browser to www.google.com and entered these terms: centos wiki wireless This was the first hit: http://wiki.centos.org/HowTos/Laptops/Wireless HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] libsrtp package anywhere?
On Wed, Jan 26, 2011 at 9:38 AM, JohnS jse...@gmail.com wrote: Hi John, Thanks for the response! On Tue, 2011-01-25 at 17:07 -0500, Bob Beers wrote: It's your build environment that's the problem. They build for el5. Clean out your build root and recreate it and do a fresh .rpmmacros file. I'm trying to understand your instructions. I think my build environment is not too bad. I build many other rpms from spec files. Most of those spec files have a line exactly like or similar to: BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) but this libsrtp.spec file does not. So it appears that at the point where DESTDIR is specified, the literal value '%{buildroot}' is used. In my trace ... make install 'DESTDIR=%{buildroot}' In yours ... make install DESTDIR=/home/ethan/rpmbuild/BUILDROOT/libsrtp-1.4.4-2.20101004cvs.el5.em2.x86_64 BTW, here is fedoraproject info on BuildRoot: [url]https://fedoraproject.org/wiki/EPEL/GuidelinesAndPolicies#BuildRoot_tag[/url] I bet I can make it work by adding a BuildRoot: line to the spec file. Where/how is %{buildroot} defined in your build environment? Are you building on a CentOS/RHEL 5.X machine? I have simplified my ~/.rpmmacros file to just these two lines: $ cat ~/.rpmmacros %_topdir/home/bbeers/redhat/ %_smp_mflags -j3 and I still get the same errors. John Wrote: /home/ethan/rpmbuild/SRPMS/libsrtp-1.4.4-2.20101004cvs.el5.em2.src.rpm Wrote: /home/ethan/rpmbuild/RPMS/x86_64/libsrtp-1.4.4-2.20101004cvs.el5.em2.x86_64.rpm Wrote: /home/ethan/rpmbuild/RPMS/x86_64/libsrtp-devel-1.4.4-2.20101004cvs.el5.em2.x86_64.rpm Wrote: /home/ethan/rpmbuild/RPMS/x86_64/libsrtp-debuginfo-1.4.4-2.20101004cvs.el5.em2.x86_64.rpm Glad to see it worked in your environment. -- Thanks, -Bob Beers ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] libsrtp package anywhere?
LOL, looks like our messages crossed in the ether, I applied a patch very similar to your suggestion: $ diff -pub libsrtp.spec libsrtp.spec.el5 --- libsrtp.spec2010-12-06 11:13:59.0 -0500 +++ libsrtp.spec.el52011-01-26 11:11:45.0 -0500 @@ -18,6 +18,8 @@ Source1: libsrtp.pc # And how does Chromium always manage to find these projects and use them? Patch0:libsrtp-1.4.4-shared.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + %description This package provides an implementation of the Secure Real-time Transport Protocol (SRTP), the Universal Security Transform (UST), an and got this result: Wrote: /home/bbeers/redhat/SRPMS/libsrtp-1.4.4-1.20101004cvs.el5.src.rpm Wrote: /home/bbeers/redhat/RPMS/i386/libsrtp-1.4.4-1.20101004cvs.el5.i386.rpm Wrote: /home/bbeers/redhat/RPMS/i386/libsrtp-devel-1.4.4-1.20101004cvs.el5.i386.rpm Wrote: /home/bbeers/redhat/RPMS/i386/libsrtp-debuginfo-1.4.4-1.20101004cvs.el5.i386.rpm Only thing I can think still to tweak is perhaps adding '--target i686' to my rpmbuild command. Thanks again, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] libsrtp package anywhere?
On Wed, Jan 26, 2011 at 11:04 AM, JohnS jse...@gmail.com wrote: On Wed, 2011-01-26 at 11:02 -0500, JohnS wrote: The problem is RPM is trying to install into the main file system whereas el5 rpm does not need an incantation like so. I mean el6 sorry.. John Yep, that make sense. For completeness, there is another mod to the spec file that is required in the %install scriptlet. patch file fc13-el5 attached. So final process was: $ rpm -ivh libsrtp-1.4.4-1.20101004cvs.fc13.src.rpm patch libsrtp.spec libsrtp.spec.fc13-el5.patch $ rpmbuild -ba libstrp.spec $ rpmbuild --rebuild --target i686 ~/redhat/SRPMS/libsrtp-1.4.4-1.20101004cvs.el5.src.rpm Now I have rpms for i686 and i386 for el5. :-D -- -Bob --- libsrtp.spec 2010-12-06 11:13:59.0 -0500 +++ libsrtp.spec.el5 2011-01-26 11:22:42.0 -0500 @@ -18,6 +18,8 @@ Source1: libsrtp.pc # And how does Chromium always manage to find these projects and use them? Patch0: libsrtp-1.4.4-shared.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + %description This package provides an implementation of the Secure Real-time Transport Protocol (SRTP), the Universal Security Transform (UST), and @@ -46,6 +48,7 @@ export CFLAGS=%{optflags} -fPIC make %{?_smp_mflags} %install +rm -rf %{buildroot} make install DESTDIR=%{buildroot} find %{buildroot} -name '*.la' -exec rm -f {} ';' pushd %{buildroot}%{_libdir} ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] libsrtp package anywhere?
On Wed, Jan 26, 2011 at 1:24 PM, JohnS jse...@gmail.com wrote: On Wed, 2011-01-26 at 11:35 -0500, Bob Beers wrote: On Wed, Jan 26, 2011 at 11:04 AM, JohnS jse...@gmail.com wrote: +rm -rf %{buildroot} Now I know you rebuild it more than one time instead of once. Well, it is recommended in the same fedoraproject reference from earlier in the thread, and I noticed I needed it when I tried to 'rpmbuild --rebuild ...' using my newly constructed el5.src.rpm. So, another alternative to the spec file modification would be an update of rpm and rpm-build packages, but I didn't see the 4.6 versions are in the vanilla repos. -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] libsrtp package anywhere?
be delighted to get it figured out sooner rather than later. Thanks for any help. -- -Bob Beers ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Binding rsyslogd to specific ip address
On Tue, Dec 14, 2010 at 8:22 AM, carlopmart carlopm...@gmail.com wrote: Hi all, Somebody knows how can I bind rsyslogd to a specific ip adress?? I have two different interfaces on a centos5.5 host and I need to bind rsyslog to only one. Hi CL, I looked here: http://wiki.rsyslog.com/index.php/Very_simple_config_--_starting_point_for_modifications and read this: -=-=-=-=-=-=-=-=- # -- Loading modules $ModLoad immark $ModLoad imudp $ModLoad imtcp $ModLoad imuxsock $ModLoad imklog # I also wanted to be able to receive syslog traffic $UDPServerAddress 0.0.0.0 $UDPServerRun 514 -=-=-=-=-=-=-=-=- Over here http://www.rsyslog.com/doc/v3compatibility.html: I read this: -=-=-=-=-=-=-=-=- The following example configures an UDP syslog server at the local address 192.0.2.1 on port 514: $ModLoad imudp $UDPServerAddress 192.0.2.1 # this MUST be before the $UDPServerRun directive! $UDPServerRun 514 $UDPServerAddress * means listen on all local interfaces. This is the default if no directive is specified. Please note that now multiple listeners are supported. For example, you can do the following: $ModLoad imudp $UDPServerAddress 192.0.2.1 # this MUST be before the $UDPServerRun directive! $UDPServerRun 514 $UDPServerAddress * # all local interfaces $UDPServerRun 1514 These config file settings run two listeners: one at 192.0.2.1:514 and one on port 1514, which listens on all local interfaces. -=-=-=-=-=-=-=-=- HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Binding rsyslogd to specific ip address
On Tue, Dec 14, 2010 at 9:16 AM, carlopmart carlopm...@gmail.com wrote: Oops sorry. I prefer to bind via tcp port, if it is possible... is it? I guess so ... you couldn't reach the links I provided? Try in rsyslog.conf: $ModLoad imtcp $TCPServerAddress 192.0.2.1 $InputTCPServerRun 514 -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Binding rsyslogd to specific ip address
On Tue, Dec 14, 2010 at 10:23 AM, carlopmart carlopm...@gmail.com wrote: On 12/14/2010 04:01 PM, Bob Beers wrote: On Tue, Dec 14, 2010 at 9:16 AM, carlopmartcarlopm...@gmail.com wrote: Oops sorry. I prefer to bind via tcp port, if it is possible... is it? I guess so ... you couldn't reach the links I provided? Try in rsyslog.conf: $ModLoad imtcp $TCPServerAddress 192.0.2.1 $InputTCPServerRun 514 Yes, I have tried, and doesn't works: MODULES #$ModLoad imuxsock.so # provides support for local system logging (e.g. via logger command) #$ModLoad imklog.so # provides kernel logging support (previously done by rklogd) #$ModLoad immark.so # provides --MARK-- message capability # Provides UDP syslog reception #$ModLoad imudp.so #$UDPServerAddress 172.25.50.26 #$UDPServerRun 514 # Provides TCP syslog reception $ModLoad imtcp.so $TCPServerAddress 172.25.50.26 $InputTCPServerRun 514 and netstat output: [r...@loghost librelp-0.1.1]# netstat -anp |grep rsyslog tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN 4446/rsyslogd unix 3 [ ] DGRAM 543447 1001/rsyslogd /dev/log Are you sure you did a 'service rsyslogd restart' after changing rsyslog.conf? Again looking at this site: http://www.rsyslog.com/doc/manual.html, specifically http://www.rsyslog.com/doc/troubleshoot.html, give these three hints on troubleshooting: 1) - Configuration Problems Rsyslog 3.21.1 and above has been enhanced to support extended configuration checking. It offers a special command line switch (-N1) that puts it into config verfication mode. In that mode, it interprets and check the configuration file, but does not startup. This mode can be used in parallel to a running instance of rsyslogd. To enable it, run rsyslog interactively as follows: /path/to/rsyslogd -f/path/to/config-file -N1 You should also specify other options you usually give (like -c3 and whatever else). Any problems experienced are reported to stderr [aka your screen (if not redirected)]. 2) - Debug Log In general, it is advisable to run rsyslogd in the foreground to obtain the log. To do so, make sure you know which options are usually used when you start rsyslogd as a background daemon. Let's assume -c3 is the only option used. Then, do the following: * make sure rsyslogd as a daemon is stopped (verify with ps -ef|grep rsyslogd) * make sure you have a console session with root permissions * run rsyslogd interactively: /sbin/rsyslogd ..your options.. -dn logfile where your options is what you usually use. /sbin/rsyslogd is the full path to the rsyslogd binary (location different depending on distro). In our case, the command would be /sbin/rsyslogd -c3 -dn logfile * press ctrl-C when you have sufficient data (e.g. a device logged a record) NOTE: rsyslogd will NOT stop automatically - you need to ctrl-c out of it! * Once you have done all that, you can review logfile. It contains the debug output. * When you are done, make sure you re-enable (and start) the background daemon! 3) - http://www.rsyslog.com/doc/debug.html HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Determine next UID number
On Wed, Oct 13, 2010 at 4:15 PM, John Kennedy skeb...@gmail.com wrote: I am more looking at what the system thinks is the next UID. Does the useradd command use this when it assigns the next UID? what about ... # useradd nextid; id -u nextid; userdel nextid -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] libsrtp package anywhere?
Hi list, I'm trying to create an asterisk 1.8 rpm with SRTP. I found mention of a libsrtp rpm, http://qutecom.ipex.cz/RPMS/srtp-1.4.4-1.i386.rpm in these instructions, http://www.voip-info.org/wiki/view/Asterisk+SRTP but it is unreachable (by me, anyway). The libSRTP source is here, http://srtp.sourceforge.net/download.html. Has this already been packaged for CentOS 5? Thanks, -Bob Beers ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] libsrtp package anywhere?
On Tue, Oct 12, 2010 at 5:52 PM, R P Herrold herr...@owlriver.com wrote: https://bugzilla.redhat.com/show_bug.cgi?id=509619 I seem to remember another packaging of this code as well I have placed a variant that builds trivially on CentOS 5 at: srtp-1.4.4-1orc.src.rpm ftp://ftp.owlriver.com/pub/local/ORC/srtp/ -- Russ herrold - /home/herrold/rpmbuild/SRPMS/srtp-1.4.4-1orc.src.rpm /home/herrold/rpmbuild/RPMS/x86_64/srtp-1.4.4-1orc.x86_64.rpm /home/herrold/rpmbuild/RPMS/x86_64/srtp-debuginfo-1.4.4-1orc.x86_64.rpm /home/herrold/rpmbuild/RPMS/x86_64/srtp-static-1.4.4-1orc.x86_64.rpm /home/herrold/rpmbuild/RPMS/x86_64/srtp-devel-1.4.4-1orc.x86_64.rpm Awesome! Thanks, -Bob Beers ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] [DRBD-user] Kernel independent DRBD packages for RHEL, CentOS and Scientific Linux
On Tue, Jun 22, 2010 at 9:03 AM, JohnS jse...@gmail.com wrote: On Mon, 2010-06-21 at 17:11 +0200, Ralph Angenendt wrote: On Mon, Jun 21, 2010 at 12:54 PM, Joseph L. Casale jcas...@activenetwerx.com wrote: This seems like duplication of effort with the CentOS people, since they already package DRBD for CentOS 5.x (and it works very well). No its not, the CentOS packages are no longer maintained... http://dev.centos.org/testing/ tells me something else (and yes, this time they will go into extras). Ralph --- The requested URL /testing/ was not found on this server. I give up... a few clicks around and I found this: http://dev.centos.org/centos/5/testing/ Is that the place? HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] script question
On Fri, Jun 11, 2010 at 10:04 AM, Jerry Geis ge...@pagestation.com wrote: Hi all, in a script if I have: VERSION=3.2.0 I can do: echo jj-$VERSION-jj and get jj-3.2.0-jj however if I do: echo jj_$VERSION_jj I get jj_ How do I get the $VERSION to work with the underscores like the dashes do. I see 4 ways: echo jj_${VERSION}_jj echo jj_$VERSION_jj echo jj-$VERSION-jj | tr '-' '_' printf jj_%s_jj $VERSION I am sure there are others. HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Unable to execute a script , Permission denied
On Tue, May 25, 2010 at 9:42 AM, Les Mikesell lesmikes...@gmail.com wrote: Bowie Bailey wrote: Jatin Davey wrote: Here is the script that i am trying to execute as a non-root user: #!/bin/sh ps -C java -o thcount /home/proc_threads/tempfile awk ' { total += $1 } END { print total } ' /home/proc_threads/tempfile here is the output when i try to execute as a non-root user: ./javathreads: line 2: /home/proc_threads/tempfile: Permission denied awk: cmd. line:1: fatal: cannot open file `/home/proc_threads/tempfile' for reading (Permission denied) The script is running, but the 'awk' line is failing to read /home/proc_threads/tempfile. What are the permissions on that file and directory? $ ls -ld /home/proc_threads $ ls -l /home/proc_threads/tempfile Unless you have some other use for the contents of tempfile, you could use a pipeline instead to avoid any permissions issue. If you don't mind, I would like to see the pipeline equivalent. :) I used an array in a similar situation, (to avoid creating tmp file) but maybe that does not scale? For this case, maybe something like this? ... #!/bin/sh OLD=$IFS IFS=$'\n' R_PS=($(ps -C java -o thcount)) IFS=$OLD # R_PS is now an array, each element is one line of the ps output for (( i = 0; i ${#r_...@]}; i++ )) ; do # Sum the desired arguments done echo $total -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Simplifying making a USB install key
On Fri, Apr 30, 2010 at 11:03 AM, m.r...@5-cent.us wrote: Ok, where/how do I submit this to the CentOS project? Here's a complete script - anyone, *please* feel free to test it, and let me know if I've missed anything. Thanks in advance. mark #!/bin/bash # ### # Author: mark roth # Date: 30 Apr. 2010 # Purpose: to create a working, bootable CentOS install on a USB key # if [[ $# 2 ]]; then echo usage: $0 devname path/to/install.iso echo Example: $0 sdb /scratch/CentOS-5.4-bin-DVD.iso echo Note: you must install livecd-tools before running this. exit fi /sbin/sfdisk -n -uM /dev/$1 EOF ,10,b,* ,,83 ; ; EOF mkfs -t vfat /dev/${1}1 mkfs /dev/${1}2 /usr/bin/livecd-iso-to-disk /scratch/CentOS-5.4-i386-LiveCD.iso /dev/${1}1 s/scratch/CentOS-5.4-i386-LiveCD.iso/${2}/ ??? mount /dev/${1}2 /mnt cp $2 /mnt/ # end ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] [OT] Small touch screens that works with CentOS
On Fri, Mar 19, 2010 at 11:26 AM, Jay Leafey jay.lea...@mindless.com wrote: On Fri, March 19, 2010 06:44, Pascal Robert wrote: Hi, We want to display on a small LCD screen next to our meeting rooms and optionally let people book the room from the panel. We looked at different providers and those solutions either works with Exchange or Lotus Notes... Since I already have code to fetch events from any CalDAV/WebDSV servers, I'm looking at building the system myself. So I'm wondering if any of you can recommend small LCD screen that works well with Linux (the app would be a full screen Web app, browser have to be Gecko or WebKit based), and even better if the screen can have « touch buttons » (so that people don't have to use a physical keyboard to book the room), that's even better. I guess my other option would be a iPad. -- Pascal Robert IMO, this sounds like an ideal application for a rooted^h^h^h^h^h^h re-purposed nook. -- -Bob Beers ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] [Possibly OT] rpm conflicts has me confused
Hi list, I can install the default ppp-2.4.4-2, but when I try to install an rpm I built from Sangoma's ppp-2.4.4.5 (using checkinstall-1.6.1) I get this error: # rpm -ivh ppp.2.4.4.5-1.eai.i386.rpm error: Failed dependencies: ppp 2.4.3-3 conflicts with kernel-2.6.18-162.2.1.el5.i686 Isn't 2.4.4.5 2.4.3-3 ??? trying this: yum localinstall ppp.2.4.4.5-1.eai.i386.rpm --nogpgcheck gives some advice: You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest and I tried each of those, but no joy. Is this an rpm bug, a checkinstall bug, or PEBKAC (problem exists between keyboard and chair)? thanks, -Bob Beers ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] [Possibly OT] rpm conflicts has me confused
On Thu, Mar 4, 2010 at 2:58 PM, Nux n...@li.nux.ro wrote: Hi Bob, building RPMs with checkinstall isn't really standard and it will cause problems. Better build from source so you avoid the rpm conflicts or ask someone here to build a proper RPM. ok, sounds like good advice ... The source is here[1], if anyone else wants to try. [1] ftp://ftp.sangoma.com/linux/utilities/ppp-2.4.4.5.tgz And this[2] is where they explain why you need their version: [2] http://wiki.sangoma.com/wanpipe-multilink-ppp -- thanks, -Bob Beers ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Bandwith limiting
On Fri, Feb 26, 2010 at 8:11 AM, Jason Pyeron jpye...@pdinc.us wrote: jpye...@pdinc.us wrote: But I do not know how to persist this. perhaps in the rc.local file? I am sure there is a proper file for this. Just like iptables, routing, etc. I am not so sure. You could make your own init script, like these guys' example[1], then use chkconfig and service to make it 'automatic'. Or you could see of tcng[2] might meet your needs. Disclaimer: I am not associated with and have not used either of these. [1] http://www.topwebhosts.org/tools/traffic-control.php [2] http://tcng.sourceforge.net/ -- HTH, -Bob Beers ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] routing multiple network cards on a single subnet
I can offer one tiny bit of help ... On Wed, Jan 20, 2010 at 11:27 AM, Frank Cox thea...@sasktel.net wrote: Incidentally, it is my current understanding that anything that I do with an ip route command will go away on a reboot, therefore if I somehow screw up the routing on this box completely all I have to do is reboot it and I'll be back to what I had before. Which is not a bad thing at the moment. Once I have this nailed down should I put the ip route commands into /etc/rc.local? Or is there a better place? man iptables-save -- -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] routing multiple network cards on a single subnet
On Wed, Jan 20, 2010 at 11:53 AM, Frank Cox thea...@sasktel.net wrote: On Wed, 2010-01-20 at 11:33 -0500, Bob Beers wrote: man iptables-save That would dump the table to a file, but what would I do with the file after that? I imagine there is a way to feed that back into the ip command and reconfigure it, but I could do that with rc.local and avoid one step. Again, I'm obviously missing something. Sorry, you're right, I'm completely off base. Forget iptables, you're asking about iproute2. You can save your ip route commands in the /etc/sysconfig/network-scripts/ directory files for each interface route-ethX. They will then be automatically called when the interface is brought up on reboot, or with 'service network restart'. IIANM, simple put all args after 'ip route add' as individual lines in the file(s). I hope this is actually helpful this time. -- -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] routing multiple network cards on a single subnet
On Wed, Jan 20, 2010 at 1:52 PM, Bob Beers bob.be...@gmail.com wrote: You can save your ip route commands in the /etc/sysconfig/network-scripts/ directory files for each interface route-ethX. They will then be automatically called when the interface is brought up on reboot, or with 'service network restart'. here's a link to a more thorough explanation: http://www.cyberciti.biz/tips/configuring-static-routes-in-debian-or-red-hat-linux-systems.html -- -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] routing multiple network cards on a single subnet
On Wed, Jan 20, 2010 at 2:20 PM, Bob Beers bob.be...@gmail.com wrote: here's a link to a more thorough explanation: http://www.cyberciti.biz/tips/configuring-static-routes-in-debian-or-red-hat-linux-systems.html ok, last word from me on the subject, really, http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.4/html/Deployment_Guide/s1-networkscripts-static-routes.html . ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Bypass Hung Applications At Boot So System Can Complete The Boot Process
On Fri, Oct 23, 2009 at 12:12 PM, Kemp, Larry larry.k...@usmetrotel.com wrote: I have a CentOS system that is hanging at boot. Sendmail takes forever (and a few other apps hang as well...mainly network apps). This has proven in the pas to be a NIC misconfiguration or a network issue. I think that is what it is on this one too. Is there a way when I see an app haning at boot to make the server stop trying to load the hung app and bring the OS up into the GI so that I get to fixing it? Thanks in advance. During the boot sequence there is a point at which you can enter an I to begin Interactive mode. From there, you can pick and choose which services/daemons to turn on. HTH, -Bob Beers ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Terminal emulation and serial ports
On Tue, Aug 25, 2009 at 9:34 AM, Robert Moskowitzr...@htt-consult.com wrote: I have to reinit a firewall that can only be done from its console port, and I do not have an XP system with Hyperterminal on it. So I went through the archive and learned that minicom could do the job for me. I installed it and went to configure it (minicom -s). I can set the speeds, but the challenge is selecting the serial device. I have a Serial-to-USB dongle, and when I connect it, the gnome hardware browser is showing a FIDI usb serial converter that was not there before connecting the dongle. But what /dev/thingee do I put into the minicom configuration? Check dmesg, but for me it's usually /dev/ttyUSB0 when I use a USB-to-serial adapter. HTH, -- -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Multiple Internet facing Nics - Gateway issue
On Fri, Jul 3, 2009 at 1:40 PM, Doug Coats dcoats...@gmail.com wrote: Adding the routes and rules to the appropriate files in network-scripts did not work. It gave me a number of errors and did not create the rules after reboot or/and network restart. You will have to show the file contents and the actual error messages to get any serious help. did not work is not enough info. I have used route-* on CentOS 5. It can work. -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] wan hdlc_ppp and IPv6
Hi list, I can successfully build the driver modules; hdlc, dlci, syncppp, and lmc from the 2.6.18-128.1.14 kernel source rpm, and have managed to create a 'wan kmod' rpm. It all works fine for IPv4, but now I need IPv6 for ppp connections, which doesn't work for me. I think I'll need to back port Krzysztof Halasa's 'ppp for generic hdlc' patches to the 2.6.18-128.1.14.el5 kernel sources. Has anyone worked on this? I have tried simply overwriting the drivers/net/wan directory with corresponding directory from more recent (2.6.25.20, 2.6.30) vanilla kernel source, but I get errors: CC [M] drivers/net/wan/hdlc.o drivers/net/wan/hdlc.c:39:31: error: net/net_namespace.h: No such file or directory drivers/net/wan/hdlc.c: In function ‘hdlc_rcv’: drivers/net/wan/hdlc.c:69: warning: initialization from incompatible pointer type drivers/net/wan/hdlc.c:71: error: ‘struct net_device’ has no member named ‘nd_net’ drivers/net/wan/hdlc.c:71: error: ‘init_net’ undeclared (first use in this function) drivers/net/wan/hdlc.c:71: error: (Each undeclared identifier is reported only once drivers/net/wan/hdlc.c:71: error: for each function it appears in.) drivers/net/wan/hdlc.c:76: error: dereferencing pointer to incomplete type drivers/net/wan/hdlc.c:77: error: dereferencing pointer to incomplete type drivers/net/wan/hdlc.c: In function ‘hdlc_proto_start’: drivers/net/wan/hdlc.c:85: error: invalid type argument of ‘-’ ... and so on. Where is the best starting point for getting these changes back-ported. I guess I need post-'ppp for generic hdlc' but pre-'net-namespace'. Is this possible? Thanks for any help/advice. -- -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] wan hdlc_ppp and IPv6
On Tue, Jun 30, 2009 at 2:56 PM, Filipe Brandenburger filbran...@gmail.comwrote: Hi, On Tue, Jun 30, 2009 at 14:24, Bob Beersbob.be...@gmail.com wrote: I think I'll need to back port Krzysztof Halasa's 'ppp for generic hdlc' patches to the 2.6.18-128.1.14.el5 kernel sources. Has anyone worked on this? I have tried simply overwriting the drivers/net/wan directory with corresponding directory from more recent (2.6.25.20, 2.6.30) vanilla kernel source, but I get errors: Instead of copying a whole subdirectory from a later kernel (which will likely not work), you can try to apply only the patch you need to the current version of the kernel. Yes, I knew this was unlikely to work. There are instructions on how to build a custom kernel based on the CentOS kernel but with additional patches here: http://wiki.centos.org/HowTos/Custom_Kernel I am familiar with this page and also the very helpful http://wiki.centos.org/HowTos/BuildingKernelModules :) I believe this is the patch you want to apply, right? http://kerneltrap.org/mailarchive/linux-netdev/2008/3/14/1165494 Yes, I've been through this thread a couple of times. There are several patches actually applied in the course of this thread. I'll go through it again and try to apply the same patches in the same order. And there are a couple other patches that show up later in the year fixing other things related to hdlc/wan. Do you know of a clever way to scan through the change logs for the relevant entries? If so, the comments on the original post on that thread suggests it works on kernels up to 2.6.22, that might end up including 2.6.18 as well, so you might have luck with that... Yes, thank you for your reply. I'll take a whack at it. -- -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Shell Script: Simple array usage = bad substitution?
On Fri, Jun 19, 2009 at 8:43 AM, James Bensley jwbens...@gmail.com wrote: Hey Guys n Gals; I have some arrays that I can't seem to expand correctly (if that's the correct word?), imagine the following example: #!/bin/bash myArray=(First Second Third) First=(Monday Tuesdays Wednesday) Second=(One Two Three) Third=(A B C) for ((i=0;i${#myarr...@]};i++)) do for ((k=0;k${#${myarray[$i...@]};k++)) # Things go bad here! do echo ${${myArray[$i]}[$k]} # I understand this line is won't work but it doesn't matter right now done done So ultimatly we shall loop round each value in the myArray array and print out the values in each array which has the same name as the value in the myArray, array. Where I have marked with a comment, the script stops with the error- : bad substitution I have looked on-line but I don't quite understand how I can correct this? I have seen other people have this error for other problems but not one like mine so I don't fully understand it? Can anyone explain to me exactly what is going wrong and how I might correct it? How about this? Avoids the c=like for loop increments and just uses the array elements for the next loop ... #!/bin/bash myArray=(First Second Third) First=(Monday Tuesdays Wednesday) Second=(One Two Three) Third=(A B C) for i in ${myarr...@]}; do for k in ${i}; do eval tmp=\${...@]} echo ${TMP} done done -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] network interface
On Tue, Dec 23, 2008 at 4:19 PM, adrian kok adriankok2...@yahoo.com.hk wrote: Hi all How can I bring up eth0:2 only ifconfig eth0:2 up is not working wouldn't it be 'ifup eth0:2' ? -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] command line escaping a dash
On Mon, Oct 20, 2008 at 11:04 AM, Craig White [EMAIL PROTECTED] wrote: I cannot figure this out... I would like to change the owner of a bunch of folders whose name begins with a dash... # chown Administrator \-BILLED\ JOBS\ -\ 1997-2002 -R chown: invalid option -- B Try `chown --help' for more information. # chown Administrator \-BILLED\ JOBS\ -\ 1997-2002 -R chown: cannot access `\\-BILLED\\ JOBS\\ -\\ 1997-2002': No such file or directory # chown Administrator -BILLED JOBS - 1997-2002 -R chown: invalid option -- B Try `chown --help' for more information. # chown Administrator '-BILLED JOBS - 1997-2002' -R chown: invalid option -- B Try `chown --help' for more information. ? maybe ... # chown -R -- Administrator '-BILLED JOBS - 1997-2002' Make sure all options are before the --, which forces end of options, IIANM. -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Shell script to list group members
Part 1: On Tue, Sep 23, 2008 at 7:37 PM, Ian Blackwell [EMAIL PROTECTED] wrote: Bob Beers wrote: grep group_name: /etc/group | cut -d: -f4 will give a comma separated list, provided group_name is a valid group name. There is one problem with this approach, which is the assumption that all users' primary group is the same as their login id - which I agree is typically the RHEL way, but it doesn't have to be the case. If however you have users with their primary group set to something other than the login id - e.g. admin or marketing - then you need to look in the /etc/passwd file as well because these users don't appear in the comma separated list outlined above. To check the /etc/passwd file, you have to determine the group id value, and then scan the /etc/passwd file looking for that value in column 4. This will give you a list of users whose primary group is the group value you're interested in. You have a valid point, but the OP's question was: I am looking for a (simple) shell command to run from a bash script that will allow me to list user accounts that belong to a particular group. Part 2: On Tue, Sep 23, 2008 at 6:43 PM, Barry Brimer [EMAIL PROTECTED] wrote: The egrep is using a leading anchor (^) to make sure the grep matches the beginning of the line. If not, and the group pattern matched as one of the users it would print those lines too .. which is probably undesirable. My instinct is that by specifying the groupname as an argument as in: 'getent group groupname', ( rather than asking for all groups with 'getent group', and then (e)grep'ing, ) that the result would not match for users in the groups list. But I may be wrong. I have not looked at the source code. But I tested on my system and I did not see the behavior you warn of. If I am correct about the getent program, then there is also the added benefit of avoiding the pipe. :-) -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Getting perl CGI programs to work on CentOS 5 server
Check your web server logs to find out what went wrong. Thanks everybody, but I still can't find the server log(s)! I've looked at /etc/httpd/conf/httpd.conf and it says the following about location of the error log: # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a VirtualHost # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a VirtualHost # container, that host's errors will be logged there and not here. # ErrorLog logs/error_log But when I look for files with the name error_log I don't see anything which looks like a (plain text) server error log file - and there is no such file in the /etc/httpd/logs directory. Where am I going wrong please? Andy maybe ... ls /var/log/httpd/*log HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos Kernel 4.7 Compile Help
On Tue, Sep 23, 2008 at 10:26 AM, Steve Moccio [EMAIL PROTECTED] wrote: Is this not the right procedure for patching the kernel? No, see http://wiki.centos.org/HowTos/Custom_Kernel. HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Shell script to list group members
On Tue, Sep 23, 2008 at 1:31 PM, Tim Alberts [EMAIL PROTECTED] wrote: So essentially, I am looking for a (simple) shell command to run from a bash script that will allow me to list user accounts that belong to a particular group. Any help is appreciated. grep group_name: /etc/group | cut -d: -f4 will give a comma separated list, provided group_name is a valid group name. HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Shell script to list group members
On Tue, Sep 23, 2008 at 7:11 PM, Tim Alberts [EMAIL PROTECTED] wrote: Barry Brimer wrote: With spaces separating groups: egrep -e '^groupname:' /etc/group | awk -F : '{ print $4 }' | sed -e 's/,/ /g' With commas separating groups: egrep -e '^groupname:' /etc/group | awk -F : '{ print $4 }' I'm sorry, I didn't specify, I'm using LDAP for user/group management. Ideally a command like 'groups' would be nice, except it would be the inverse, it would print the users in a group, not the groups a user belongs to. I guess ... ldapsearch ... (group=xyz) ... HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Shell script to list group members
On Tue, Sep 23, 2008 at 7:26 PM, Barry Brimer [EMAIL PROTECTED] wrote: Quoting Tim Alberts [EMAIL PROTECTED]: Barry Brimer wrote: With spaces separating groups: egrep -e '^groupname:' /etc/group | awk -F : '{ print $4 }' | sed -e 's/,/ /g' With commas separating groups: egrep -e '^groupname:' /etc/group | awk -F : '{ print $4 }' I'm sorry, I didn't specify, I'm using LDAP for user/group management. Ideally a command like 'groups' would be nice, except it would be the inverse, it would print the users in a group, not the groups a user belongs to. With commas separating groups: getent group | egrep -i '^groupname:' | awk -F : '{ print $4}' With spaces separating groups: getent group | egrep -i '^groupname:' | awk -F : '{ print $4}' | sed -e 's/,/ /g' ok, Barry wins. :) But, I don't think you need the egrep ... getent group groupname | ... works ok for me. -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] USB DVD drive disappearing during kickstart install.
On Thu, Sep 18, 2008 at 10:24 AM, Alex Tang [EMAIL PROTECTED] wrote: Thanks John. I'll check the BIOS on these machines. Unfortunately, i need the DVD based setup to work because sometimes i have to do this at odd places where i don't have the network infrastructure to do PXE boots. What i'm confused about is that i didn't have these problems (well, mostly) in the the 4.5 based distro (and a 3.x based distro from a while back...but that was using CDs instead of DVDs). It's only since moving to 4.6 and 4.7 that i'm seeing this consistently. Any other ideas? Maybe this is a bad idea, but can you at this point in the kickstart, unplug/replug the USB DVD drive or cycle power to the USB DVD drive to maybe 'force' the kernel to detect it? ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] link speed
On Thu, Sep 18, 2008 at 2:28 PM, Craig White [EMAIL PROTECTED] wrote: Is there a command line way to tell me whether a ethernet connection is 100 BaseT or Gigabit Ethernet? ethtool? ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Re: Is there a way to save the routing table permanently?
IIANM, you can also use /etc/sysconfig/network-scripts/route-eth*, no? Take a look at /etc/sysconfig/network-scripts/ifup-routes script. -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] openldap package compilation flags?
On Wed, Jul 16, 2008 at 6:30 PM, Johnny Hughes [EMAIL PROTECTED] wrote: tblader wrote: Hello All. How do I find out what flags were used to compile the Centos openldap-2.3.27-8.el5_2.4 rpm package? I'm specifically wondering if it was compiled with --enable-lmpasswd Thanks! If you download the SRPM and install it, then you can look at the spec file. Server is built like this: --enable-plugins \ --enable-slapd \ --enable-slurpd \ --enable-multimaster \ --enable-bdb \ --enable-hdb \ --enable-ldap \ --enable-ldbm \ --with-ldbm-api=%{ldbm_backend} \ --enable-meta \ --enable-monitor \ --enable-null \ --enable-shell \ --enable-sql=mod \ --disable-perl \ --disable-shared \ --disable-dynamic \ --enable-static \ --with-kerberos=k5only Client like this: --disable-slapd \ --disable-slurpd \ --enable-shared \ --enable-dynamic \ --enable-static \ --without-kerberos \ --with-pic Slightly OT, but related to this question and answer, I'd like to know what options are used to build the openssh-4.3p2-26.el5 package. Fetching the SRPM and exploring in there I can see the %configure section in the openssh.spec: %configure \ --sysconfdir=%{_sysconfdir}/ssh \ --libexecdir=%{_libexecdir}/openssh \ --datadir=%{_datadir}/openssh \ --with-tcp-wrappers \ --with-rsh=%{_bindir}/rsh \ --with-default-path=/usr/local/bin:/bin:/usr/bin \ --with-superuser-path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin \ --with-privsep-path=%{_var}/empty/sshd \ --enable-vendor-patchlevel=FC-%{version}-%{release} \ --disable-strip \ --without-zlib-version-check \ %if %{nss} --with-nss \ %endif %if %{scard} --with-smartcard \ %endif %if %{rescue} --without-pam \ %else --with-pam \ %endif %if %{WITH_SELINUX} --with-selinux \ %endif %if %{WITH_AUDIT} --with-linux-audit \ %endif %if %{kerberos5} --with-kerberos5${krb5_prefix:+=${krb5_prefix}} %else --without-kerberos5 %endif But many of these %if's leave me wondering what was actually used. Is there a way to query the resultant binary files for their options? -- Thanks, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] openldap package compilation flags?
On Thu, Aug 7, 2008 at 4:20 PM, Johnny Hughes [EMAIL PROTECTED] wrote: Bob Beers wrote: Slightly OT, but related to this question and answer, I'd like to know what options are used to build the openssh-4.3p2-26.el5 package. Fetching the SRPM and exploring in there I can see the %configure section in the openssh.spec: %configure \ --sysconfdir=%{_sysconfdir}/ssh \ --libexecdir=%{_libexecdir}/openssh \ --datadir=%{_datadir}/openssh \ --with-tcp-wrappers \ --with-rsh=%{_bindir}/rsh \ --with-default-path=/usr/local/bin:/bin:/usr/bin \ --with-superuser-path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin \ --with-privsep-path=%{_var}/empty/sshd \ --enable-vendor-patchlevel=FC-%{version}-%{release} \ --disable-strip \ --without-zlib-version-check \ %if %{nss} --with-nss \ %endif %if %{scard} --with-smartcard \ %endif %if %{rescue} --without-pam \ %else --with-pam \ %endif %if %{WITH_SELINUX} --with-selinux \ %endif %if %{WITH_AUDIT} --with-linux-audit \ %endif %if %{kerberos5} --with-kerberos5${krb5_prefix:+=${krb5_prefix}} %else --without-kerberos5 %endif But many of these %if's leave me wondering what was actually used. Is there a way to query the resultant binary files for their options? Not by looking at the RPM .. but you can look in the build log (if you have one). Here is the line for i386 for openssh-4.3p2-26.el5: ./configure --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/etc/ssh --libexecdir=/usr/libexec/openssh --datadir=/usr/share/openssh --with-tcp-wrappers --with-rsh=/usr/bin/rsh --with-default-path=/usr/local/bin:/bin:/usr/bin --with-superuser-path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin --with-privsep-path=/var/empty/sshd --enable-vendor-patchlevel=FC-4.3p2-26.el5 --disable-strip --without-zlib-version-check --with-nss --with-pam --with-selinux --with-linux-audit --with-kerberos5 ok, very nice! And could I get such build log by rebuilding the rpm from the SRPM? ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] OT: get files with wget
On Thu, Apr 10, 2008 at 7:39 AM, Frank Büttner [EMAIL PROTECTED] wrote: Sudev Barar schrieb: On 10/04/2008, Frank Büttner [EMAIL PROTECTED] wrote: Hello, how can I get all files from an directory of an web server. An simple wget http://www.foo.bar/sample/* will not work:( Perhaps you should do: wget -r http://www.foo.bar/sample Hm, this will download the whole www.foo.bar site:( man wget: -r -- recursive -nd -- no directories (still gets the whole site) -l N -- max level of recursion (default max is 5) -- HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 5.1 + beryl + 1440x900 -thanks!
On Mon, Apr 7, 2008 at 12:50 PM, Masters IT Gmail [EMAIL PROTECTED] wrote: a graphic card mobile intel 945gm/gu express. I have problems too when I want to change resolution to 1440x900, the menu doesn't show that option the max is 1280 or something like that, well I you could open my eyes it will be much appreciated. 915resolution might help you. here's one link, there are others, google is your friend. [1] http://www.geocities.com/stomljen/ ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Strange behavior from grep
On Fri, Mar 28, 2008 at 9:37 AM, Mário Gamito [EMAIL PROTECTED] wrote: Well, my question now is, how do I get the word 'gamito' alone from the file ? Any help would be appreciated. What are you really trying to do? grep 'gamito' file and grep -c 'gamito' file will tell you if it is present. grep -n 'gamito' file will tell you which line(s) it is on. grep -o 'gamito' file only gives you the word 'gamito' is in or not. grep -C3 'gamito' file should give 3 context lines There are also sed and awk commands which might be useful. But the real answer depends on what you will do with the info. -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] internet search (not relate to Centos)
On Mon, Mar 10, 2008 at 2:45 PM, Hiep Nguyen [EMAIL PROTECTED] wrote: hi all, i have a little problem and seek for your advice. search jade sterling on google, msn or any other, the return is: Offering surplus bar and rod, selling to the Forging Industry, CNC Machining Industry and Screw Machine Industry supplying hot rolled and cold finished i went through all my pages and can't find Offering surplus. my question is how do i remove these words??? At least on google, you can force to search for sites without specific words by prefixing a '-'. So in your example enter the following in the search bar: jade sterling -surplus -hth ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] internet search (not relate to Centos)
nevermind, obviously I misunderstood the question, sorry. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] GRabbing MAC address
On Thu, Feb 28, 2008 at 8:47 AM, Jerry Geis [EMAIL PROTECTED] wrote: I am trying to grab the mac address for eth0 on centos 5.1 with ifconfig | grep eth0 | cut -d ' ' -f 5 and I dont get anything. What am I not doing right? ifconfig | grep eth0 | cut -d ' ' -f 1 gives me eth0 but anything else like -f 2, -f 3 etc I get nothing. ifconfig -a | awk '/eth0/ {print $5}' should work even if eth0 is not 'UP' ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] bash - safely pass untrusted strings?
On Tue, Feb 26, 2008 at 10:11 AM, Benjamin Smith [EMAIL PROTECTED] wrote: In bash, given a string assignment as follows, how do I add slashes automagically, so that it can be safely passed to another program? Notice that the assignment contains spaces, single-quotes and double-quotes, maybe god-only-knows-what-else. It's untrusted data. Yet I need to pass it all *safely*. The appropriate function in PHP is addslashes(); but what is the bash equivalent? EG: short answer: single quotes will handle all characters, except single quotes. long answer: man bash the section called QUOTING may help you figure a solution. #! /bin/sh A=This isn't a \parameter\; B=`/path/to/somecommand.sh $A`; exit 0; Thanks, -Ben HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] system-config-display wrongly sets up Viewsonic VG730m monitor
On Feb 18, 2008 12:24 PM, Anne Wilson [EMAIL PROTECTED] wrote: Any advice, please? I am not an expert, but maybe ... ### Comment all HorizSync and VertSync values to use DDC: Identifier Monitor0 ModelNameMonitor 1280x1024 ### Comment all HorizSync and VertSync values to use DDC: try what it says above or, from the spec sheet, use HorizSync60.0 - 72.0 HorizSync30 - 82 VertRefresh 60.0 - 72.0 VertRefresh 56 - 75 Option dpms EndSection Section Device Identifier Videocard0 Driver nv EndSection Section Screen Identifier Screen0 Device Videocard0 MonitorMonitor0 DefaultDepth 16 SubSection Display Viewport 0 0 Depth 24 EndSubSection SubSection Display Viewport 0 0 Depth 16 EndSubSection EndSection HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Cron on certain days?
On Jan 28, 2008 2:26 PM, Scott Ehrlich [EMAIL PROTECTED] wrote: Is it possible for me to schedule cron to say run script A on the first Friday of the month, script B on the second Friday of the month, script C, etc.? I think you can make cronjob run on every Friday, and in your script check if date is 2nd (3rd) Friday. OTOH, if you specify days and day of week, I think they will both match, which is not what you want. I found this with google: http://www.computing.net/unix/wwwboard/forum/2731.html Which leads to something along these lines ... day=`date +%d` if [ $day -ge 8 -o $day -le 14 ]; then echo javascript:void(0) '2nd Friday' # do F2 elif [ $day -ge 15 -o $day -le 21 ]; then echo javascript:void(0) '3rd Friday' # do F3 fi HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Cron on certain days?
Sloppy cut-n-paste error using -o, so this is obviously wrong ... day=`date +%d` if [ $day -ge 8 -o $day -le 14 ]; then echo '2nd Friday' # do F2 elif [ $day -ge 15 -o $day -le 21 ]; then echo '3rd Friday' # do F3 fi maybe something more like this: day=$(date +%d) [[ $day -le 7 ]] echo 1st Friday do_F1 exit [[ $day -ge 8 $day -le 14 ]] echo 2nd Friday do_F2 exit [[ $day -ge 15 $day -le 21 ]] echo 3rd Friday do_F3 exit [[ $day -ge 22 $day -le 28]] echo 4th Friday do_F4 exit -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] screen locking - pam and xscreensaver
On Jan 16, 2008 3:32 PM, Scott Ehrlich [EMAIL PROTECTED] wrote: If Xwindows was to be disabled, and only tty was used, what would be the best option for ensuring the logged-in session was locked after a determined amount of inactivity If logged in to bash, TMOUT is the (seconds) setting to terminate the shell if no activity, but it is not fool-proof. For example, an open vi session will prevent the logout. HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] CentOS-5 Need Help With Serial Ports
On Dec 21, 2007 1:16 PM, James B. Byrne [EMAIL PROTECTED] wrote: When I run setserial -g ttyS* I get this: try setserial -g /dev/ttyS* BTW, what does dmesg | grep tty show? HTH, -Bob ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos