Archive for the 'Scripts' Category

Mounting A Network Drive On Startup Using Linux Ubuntu 7.10 On A Macbook Pro

http://celeb.wohoo.co.uk/wp-content/uploads/2007/02/nas-where-are-they-now.jpgI wanted to have my network attached storage (NAS) always mount on startup.

To do this there must first be a place to mount to, so create a folder (I created mine at /media/nas) either visually or using the following line in terminal:

sudo mkdir /media/nas

Once this is done the following line mounts the drive:

sudo mount -t cifs -o username=username,password=password //192.168.1.10/nas /media/nas

Once that is all working to get the NAS to mount every time add the following line to the bottom of /etc/fstab:

#Mount NAS
//192.168.1.10/nas /media/nas cifs username=username,password=password

Add the correct username and password and you’re away. If it’s a guest account the username is guest and password remains blank. The drive mounts fine at startup and when no network connection is present, nothing happens. When you then connect, the NAS will be mounted automatically, at least in my experience.

There may be some issues with permission so you might need to chmod and chown the folder created to mount to, but I have had no problems as yet.

Hello, My Name Is EL011272.ORF and I’m All The Way From Flickr


EL011272.ORF

Originally uploaded by e lton1

How about a bit of that

Flickr Blog API
Seems Flickr has an API function that allows it to link up with Wordpress (or other popular blog engine) so you can post your Flickr images to your blog. This effectively becomes your Flickr blog too, so that’s a nice solution.

However, after an easy set up and some nice options and customizable html and css for layout you unfortunately can only post one image at a time to your blog. It would be great if you could post whole sets more easily.
Please someone make this.

Also, you can’t post categories and tags from flickr so you have to add them later which is bum, and if you edit a flickr post using wordpress for some reason the image fails to show up, at least on my version of wordpress (2.3.1) and server. shouldn’t be a problem though. anyone else seeing no image and just the tiny border in this post? so realistically you can’t add categories or tags to posts made in flickr, rendering it pretty useless.
i promise i haven’t deleted anything, i double checked.
very odd..

UPDATE
This happens because Wordpress, on formatting the entry to be edited (but not on saving) for some reason changes the formatting of the HTML as follows:

From this (which works and is from flickr):

<div style=”float: right; margin-left: 10px; margin-bottom: 10px”>
<a href=”http://www.flickr.com/photos/eltonone/2030342401/” title=”photo sharing”><img src=”http://farm3.static.flickr.com/2152/2030342401_1caf1c5ffb_m.jpg” style=”border: 2px solid #000000″ /></a>

<span style=”font-size: 0.9em; margin-top: 0px”></span>
<a href=”http://www.flickr.com/photos/eltonone/2030342401/”>EL011272.ORF</a>

Originally uploaded by <a href=”http://www.flickr.com/people/eltonone/”>e lton1</a>
</span>
</div>

To this (adapted by Wordpress):

<p style=”float: right; margin-left: 10px; margin-bottom: 10px”> <a href=”http://www.flickr.com/photos/eltonone/2030342401/” title=”photo sharing”><img src=”http://farm3.static.flickr.com/2152/2030342401_1caf1c5ffb_m.jpg” style=”border: 2px solid #000000″ /></a><span style=”font-size: 0.9em; margin-top: 0px”></span>
<a href=”http://www.flickr.com/photos/eltonone/2030342401/”>EL011272.ORF</a>

Originally uploaded by <a href=”http://www.flickr.com/people/eltonone/”>e lton1</a>

So until Wordpress fixes this bug, change it back and it’ll display right. Until you want to edit it again.
Another thing that might be interesting - if you want to paste code into wordpress an have it show up as plain text, just paste it into the visual window and it’ll be plain. Make sure you click save and continue though because if you go into the code window it screws everything up. I learnt the hard way. Essentially click save and continue all the time and you’ll be ok. Just like word.
|| Made me wonder what the code buttons are for in the code window though (i thought it escaped code, and it sort of does). Don’t get me started on that though..

Anyway..

Wordpress Flickr Photo Album Plugin by Silas Partners
The Flickr plugin I have for Wordpress is good, but you have to select each image individually to get a whole set on (like the sets further down the page), and the title doesn’t link to the set unless you find it out and make it. And for some reason sets are called albums.. and when you add an ‘album’ (it’s a set. call it that. please.) it only adds the first image in that set with a link to that sets page. it’s good, but it’d be better to have the options to add a whole set as:

a) one image you can choose from that set;

or

b) all images from that set

and have the link for each image as the set page or the images page (and be able to choose which).

I think though it might be easy enough to figure out as the Wordpress plugins are in PHP.. then again it’s someones else PHP so it might not.

I’ll add that to the list..

The curse of php files forcing themselves to download and not display normally on your localhost

When you want to change your PHP version (like from 4 to 5) you need to put in your local .htaccess file the line:

AddHandler application/x-httpd-php5 .php

This works fine on a web server, but when applied to your localhost it causes your browser to try to download the .php file as oppossed to display it as normal.

I went mental for a few months and completely stopped web scripting because MAMP and my localhost refused to let me see my local web pages. I thought for a while it was something to do with MIME Types, but I could find no conclusive evidence to support this.

Jay from RebuildTheRobots randomly discovered this when upgrading from PHP4 to PHP5.

Remember: Don’t despair. There is always a solution.

« Previous Page