8th August 2008, 02:37 pm
I’ve been interested in trying to stream some of my videos from my server rather than from YouTube. YouTube is great but the video quality is pretty poor.
I’m running CentOS 5.2 and decided to just try installing ffmpeg from rpmforge rather than compiling it. Lazy but easy!
rpmforge is a repository where you can find lots of prebuilt packages that are not part of a standard Redhat/CentOS install. You can find instructions for setting it up here.
So, with rpmforge configured, this was all I needed
Then I looked round for a player to stream the video (which were going to be in flash format). Flowplayer looked pretty nice. I just wanted something simple that would have only the video and controls on the page.
After looking over the sample html pages that come with flowplayer it was easy to create a page with just the video on there. So I uploaded my videos which were in mpg format.
Running the command
# ffmpeg -i video.mpg -s 320x288 -b1200000 -ar 44100 video.flv
#
converted the video to flash format with a pretty high quality but without making the files too large. I’m sure I could probably find better settings if I played around a bit more.
And here some examples of the end result -
http://sysadminman.net/video/takeoffsywell.html
http://sysadminman.net/video/alconbury.html
http://sysadminman.net/video/fisty_nuts.html
Just out of interest - the aircraft is a Pegasus Quantum 582 which you can see a picture of here.
I no longer own it and and miss the summer evenings flying around the english countryside.
1st August 2008, 08:13 am
I get a lot of people asking me about running Asterisk on a VPS. It’s a great way to get started and experiment with Asterisk and find out what it can do.
If you’ve used something like Skype or Vonage before then you’ll have an idea what you can do with VOIP but running your own Asterisk server makes things so much more flexible.
If you combine Asterisk with FreePBX, a great web interface for configuring Asterisk, then you’ll have an extremely capable PBX. There are many plugin modules available for FreePBX which provide an easy way to setup advanced features such as voicemail, IVRs, follow-me, time conditions, conferencing …
It is possible to run Asterisk on pretty much any VPS but you’ll definitely have a better experince using a VPS specifically designed for running Asterisk. A couple of features that may not be available with a ‘normal’ VPS is the ztdummy driver and high quality bandwidth.
Continue reading ‘Asterisk on a VPS’ »
7th July 2008, 11:08 am
Here’s a small bash script to destroy all existing zfs snapshots.
Run at your own risk!
#!/bin/bash
for snapshot in `zfs list -H -t snapshot | cut -f 1`
do
zfs destroy $snapshot
done
18th June 2008, 09:09 am
If you’re running Asterisk on a VPS or a dedicated server then setting up your iptables firewall can be a tricky.
I thought I’d post my firewall script to help get you started. I save this script as /usr/local/bin/firewall.sh and then add a line to run it from /etc/rc.local
It allows SSH’ing to the machine plus rules required for SIP connections (you will need other rules if you use IAX) plus some basic “bad stuff” filtering.
I’ve commented it so, hopefully, you’ll be able to figure out and chages you need.
Continue reading ‘iptables for asterisk’ »
2nd June 2008, 09:39 am
As someone pointed out here another possibilty for these kind off error messages is that, if you’ve just changed the SSH port from 22 to something else for security, then there’s a good chance your firewall may be blocking the connection.
Redhat5/CentOS5 cetainly has a firewall enabled as default. Try ‘iptables –list’ to see if you’ve got iptables running
1st June 2008, 06:46 am
If you have your website, e-mail system, etc. running on your own VPS or dedicated server it’s good to know when that server is unavailable so you can contact your server provider asap.
The best way to do this is use an external monitoring company. I’ve been using Hyperspin for a couple of months now and it’s been working great.
You can pick what services/ports on your server to monitor (SMTP, HTTP, HTTPS, etc.) and you can chose how to be alerted when they are not available. Obviously you need to make sure that you’re alerted via an out of band method (in other words don’t rely on an e-mail to an e-mail account on your VPS to know that your VPS is down!)
The Hyperspin website isn’t very pretty but overall their system is reliable and easy to use.
29th May 2008, 09:28 am
I run a backup script to backup my VPS’s every night using rsync. On one of my VPS’s I was seeing the error “ssh: connect to host … port 22: Connection refused” at seeming random points.
It took me a while to track down the fact that lylix.com (the provider of my VPS) block multiple inbound and outbound ssh connections to a server made over a short period of time.
Whilst this is probably useful for some people, and will offer their VPS some protection from brute force login attempts, it broke my script!
Continue reading ‘ssh: connect to host … port 22: Connection refused’ »
27th May 2008, 10:54 am
Do you fancy winning a brand new laptop?
There are a total of 13 being given away by some tech bloggers/podcasters.
Head on over here to find out how to win one
19th May 2008, 01:41 pm
Even with today massive disk drives it’s so easy to run out of disk space. This can be a real pain if you happen to run out of space on your root volume.
So, you fancy doing some spring cleaning and want to track down where all of your space has gone.
Here’s a quick run through using nothing more than the command prompt -
To show all of your filesystems with the -m showing used/free space in megabytes
$ df -m
Filesystem 1M-blocks Used Available Use% Mounted on
simfs 10000 718 9283 8% /
So I’m using 718 MB of my disk space but where?
For the next bit we’re going to need to be root (or root equivalent)
$ sudo -s
# cd /
# du -ahm --max-depth 1 --exclude /proc | sort -n
That will list the size in MB of all of the folders in root (/) with the largest last.
5 ./bin
6 ./etc
6 ./root
7 ./sbin
12 ./lib
18 ./home
154 ./var
513 ./usr
So my /usr folder is using 513MB. Now I can drill down into the folders running the same command again.
# cd /usr
# du -ahm --max-depth 1 --exclude /proc | sort -n
and so on.
Obviously you only want to be deleting files when you’re absolutely positive what they are used for and what impact deleting them will have on your system!
There are a whole bunch of utilities for both Windows and linux to make this process easier and prettier! Here’s a couple -
Linux - http://treesize.sourceforge.net/
Windows - http://sourceforge.net/projects/windirstat/
16th May 2008, 10:37 am
I’ve always been pretty confident just using denyhosts to prevent people running brute force ssh login attempts against my servers but now with this from securityfocus - http://www.securityfocus.com/news/11518 - I think I’ll also be changing the port number that SSH is listening on.
The report says that there are now large distributed brute force ssh attempts coming from multiple IP addresses. This means that utilities that are blocking login attempts from hosts that have made multiple failed attempts are not going to help.