Archive for the Category » server «

Monday, August 09th, 2010 | Author: muthii

In this post I will be making a list of great Linux cmd’s that I find all over the net one great place to stop by is commandlinefu.com they have a great deal of important linux cmd’s.

First cmd is mtr, it combines your ping and netstat cmd’s. In CentOS you have to su- to run this cmd:

mtr google.com

The following cmd I just started using recently and it has been a life saver I don’t know how I went all that time without it. The cmd is screen it works like your VNC or NX but for the terminal, it is especially handy if you SSH into your box but you don’t want to leave the terminal running waiting for a task to finish, you just start a screen run your cmd and detach from the screen. Now even if your connection gets disconnected or you disconnect yourself all you have to do when you connect again is run “screen -dR” and you are connected back to your earlier session and you can check on the progress of your task. To list screen instances “screen -ls”.

screen

Ctrl+a   ->pressing this twice moves to the next screen

Ctrl+a+c  ->adds a new screen to you screen instance

Ctrl+a+d ->detach from screen session

Ctrl+d  ->exit a screen

screen -dR   ->connect to/start a screen session

Mount a drive world writeable

mount -t ntfs-3g -o umask=000 /dev/drive /mnt/mountpoint

mount -t cifs -o umask=000,username=username,password=password //ipaddress/folder /mnt/mountpoint

by adding the option umask=000 any user can write to the mounted folder, this comes in handy when you want to write to a mounted drive as a regular user.  I have had a problem with some slack based distro’s not accepting this option in the current format and might need to play around with the mask cmd placement to see what works.

Category: Computer, Linux, server  | Tags:  | Leave a Comment
Sunday, May 16th, 2010 | Author: muthii

I had installed ipupdate while trying out dnsexit.com and loved its simplicity, dnsexit.com provides a great service but in the end I chose to stick with my current registrar lqconsulting who is a major supporter of Linux users, they also run linuxquestions.org of which am a member. I had tried to configure ddclient to work with my registrar but I did not have enough info about my registrar’s requirements of the client to work with their site. So in the mean time I have edited ipupdate to send me an email everytime my ip address changes while still doing evrything else it does. I prefer it this way over updating my registrar, since I do a lot of remoting in and it takes a few minutes before a new IP is updated to nameservers “around 20min”, but if I already have my new IP in my mail when it changes I don’t have to wait until nameservers update my site IP for me to be able to remote in. I have provided the edited file below for anyone who wants to use it also the tar,rpm and deb files that install it.

For install instructions go to:

My edited file
You can replace the installations ipupdate.pl with mine for v1.6-2 or just copy over my additions to them whichever works for you.

Monday, June 01st, 2009 | Author: muthii

Command to delete files older than x days

find /your_directory -mtime +7 -exec rm -f {} \;

works great for my mysql backup folder.

Tuesday, April 14th, 2009 | Author: muthii

After upgrading my box to centos5.3 I started seeing an error

There are unfinished transactions remaining. You might consider running yum-complete-transaction
first to finish them

On trying to run yum-complete-transaction the cmd was unrecognized.
. Solution: Install yum-utils, drop down to root environment (su -) and run the cmd yum-complete-transaction, it should run and fix your yum problem

.

Thursday, March 19th, 2009 | Author: muthii

I messed up the permissions on my box and on restart three quarters of the services would not come up so doing a database backup was out. All my previous DB backups had the plugins still active. So when I tried to restore using them the blog is viewable, but when I try to log in I get a blank page on checking my Apache logs I saw the following error

Cannot use string offset as an array in wp-includes/capabilities.php on line 116

Restored database a couple of times nothing worked, tried upgrading & updating database nothing worked. Finally just installed WP from scratch with blank database. Opened up PhpMyadmin replaced new WP tables with tables from old WP DB backup, skipped table wp_options as it broke the new WP and both user tables as I had already setup the new user data on install, but I guess if you want to keep the old user data you can transfer these too.
Now I just made a backup of wp_options after restoring all the settings e.g blog name etc and turning off all plugins. This way next time all I have to do is just switch this table with the one from a backup whose plugins were still on at backup and am good to go.

Monday, January 12th, 2009 | Author: muthii

After installing web calender and activating the send reminders option, be sure to edit the location of

/usr/bin/php

as on default it tries

/usr/local/bin/php

which is the wrong place. This will cause cron errors.
Remember to move it’s location for security purposes.

Category: Internet, server  | Tags:  | Leave a Comment
Monday, November 17th, 2008 | Author: muthii

I was using dreamweaver to edit my webpages which uses it’s own auto update on save date code<!– #BeginDateformat:Am1 –>May 5, 2005<!– #EndDate –> (Dreamweaver’s Auto-Update-on-Save Date Code). When I switched to bluefish as my main editor the auto update code wouldn’t work. So I looked around and found a php code to get the same thing done. Just place it anywhere you want the date to appear

<?php echo date(‘F j, Y’, filemtime(__FILE__));?>

If you want to store it to a variable you can do

$variable_date = date(‘F j, Y’, filemtime(__FILE__));

You can exchange filemtime with filectime if you want to display the date the file was created.

Tuesday, November 04th, 2008 | Author: muthii

Booted the server the other day and got the message that dovecot can’t start because listen address 993 was already in use.

Any logins to squirrelmail received an error message. To solve this I run the command

lsof -i :993

This will list the application listening on the particular port and you can go ahead and kill it or assign it a different port. Remember to change the port number (993) to whatever port your imap server or whatever program you are troubleshooting is supposed to be listening on.
To start dovecot the command is:

/etc/init.d/dovecot start
Sunday, October 12th, 2008 | Author: muthii

I am used to using the linux gui to do most of my stuff, but every now and then you have to drop to cmd line to expediate some tasks. I found this neat app that i haven’t been using called smbclient, it has been saving me a lot of time while copying files to and from my linux box since I started using it.

To log in to a share:

smbclient //IP/share  -> you enter password and you are in

To copy local file to share:

put test.odf  -> you can add path details if the file is not in your local directory e.g /var/doc/test.odf

To copy file from share:

get test.odf

To find out further uses of this app checkout this link.

Friday, October 03rd, 2008 | Author: muthii

If you are using any version => than 2.6 you can force all admin sessions to be over ssl just add the following to your wp-config.php file:

define(’FORCE_SSL_ADMIN’, true);

Ryan Boren does a great job of explaining this and other options you have to secure your connection here.

You might also be interested in the SSL plugin incase your wordpress version does not support this.

Category: server  | Tags:  | Leave a Comment