Updating LXC Containers Using do-release-upgrade

A while ago i went through the whole rigmarole of updating Ubuntu from a no longer supported version to a supported version and had to go about updating all my LXC containers at the same time.   The later part of this mission might have been made easier with the following information.

Read More

Friday 12 December 2014 at 4:38 pm | | Linux | No comments

Linux Screen - Reconnect to Disconnected Session

I quite often use the 'screen' command when i work remotely, mainly to safe guard against losing work from unexpected disconnects.

One of the problems i found though was that when an unexpected disconnect happened, quite often i'd end up with a screen session still attached to a now stale ssh tty, and screen -r would not allow me to reattach to an already attached session, albeit a session attached to a stale/zombie ssh session.

After some googling around, i've found the solution to be using, screen -Dr as oppossed to screen -r ...... essentially it does what ever is nessecary to reconnect to the specified session, or the last session if none is specified.

Saturday 09 August 2014 at 05:12 am | | Linux | No comments

Ubuntu 12.04 LXC Container CurlFTPFS, fuse: mount failed: Permission denied

Had a problem today, where i came to use curlftpfs inside of an LXC container running Ubuntu 12.04 that i had upgraded from some previous version of Ubuntu a while ago, and had not actually needed to use curlftpfs until now.

When ever i tried to mount a remote ftp site via curlftpfs i kept getting the message "fuse: mount failed: Permission denied".    After a little bit of investigation and Googling, i found i needed to do the following :-

Read More

Monday 10 February 2014 at 04:27 am | | Linux | No comments

Apache Logs Rough Data Transfer

how to get a rough daily and average data transfer figure from logs

I needed to figure out how much data transfer one of my clients sites was using today, and after a bit of a headstart from these sites :-

http://www.linuxjournal.com/article/9257?page=0,0

http://www.chemie.fu-berlin.de/chemnet/use/info/gawk/gawk_12.html

I came up with the following one liner :-

cat other_vhosts_access.log.1 [.. add any additional files here ..] | \
tr :][ " " | \
awk '{ sum[$6] += $15 }
END {
for(r in sum) {
print r,sum[r];
tot += sum[r];
numrows += 1
};
printf "Average Daily Transfer : %.2fmb\n", tot/numrows/1024/1024
}'

(note: Remember to either remove or replace "[.. add any additional files here ..]")

(note: it was a one liner before i multi lined it for formatting purposes here)

The numbers to use for $6 and $15 (field positions you will need to experiment with your log files until you get the right values ( $6 should be the field that contains the date, and $15 should be the field that contains the total bytes transferred )

Monday 27 January 2014 at 2:15 pm | | Apache, Linux | No comments
Tags: ,

Dual Boot Ubuntu 13.04 / Windows 8

how to install Ubuntu 13.04 along side Windows 8 - when Ubuntu doesn't detect Windows 8

Recently I bought a new laptop with Windows 8 Home installed as default(an Acer V5-471 from Tescos, at an amazingly good price ;) ), though when i came to install Ubuntu WUBI on it, everything went great until i attempted to boot into WUBI.   On attempting to boot i got a white on black text error scree pertaining to "wubildr.mbr".

After a bit of research i found that this was down to the new type of boot configuration on new hardware known as UEFI & Secure Boot.

Read More

Friday 28 June 2013 at 06:24 am | | Linux | No comments

Ubuntu - OpenVPN

connecting to an OpenVPN from Ubuntu client

Recently my employer changed it's VPN from being a Windows PPTP connection to an OpenVPN configuration.   For Windows users it was no problem, they supplied a preconfigured installation of the OpenVPN client for Windows which worked out of the box.

However, when i came to trying to get up and running on a Ubuntu machine i had a few problems.   My employer had supplied me with a .ovpn config file that i was supposedly going to be able to just give to Ubuntu and it would work - it didn't.

The is what i had to do :-

Read More

Friday 28 June 2013 at 06:23 am | | Linux | No comments

Deny .svn Directory Access With .htaccess

The following little snippet in a .htaccess file in your web root will block access to .svn directories via http.

# Block access to .svn files
RewriteRule ^(.*/)?\.svn - [F,L]
ErrorDocument 403 "Access Forbidden"

I found this by googling but the original had a trailing / on the .svn in the RewriteRule.   I've removed this as with out it, it appears that /.svn/ would be blocked, but /.svn would still get through.

Friday 28 December 2012 at 8:56 pm | | Apache, Linux | No comments

Linux CLI, Remove Leading or Trailing Spaces

A handy little snippet for removing leading or trailing spaces from lines of piped data :-

To remove leading spaces from each line in the piped data

somecmd | sed -e 's/^[[:space:\]]*//'

To remove trailing spaces from each line in the piped data

somecmd | sed -e 's/[[:space:]]*$//'

Friday 21 December 2012 at 09:31 am | | Linux | No comments