Favicon/URL/Bookmark icon for you website

October 7, 2010

You can easily create a bookmark icon / URL icon / Domain Icon / favicon.ico for your website.

This is usually called favicon.ico, and usually exists in your web root folder (htdocs, public_html, etc).

Why would you do this?

  1. Your Brand is present in the users Browser URL/URI field in browsers and/or on the browser window or tab title
  2. Your Brand is present in the users browser bookmarks
  3. You user can easily find Your Brand in their bookmarks list – from my perspective, this is a big win.
    1. I have a couple of options bookmarked for the types of online service I use most, and in the cases where one of the sites has no favicon and another does, I inevitably end up using the site that has the favicon, simply because their favicon stands out immediatly in my list of bookmarks.

Your favicon can be a .ico, .gif or .png file.

I use .png more and more. I use a 32×32 pixel file but you can use 16×16 also.

http://en.wikipedia.org/wiki/Favicon

Generally, for the simple/default case, you just name the icon as “favicon.ico” and upload it to the root directory of your website. The broswers will check for it there (http://www.yourdomain.tld/favicon.ico).

You can also use this markup, per page, to have a favicon per page.

<link rel=”shortcut icon” href=”/img/favicon.ico”/>

 


Reset Administrator Password on a Mac / Apple Mac

October 7, 2010

Have tried this on a Tiger OS X

  • Reboot
  • Hold down Apple+S when you hear the chime
  • When you see the Aplle on screen, hit the power button once

You should see the text prompt now

Type:

  • mount -uw /
  • passwd
  • reboot

That’s it.
You should be able to log into the administrator user account with the new password you set now.

You keychain will probably be useless no unless you remember the password for that. I had connectivity issues, the airport would not connect to my wireless networks.

Once I deleted the login keychain, the network issues went away.

To delete the login keychain:

  • Open Applications/Utilities/Keychain Access
  • Click the Login keychain
  • Choose Edit -> Delete

root user password recovery / resetting on Debian/GNU based linux systems

August 5, 2010

I have had need for this more often than I would like of late, it is a nice and quick way to reset the root password if you can’t remember, or the person who had it isn’t around any more. You need access to the actual console of course, physical access or a remote KVM. I’ve used this on both Debian boxes and Ubuntu boxes recently.

  1. rebooot the machine
  2. interrupt the boot sequence at the GRUB bootloader / LILO screen (I haven’t seen LILO on Deban / Ubuntu in quite a while)
  3. edit the boot line with “kernel” information (select and press e to edit)
  4. add init=/bin/bash to the end of the line
  5. hit enter and then press ‘b’ to boot
  6. when the boot sequence has finished, type the following:

mount -o remount,rw /
passwd root
(enter the new password for the ‘root’ user)
shutdown -r now (to reboot and login as root with the new password)


Debian : Apache : PHP : Database Error: Unable to connect to the database:The MySQL adapter “mysql” is not available.

May 28, 2010

Got this today when I browsed to my Joomla site, which I had just imported from elsewhere.

Database Error: Unable to connect to the database:The MySQL adapter "mysql" is not available.

Setting the correct database password in the joomla configuration file fixed the issue.


Clearing the MySql Logs

August 19, 2009

mysql> show master logs;

+------------------+------------+
| Log_name         | File_size  |
+------------------+------------+
| mysql-bin.000023 | 1074039776 |
| mysql-bin.000024 | 1023334365 |
| mysql-bin.000025 | 1073742100 |
| mysql-bin.000026 | 4254255    |
| mysql-bin.000027 | 117        |
| mysql-bin.000028 | 98         |
+------------------+------------+
6 rows in set (0.00 sec)

mysql> purge master logs to ‘mysql-bin.000028′;
Query OK, 0 rows affected (10.35 sec)

mysql> show master logs;
+——————+———–+
| Log_name         | File_size |
+——————+———–+
| mysql-bin.000028 | 98        |
+——————+———–+
1 row in set (0.00 sec)

 

mysql>


On demand “Tailing” of a database log table: select the last x records

August 19, 2009

Recently I had to monitor some data being output to a log table while an application was running.

The log table was quite large, and being written to constantly and also by portions of that system I wasn’t interested in.

So I only wanted to see the 10 or 20 most recent rows / records written.

There are quite a few ways to do this, but this is what I threw together. It assumes the ordering is based on an incrementing unique record id.

select count(*) into @rowcount from prodlog; select id, source_id, created_on, message from prodlog where id > (@rowcount-20) order by id;

I put the latest count of records in the table into a temporary variable. I then use that figure, minus the number of rows I want to see, to offset into the data.

Note that if the count of rows and row ids don’t match (e.g. because you used truncate) the above method will fail.

In this case you may use:

select id into @last_id from prodlog order by id desc limit 1; select id, source_id, created_on, message from prodlog where id > (@last_id-20) order by id;

This is still potential issues with this, for instance you may get less than you expected if there are gaps in the id sequence.

But it sufficed for my needs at the time :)


VNC server : Fatal server error: could not open default font ‘fixed’

August 18, 2009

Trying to run vnc-server recently on a debian system, I ran into the following issue:

cat .vnc/debian-dev\:1.log
14/08/09 14:40:01 Xvnc version 3.3.7 - built Dec 30 2006 12:50:35
14/08/09 14:40:01 Copyright (C) 2002-2003 RealVNC Ltd.
14/08/09 14:40:01 Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
14/08/09 14:40:01 All Rights Reserved.
14/08/09 14:40:01 See http://www.realvnc.com for information on VNC
14/08/09 14:40:01 Desktop name 'X' (debian-dev:1)
14/08/09 14:40:01 Protocol version supported 3.3
14/08/09 14:40:01 Listening for VNC connections on TCP port 5901
Font directory '/usr/share/fonts/truetype/' not found - ignoring

Fatal server error:
could not open default font 'fixed'

I solved the issue with some apt-get for dependancies as per below

apt-get install xutils xbase-clients xfonts-base xfonts-75dpi xfonts-100dpi

Ref:  http://www.debianhelp.org/node/5720


Using MySql with Jahia on Debian GNU/Linux

October 6, 2008

After installing Jahia today, I wanted to use the MySql database instead of the default HyperSonic. I am currently using MySql for other purposes and want to have a look at accessing the Jahia database to re-use content.

Initially when I created the ‘jahia’ database in mysql and granted permissions to the Jahia user, Jahia reported:

"This database doesn't seem to support extended charsets."

Dropping the database and recreating it with a unicode dataset sorts this little niggle out.

mysql> create database jahia character set = utf8;


Creating labels for disks in Ubuntu Debian GNU/Linux

March 31, 2008

The ability to create or change the disk label of fat/fat32/vfat file systems/partitions doesn’t come with Parted; yet is quite simple to achieve with Ubuntu Debian GNU/Linux :) .

This comes in very handy when you have a number of fat devices (like USB, SD, etc) and want something more meaningful than just “disk” as its name.

Get mtools if you haven’t it already
sudo apt-get install mtools

Create a configuration file to avoid some error reporting
echo "mtools_skip_check=1" > ~/.mtoolsrc

Check where your disk is in the linux devices
mount

Label your disk
mlabel -i /dev/sdb1 -s ::my_disc

…and there you have it.

Disconnect the device and reconnect it and the label will show when it is auto mounted.


Undelete files on a vfat partition in Ubuntu Debian GNU/Linux

March 31, 2008

I have recently used the ‘photorec’ component of the ‘testdisk’ application for recovering files from FAT32 file systems.

I had used it before to recover files from general USB devices and others like Compact Flash/MMC/Secure Digital media with great success.

Then, I was focusing on recovery of photos and movies.

This time I was looking for various non-image files. Again I was suitably impressed by its coverage, and its simplicity in terms of use and speed.

They name may suggest only photos, but this is a great piece of software, regardless of what kind of file you are trying to recover.


Follow

Get every new post delivered to your Inbox.