Archive | Linux RSS feed for this section
July 29, 2012

Force SSH over IPv4 or IPv6

I've got an IPv6 connection at home via Sixxs which works pretty well.

Of course some of the time when I need to access certain machines from outside the office I'll run into issues ie. I can get in over IPv4, but not over IPv6. Other times the IPv6 connection from wherever I happen to be might not be as stable as the IPv4 one.

So being able to force an SSH connection over IPv4 (or over IPv6) is handy (and this is more for my own reference than anyone else's!):

ssh -4 user@hostname

Will force the connection over IPv4, while:

ssh -6 user@hostname

will force it over IPv6

Related Posts:

July 20, 2012

Updating Whois On Debian

Getting an up to date whois client on Debian is a requirement if you work in my world:

wget http://ftp.ie.debian.org/debian/pool/main/w/whois/whois_5.0.17_amd64.deb

dpkg -i whois_5.0.17_amd64.deb

Problem solved ..

Related Posts:

April 10, 2012

Linux Sysadmin Type Wanted

Image representing Blacknight as depicted in C...

Image via CrunchBase

We're hiring for a number of roles at the moment over in Blacknight

The latest one we announced was this one for a Linux Systems Engineer

Think you qualify?

Then please apply

Related Posts:

March 4, 2011

Checking Which Ports Are Doing What On Linux

From time to time it's handy to be able to see exactly which process is using a particular port on a Linux system - especially if you're debugging issues.

This command will let you see exactly what's going on - you simply change the port number:

lsof -i:80

If you need the standard port numbers you can check this list

Related Posts:

  • No Related Posts
October 23, 2010

Postfix Mail Queue Management

This is more as a reminder for myself than anything else since I tend to forget Postfix commands unless I use them regularly.

To see all mails in the current queue:

mailq

To flush the mail queue run:

postfix flush

To remove all the mail from the queue (ie. delete it) run:

postsuper -d ALL

Related Posts:

July 11, 2010

Tweaking Spam Filters

I've been running my own mail server for this domain and several others for a few years. I could have used our main mail servers, but I like messing around with the server settings and trying out new things.

One thing that I hadn't been checking too stringently on my inbound email was SPF.
Sure, I had it set up on several of my domains so that anyone else getting mail from me would be "happy".
Switching it to more stringent settings and checking SPF inbound, however, has proven to be worth the few minutes it took to set it up - over 100 mails blocked in less than 24 hours!

I opted to install postfix-policyd-spf-perl as I'm using Postfix. Configuration was pretty easy - just adding a couple of lines to the main.cf and master.cf (the man page gives you the most up to date configuration settings)

Enhanced by Zemanta

Related Posts:

March 4, 2010

Ubuntu Gets A Visual MakeOver

Ubuntu, which is one of the more popular Linux distributions these days, has unveiled a completely new look.

It's got a new logo:
blackeubuntulogoAnd a whole new range of styles for just about every other visual asset associated with the brand, both online and on the users' desktops.

The new look is very slick compared to the "old" image of Linux distributions as being ugly, yet functional

Full details here

Thanks to Laura for mentioning it earlier this evening

Related Posts:

March 1, 2010

Cleaning Up Old Configs On Ubuntu / Debian

Debian OpenLogo

Image via Wikipedia

This is more for my own use than anyone else...

If you remove a package in Debian / Ubuntu you often end up with legacy configuration files lying around.

Running the following command removes all the crud left lying around your system and may fix silly issues that you run into. As it's Linux, there's probably about 10 other ways to do this!

Here's the command:

sudo aptitude purge `dpkg --get-selections | grep deinstall | awk '{print $1}'`

Enjoy!

Related Posts:

May 10, 2009

Playing With Lifestreams and SweetCron

sweetcron logoA few months ago Stewart mentioned Sweetcron as a "lifestream" solution (You can see his here).

A "lifestream" basically acts as an aggregator of all your online activities, as many of the online services that people use, such as Twitter, Flickr etc., publish your activity via RSS.

I'd already been experimenting with Movable Type's Motion, which is a pretty cool addition to an existing MT powered site, however having a separate, standalone, solution was not without its attractions. I registered michele.ie a few months ago, but apart from using it to test our Exchange mail hosting I hadn't really done anything with it.

So last night (and very early this morning) I decided to setup Sweetcron on one of our shared hosting plans. Our hosting system allows you to split your domain up across multiple hosting plans and platforms, so while the main site is now on a Linux web server the email is still on Microsoft Exchange.

I chose to setup the webspace to use PHP5, since PHP4 is defunct. In terms of the database I opted for MySQL5, since it's also the more recent version.

I'll have to admit that I hadn't used FTP for a long time. I have a habit of just doing things from the command line, but once I'd got over that it was easy enough to setup.

The documentation for Sweetcron is a bit sparse, but the basic install is easy enough. On our system you just need to remember that the MySQL database server is NOT "localhost", as the basic configuration file assumes that you're running everything on a single server.

The one step that isn't documented clearly is how to setup a simple cronjob to automate it for you. Fortunately someone else had done that already, so adding the cronjob via the hosting control panel was fine.
You just need to execute the following command every few minutes (or hours):

curl http://your/true-cron/url

You can find the actual URL in the Sweetcron admin panel. So just set that command to run via the cronjob manager and off you go.

The basic install ships with two themes, but there are several other themes available which range from the very simple to the incredibly complex. I still haven't settled on which one I actually want to use, as they all handle parts of your "stream" differently. In order to avoid duplication issues I think I'll stick with a theme that doesn't pull in the full content from blog posts and just provides a link to the original source.

So if you're bored and want to know what I'm up to you can head over to my new personal space and see!

Related Posts:

April 27, 2009

Logging Email From PHP Scripts

This is more a note for myself than anything else ...

By default a lot of php scripts will send emails that appear as coming from the Apache user, which makes tracking down a rogue script really annoying and time-consuming.

You end up with entries in the mail logs similar to this one:

Apr 27 18:22:29 servername postfix/qmgr[23581]: 0F53421C1FA: from=<www-data@servername.com>, size=929, nrcpt=1 (queue active)

Which isn't particularly helpful if you have more than one site (vhost) on a particular server.

Making it a bit saner can be done via a simple addition to the Apache vhost config:

php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f address@domain.tld'

So now any emails sent from that vhost will reference the email specified instead of the Apache user:

Apr 27 19:40:34 servername postfix/qmgr[2469]: 16A8F21C1FA: from=<address@domain.tld>, size=358, nrcpt=1 (queue active)

There are other additions to Php that can log the path to the script itself, though until such time as someone makes it available for Debian / Ubuntu I don't really fancy having to compile it in manually

Related Posts: