List serial number of USB device
Q. Is there a way to under Linux to find out the Serial number of a device plugged into the system?
A. Yes, there is a simple command:
lsusb -v
This will produce a long output, so it's best to pipe it into a "more" or just a text file.
Postfix and Clam AV
It's been a while since we've posted something and a lot of stuff piled up. At the day and age of MS Exchange and cloud hosting, there are still instances when you'd like to run your own email server. Postfix being the popular choice, we present here are simple steps to enable ClamAV to scan your incoming emails (Ubuntu is used as an example in this case).
First, a short description of the steps that the mail will take:
Incoming mail → 25:postfix → 10026:clamav → 10025:postfix → Delivery to user
Installation steps are as follows:
1) download and install ClamAV
apt-get install clamsmtp clamav-freshclam
MySQL backup and restore
This is more to serve as a reminder for myself on how to backup and restore databases using the command line.
1. Backing up a database:
Where username is of course your username and dbname is the database that you are trying to backup. Userpass is optional - if you don't enter it on the command line, you will be prompted for it:
mysqldump -u username -p[userpass] dbname > filename.sql
or you can get fancier, if you need to specify the host or port:
mysqldump --user=username --password=password --port=port --host=hostname dbname > backupfile.sql
2 Backing up with compression
mysqldump -u username -p[userpass] dbname | gzip > filename.sql.gz
3. Restoring a database:
mysql -u username -p[root_password] database_name < filename.sql
Creating desktop application shortcuts in Ubuntu (12.04/12.10)
Q. I can't create a shortcut on the desktop in Gnome under Ubuntu 12.04 (or 12.10) when right-clicking on the desktop. How can I do that?
A. Some things have changed and the create desktop launcher link is no longer there. One way to create a shortcut is drag and drop the link from the menu onto the desktop. If you would like to use the traditional way, you can do so by running the following command:
gnome-desktop-item-edit Desktop --create-new
Apache Do Not Log
Q. I'm trying to clean up my Apache logs. How do I not log certain events, such as local IP?
A. This can be achieved by setting a dontlog option in your configuration files:
For example, let's say you are indexing your site and don't want the local network to appear in the logs, you can add something like this:
SetEnvIf Remote_Addr "192\.168\." dontlog
How do I change the timezone in Ubuntu?
Q. How can I change the timezone in Ubuntu server?
A. Easy, just run the following command as sudo or root:
dpkg-reconfigure tzdata
Send email from a command line
Q. I would like to send an email from a command line in bash, how do I do that?
A. Assuming you have your outgoing server configured and either bsd-mailx or mailx (simple mail user agent for Linux) you can use this command to send out email:
echo "Email body text" | mail -s "Email subject" email@example.com
More Articles...
Page 6 of 21
<< Start < Prev 1 2 3 4 5 6 Next > End >>