Command line network drive quickies

No Comments

The most common way to connect a drive to a network path in Windows is this command:

net use X: \\SERVER\Share

Where:

  • X: is the drive letter you wish to map the share to,
  • \\SERVER\Share is the UNC path to the share.

Assuming you have permissions to map drives and to access that share, it will map the drive and tell you that it mapped successfully.

If you want quick access and do not want to map a network drive, you can access a UNC Path directly from the Command Prompt using pushd.

For example:

pushd \\SERVER\Share

This will connect to the path automatically for you and make it your current working directory.

When you are finished on the network share enter the popd command. This will return you to the directory you were in before and delete the temporary network drive.

The popd and pushd commands can be used with local directories. If change to a directory with pushd it stores the previous location you were in so that when you issue the popd command you are returned to it. This is similar to bash-stacking in linux where if you open a shell within an existing shell, quitting that will take you back to where you were when you opened it.

When variable substitution goes wrong…

No Comments

Boy I love spam some days, it’s just … weird :) We had this one forwarded to us to block, I wonder if it’ll break something in our wonderfully crap filtering system.

—–Original Message—–
From: Julius Vailes [mailto:Julius-assolato@leeegs.demon.nl]
Sent: Monday, 11 May 2009 10:06 AM
To: [deleted]
Subject: $WordFile{click.txt}

$WordFile{click.txt} $WordFile{click.txt} $WordFile{click.txt}
$WordFile{click.txt} $WordFile{click.txt} $WordFile{click.txt}
$WordFile{click.txt} $WordFile{click.txt} $WordFile{click.txt}
$WordFile{click.txt} $WordFile{click.txt} $WordFile{click.txt}
$WordFile{click.txt} $WordFile{click.txt} $WordFile{click.txt}
$WordFile{click.txt} $WordFile{click.txt} $WordFile{click.txt}
$WordFile{click.txt} $WordFile{click.txt}

JCal Pro All day problem fix.

No Comments

It seems that on the “upcoming events” module of JCal Pro it shows “(All Day)” if you’ve got an all day item. It’s ugly and I was asked how to remove it. Here’s how to do it:

Edit modules/mod_jcalpro_latest.php
Comment out this line:

$returnstring .= ( $EXTCAL_CONFIG['show_times'] ) ? ‘ (‘ . $start_time . ( ($EXTCAL_CONFIG['show_times'] == 3 || $no_end_specified) ? ” : ‘ – ‘ . $end_time ) . ‘)’ : ”;

Replace it with:

if( $EXTCAL_CONFIG['show_times'] )
{
if( $start_time != EXTCAL_TEXT_ALL_DAY )
{
$returnstring .= ‘ (‘ . $start_time . ( ($EXTCAL_CONFIG['show_times'] == 3 || $no_end_specified) ? ” : ‘ – ‘ . $end_time ) . ‘)’;
}
}

WordPress security tip

No Comments

You can prevent people from looking inside your directories by creating a file in there called “.htaccess” and adding the following line:

Options -Indexes

This is a good way of doing this, since it then tells the web browser “You’re not allowed in here” rather than having to create blank files to hide your directories :)

Missing categories problem with WordPress 2.6

No Comments

So, loads of people are having issues with this as per a search or two on the WordPress forums, and I found myself in the same boat. Check it out – I found a fix :)

I inserted the wp_categories table from my backups and then ran the sql query I found here:

update wp_term_taxonomy, wp_categories set description = cat_name where term_id = cat_ID;
update wp_terms, wp_categories set name = cat_name, slug = category_nicename where term_id = cat_ID;

Older Entries