/var/net/sys/admin/blog

Archives for Quick Tips & Tricks category

There are few ways to set the date and time on Linux command line. In order to do this, you must login as root and execute the following methods as follow:

For you to remember the syntax, issue the command “date” first

[root@freelinux ~]# date 
Mon Aug 20 18:30:29 SGT 2012

Let say you want to change it to Sept 6, 2012, 3pm, just follow the pattern above

[root@freelinux ~]# date 090615002012
Thu Sep  6 15:00:00 SGT 2012

where as:
09 = month (September)
06 = day
15 = hour
00 = min
2012 = year

Share

Here’s one trick to do that:
Step 1. Install  FreeTDS

FreeTDS Website: http://www.freetds.org/ choose FreeTDS source distribution

Compile parameter: –prefix=/usr/local/freetds –enable-msdblib

Then, copy /etc/ld.so.conf, to /usr/local/freetds/lib; and then run ldconfig

Step 2. Change /usr/local/freetds/etc/freetds.conf

[sql2k]

host = your.mssql.server.ip
port = 1433
client charset = cp950
tds version = 8.0

b. tds version: 4.2 (for MS SQL Server 6.x); 7.0 (for 7.x); 8.0 (for 2000)

Step 3. Test FreeTDS connect to MS SQL Server

#cd /usr/local/freetds/bin
#./tsql -S sql2k -U sa
1> use mydatabase
2> select * from mytable
3> go

Share

1. FTP & Telnet  daemons are controlled by the inetd, so to simply stop the service, just comment the lines under /etc/inetd.conf

ftp stream tcp6 nowait root /usr/lbin/ftpd ftpd -l
telnet stream tcp6 nowait root /usr/lbin/telnetd telnetd

2. Reconfigure the internet daemon to reread the /etc/inetd.conf

#inetd -c

That’s it and you can do test:

Before:

# ftp 172.16.0.100
Connected to 172.16.0.100.
220 freehpux FTP server (Revision 6.0 Version wuftpd-2.6.1 Fri Apr 1 07:44:09 GMT 2011) ready.
Name (172.16.0.100:root):

[darwin@freelinux ]$ telnet 172.16.0.100
Trying 172.16.0.100…
Connected to 172.16.0.100 (172.16.0.100).
Escape character is ‘^]’.
HP-UX freehpux B.11.31 U ia64 (ta)
login:

Share

Relaying to Gmail via smtp.gmail.com can be accomplished by configuring your Postfix with SASL authentication and TLS encryption.

The common errors you will encounter if sending from your postfix mail server failing to gmail.com domain but works in other domains are:

@/var/log/maillog
-Must issue a STARTTLS command first
-certificate verification failed for gmail.com:unable to get local issuer certificate
-Authentication Required. Learn more at 530 5.5.1 http://mail.google.com/support/bin/answer.py?

How to fix?

Assuming you already installed Postfix and everything works fine except sending to gmail smtps, here are the steps to follow:

1. Configure Postfix main configuration

Share

If you have multiple virtual hosts in your server and you specified different log files for each, it is more organized and easy to locate, but the downside is Linux has so called file descriptors or the number of files that it can be handle. Basically , it can be increased but I think it’s not really recommended just for the sake of it.
Making your apache logs more organized can be done by many ways, one way is via piped logging and use rotatelogs. And based on my tips before named Automatic unlimited subdomains via Apache mod_rewrite, one issue is the log files. But there’s one method to solve this, and this is by splitting up your log files.

Share

Wondering how blogger website gives you a subdomain from the blogspot.com domain based on  your username of your choice? Well, the concept for this tutorial is somewhat related with it on setting up unlimited subdomains. I’m not sure how do they do it because it could be done by any script, hardcoded or not, thru static or dynamic way via database, many possibilities, and one possible way is thru URL rewriting via Apache’s mod_rewrite.

Requirements of this setup:

a. Apache 2.x or later
mod_rewrite module should be enable.  To check if it’s enabled you should see this line on your httpd.conf

Share

One of the most important procedure in setting up master-slave replication on Mysql database successfully is to have a consistent dump or backup of database(s) from the master server by locking all tables during mysqldump so write access is not possible.

master log file and log position will be taken from the master and configure it on the slave server. But it’s not always good times. There are some bad times too. And one of it is sudden stop of your slave and no longer synching with the master database.

Share

I’ve been working with the servers most of the time, and few days ago, i had free time to test ubuntu on one of my laptop, it’s not new but not too old either, it’s dual core MSI VR320 and guess what it’s kinda frustrating to have issues on this laptop upon installing ubuntu 8.04 and 9.04.

with 8.04, wifi (using WPA-PSK at home) is not working and sound is looping
with 9.04, wifi is ok but audio playback is damn too slow.

Share

1. Wonder why you can’t send email from your linux server?

2. Is your mail server or 3rd party email hosting provider requires authentication for your outgoing server to send out emails successfully?

3. Are you using a default sendmail email client on your linux box and wonder why your getting maillog errors such as this:

——-sample sendmail maillog error from my nagios server—————
Oct  2 17:03:54 nms sendmail[25657]: n9293qiw025655: to=<nagios@freelinuxtutorials.com>,

ctladdr=<root@nms.freelinuxtutorials.com> (0/0), dela0928, relay=smtp.freelinuxtutorials.com.

[216.200.145.17], dsn=5.1.1, stat=User unknown
Oct  2 17:03:54 nms sendmail[25657]: n9293qiw025655: n9293siw025657: DSN: User unknown
Oct  2 17:03:54 nms sendmail[25657]: n9293siw025657: to=<root@nms.freelinuxtutorials.com>,

Share

Assuming you already have mysql server installed on your machine, the reason you are
installing phpmyadmin is to ease  your administration of  your MySQL like database creation and deletion, create/alter/drop/view tables and execute any SQL statements, privilege and trigger management, stored procedures, and backup/ maintenance

phyMyAdmin is a tool built in PHP to manage and administer your MySQL servers via your browser.

Requirements:

1.PHP
2.MySQL
3.php-mysql
4.gd/gd-devel
5. Apache

Share
 

About FLT

This site is dedicated to everyone who likes to learn and explore the beautiful world of Linux. If you have comments and suggestions, please feel free to email at freelinuxtutorials@gmail.com. I am happy to serve and share things esp. that is free and enjoyable as Linux.