» tagged pages
» logout

sorted by: recent | see : popular
Content Tagged with System + Administration

How-To: Remote syslog logging on Debian and Ubuntu

syslogd is the Linux system logging utility that take care of filling up your files in /var/log when it is asked to.

On a standard system, logging is only done on the local drive. But syslog can be configured to receive logging from a remote client, or to send logging to a remote syslog server.

Some of the use cases could be:

  • A machine which filesystem goes read-only
  • Log replication

this tutorial will explain how to set up both the server, to receive message from a remote client, and the client to emit messages to a syslogd server.


read more

Debian: Debian/Ubuntu Tips & Tricks

How-To: Set up a LAN gateway with DHCP, Dynamic DNS and iptables on Debian Etch

Linux is a perfect platform to act as a router/gateway.

In this tutorial, I will explain how to set up a Linux box to operate as a network router. The box will provide the following services:

  • DHCP server to provide the ip addresses to the machines in the LAN
  • DNS server to resolve domain names
  • Gateway with IP tables to give access to the Internet.
  • Firewall with IP tables.

The resulting machine will have quite a small footprint: about 600M, and except if your network is intensively used, a low spec computer can be recycled to do the job.

As the machine is going to operate as a router/firewall


read more

Debian: Debian/Ubuntu Tips & Tricks

How-To: copy files over the network and preserve file permissions and informations with ssh and rsync

When copying files over the network, the files informations can be modified.

When using cp, one can avoid this issue by using the -a which will do the copy in archive mode, meaning that it will keep the links, preserve mode, ownership and timestamps and the copy is recursive.

the solution to this over the network is rsync alongside with ssh.


read more

Debian: Debian/Ubuntu Tips & Tricks

How to fix broken NX user authentication after OpenSSL fix


It looks like OpenSSH Keys generated on Debian derived distros (Ubuntu/Voyage etc.) are REALLY bad. I’m currently rolling out OpenSSL key updates as adviced on http://wiki.debian.org/SSLkeys.

One casualty of this update was my NX server using freenx. It just tells me that I can’t be authenticated. In the log /var/log/freenx.log it shows the following:

– NX SERVER START: -c /usr/lib/nx/nxserver - ORIG_COMMAND=
HELLO NXSERVER - Version 2.1.0-71 OS (GPL)
NX> 105 hello NXCLIENT - Version 2.1.0
NX> 134 Accepted protocol: 2.1.0
NX> 105 SET SHELL_MODE SHELL
NX> 105 SET AUTH_MODE PASSWORD
NX> 105 login
NX> 101 User: shuerlimann
NX> 102 Password:
NX> 404 ERROR: wrong password or login
NX> 999 Bye

This post talks about the NoMachine NX Server, but gave me the necessary clues: http://lists.kde.org/?l=freenx-knx&m=116542288527396&w=2

The magic command for freenx from http://datakeylive.com
on Ubuntu is

sudo rm /var/lib/nxserver/home/.ssh/known_hosts

This is necessary, as the SSH host key has been updated… Well, a more informative error message would’ve been nice, but I’m thankfull to the guys who produce freenx, anyway ;-)

IsiSetup: Huerlisi blogging on IsiSetup

Setup Mail Client on UNIX-based System

In the last post, a mail server setup was demonstrated. This post will demonstrate the setup of a mail client. Again, the setup of mail client is fairly straightforward. Here is the run.

On the client side, ensure the /var/mail directory is present.
# ls -l /var/mail

If not, create it.
# cd /var
# mkdir mail

Now modify the client's /etc/vfstab file
# vi /etc/vfstab
esoft:/var/mail - /var/mail nfs - yes -
:wq!

Now mount /var/mail
# mount /var/mail

Verify the /var/mail is actually being shared from the mail server
# cd /var/mail
# df -k .

Unix: My SysAd Blog

Finding Open Files with lsof Command

When a file is in use by a process, it is possible to delete the file - OR at least it may appear that is the case. The filename is no longer visible via the ls command, but it is there until the process using it exits.

For example, let's say Sysadmin1 runs a sniffer process in the background to capture and save packets to a file. The capture file starts growing bigger over time. Instead of killing the process, he/she simply deletes the capture file, thinking this will recover the disk space. It doesn't. Believing everything is well, Sysadmin1 goes home.

Now Sysadmin2 shows up and notices the box is running out of disk space. Naturally, the admin wants to figure out what’s rapidly consuming disk space. The easiest way for the SysAd to locate the growing file is to use the lsof command.

Another instance the lsof would be helpful is when a filesystem refuses to unmount due to open files.

Here are a few practical examples of using the lsof command.

To list all the open files on the var filesystem:
# lsof +D /var

To list all open files in your current directory only:
# lsof +d .

To list all open Internet files:
# lsof -i

To list all files currently open by user joe:
# lsof -u joe

To list all files open by syslog-ng (this is a great quick way to find
logs!):
# lsof -c syslog-ng

To list all files open by pid:
# lsof -p PID

Note: There are additional parameters you can add to the command to narrow the listing to include or exclude types of files and much more!

# lsof -help

Post provided by Mary M. Chaddock

Unix: My SysAd Blog

Split XML Records with Perl Script

A colleague, Mahlon Anderson, and I were thinking of ways of splitting up a fairly large XML file, which had approximately 27K records in it. I wanted to split this file into smaller ones, each having about 250-300 records, because my former web host service kept complaining about constant CPU quota overloads during uploads. A Perl based splitter script quickly came to mind.

With the web host service, I had plenty disk space and plenty bandwidth but limited CPU usage. Apparently, I didn’t notice that sticky point in the fine print while signing up for the service.

A different splitting implementation was later used as the permanent solution, but here is Mahlon's "quick and dirty" XML Perl splitter-- printed with his permission of course.

# vi split.pl
#!/usr/bin/perl
$file = @ARGV[0];

open(_FH, "_FH)
{
if($count == 0)
{
$filename = $file . "_part_" . $files_counter;
open(FH2, "> $filename") or die "Unable to open file: $filename\n";
$count++;
}

if (grep //, $_ )
{
$count++;
}

print FH2 $_;

if ($count == $max_records + 1)
{
$count = 0;
$files_counter++;
close(FH2);
}
}
:wq!

# ./split.pl bigxmlfile.xml

Unix: My SysAd Blog

IT Certification Self-Help Portal

I found this technical self-help website, uCertify.com, very interesting and wanted to share it with some of the readers. The company has been online since 1999. They are offering PrepKits which are interactive software programs that help you learn, track your progress, identify areas for improvement and simulate the actual exam. I sampled a few of their demo quizzes, but I mainly focused on their database kits because I am thinking about an Oracle certification in the near-term. On my initial run through, I found the practice test questions to be relevant and comprehensive, not just some cheesy Q&A effort.

I downloaded their Oracle 10G kit and obtained a key for it. It was a quick download via VDSL and was extremely easy to setup. I did not have any problems obtaining a key from uCertify. For the premium version, I took a couple of its timed practice tests along with its timed final. I thought the final test was a bit more difficult than the practice tests which was probably by design. Also, I noticed there was a “learn” function for each test question, which was accompanied by a thorough explanation. Frankly speaking, I needed to use a “RE-learn” function on some of the questions. :) There was also a means to create your own tests, add your own questions, provide immediate feedback, tagging, print, review questions, and make notes online – this flexibility was a nice surprise.

One last thing, per their website, they say if you do not pass the certification on your first attempt, they will refund your money. Yes, I was looking for an asterisk after this statement and was pleasantly surprised not to find one.

Here is what you get with the sample version.

30 questions total (this includes the quiz questions)
30 diagnostic test questions
Create tests
22 study notes
Articles, HOWTO's, and study tips
Progress report

Here is an example of what you get with the premium version, which may vary from kit to kit.

301 test questions
3 full length practice tests
105 study notes
Create tests
Unlimited free upgrades for a period of one year from the date of purchase
24x7 technical services
100% money back guarantee
Articles, HOWTO's, and study tips
Provide discounts on all future purchases

The sample version did give me a decent idea of what the tests were all about. Their PrepKits are designed to help you certify on vendors such as Microsoft, Cisco, Oracle, Adobe and a few others.

By the way, this is NOT a paid post.

If you are interested in a free, fully functional certification kit of your choice, leave a helpful non-anonymous UNIX-related HOWTO comment here and I will choose a winner after about two weeks. This is a $10 to $100+ value depending on the selected kit.

Update from uCertify: Your readers can use our discount code given on your Blog and get 10% discount on the uCertify PrepKit of their choice. Please use the following Discount code: ESOHUB

Unix: My SysAd Blog

Troubleshoot POP3 Mail Server with Telnet

I am finally getting an opportunity to write a post. I have been so busy with upgrades lately and had to put off writing for awhile.

The other day I had a number of users complaining about not being able to fetch mail to their mail client, MS Outlook. As usual, I attempted to duplicate the error. The error message was reporting unable to connect to the mail server. At that point, I decided to telnet the Post Office Protocol or POP3 port, 110, via the command line interface. Sure enough, I had a problem.

Note: The “before and after” command line examples are only for illustration purposes.

# telnet server 110
Trying 192.1xx.xx.xxx...
telnet: Unable to connect to remote host: Connection refused

I started thinking there was a problem with the inetd.conf file. After reviewing the file, I noticed the pop3 service was commented out. The appropriate change was made and inetd was restarted. Problem resolved.

# telnet server 110
Trying 192.1xx.xx.xxx...
Connected to server.
Escape character is '^]'.
+OK connected to pop3 on 3429

By the way, you can check out other popular port services, too.
# telnet server 6667
# telnet server 25

Unix: My SysAd Blog

Permanently Remove Data on UNIX Hard Drives

It is fairly common for companies to dispose of their obsolete hard drives. However, most of them want to ensure all data is shredded from the hard drives. Finding a Windows-based wipe program was fairly easy, but finding a UNIX-based program took a little more searching. BCWipe is a program that will wipe a UNIX-based hard drive clean. The BCWipe website claims their multi-platform UNIX version is intended to give you a confidence that your deleted files cannot be recovered by an intruder. BCWipe repeatedly overwrites special patterns to the files to be destroyed.

Note: Most likely you will have to compile the source code for your particular platform architecture.

BCWipe for UNIX offers the following wiping schemes per their site.

1. US DoD 5220.22-M standard (7 passes with verification)
2. User-defined number of passes
3. Peter Gutmann's 35 pass scheme

BCWipe for UNIX is designed as a multi-platform solution. Here is their supported list of various UNIX flavors.

Linux 2.0-2.6
FreeBSD 3.0-4.6
OpenBSD 2.8
Solaris 8-10
Digital UNIX 4
SGI Irix 6.5 (wiping block devices was not tested)
IBM AIX 5
HP-UX 10, 11

Here is the download link for 30 day evaluation.
BCWipe Download

Unix: My SysAd Blog

Using Z Shell Brace Expansion to Create Test Files

Here is a convenient way of creating test files using the powerful Z Shell. I have been using this shell for a short while, and I am quickly becoming a fan of it. I used it to support transfer speed tests. To support these tests, I created a specified number of files that varied in size (1MB, 5MB, 10MB, 50MB, 100MB, 500MB, etc). Here is a straightforward one-liner mkfile example of creating 50 x 12MB files and a few others using zsh’s brace expansion.

# zsh
# mkfile 12m {1..50}.tst
# ls -l
total 122960
-rw------T 1 root other 12582912 Feb 18 20:04 1.tst
-rw------T 1 root other 12582912 Feb 18 20:04 2.tst
-rw------T 1 root other 12582912 Feb 18 20:04 3.tst
-rw------T 1 root other 12582912 Feb 18 20:04 4.tst
-rw------T 1 root other 12582912 Feb 18 20:04 5.tst
...

Other examples...

# touch {1..5}.testfile
# ls -l
total 0
-rw-r--r-- 1 root other 0 Feb 18 20:07 1.testfile
-rw-r--r-- 1 root other 0 Feb 18 20:07 2.testfile
-rw-r--r-- 1 root other 0 Feb 18 20:07 3.testfile
-rw-r--r-- 1 root other 0 Feb 18 20:07 4.testfile
-rw-r--r-- 1 root other 0 Feb 18 20:07 5.testfile

# touch {6..10}.data
# ls -l
total 0
-rw-r--r-- 1 root other 0 Feb 18 20:30 1.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 10.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 2.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 3.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 4.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 5.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 6.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 7.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 8.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 9.data

# ls -l {1..5}.data
-rw-r--r-- 1 root other 0 Feb 18 20:26 1.data
-rw-r--r-- 1 root other 0 Feb 18 20:26 2.data
-rw-r--r-- 1 root other 0 Feb 18 20:26 3.data
-rw-r--r-- 1 root other 0 Feb 18 20:26 4.data
-rw-r--r-- 1 root other 0 Feb 18 20:26 5.data

Unix: My SysAd Blog

Troubleshooting the "su: No shell" error

The other day we had a problem with a system account. At first we did not notice the “su: No shell” error on the console (headless server) but after a few reboots it was fairly evident. The message gave us enough feedback to determine the substitute user or su command was having a problem with a particular account. To ascertain which system account, we invoked a sequential step-through of the startup scripts.

In the end, it appears that a third party application used to manage NIS+ had locked and changed the account’s shell to something unknown (by design) due to multiple login failures. The account was restored to its original shell.

# su - esofthub -c "myscript"
su: No shell

View locked account
# niscat passwd.org_dir | grep esofthub
esofthub:*LK*:1005:10:esofthub test:/home/esofthub:/bin/sh.locked:13933::::::

Modify with third party application
After the modification
# su - esofthub -c "myscript"
Visit Ucertify's challenge winners' blogs: Ax0N and armando

For Files Only

If you are using the files repository and no third party software to manage your user information, modify the /etc/passwd file.

View locked account
# less /etc/shadow | grep esofthub
esofthub:*LK*:13933::::::
# less /etc/passwd | grep esofthub
esofthub:x:1005:10:esofthub test:/home/esofthub:/bin/sh.locked

Modify the account manually or admintool
# vi /etc/passwd
...
esofthub:x:1005:10:esofthub test:/home/esofthub:/bin/sh
...
:wq!

Change shell to C shell or any other shell if so desired
# passwd -r files -e esofthub
Old shell: /bin/sh
New shell: /bin/csh

Or
# admintool &

After the modification
# su - esofthub -c "myscript"
Visit Ucertify's challenge winners' blogs: Ax0N and armando

Unix: My SysAd Blog

Add DES Credential For a Client Workstation

If you want to add a credential for a workstation, you will need to make an entry into the niscred.org_dir table on the server. This example demonstrates what is done on the server side and workstation side. There are third party tools out there to manage credentials, but personally I like using the command line. Here is what a colleague and I did to support a NIS+ server change.

On Server
C shell
# setenv PATH $PATH:/usr/lib/nis
Bourne or Korn Shell
# PATH=$PATH:/usr/lib/nis; export PATH
# nisclient -c -o -d esofthub.com esoft
# nisaddcred -p unix.esoft@esofthub.com -P esoft.esofthub.com. des
# nisgrpadm -a admin.esofthub.com esoft.esofthub.com.

On Workstation
C shell
# setenv PATH $PATH:/usr/lib/nis
Bourne or Korn Shell
# PATH=$PATH:/usr/lib/nis; export PATH
# nisclient -i -d esofthub.com -h esoftsvr -a IPADDRESS

Unix: My SysAd Blog

List Objects and Tables in Nisplus

I have had a few search queries (metadata) via MyBlogLog analytics from readers who were searching for commands to show Nisplus objects and tables. Frankly speaking, I neglected posting much about this legacy name service (earlier on) because I did not really think it was worthwhile. But apparently, there seems to be a decent number of organizations still using it. At any rate, here is an example run.

Show the objects
# nisls
esofthub.com.:
org_dir
groups_dir

Show the tables
# nisls org_dir
org_dir.esofthub.com.:
passwd
group
auto_master
auto_home
bootparams
cred
ethers
hosts
ipnodes
mail_aliases
sendmailvars
netmasks
netgroup
networks
protocols
rpc
services
timezone
client_info
auth_attr
exec_attr
prof_attr
user_attr
audit_user

Other posts on nisplus

Unix: My SysAd Blog

Display the Structure of a Nisplus Table

Building on the last post, I am using the niscat -o flag to display the structure of a common nisplus table. In the example below, the run shows the passwd table and its specific metadata/attribute information. Here is the syntax.

# niscat -o passwd.org_dir
Object Name : "passwd"
Directory : "org_dir.esofthub.com."
Owner : "esoft.esofthub.com."
Group : "admin.esofthub.com."
Access Rights : ----rmcdrmcdr---
Time to Live : 12:0:0
Creation Time : Sun Feb 24 18:22:47 2008
Mod. Time : Sun Feb 24 18:22:47 2008
Object Type : TABLE
Table Type : passwd_tbl
Number of Columns : 8
Character Separator : :
Search Path :
Columns :
[0] Name : name
Attributes : (SEARCHABLE, TEXTUAL DATA, CASE SENSITIVE)
Access Rights : r---r---r---r---
[1] Name : passwd
Attributes : (TEXTUAL DATA)
Access Rights : ----rm--r---r---
[2] Name : uid
Attributes : (SEARCHABLE, TEXTUAL DATA, CASE SENSITIVE)
Access Rights : r---r---r---r---
[3] Name : gid
Attributes : (TEXTUAL DATA)
Access Rights : r---r---r---r---
[4] Name : gcos
Attributes : (TEXTUAL DATA)
Access Rights : r---rmcdrmcdr---
[5] Name : home
Attributes : (TEXTUAL DATA)
Access Rights : r---rmcdrmcdr---
[6] Name : shell
Attributes : (TEXTUAL DATA)
Access Rights : r---rmcdrmcdr---
[7] Name : shadow
Attributes : (TEXTUAL DATA)
Access Rights : ----------------

Unix: My SysAd Blog

Modify Information in a Nisplus Table

The nistbladm command is used to modify information in a nisplus table. In this example, the passwd.org_dir table was modified. The login directory and shell was modified for the esoft user. Here is the syntax.

Prior to modification
# niscat passwd.org_dir | grep esoft
esoft:SNVE9mJSZ9ub6:1005:10:Test Account:/export/home/esoft:/bin/sh:13947::::::

Modify the user's home directory
# nistbladm -e home=/home/esoft '[name=esoft]'passwd.org_dir
# niscat passwd.org_dir | grep esoft
esoft:SNVE9mJSZ9ub6:1005:10:Test Account:/home/esoft:/bin/sh:13947::::::

Modify the user's shell
# nistbladm -e shell=/bin/zsh '[name=esoft]'passwd.org_dir
# niscat passwd.org_dir | grep esoft
esoft:SNVE9mJSZ9ub6:1005:10:Test Account:/home/esoft:/bin/zsh:13947::::::

###
Add a user
# nistbladm -a name=softhub uid=1000 gid=10 home=/home/softhub shell=/bin/zsh passwd.org_dir

Unix: My SysAd Blog

SSH Secure Shell for Workstations

A few years ago I took an Oracle database class at a university. I remember running SQL commands to perform a number of DBA tasks, such as creating databases, creating tables, creating procedures, altering tables, etc. via the command line. But in order to complete these tasks, we had to connect to the university's UNIX server via SSH. I remember using a nifty ssh client application. I found a link to its website while browsing my old coursework archive. At the time, I downloaded the "university use" copy, which was free, and it worked pretty well for the course.

Per the vendor's website, you can still download their SSH Secure Shell 3.2 non-commercial source code and there is also a Windows Client executable. Both are free of charge from various anonymous ftp sites around the globe for purposes of EVALUATION, NON-COMMERCIAL USE, and UNIVERSITY USE as defined in their license agreement.

Here is the link to the SSH Secure Shell for Workstations.

Other suggestions are always welcome.

Unix: My SysAd Blog

Emoticons and Their Meanings


A co-worker of mine emailed me this table of emoticons. I thought it was a fairly comprehensive list until I did a brief Internet search. The list was just a snippet, especially in the chat room space. I rarely engage in chat activities (maybe an occasional MSN chat with a family member), so I had no idea how many emoticons were out there. I discovered that I have been misusing a couple, which probably prompted the email and subsequently the table.



Here are a few more reference links.
Emoticons & Smiley Page
List of Emoticons
Gmail Emoticons
Emoticons and Smileys 101
Wiki - List of Common Emoticons

Unix: My SysAd Blog

Create table and Insert into Examples for MySQL

A couple of days ago I was adding entries to my ban related tables via phpbb's administration tools. After awhile, I quickly tired of serially adding an entry and then submitting it. I decided to dump the three tables in question and then modify them by hand. Plus that, I wanted to review the MySQL syntax.

Here are a series of create and insert statements for MySQL. I modified some of the entry values with "x", "!", "?" as to not offend some readers.

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Table structure for table `phpbb_banlist`
--

CREATE TABLE `phpbb_banlist` (
`ban_id` mediumint(8) unsigned NOT NULL auto_increment,
`ban_userid` mediumint(8) NOT NULL default '0',
`ban_ip` varchar(8) NOT NULL default '',
`ban_email` varchar(255) default NULL,
PRIMARY KEY (`ban_id`),
KEY `ban_ip_user_id` (`ban_ip`,`ban_userid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=97 ;

--
-- Dumping data for table `phpbb_banlist`
--

INSERT INTO `phpbb_banlist` VALUES(84, 0, '', '*@fromru.com');
INSERT INTO `phpbb_banlist` VALUES(5, 0, '', '*@mail.ru');
INSERT INTO `phpbb_banlist` VALUES(6, 0, '', '*@*.ru');
INSERT INTO `phpbb_banlist` VALUES(7, 0, '', '*@go2.pl');
...

CREATE TABLE `phpbb_disallow` (
`disallow_id` mediumint(8) unsigned NOT NULL auto_increment,
`disallow_username` varchar(25) NOT NULL default '',
PRIMARY KEY (`disallow_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=30 ;

INSERT INTO `phpbb_disallow` VALUES(1, '*porn*');
INSERT INTO `phpbb_disallow` VALUES(2, '*sex*');
INSERT INTO `phpbb_disallow` VALUES(3, '*xxxxx*');
INSERT INTO `phpbb_disallow` VALUES(4, '*co!!*');
INSERT INTO `phpbb_disallow` VALUES(5, '*axx*');
INSERT INTO `phpbb_disallow` VALUES(6, '*adult*');
INSERT INTO `phpbb_disallow` VALUES(7, '*viagra*');
INSERT INTO `phpbb_disallow` VALUES(8, '*pill*');
INSERT INTO `phpbb_disallow` VALUES(9, '*drug*');
INSERT INTO `phpbb_disallow` VALUES(10, '*pharm*');
...

-- Table structure for table `phpbb_words`
--

CREATE TABLE `phpbb_words` (
`word_id` mediumint(8) unsigned NOT NULL auto_increment,
`word` char(100) NOT NULL default '',
`replacement` char(100) NOT NULL default '',
PRIMARY KEY (`word_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ;

--
-- Dumping data for table `phpbb_words`
--

INSERT INTO `phpbb_words` VALUES(1, 'xxxx', '***');
INSERT INTO `phpbb_words` VALUES(2, 'sh??', '****');
INSERT INTO `phpbb_words` VALUES(3, 'xxxch', '*****');
INSERT INTO `phpbb_words` VALUES(4, 'fxxke?', '******');
INSERT INTO `phpbb_words` VALUES(5, 'axx', '***');
INSERT INTO `phpbb_words` VALUES(6, '*turd*', '****');
...

Unix: My SysAd Blog

Free Anti-virus Software Solution

If you are like me, you are always searching for ways to protect your personal computer. Probably, the first thing that comes to mind is viruses and worms.

Along with millions of other AVG users, I have been using their free anti-virus software version off and on since 1997. Usually, when something is for free, you get what you paid for - sub par performance. But with AVG, I can't complain too much about their free non commercial anti-virus solution. Why? It has been easy to use, consumes low system resources, automatic update functionality and provides real time protection. If you want more services, such as anti-spyware, anti-rootkit, anti-spam, firewall, web shield or 24/7 support, you will have to pay for them. The free version supports most Windows and Linux platforms. As usual, this is not a paid post and other free anti-virus solutions/suggestions are welcome.

Note: Per AVG's website: AVG Anti-Virus Free is only available for single computer use for home and non commercial use - for platform compatibility.

Unix: My SysAd Blog

Truncate Table Example for MySQL

I have been upgrading my phpbb forum from 2.X to 3.X. It has been a slog so far and mostly due to spammers. Before the 3.X converter would allow me to complete the conversion process, I had to delete most of the spammer usernames because they were essentially dups (e.g. User, USer, user, etc) but with different UID's . There were about 7,000 rows in the phpbb_user table - now there is a fraction of that left. Good.

Anyways, after exporting approximately 7000 rows to a file, I truncated the table. Here is an example.

TRUNCATE TABLE `phpbb_users`;

Here is the cleaned up (unique usernames) version of the file, which was re-ingested into the phpbb_users 2.X table.

INSERT INTO `phpbb_users` VALUES(2, 1, 'adam123', '49ad5...,NULL);
INSERT INTO `phpbb_users` VALUES(3, 1, 'laurahing', 'a3dcb4d2..., NULL);
INSERT INTO `phpbb_users` VALUES(4, 1, 'joshman', '49ad5b0771f..., NULL);
INSERT INTO `phpbb_users` VALUES(5, 0, 'ipsofacto', 'b63fc..., NULL);
INSERT INTO `phpbb_users` VALUES(6, 1, 'FitForFree', '04305e8e..., NULL);
INSERT INTO `phpbb_users` VALUES(7, 1, 'banchee', '8a645340...,NULL);
...

#####
I saw another meta data query asking how to limit the deletes by time for mysql. Here is a simple example.

DELETE FROM classified_ads WHERE user = 'esoft123'
ORDER BY timestamp_col LIMIT 10;

Unix: My SysAd Blog

Reset User Account Password Example for MySQL

Recently I upgraded a legacy application on my server. After the upgrade, I had to reset a user account's password to match the one in the application's configuration file. Luckily, MySQL provides a utility to handle this fairly straightforward task. Here is the syntax and a couple examples.

mysql> use mysql;
Database Changed
mysql> set password for 'elforum'@'localhost' = password('98m4@9er');
Query OK, 0 rows affected (0.00 sec)
mysql> set password for 'mysysad'@'localhost' = password('950v4.Kr');
Query OK, 0 rows affected (0.00 sec)

mysql> select user, password from user;
+---------------+-------------------------------------------+
| user | password |
+---------------+-------------------------------------------+
...
| elforum | *EAE7DE143B1B9598745AD571885A98E723ABE9056 |
| mysysad | *Ebe7D596878627EDD581EADEFSA98E723ABE9C58 |
...

Unix: My SysAd Blog

How-To set up a serial console on Debian

This tutorial will go over the steps to go through in order to set up a serial console on Debian Linux.

Debian uses sysvinit to handle the booting process, amongst the different task, and as such, there is a few differences between most of the tutorial that you might find on the internet regarding how to set up a serial console.

A Serial Console becomes handy when running a headless server (i.e no keyboard and screen) or if you cannot connect a a server because of a network issue.


read more

Debian: Debian/Ubuntu Tips & Tricks

How-To set up a serial console client

In the 2 previous articles, I explained how to set up a serial console on Ubuntu and Debian.

This tutorial will now show how to connect to those serial console using another machine using a software called minicom.


read more

Debian: Debian/Ubuntu Tips & Tricks

How-To set up a serial console on Ubuntu

This tutorial will go over the steps to go through in order to set up a serial console on Ubuntu Linux.

Unlike most other distros, Ubuntu uses upstart instead of sysvinit and as such, there is a few differences between most of the tutorial that you might find on the internet regarding how to set up a serial console.

A Serial Console becomes handy when running a headless server (i.e no keyboard and screen) or if you cannot connect a a server because of a network issue.


read more

Debian: Debian/Ubuntu Tips & Tricks

How-To: Customizing SSH client

SSH is great. There is so many thing you can do with it other than just a remote secure shell like X forwarding, port forwarding, authenticate using a private/public key, compress the transmitted stream....

If you have different account that you use on an every day basis, it becomes quickly cumbersome to type those lengthly command lines.

One could work around this by using aliases, the right way would be to use ~/.ssh/config

This tutorial will show some customization examples that should cover most ssh use cases.


read more

Debian: Debian/Ubuntu Tips & Tricks

How To: booting another Grub from Grub

Chainloading an operating system allows grub to boot an opearating system's boot loader. This is commonly used to boot Windows for instance.

I personnaly use it to be able to have my "production" system's grub on the MBR, and address other distros'grub install on their root partition. The advantage is that kernel updates are real easy to handle. Each testing distro modifying their own grub won't interfere with my main OS bootloader.

This tutorial will explain how to configure grub's menu.lst from the main OS to boot other OSes bootloader through an example.


read more

Debian: Debian/Ubuntu Tips & Tricks

How-To: email notification upon available package updates with cron-apt

cron-apt is a tool run by a cron job at regular interval that will check for package updates and optionally do some actions.

cron-apt will by default download the packages without installing them.

This tutorial will explain how to set up cron-apt in order to have it send an email to a specified address when updates are ready to be installed.


read more

Debian: Debian/Ubuntu Tips & Tricks

The Linux Samba-OpenLDAP Howto (Revision: 1.10 )

Good tutorial on how to set up a Samba LDAP environment, especially for a PDC

Samba: del.icio.us tag/samba

How-To: Find files on your computer with find

A standard Linux system has an incredible amount of files installed. Looking for a file location can be a painful task to do though a file browser.

Fortunately, there is a nifty command line available by default on any Linux distribution: find.

find can virtually find anything on your computer and comes with a lot of options. This tutorial will introduce a basic use of it and show how you can search your filesystem for file names matching a name pattern.


read more

Debian: Debian/Ubuntu Tips & Tricks

Page 1 | Next >>