Some Handy Chrome Extensions

I've not used Firefox as my main browser in a long while now, probably for almost as long or longer as my break from adding entries to my blog !    Chrome is now my main browser and over my time of using it i've found a few extensions in the Chrome Store that have made my life easier or more fun.

Read More

Thursday 30 November 2017 at 3:19 pm | | Chrome | No comments

Git Merge !!

Sunday 12 November 2017 at 1:59 pm | | Funny Shit | No comments

Has it Really Been Almost Three Years ???

Has it really been almost three years since i last posted here ??  YES it has, and i've just realised i've let alot of things slide in this time also.    So where have i been, what have i been doing ?   Good question !

Read More

Sunday 12 November 2017 at 1:21 pm | | Personal | No comments

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: ,

Get The Size of MySQL Databases

I'm currently dealing with moving a client's web application over to a new host, and one of the hosts that the client wanted me to check out was 1&1.   The only problem with 1&1 that i could see was a 1GB limit on database size.

So i needed to check the size of the database right now, and normally, although not accurate, what i would normally do is do mysqldump of the db, and see how large that is.   On this occassion though i decided to research if there's a better and more accurate way of doing it.

I very quickly came accross running the following query :-

SELECT table_schema "DB Name",
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM   information_schema.tables
GROUP  BY table_schema;

This was found on StackOverflow.

Wednesday 03 July 2013 at 2:01 pm | | mysql | No comments