Ivorde Unix/Linux/Database/Web/Mail Forum

View unanswered posts
View active topics
It is currently Tue Feb 07, 2012 11:33 pm


News News of Tutorials & Guides

Site map of Tutorials & Guides » Forum : Tutorials & Guides

Tutorials/Guides/Tips&Tricks/Docs/HowTos for BSD Linux and other Unix distributions

 [ Total topics 43 Go to page 1, 2, 3, 4, 5

Message
 Post subject: Linux/FreeBSD how to check ntp time synchronization
PostPosted: Tue Nov 01, 2011 4:50 pm 
Giving that a system has ntpd up&running, ntpq utility can be used to check system time synchronization:
Code:
# ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+80.96.120.251   .PPS.            1 u  984 1024  377   10.723   -0.909   1.437
+80.96.120.252   .PPS.            1 u  851 1024  377   10.800   -0.503   0.476
*80.96.120.253   .PPS.            1 u 1019 1024  377   10.611   -0.698   0.669


Man ntpq quote:
Quote:
NTPQ(8) FreeBSD System Manager's Manual NTPQ(8)

NAME
ntpq -- ...

Read more : Linux/FreeBSD how to check ntp time synchronization | Views : 302 | Replies : 3 | Forum : Tutorials for general Unix

Top
 Post subject: bash: -bash: output: cannot overwrite existing file
PostPosted: Mon Oct 31, 2011 2:03 pm 
In Bash shell, redirecting output to a existing file is not possible if the "noclobber" bash option is set.

To overcome this, use the ">|" or ">>" redirect operator. The pipe will overwrite the file if you are using single angle bracket and append if you're using double angle brackets.

How to forcely overwrite a file with output from a command:

# cat output
# echo 'output' >output
-bash: output: cannot overwrite existing file ...

Read more : bash: -bash: output: cannot overwrite existing file | Views : 253 | Replies : 0 | Forum : Tutorials for general Unix

Top
 Post subject: bash: Redirecting standard error to a shell variable and standard output to a file
PostPosted: Mon Oct 31, 2011 1:54 pm 
A little background from bashref:http://www.gnu.org/software/bash/manual/bashref.html
Quote:
3.2.4.3 Grouping Commands

Bash provides two ways to group a list of commands to be executed as a unit. When commands are grouped, redirections may be applied to the entire command list. For example, the output of all the commands in the list may be redirected to a single stream.

()
( list )

Placing a list of commands between parentheses causes a subshell environment to be created (see Command ...

Read more : bash: Redirecting standard error to a shell variable and standard output to a file | Views : 168 | Replies : 0 | Forum : Tutorials for general Unix

Top
 Post subject: Changing man path when having multiple man files from daemons with the same name
PostPosted: Thu Apr 07, 2011 1:50 pm 
When having multiple man files from multiple daemons with the same name (ie: /usr/share/man/man8/tftpd.8.gz from freebsd stock tftpd daemon and /usr/local/man/man8/tftpd.8.gz from yale-tftpd packet), the man tftpd command will show the content of the default tftpd.8.gz man page (/usr/share/man/man8/tftpd.8.gz).

Code:
# pkg_info -L freebsd*; pkg_info -L yale*
Information for freebsd-tftp-1.0:

Files:
/usr/bin/tftp
/usr/libexec/tftpd
/usr/share/man/man1/tftp.1.gz
/usr/share/man/man8/tftpd.8.gz

Information for yale-tftpd-3.0:

Files:
/usr/local/libexec/tftpd
/usr/local/man/man8/tftpd.8.gz


If you want to see the man page from yale-tftpd (/usr/local/man/man8/tftpd.8.gz), you can change ...

Read more : Changing man path when having multiple man files from daemons with the same name | Views : 523 | Replies : 0 | Forum : BSD Operating Systems

Top
 Post subject: Fix shell terminal after cat-ing a binary or echoing some encrypted content
PostPosted: Thu Mar 03, 2011 12:58 pm 
Ever had the putty/securecrt/terminal looking like this after cat-ing a binary or echoing encrypted content ?

Code:
[⎼⎺⎺├@├␤⎺⎼ ·]#
[⎼⎺⎺├@├␤⎺⎼ ·]#
[⎼⎺⎺├@├␤⎺⎼ ·]#
[⎼⎺⎺├@├␤⎺⎼ ·]# ␊␌␤⎺ '\17'
\17
[⎼⎺⎺├@├␤⎺⎼ ·]# ␊␌␤⎺ -␊ '\␊(0'


There are many solutions on the web, but not all work all the time. Here's one that worked everytime for me:
Code:
echo -e '\017'

Read more : Fix shell terminal after cat-ing a binary or echoing some encrypted content | Views : 752 | Replies : 0 | Forum : Tutorials for general Unix

Top
 Post subject: Linux - Unable to login (and authentication succeeds) - File size limit exceeded
PostPosted: Fri Oct 08, 2010 5:22 pm 
This is most probably because of the /var/log/wtmp file which, if it goes over ~4.5GB, getty processes will not be able to create virtual terminals and all sorts of login problems from here on (sshd, telnet and so on).

Read more : Linux - Unable to login (and authentication succeeds) - File size limit exceeded | Views : 938 | Replies : 3 | Forum : Tutorials for general Unix

Top
 Post subject: Normalizing terminal prompt (or putty prompt) after catting a binary file
PostPosted: Wed Aug 04, 2010 10:44 am 
Some binaries or some command output (unexpected) can contain control sequence which can cause a terminal to interpret it as changing character set. That's why the prompt becomes unreadable and keystrokes abnormal (lines).

To fix this, there are few possible solutions:
Code:
$ echo -e '\017'

or
Code:
$ reset
(NOT REBOOT)
or
Code:
$ stty sane

Read more : Normalizing terminal prompt (or putty prompt) after catting a binary file | Views : 502 | Replies : 1 | Forum : Tutorials for general Unix

Top
 Post subject: CentOS Apache 2.2.3 Directory index forbidden by Options directive
PostPosted: Thu Jul 29, 2010 6:34 pm 
After installing Apache 2.2.3 on Centos 5.5, adding virtual domains with Directory indexes will not be possible and the apache welcome page will be displayed if there isn't an index file in the root directory of the vhost.

Quote:
Directory index forbidden by Options directive


This behavior can be fixed by editing /etc/httpd/conf.d/welcome.conf and change it from:
Code:
<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>


to
Code:
<LocationMatch "^/+$">
    Options Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>
...

Read more : CentOS Apache 2.2.3 Directory index forbidden by Options directive | Views : 3302 | Replies : 0 | Forum : Linux Distributions

Top
 Post subject: FreeBSD - Can't locate Mail/Header.pm in @INC (@INC contains:
PostPosted: Thu Jul 29, 2010 10:00 am 
While running the cyrus2courier perl script, I ran into the following error:
Quote:
# /usr/bin/perl /tmp/maildir2cyrus-uid-internaldate
Can't locate Mail/Header.pm in @INC (@INC contains: /usr/local/lib/perl5/5.8.8/BSDPAN /usr/local/lib/perl5/site_perl/5.8.8/mach /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 .) at /tmp/maildir2cyrus-uid-internaldate line 60.
BEGIN failed--compilation aborted at /tmp/maildir2cyrus-uid-internaldate line 60.



For this, the perl MailTools module is needed.

To install Mail-Tools perl module on FreeBSD:
# make install -C /usr/ports/mail/p5-Mail-Tools
===> License check disabled, port has not defined LICENSE
=> MailTools-2.06.tar.gz doesn't seem to ...

Read more : FreeBSD - Can't locate Mail/Header.pm in @INC (@INC contains: | Views : 838 | Replies : 0 | Forum : BSD Operating Systems

Top
 Post subject: Invalid command 'AddHandler', perhaps misspelled or defined by a module not included in the server..
PostPosted: Thu Jul 22, 2010 9:30 pm 
Quote:
Syntax error on line 428 of /opt/apache-2.2.15_9/etc/apache22/httpd.conf:
Invalid command 'AddHandler', perhaps misspelled or defined by a module not included in the server configuration


I started compiling apache from scratch (I removed almost all the modules). The error above was expected when installing php module.

Fix is to use apche APXS utility to install modules without recompiling apache:

Code:
# /opt/apache-2.2.15_9/sbin/apxs -c -i mod_mime.c


Caution: Use apxs from the version of Apache you want the module ...

Read more : Invalid command 'AddHandler', perhaps misspelled or defined by a module not included in the server.. | Views : 1873 | Replies : 0 | Forum : Tutorials for general Unix

Top
 [ Total topics 43 Go to page 1, 2, 3, 4, 5


Last 10 active topics


Apache, Nginx, Lighttpd and other web server software

No new posts Nginx + php-fpm setting php upload_max_filesize and other php values per vhost
View the latest post

Mysql

No new posts Mysql> how to store select Zulu / UTC timestamp in database
View the latest post

TCP/IP Networking

No new posts Quagga ospf neighbour stuck in ExStart/DROther state
View the latest post

FTP, Scp, Sftp, Rsync

No new posts How to disable anonymous access in samba 3
View the latest post

Package and Software Management

No new posts "checking for libnet_build_ip in -lnet... no"+"ERROR! Libnet library not found"
View the latest post

Server and Network Security

No new posts CentOS Install Nemesis packet crafting tool + Libnet
View the latest post

Tutorials for general Unix

No new posts Using curl to get the HTTP response from an HTTP server
View the latest post
No new posts Linux - Unable to login (and authentication succeeds) - File size limit exceeded
View the latest post
No new posts Linux/FreeBSD how to check ntp time synchronization
View the latest post

Memory, Storage, Backup and Filesystems

No new posts Mdadm - Linux software RAID
View the latest post

Login

Username:   Password:   Log me on automatically each visit  

Statistics

Statistics

Total posts 188 | Total topics 681 | Total members 827



News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC + 2 hours [ DST ]

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
DAJ Glass 2 template created by Dustin Baccetti

phpBB SEO