Posts Tagged ‘content’
Monday, August 8th, 2011
I’ve recently built new mail qmail server with vpopmail to serve pop3 connectins and courierimap and courierimaps to take care for IMAP IMAPS.
I further used telnet to test if the Linux server pop3 service on (110) and imap on (143) worked fine, straight after the completed qmail install.
Here is how to test mail server with vpopmail listening for connections on pop3 port :
debian:~# telnet mail.mymailserver.com 110
Trying 111.222.333.444...
Connected to mail.mymailserver.com.
Escape character is '^]'.
+OK <2813.1312745988@mymailserver.com>
USER hipo@mymailserver.com
+OK
PASS here_goes_my_secret_pass
+OK
LIST
1 309783
2 64053
3 2119
4 64357
5 317893
RETR 1
My first mail content retrieved with RETR commandgoes here ....
quit
+OK
Connection closed by foreign host.
You see I have 5 messages in my mailbox, as you can see I used RETR command to check the content of my mail, this is handy as I can read my mails straight with telnet (if the mail is in plain text), of course it’s a bit more complicated if I have to read encrypted or html mail, though still its easy to write a tiny parser and pipe the content produced by telnet command to lynx or some other text based browser.
Now another sys admin handy tip is the use of telnet to check my mail servers IMAP servers is correctly operating.
Here is how:
debian:~# telnet mail.mymailserver.com 143
Trying 111.222.333.444...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2010 Double Precision, Inc. See COPYING for distribution information.
01 LOGIN hipo@mymailserver.com here_goes_my_secret_pass
A OK LOGIN Ok.
02 LIST "" *
* LIST (Unmarked HasNoChildren) "." "INBOX"
02 OK LIST completed
03 SELECT INBOX
* FLAGS (Draft Answered Flagged Deleted Seen Recent)
* OK [PERMANENTFLAGS (* Draft Answered Flagged Deleted Seen)] Limited
* 5 EXISTS
* 5 RECENT
* OK [UIDVALIDITY 1312746907] Ok
* OK [MYRIGHTS "acdilrsw"] ACL
03 OK [READ-WRITE] Ok
04 STATUS INBOX (MESSAGES)
* STATUS "INBOX" (MESSAGES 5)
04 OK STATUS Completed.
05 FETCH 1 ALL
...
06 FETCH 1 BODY
...
07 FETCH 1 ENVELOPE
...
As you can see according to standard to send commands to IMAP server from console after a telnet connection you will have to always include a command line number like 01, 02, 03 .. etc.
Using such a line numbering is not obligitory and also letters like A, B, C could be use still line numbering with numbers is generally a good idea since it’s easier for reading on the screen.
Now line 02 shows you available mailboxes, line 03 SELECT INBOX selects the imap Inbox to be further operated with, 04 STATUS INBOX cmd displays status about current mailboxes in folder.
FETCH 1 ALL instructs the imap server to get list of all IMAP message headers. Next command in line 05 FETCH 1 BODY will display the message body of the first message in list.
The 07 FETCH 1 ENVELOPE will display the mail headers for the 1 message.
Few other IMAP commands which might be helpfun on connection are:
08 FETCH 1 FULL
09 FETCH * FULL
First one would fetch complete content of a message numbered one from the imap server and the second one 09 FETCH * FULL will get all the mail content for all messages located on the remote IMAP server.
The STATUS command aforementioned earlier could take the following list of arguments:
MESSAGES, UNSEEN, RECENT UIDNEXT UIDVALIDITY
These commands are a gold mine for me as a sysadmin as it helps quickly solve problems, hope they would help to somebody out there as well 😉
This way is a way shorter than bothering each time to check, if some customer e-mail account is improperly configured by creating setting up a new account in Thunderbird.
Tags: acl, ALL, bit, care, cmd, com, content, course, Deleted, double precision, Draft, first mail, FULL, handy tip, hipo, host, html mail, imap, imaps, Linux, linux server, Lynx, mail content, mail server service, mail servers, new mail, parser, PASS, pop, pop mail server, precision inc, quot, RETR, server pop3, starttls, sys admin, Telnet, text, vpopmail
Posted in Linux, Postfix, Qmail, System Administration | 2 Comments »
Monday, March 19th, 2012 One of the company Debian Lenny 5.0 Webservers, where I'm working as sys admin sometimes stops to properly server HTTP requests.
Whenever this oddity happens, the Apache server seems to be running okay but it is not failing to return requested content
I can see the webserver listens on port 80 and establishing connections to remote hosts – the apache processes show normally as I can see in netstat …:
apache:~# netstat -enp 80
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 xxx.xxx.xxx.xx:80 46.253.9.36:5665 SYN_RECV 0 0 -
tcp 0 0 xxx.xxx.xxx.xx:80 78.157.26.24:5933 SYN_RECV 0 0 -
...
Also the apache forked child processes show normally in process list:
apache:~# ps axuwwf|grep -i apache
root 46748 0.0 0.0 112300 872 pts/1 S+ 18:07 0:00 \_ grep -i apache
root 42530 0.0 0.1 217392 6636 ? Ss Mar14 0:39 /usr/sbin/apache2 -k start
www-data 42535 0.0 0.0 147876 1488 ? S Mar14 0:01 \_ /usr/sbin/apache2 -k start
root 28747 0.0 0.1 218180 4792 ? Sl Mar14 0:00 \_ /usr/sbin/apache2 -k start
www-data 31787 0.0 0.1 219156 5832 ? S Mar14 0:00 | \_ /usr/sbin/apache2 -k start
In spite of that, in any client browser to any of the Apache (Virtual hosts) websites, there is no HTML content returned…
This weird problem continues until the Apache webserver is retarted.
Once webserver is restarted everything is back to normal.
I use Apache Check Apache shell script set on few remote hosts to regularly check with nmap if port 80 (www) of my server is open and responding, anyways this script just checks if the open and reachable and thus using it was unable to detect Apache wasn't able to return back HTML content.
To work around the malfunctions I wrote tiny script – retart_apache_if_empty_content_is_returned.sh
The scripts idea is very simple;
A request is made a remote defined host with lynx text browser, then the output of lines is counted, if the output returned by lynx -dump http://someurl.com is less than the number returned whether normally invoked, then the script triggers an apache init script restart.
I've set the script to periodically run in a cron job, every 5 minutes each hour.
# check if apache returns empty content with lynx and if yes restart and log it
*/5 * * * * /usr/sbin/restart_apache_if_empty_content.sh >/dev/null 2>&1
This is not perfect as sometimes still, there will be few minutes downtime, but at least the downside will not be few hours until I am informed ssh to the server and restart Apache manually …
A quick way to download and set from cron execution my script every 5 minutes use:
apache:~# cd /usr/sbin
apache:/usr/sbin# wget -q https://www.pc-freak.net/bscscr/restart_apache_if_empty_content.sh
apache:/usr/sbin# chmod +x restart_apache_if_empty_content.sh
apache:/usr/sbin# crontab -l > /tmp/file; echo '*/5 * * * *' /usr/sbin/restart_apache_if_empty_content.sh 2>&1 >/dev/null
Tags: address state, apache processes, apache server, apache webserver, apache2, apacheroot, Auto, checks, child processes, client, client browser, content, cron, Draft, enp, everything, grep, HTML, HTTP, internet connections, lenny, Lynx, nmap, oddity, program, proto, Restart, restart apache, root, script, scripts, Shell, shell script, show, spite, ss, SYN, User, Virtual, virtual hosts, webservers, weird problem
Posted in System Administration, Web and CMS | 7 Comments »
Tuesday, March 6th, 2012 Facebook is usually praised and very seldom criticized. I've seen already on a couple of occasions on the TV channel news on earthquake occasions or some kind of other calamities, where facebook was said to help the rescuing teams etc. We constantly hear how facebook has helped people point their location in disastrous situations or just helping people organize a protest against a harmful company activity. Whilst this might be true, the harms it does are quite big as well. A primary harm it does is to economy as we know it. As people are engaged in filling in Mark Zuckerberg and facebook investors pockets, they rarely think about how actually facebook gets their money?
Let me explain:
Basicly facebook makes money out of its constantly increased social network data content. This could have not been possible without the 800 000 000+ million of people who constantly post updates on facebook, create groups, post pictures, add likes, comment and post links to other facebook pages. If people had not all this volunteers (facebook users) to post all this bunch of mostly junky information, facebook inc. would not have a penny. Therefore what makes facebook grow is the people itself who willingly choose to be part of this money making machine. One would think with regular company the investors are the owners of the company shares. This classical business model is not facebook model, there it is rather different as the real investors in facebook are not the capital shareholders but the regular social network user base – this means (you and me)!.
For all those who still don't get what I'm talking about I will shortly explain.
Everyone who has a basic idea on how internet advertising works is aware that the primary origin for facebook todays profit is the left pane sky scraper field with ever changing advertisements.
Various advertisers pays facebook all the time big money for displaying those stupid advertisement. As many peole are viewing and clicking the advertisements, facebook makes billions out if its advertisers.
So far so good, facebook generates its profits out of peoples free time and delibarately information sharing you would say and you might argue me that facebook steals people (time / money). This would have been true if you don't put in the picture for a contrast, a regular blogger, who makes its daily living out of blogging.
What a regular blogger does is frequent blogging on various kind of topics of his interest. Various bloggers blog at various titles, but most of them has a few major topics which they're following.
The more articles a blogger collects and the higher the uniqueness of this information is the bigger the probability this blog to have a good users base and the more interesting content it will have for search engine robots like Google Bot Crawlers or Yahoo Bot etc. etc.
With all priod said, the higher the probability this blog to have more traffic drawn from web searches to the blog. As the blogger content increases with time when it gets 10000 or more unique articles (pages), consequently it can be used as an advertising place. A 10000 pages blog could earn a person a few hundred of euros (200, 300 EUR) per month.
Well the business scheme behind facebook is exactly the same, except they store and physically own the data of the facebook registered persons. The user posts content on his facebook wall, makes pages or does various activities which generate pages, the content gets indexed in Google and with time the overall facebook website content grows. As new users joins facebook with the increased popularity of website. The website is growing exponentially like in a atoms chain reaction.
Because of this steady content growth, it becomes an interesting place not only for advertisers but for all kind of people that use the internet.
And there you have the monetarization facebook makes billions of dollars every second because of you. This is the shocking truth, they get their money because people click or view advertisement on each others profile, so there you're YOU make the little people who develop facebook and the original investors richer and richer with every day, where you make yourself poorer and poorer by investing your personal time in facebook instead of using it to work on something that will potentially generate you some dividents in short or long future.
Actually social network is nothing more than just a multiple blogging platform, but some marketing person come with this marketing hype work "social network".
The social network buzz word is in my view just another big marketing "white lie"!. Correct me if i'm wrong but what in fact is a "Social network?". I don't see facebook neither as social, network as network. I don't know about you but I have never made a long lasting friend or relationship using facebook so far. I think the poor Facebook creator Zuckerberg made facebook with a viral mindset. He intended it to be like a social virus and so far he succeed pretty much. I just wait and eager to see who will start the anti-virus for Zuckerberg's (facebook) – people time eating virus.
Tags: advertisements, advertisers, advertising works, Auto, billions, blogger, business model, calamities, capital, channel news, company shares, content, contrast, data content, disastrous situations, Draft, earthquake, economy, Engine, everyone, facebook, information, interest, internet advertising, junky, left pane, location, machine, mark zuckerberg, network content, occasions, peole, person, picture, place, pockets, profits, Search, shareholders, sky, sky scraper, time, tv channel, volunteers
Posted in Business Management, Entertainment, Everyday Life, Various | No Comments »
Friday, December 3rd, 2010 ‘ve used the RSForms to build some custom Joomla Contact forms.
The RSForms was recommended to me by a friend and actually it’s a pretty cool and quick way to create forms.
I’ve installed it and played a bit with it to create a custom forms for one of the website I had to bring up just recently.
After the contact form was ready however there was a problem with sending emails. It took me quite a while to find out how to solve the problemwith contact not able to mail whatever is filled in.
First time I tried the RSForms after filling in the details and pressing the submit button,I got the error message;
Could not instantiate mail function.
I should say that, I’m running a QMAIL email server on the server where I have the Joomla & RSForms installed and configured.
I’ve came up with a solution to this issue after some research in Google
In order to solve that you will have to login to your Joomla administrator and
Navigate to:
Site -> Global Configuration -> Server
Whenever it opens up you should be seing the Mail Settings on the bottom right corner;
From there you will have to change the Mailer from PHP Mail Function to SMTP Server
To give you a better idea check out the screenshot of the Mail Settings below:
Changing this simple setting resolved the Could not instantiate mail function for me.
Right after I tested the RSForms to send my filled in form content but this time the PHPMAILER_RECIPIENTS_FAILED message was there;
This error was caused actually by a mistake I made in the configuration of the Custom RSForm I have prepared;
In Components -> RSForm!Pro -> Manage forms whenever I was preparing my form I’ve made a mistake in the User Emails customized field in my custom prepared form in the To: field I had a wrong variable set (a different value was set from the E-mail caption I’ve set on).
Solving this solved the issue. Even though the PHPMAILER_RECIPIENTS_FAILED was gone now, next I was unpleasently surprised by another error message which prevented the Contact form to properly send the input data:
Now I had to fight with the error;
PHPMAILER_FROM_FAILED
It took me a while and a lot of forums reading before I figure it out again my custom prepared RSForm had an issue;
The problem was in the Admin Emails customization of the form in the From: fill in box I had mistakenly typed in proper email, setting a proper email there solved the issue;
I’ve red online many suggested solutions to the issue which dealt with changes in the the file joomla/components/com_contact/controller.php around line 112, 162 etc.
I should say that before I found and solved the actual problem I’ve tried modifing this file also but with zero success.
Sometimes Linux is so complicated, it really pisses me of, why is not life easier? 😐
Tags: amp, bottom right corner, Button, Components, contact forms, content, cool, custom, email server, Emails, error message, file, form, function, Global, global configuration, google, How to fix "Could not instantiate mail function", login, mail function, mail settings, Manage, mistake, php, phpmailer, PHPMAILER_RECIPIENTS_FAILED and PHPMAILER_FROM_FAILED on Joomla and RSforms, problemwith, RECIPIENTS, screenshot, site, time, User, value
Posted in Joomla, Programming, System Administration, Various | 2 Comments »
Tuesday, May 31st, 2011 This content editor is really awesome compared to the default editor TinyMCE. If you want to have an options rich content editor for Joomla, then this is the one for you 🙂
download JCE Content Editor here
After installing the JCE Joomla content editor in order to enable it as a default editor you need to go to the following location:
Site -> Global Configuration -> Default WYSIWYG Editor
There place on Editor TinyMCE and change it with Editor – JCE
Now go to edit some article, and you will see the difference in the editor 🙂
7. Add gallery Joomla capabilities with sigplus (Image Gallery Plus) and Very Simple Image Gallery
sigplus Image Gallery Plus is a straightforward way to add image or photo galleries to a Joomla article with a simple syntax. It takes a matter of minutes to set up a gallery but those who are looking for a powerful gallery solution will not be disappointed either: sigplus is suitable for both beginner and advanced users.
Tags: beginner, capabilities, Configuration, content, content editor, default editor, download, EditorThere, gallery, Global, global configuration, Image, image gallery, JCE, location, location site, matter, matter of minutes, nbsp, order, photo, photo galleries, place, Plus, site, solution, syntax, TinyMCE, way, WYSIWYG
Posted in Joomla, Various, Web and CMS | 1 Comment »
Thursday, February 2nd, 2012 I'm managing few wordpress installations which requires me to type in:
Hostname , FTP Username and FTP Password , every single time a plugin update is issued and I want to upgrade to the new version.
Below is a screenshot of this annoying behaviour:
As you can see in the above screenshot, there is no way through Update Plugins web interface to store the password permanently. Hence the only option to store it permanently is to manually edit wp-config.php (file located in wordpress docroot, e.g. /path/to/wordpress/wp-config.php , inside the file find the line:
define ('WPLANG', '');
Right after it put a code similar to:
define('FS_METHOD', 'ftpsockets');
define('FTP_BASE', '/path/to/wordpress/');
define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');
define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/');
define('FTP_USER', 'Username');
define('FTP_PASS', 'Password');
define('FTP_HOST', 'localhost');
Change the above defines:
path/to/wordpress/ – with your wordpress location directory.
Username and Password – with your respective FTP username and password. The localhost
That's all, from now onwards the User/Password prompt will not appear anymore. Consider there is a security downside of storing the FTP User/Pass in wp-config.php , if someone is able to intrude the wordpress install and access the documentroot of the wordpress install he we'll be able to obtain the ftp user/pass and log in the server directly via FTP protocol.
Tags: Auto, base path, behaviour, config, content, documentroot, downside, Draft, file, g path, host, line, localhost, location, location directory, password, Path, php, plugin, Protocol, screenshot, security, someone, time, type, update, User, version, way, web interface
Posted in System Administration, Web and CMS, Wordpress | 1 Comment »
Tuesday, February 14th, 2012 I had to setup a QMAIL auto reply (Out of the Office) message on 5 email addresses and since I haven't done it for a long time it took me a couple 20 minutes to consult Qmail (Life With Qmail http://lifewithqmail.org (great website!) documentation and read a couple of online forum threads until I finally remembered, how I used to be setting up a vacation message manually via qmail's .qmail file.
Of course Setting qmail auto reply can always be done via QmailAdmin or VQadmin .. – Qmail Vpopmail web frontends however on many Qmail mail servers Qmailadmin or/and VQadmin is absent due to some reason or even on a big mail servers the server doesn't run Apache at all. Hence it is good to know how to set qmail vacation message directly via plain SSH terminal connection and this is why how this article got born.
So here is how I enable qmail auto reply "manually", through .qmail for my email address info@my-email-domain.com:
1. Set a /var/vpopmail/domains/my-email-domain.com/info/.qmail file with the following content:
| /usr/bin/autorespond 86400 3 /home/vpopmail/domains/my-email-domain.com/info/vacation/message /home/vpopmail/domains/my-email-domain.com/info/vacation
2. Create /home/vpopmail/domains/my-email-domain.com/info/vacation directory
linux:~# mkdir -p /home/vpopmail/domains/my-email-domain.com/info/vacation/
3. Create /home/vpopmail/domains/my-email-domain.com/info/vacation/message file with auto reply message
First create the message file with touch command:
linux:~# touch /home/vpopmail/domains/my-email-domain.com/info/vacation/message
Then put with vim or mcedit etc. an auto-reply vacation message similar to the sample below:
From: info@cadiainsurance.com
Subject: We have received your message. Thank you!
Dear Customer, we thank you for the interest in our services.
A member of our team will reply promptly to your enquiry shortly.
4. Set proper permissions for vacation/message and .qmail files
/home/vpopmail/domains/my-email-domain.com/info/vacation/message and /home/vpopmail/domains/my-email-domain.com/info/.qmail files has to be owned by user/group vpopmail:vchkpw, e.g.:
linux:~# chown -R vpopmail:vchkpw /home/vpopmail/domains/my-email-domain.com/info/vacation
linux:~# chown vpopmail:vchkpw /home/vpopmail/domains/my-email-domain.com/info/.qmail
If you are a qmail administration with the requirement to create auto reply message for employees going on a holiday often (in a middle sized company office), setting up the out of the office auto reply manually one by one is a time consuming, annoying task and "crazy" task. Therefore some time ago while still I was employed in a Bulgarian mid-sized company called Design.BG, I've written a tiny shell script which creates qmail email users vacation messages by passing few arguments.
Here is my create_vpopmail_vacation.sh shell script
Note that this script might have a lot of bugs and is not much tested, so read it carefully and test it before you put it for daily use 😉
Happy Hacking! 😉
Tags: address info, apache, auto reply, autorespond, com, connection, content, course, dear customer, doesn, email addresses, email domain, enquiry, file, forum threads, info, life, long time, mail servers, mcedit, message file, message home, office message, processing, proper permissions, qmailadmin, quot, reason, reply message, script, Set, Shell, terminal, terminal connection, time, vacation directory, vacation message, vim, vqadmin, website documentation
Posted in FreeBSD, Linux, Qmail, System Administration | 1 Comment »
Thursday, December 8th, 2011 I’m realizing the more I’m converting to a fully functional GUI user, the less I’m doing coding or any interesting stuff…
I remembered of the old glorious times, when I was full time console user and got a memory on a nifty trick I was so used to back in the day.
Back then I was quite often writing shell scripts which were fetching (html) webpages and converting the html content into a plain TEXT (TXT) files
In order to fetch a page back in the days I used lynx – (a very simple UNIX text browser, which by the way lacks support for any CSS or Javascipt) in combination with html2text – (an advanced HTML-to-text converter).
Let’s say I wanted to fetch a my personal home page https://www.pc-freak.net/, I did that via the command:
$ lynx -source https://www.pc-freak.net/ | html2text > pcfreak_page.txt
The content from www.pc-freak.net got spit by lynx as an html source and passed html2pdf wchich saves it in plain text file pcfreak_page.txt
The bit more advanced elinks – (lynx-like alternative character mode WWW browser) provides better support for HTML and even some CSS and Javascript so to properly save the content of many pages in plain html file its better to use it instead of lynx, the way to produce .txt using elinks files is identical, e.g.:
$ elinks -source https://www.pc-freak.net/blog/ | html2text > pcfreak_blog_page.txt
By the way back in the days I was used more to links , than the superior elinks , nowdays I have both of the text browsers installed and testing to fetch an html like in the upper example and pipe to html2text produced garbaged output.
Here is the time to tell its not even necessery to have a text browser installed in order to fetch a webpage and convert it to a plain text TXT!. wget file downloading tools supports source dump as well, for all those who did not (yet) tried it and want to test it:
$ wget -qO- https://www.pc-freak.net | html2text
Anyways of course, some pages convertion of text inside HTML tags would not properly get saved with neither lynx or elinks cause some texts might be embedded in some elinks or lynx unsupported CSS or JavaScript. In those cases the GUI browser is useful. You can use any browser like Firefox, Epiphany or Opera ‘s File -> Save As (Text Files) embedded functionality, below is a screenshot showing an html page which I’m about to save as a plain Text File in Mozilla Firefox:
Besides being handy in conjunction with text browsers, html2text is also handy for converting .html pages already existing on the computer’s hard drive to a plain (.TXT) text format.
One might wonder, why would ever one would like to do that?? Well I personally prefer reading plain text documents instead of htmls 😉
Converting an html files already existing on hard drive with html2text is done with cmd:
$ html2text index.html >index.txt
To convert a whole directory full of .html (documentation) or whatever files to plain text .TXT , cd the directory with HTMLs and issue the one liner bash loop command:
$ cd html/
html$ for i in $(echo *.html); do html2text $i > $(echo $i | sed -e 's#.html#.txt#g'); done
Now lay off your back and enjoy reading the dox like in the good old hacker days when .TXT files were fashionable 😉
Tags: advanced html, character mode, command lynx, content, convertion, course, CSS, drive, file, freak, full time, glorious times, gnu linux, html pages, html source, HTML-to-text, html2text, index, interesting stuff, javascipt, Javascript, Lynx, necessery, nifty trick, page, page txt, pcfreak, PDF, personal home page, Shell, shell scripts, spit, support, terminal, text, text browser, text converter, time, trick, TXT, unix text, wget
Posted in Everyday Life, FreeBSD, Linux, Linux and FreeBSD Desktop, Various | 1 Comment »
Wednesday, June 1st, 2011 On Debian Linux I’m used to configure the networking via /etc/network/interfaces , however on Redhat based distributions to do a manual configuration of network interfaces is a bit different.
In order to configure networking in CentOS there is a special file for each interface and some values one needs to fill in to enable networking.
These network adapters configuration files for Redhat based distributions are located in the files:
/etc/sysconfig/network-scripts/ifcfg-*
Just to give you and idea on the content of this network configuration file, here is how it looks like:
[root@centos:~ ]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetLink BCM57780 Gigabit Ethernet PCIe
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:19:99:9C:08:3A
IPADDR=192.168.0.1
NETMASK=255.255.252.0
ONBOOT=yes
This configuration is of course just for eth0 for other network card names and devices, one needs to look up for the proper file name which corresponds to the network interface visible with the ifconfig command.
For instance to list all network interfaces via ifconfig use:
[root@centos:~ ]# /sbin/ifconfig |grep -i 'Link encap'|awk '{ print $1 }'
eth0
eth1
lo
In this case there are only two network cards on my host.
The configuration files for the ethernet network devices eth0 and eth1 from below example are located in files /etc/sysconfig/network-scripts/ifcfg-eth{1,2}
/etc/sysconfig/network-scripts/ directory contains plenty of shell scripts related to Fedora networking.
This directory contains actually the networking boot time load up rules for fedora and CentOS hosts.
The complete list of options available which can be used in /etc/sysconfig/network-scripts/ifcfg-ethx is located in:
/usr/share/doc/initscripts-*/sysconfig.txt
, to quickly observe the documentation:
[root@centos:~ ]# less /usr/share/doc/initscripts-*/sysconfig.txt
One typical example of configuring a CentOS based host to possess a static IP address (192.168.1.5) and a gateway (192.168.1.1), which will be assigned in boot time during the /etc/init.d/network is loaded is:
[root@centos:~ ]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetLink BCM57780 Gigabit Ethernet PCIe
IPV6INIT=no
BOOTPROTO=static
ONBOOT=yes
USERCTL=yes
TYPE=Ethernet
DEVICE=eth0
IPADDR=192.168.1.5
NETWORK=192.168.1.0
GATEWAY=192.168.1.1
BROADCAST=192.168.1.255
NETMASK=255.255.255.0
After some changes to the network configuration files are made, to load up the new rules a /etc/init.d/network script restart is necessery with the command:
[root@centos:~ ]# /etc/init.d/network restart
Of course one can always use /etc/rc.local script as universal way to configure network rules on a Redhat based host, however using methods like rc.local to load up, ifconfig or route rules in a Fedora would break the distribution logic and therefore is not recommended.
There is also a serious additional reason against using /etc/rc.local post init commands load up script.
If one uses rc.local to load up and configure the networing, the network will get initialized only after all the other scripts in /etc/init.d/ gets started.
Therefore using /etc/rc.local might also be DANGEROUS!, if used remotely via (ssh), supposedly it might completely fail to load the networking, if all bringing the server interfaces relies on it.
Here is an example, imagine that some of the script set in to load up during a CentOS boot up hangs and does continue to load forever (for example after some crucial software upate), as a consequence the /etc/rc.local script will never get executed as it only starts up after all the rest init scripts had succesfully completed execution.
A network eth1 interface configuration for a Fedora host which has to fetch it’s network settings automatically via DHCP is as follows:
[root@fedora:/etc/network:]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
# Intel Corporation 82557/8/9 [Ethernet Pro 100]DEVICE=eth1
BOOTPROTO=dhcp
HWADDR=00:0A:E4:C9:7B:51
ONBOOT=yes
To sum it up I think Fedora’s /etc/sysconfig/network-scripts methodology to configure ethernet devices is a way inferior if compared to Debian.
In GNU/Debian Linux configuration of all networking is (simpler)!, everything related to networking is in one single file ( /etc/network/interfaces ), moreover getting all the thorough documentation for the network configurations options for the interfaces is available as a system wide manual (e.g. man interfaces).
Partially Debian interfaces configuration is a bit more complicated in terms of syntax if matched against Redhat’s network-scripts/ifcfg-*, lest that generally I still find Debian’s manual network configuration interface to be easier to configure networking manually vicommand line.
Tags: AIPADDR, bit, boot time, broadcom, broadcom corporation, card, card names, CentOS, Configuration, configuration files, configuration of network, configure, content, course, Debian, distributions, distros, etc network, eth, ethernet network, fedora, file, gateway, gigabit ethernet, host, ifcfg, init, instance, interface, Linux, loIn, manual configuration, network, network adapters, network configuration, network interface, network interfaces, network scripts, Networking, ONBOOT, order, Redhat, root, script, shell scripts, static ip address, sysconfig, time, time load, two network cards, typical example
Posted in Linux, System Administration | 1 Comment »
Friday, May 27th, 2011 As an administrator of few company email delivery servers, I always had to debug problems related to emails unable to drop in Yahoo’s Mail and Gmail default mail Inbox
In that reason I always need to take a close look on Email headers to try to isolate email issues.
Most often the problems with messages unable to deliver in default in Inbox are with the 3 most popular mail services:
Thus I decided to explain shortly here how one can check full email headers in Gmail and Yahoo public mail services in order to be able to later derive conclusions on what is wrong with his mail server outgoing messages.
1. How to view full email headers in Gmail
It’s pretty easy, though for some reason Google decided to place the button which shows the complete email message headers in a I would say not too user friendly location.
To view email headers, login to Gmail, click over some random email in Inbox or some of the other mail folders.
Once you can read the email and you see the Reply button located on the right,next to the Reply button there is the down triangle which while pressed will display a menu.
To view the full email headers one has to press over the Show original button presented in the menu. Below you see a sample screenshot on the menu with the Show Original button.
Show complete e-mail message headers and content in Gmail
2. How to view full email headers in Yahoo Mail Classic
I use Yahoo Mail Classic, as I like old stuff, Checking the full email headers there is a bit more intuitive than with Gmail.
To check email headers, just login to Yahoo mail, click over inbox, select an email message you would like to review as text.
Further on after the end of the email, you will see the Delete, Reply, Forward, Spam and Move buttons, right below this field of buttons there is the Full Headers blue text link with very small letters.
Here is a screenshot I’ve made of a sample opened mail. On the screenshot in right bottom you see the blue Full Headers button.
Yahoo Mail Cassic View Email Full Header
3. How to view full mail headers in Hotmail
In Hotmail checking the email, headers’s button position is very similar to Gmail’s, the only difference is the exact button which shows the Full Email header is named View Message source
In order to check Email headers in Hotmail, one has to click over a desired message, click once again on the down triangle near the Reply button and press over View Message source
Here is a screenshot showing the View Message source menu
Hotmail View Full email Headers
One small note to make here is that the View source headers buttons is currently not working on Epiphany browser running on Linux.
As always Microsoft are making stuff incompatible, if it’s not used with a Microsoft product ..
Tags: bit, Button, Cassic, content, default, default mail, Delete, delivery servers, difference, e mail, email, Forward, forward spam, Gmail, google, hotmail, location, login, mail folders, mail headers, mail inbox, mail message, mail server, mail services, menu, message headers, Microsoft, move buttons, old stuff, outgoing messages, public mail, reason, reply button, right, screenshot, show, stuff, text, yahoo mail
Posted in System Administration, Various | 3 Comments »