Windows Live Writer

July 2nd, 2009 Brad No comments

Over the years there have only been a handful of Microsoft products I liked enough to praise, in fact besides Windows XP SP2 the only others that come to mind are the Powertoys of yesteryear and the Sysinternals suite. Today that has all changed when I stumbled upon Windows Live Writer. Live Writer is a .NET application that allows blog posting and management for almost any blogging system used today. Writer also has a plugin system that allows you to connect with other services like Facebook, Twitter, and Flickr, along with making it a snap to insert code, videos, maps, and more.

Using this entry I’m going to test out some of the features and plugins I’ve installed. The first is a feature that should have been included with the Wordpress core from day one, a Code Snippet plugin with syntax highlighting:

   1: foreach ($hesk_settings['custom_fields'] as $k=>$v)

   2: {

   3:     if ($v['use'] && $v['place'])

   4:     {

   5:         if ($br)

   6:         {

   7:             echo '<br /><br />';

   8:             $br = 0;

   9:         }

  10:         echo $v['name'].': '.$ticket[$k].'<br />';

  11:     }

  12: }

 

Looks good! Now lets see about quickly and easily linking an image from my Flickr photostream. And yes ladies and gentlemen, that is a picture of fiber optic cable spliced together with “scotch-lok” style crimp connectors. It’s amazing what you’ll find in the field!

0129091350a

 

It looks like I’ve finally found a desktop blog publishing application, at least until I find the big caveat I always seem to find in Microsoft products. Enough praise though, I’d hate to waste it all now and not have enough for Windows 7’s release, just in case I need it. ;)

Categories: Blog, Windows Tags: ,

Facebook Privacy Hack

June 22nd, 2009 Brad No comments

There’s something new to be scared of on one of the largest Social Networking sites, Facebook. There is a new “hack” that allows someone to view information in your profile that is marked as private. Now this actually doesn’t bother me much but some people are going to be freaking out very soon! The author of this hack has stated that it will be released to the public soon so get ready for the spam!

Source: http://www.fbhive.com/private-facebook-info-accessible-with-a-simple-hack/

Alternate: http://bit.ly/ulvWc

Categories: Facebook, Internet Tags: ,

Time Killing Game

June 17th, 2009 Brad No comments

Lately I have become addicted to a little game called Cargo Bridge. If you have a few minutes try out this flash game! So far I’ve made it to level 20….. and it doesn’t look like I’ll ever make it past!

Categories: Uncategorized Tags:

AreaCode Lookup Script

June 17th, 2009 Brad No comments

Here we have an almost useless script that I built last night! That’s right, I’m now writing scripts that would have been useful 5 years ago. While that is actually true I didn’t really make this AreaCode Look up Script because I needed it, I simply made it to help myself along with learning PHP. This script makes use of a large array, if/else statements, and even a little error handling. Those three items happen to be exactly what I’ve been working on and having issues so I decided to build something that could help me understand how all of these work, and work together.

So here’s a handy little PHP script that checks an areacode and returns what state it is found in. It’s linked here on the Tools page and available for download here if you’d like. Two files, one is an include that carries the array and the other is the form and script.

Categories: PHP, Web Development Tags: ,

Apache2: Virtual Directory outside of /var/www

June 7th, 2009 Brad 1 comment

Since Apache2 changed the format and location of certain settings in config files there is a new way to create a Virtual Directory outside of the default /var/www home location. This is actually very easy and involves creating only one file.

Using your favorite text editor create a new file:

sudo nano /etc/apache2/conf.d/alias

In this new file enter this information replacing the paths to suit your needs:

Alias /URL-Alias /folder_location
<Directory /folder_location/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Now reload Apache2’s config and restart the server (restart is not always needed but never hurts):

sudo /etc/init.d/apache2 reload

sudo /etc/init.d/apache2 restart

That’s it, you should be able to access your new virtual directory at http://localhost/URL-Alias.

Categories: Apache, Linux, Ubuntu Tags: , ,

Refresh an Image with a Single Line of Code

June 6th, 2009 Brad No comments

Various web projects I’ve done over the years have needed to refresh an image on a specific time interval.  There are many ways to accomplish this including the method I’ve been using which is a Javascript function, which was only about 10 lines of code when neatly formatted.  This evening I stumbled onto a different way to refresh a single image, and it’s all done within the <img> tag.

<img src=”image.jpg” id=”reloader” onload=”setTimeout(’document.getElementById(\’reloader\’).src=\’image.jpg?\’+new Date().getMilliseconds()’, 5000)” />

Simply replace the two image.jpg places with the path to your image and adjust the time to suit your needs. The code as shown will refresh the image every 5000 milliseconds (5 seconds).

Keep an eye on your SSH Access

June 5th, 2009 Brad No comments

One of the first things I do to every Linux server I manage is setup a small notification to be sent any time the server is accessed via SSH. There are a couple of ways to do this but the method below has always worked for me. The only prerequisite is the server being able to send email.

Here’s our code that will notify us via email anytime someone logs in via SSH:

echo ‘[SSH] – SSH access to SERVERNAME on:’ `date` `who` | mail -s “SSH access from `who | cut -d”(” -f2 | cut -d”)” -f1`” enter_email@address.here

Open up /etc/profile in your favorite text editor and add this to the end, changing the SERVERNAME and Email address of course. Now when someone logs into your server you’ll know it!

Categories: Linux, Ubuntu Tags: , , ,

Crontab Refresher

June 5th, 2009 Brad No comments

What happens when you are setting a few cron jobs up from memory after a server migration and you get in a hurry? The answer is of course you screw them up! Yesterday I managed to have a backup script run every minute of the 3AM hour, which the server did not like much at all. This script was intended to run at 3AM only but because I was in a hurry to finish the migration it ran 60 times in an hour. So for anyone that might be reading this here is a quick guide to cron and crontab format.

Read more…

Categories: Linux, Ubuntu Tags: , ,

Nano and Numpad, working together!

June 4th, 2009 Brad No comments

If Nano is your bash editor of choice like it is mine then I’m sure you’ve noticed the little annoying problem with the numpad not working properly. It’s an easy fix if you don’t mind typing nano -K file.sh everytime, but who wants to do that? Making an alias for Nano is the easiest way to solve this problem:

alias nano=’nano -K’

Now when you use nano file.sh your numpad will work like a champ! To take this one step further we’ll make this alias hang around through logoff and reboots. In your home directory edit the hidden file .bashrc and look for the area #Alias Definitions. Add your alias here and Nano will be much more pleasant every time you logon.

Categories: Debian, Linux, Ubuntu Tags: , , ,

Ubuntu: Setup a Static IP

June 4th, 2009 Brad No comments

Setting a fresh Ubuntu Server or Desktop to us a static IP instead of DHCP is quite easy. You can do this using the GUI on Ubuntu Desktop edition but I’m only going to cover the command line method since it applies to both and is easier than the Network Manager GUI in my opinion.

First off we’ll edit our interfaces file:

sudo nano /etc/network/interfaces

Your file should look like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

We want to change the section for the Primary network interface, eth0 in most cases, to look like this:

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

You’ll need to change the IP’s and Netmask to suit your needs.

After you’ve edited the file all we need to do now is restart the networking daemon:

sudo /etc/init.d/networking restart

Categories: Linux, Ubuntu Tags: ,