Back Up Windows From Linux, Free and Simple

Martti Kuparinen was kind enough to share a script he has made for backing up the Windows partition as an image. Here is a link to his original site, which has clear instructions.

http://kuparinen.org/martti/comp/windows/backup.html

I highly advise that you follow his instructions on his web page.

I have downloaded and saved as an archive the scripts, win2bak and bak2win

and his instruction page along with some of my own notes

Here is the archive – win2bak-bak2win.tar.gz

I have not attempted to restore the image yet. ;-)

Posted in Uncategorized | Leave a comment

Terry’s Favorite Mushroom Frittata

  • 1 large onion – chopped
  • Pat of butter
  • 1/2 to 1 cup chopped mushrooms -  any kind
  • Tbs of chopped garlic, or one large clove
  • Two eggs, beaten
  • 1/4 to 1/2 cup of chopped cilanto
  • 1/2 can of olives – chopped or small can of chopped olives

Sauté an onion in a heavy skillet with a pat of butter. When onion begins to get translucent, add chopped mushrooms and cook for about 5 minutes. Next, add some fresh, chopped garlic and cook for another minute. Turn the heat down to medium and add beaten eggs. Give it one stir, and immediately add chopped cilantro and olives. Stir to mix, then let set until the egg gets firmed. Turn over and cook other side, add salt and pepper to taste.

Posted in recipes | Leave a comment

Frozen Tamales with Sauteed Mushrooms

Take your frozen tamales and steam them – I like those vegetarian ones at the Community Store. . . Zucchini and cheese flavor – don’t overcook. Maybe five minutes, maybe 9. While they are steaming, put your mushrooms in the butter in the pan with a little garlic. Sautee them a little and by the time you think they are done, the tamales will be, too.

Put the buttery mushrooms on top of the tamales and eat.

Posted in Uncategorized | Leave a comment

Tiny Taco Salads

For the tiny taco bowls use Tostitos “Scoops” chips and add tiny portions of

  • ground protein source (tempeh, Gardenburger, etc. or try delicious Morningstar Farms Breakfast Sausage) cooked with chili powder, salt
  • cheese
  • avocado
  • salsa
  • chopped lettuce
  • slivered onions
  • maybe a little sour cream . .
Posted in recipes | Leave a comment

Handbrake 0.9.3 for Ubuntu 9.10 Karmic Koala

I want to rip my DVDs to Xvid but the newer version of Handbrake doesn’t support it. Marc Deslauriers has been so kind as to make available on his Launchpad PPA the Handbrake 0.9.3 package he created for Ubuntu 9.10 Karmic Koala. This way I can still rip DVDs to Xvid avi files like I like. One day I’ll try using the newer codecs, but for now, I’m staying cool because my DVD players all support xvid and not Matroska.

I have saved the deb files here but I recommend simply adding his PPA as a source (click “Technical details about this PPA” on that page to learn how)

and then

sudo apt-get install handbrake-gtk

That way your system will stay updated if newer versions are released.

Alternatively, you could install the Ubuntu 9.10 packages I saved here:

If you have Ubuntu 9.10 Karmic Koala or Linux Mint 8 do the following:*

Install the common-files package first:

DO Install handbrake-common_0.9.3+repack1-0md0.9.10.2_all

AND Then install this package for the handbrake program:

handbrake-gtk_0.9.3+repack1-0md0.9.10.2_i386

OR If you are sure that you are ready to use the 64-bit version, then install the common-files above and then choose this package instead:

handbrake-gtk_0.9.3+repack1-0md0.9.10.2_amd64

*If you are using Ubuntu 9.04 or if you’re using Windows, see my other post about Handbrake 0.9.3 for ripping to Xvid avi files

Posted in Uncategorized | Leave a comment

Protected: A Little History (Bash history)

This post is password protected. To view it please enter your password below:

Posted in Uncategorized | Leave a comment

Old Version of Handbrake for Ripping DVD to Xvid

Handbrake is a great DVD ripper. It’s good for “ripping” a DVD to make a movie file such as “American_Psycho.avi” ;) . Handbrake 0.9.3 is the last version that has support for creating Xvid video – the kind you want for your standalone divx player such as the Philips DVP642. They developers have dropped support for Xvid in the new releases because of Xvid’s incompatibilities with the newer codecs like H264 Matroska, etc, which are actually better for HD video and can have chapters, etc. . . .

But I like encoding in Xvid because the standalone players (Philips DVP 642, DVP 5960, DVP 3140) my friends and family and I use do not support Matroska or h264, but do a great job with Xvid. We have quite a collection and it will still be in use for years to come. So since Xvid is such a favourite, and Handbrake is so ultra-cool and awesome, I am going to keep the Xvid version, Handbrake 0.9.3, running on my computers as long as I can. To that end, I’ve collected some installers and links to old versions of handbrake here.

Installers

Windows (You may need to install .NET first from Windows Update):

Handbrake 0.9.3 Windows Installer

Linux:

Ubuntu 9.10

Handbrake 0.9.3 packages installed easily on Ubuntu 9.04 (see below) but wouldn’t run on Ubuntu 9.10 Karmic Koala because of dependency problems (add error message here)

If you have Ubuntu 9.10 Karmic Koala or Linux Mint 8 do the following:*

Install the common-files package first:

DO Install Ubuntu – common (9.10) handbrake-common_0.9.3+repack1-0md0.9.10.2_all

AND Then install this package for the handbrake program:

Ubuntu 32-bit (9.10)-handbrake-gtk_0.9.3+repack1-0md0.9.10.2_i386

OR If you are sure that you are ready to use the 64-bit version, install the common-files above and then choose the 64-bit package instead:

Ubuntu 9.10 Karmic Koala 64-bit -handbrake-gtk_0.9.3+repack1-0md0.9.10.2_amd64

Ubuntu 9.04 and earlier

Ubuntu 32-bit (9.04 or earlier) – Choose this if have ubuntu and you aren’t sure if you have 64-bit

Ubuntu 64-bit (9.04 or earlier)

PPA for Marc DesLauriers – Where I found the handbrake package and where you can simply add the source (click “Technical details about this PPA” on that page to learn how) and then

“sudo apt-get install handbrake-gtk” will install Handbrake for you!

*If you are not sure which Ubuntu version you have, look in your “Software Sources” applet. There you will get some idea.

Posted in Uncategorized | Leave a comment

Exclude a Category from the Front Page in Wordpress

To prevent posts from a certain category from showing up on your front page in Wordpress, put this in your index.php (or the template where you want to exclude a category from your page, maybe archive.php) BEFORE the loop:
< ?php query_posts($query_string . '&cat=-53'); ?>
The category number to exclude in my example is 53. You can replace that number with whichever category you want to exclude. To exclude more than one category, just separate with a comma, so:
< ?php query_posts($query_string . '&cat=-53,-13'); ?>
To determine the category’s number, just open your admin panel, and go to –posts–categories and then hover your mouse pointer over the category in question, while watching the status bar of your browser, or just click on one of the category names there. The last bit in the url is the category number, like “cat_ID=53″
I wanted to exclude all video posts from my front page cannabisfantastic.com because they sort of block the news and other content. By using this method, I can still have a video category but the video posts don’t automatically show up on top distracting from my other posts. See the The Loop page at the Wordpress Codex for more information.

Posted in web development, wordpress | Leave a comment

Dell Inspiron 2500 With Intel 82815 Graphics xorg.conf for 1024×768

Just install Xubuntu 8.04 and use the following for your /etc/X11/xorg.conf.
To do that, simply back up your existing xorg.conf . . .

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

And then . . .

sudo gedit /etc/X11/xorg.conf

–paste in the following, and then save:


Section "Files"
EndSection
#
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
#
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection
#
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizEdgeScroll" "0"
EndSection
#
Section "Device"
Identifier "Intel Corporation 82815 CGC [Chipset Graphics Controller]"
Driver "intel"
BusID "PCI:0:2:0"
EndSection
#
Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 31.5-48.5
VertRefresh 40-70
EndSection
#
Section "Screen"
Identifier "Default Screen"
Device "Intel Corporation 82815 CGC [Chipset Graphics Controller]"
Monitor "Generic Monitor"
DefaultDepth 16
SubSection "Display"
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection
#
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
#
# Uncomment if you have a wacom tablet
# InputDevice "stylus" "SendCoreEvents"
# InputDevice "cursor" "SendCoreEvents"
# InputDevice "eraser" "SendCoreEvents"
InputDevice "Synaptics Touchpad"
EndSection

Posted in Uncategorized | Leave a comment

Setting Permissions Properly in Wordpress

This is basically notes I am taking while learning in the school of hard knocks based on an article I posted 2008-July-31. To cut to the meat of the matter, here are the notes I took as I learned:

In the blog directory;
Type the following to see folders in and under this directory that are writeable by group and/or others:
find . -type d -perm +022 -ls
Do the following to take away write permissions from group and others on those same folders:
find . -type d -perm +022 -exec chmod go-w '{}' \;
Type the following to see files in and under this directory that are writeable by group and/or others:
find . -type f -perm +033 -ls
Do the following to take away write permissions from group and others on those same files:
find . -type f -perm +033 -exec chmod go-wx '{}' \;
And then, test to see if your server can run wordpress with the wp-config.php file invisible. It is obviously more secure to do this, since this file contains your database passwords in plain text! To do this:
chmod 600 wp-config.php
or, instead, just:
chmod go-rwx wp-config.php
to make your config file unwriteable and unreadable by others and also by group. The former sets all perms explicitly; the latter merely takes away read, write, and execute from the group and other. These measures work great for me on my linux shared server but the resulting permissions on wp-config.php may be too tight for some servers which are set up another way. My joyent server has something called php-suexec where Apache can run as my user or something like that.  If upon setting the permissions for wp-config.php to 600, you get an error about permissions in ‘wp-load.php on line 27″, or something like that, you may need to leave the wp-config.php readable by group and others, so just
chmod 644 wp-config.php

Edit: I have discovered that to coax the upload feature to function on a certain Linux configuration, where Apache apparently does not run as the user account (no suexec), the uploads folder inside wp-content must be writeable by the group and by everyone! That is unless it’s possible to make the apache user be in the same group as me or something. Anyway apparently according to the Wordpress codex, it was designed to work that way. On a different server where apache runs the suexec module so it can run as the user (me) I can still keep my uploads folder 755. Not in this configuration. So far it must be 777 for that folder only.  Unless there is a way for me and the web server to share group permissions somehow . . .
And read on for my whole rant on the subject, including my first attempts down below—–

Security is a matter of trust, and access should be granted on a need-to-know basis, and (you) don’t need to know. ;) loi
Consider, for example, the case of running Wordpress on a shared server. It’s frequently recommended that after installing and setting up Wordpress we change the permissions on wp-config.php to 600. Why? With permissions of 644 It would be readable by other user accounts on a shared server. Since wp-config contains sensitive database information that would be an insecure situation. Of course, one could always change permissions and then change them back if and when one needs to edit the file.
I’m going to digress a bit for some background on file permissions in Linux/BSD/Unix. Permissions can be symbolic , like drwxr-xr-x or octal, like 755. By the way, the “d” in the front of drwxr-xr-x tells us it’s a directory (folder). If it were a file, it would be a “-”.
Here’s a table I made to help me remember :

read write execute
r w x
4 2 1

To see information about the files in the current directory, including permissions, type

ls -la

The Wikipedia entry has a more complete explanation.
Setting permissions on all folders to 755 and on all files to 644 is emphatically recommended by many Wordpress blog owners. Contrarily, the Wordpress Codex says to make all the files in your wp-content directory writable by using the following two steps:

1. Go to your WordPress main directory, with a command like cd wordpress/
2. Enter chmod -R 777 wp-content

The Codex also says if you use Permalinks you should change permissions of .htaccess to make sure that WordPress can update it when you change settings or add some new Page (which requires update of the file to work when Permalinks are enabled).

1. Go to the main directory of WordPress
2. Enter chmod 666 .htaccess

I’m not doing that yet, though. I read that with a modern setup where the server (Apache, etc) runs as the user (setuid user) you can keep your wp-content directory 755. Also I read that you should simply set .htaccess temporarily to 666 while WP updates it when you change settings or create a Page.

STEPS I DID to my blog to tighten up the ol’ security belt
First, make sure I (the user) own everything in the blog directory.
cd to your blog directory (or your web root if you like)

cd my/blog

and issue the following command to find files not owned by you (please replace the word “me” with your username):

find . ! -user me

Maybe do this if you can:

sudo chown -R me .

So now you could find all directories (folders) under the current folder and set their permissions to 755

find . -type d -exec chmod 755 '{}' ;

I’m following along with what’s recommended in the Wordpress Codex here. Note that that document indicates cryptically that

You have to omit to use this command for /wp-includes/.

However, I think it’s a typo and they meant to refer to /wp-content/, which is the folder mentioned elsewhere as being the only folder needing different permissions, those being 777 ! World-writeable?!
It seems that some or most of the files in /wp-includes have read-only permissions, 444 or -r–r–r– !
I felt that it couldn’t hurt to leave the permissions as strict as possible, while I wanted to change the permissions recursively, and not have to issue a bunch of separate commands. I administer several blogs, and I’m going to have to duplicate this a few times. I did a little research:

man find

And I decided to find all files (not directories) under the current directory that are writeable by either the group or the world (other) or both and change their permission mode removing write permissions for group and for other. This will include the wp-includes directory but will leave more restricted permissions alone, instead of arbitrarily changing every file’s permissions (Please take note that this is the proper command for FreeBSD and probably will but might not be exactly right for Linux; please research for yourself) :

find . -type f -perm +066 -exec chmod 644 '{}' ;

After Wordpress is set up and running properly, and before it is attacked by someone who owns an account on your shared server,

chmod 600 wp-config.php

—EDIT 2009-01-06

I have now done this in a linux box and it seems like it’s different.

I think on Linux the find option, or test, “-perm +mode” might behave differently than on BSD. I’ll report back later but these are the ones that worked on Linux:

find . -type f -perm +033 -exec chmod 644 '{}' ;

The above means find in this directory files of type file (not a dir, etc) that are either group or others writeable, (I think) and change their permissions to 644. 644 is how you want most, if not all regular files’ permissions set.
Directories (folders) to be accessed publicly you want to be 755 generally. That means rwx for owner and rx for others and group.

find . -type d -perm +022 -exec chmod 755 '{}' ;

also use for instance to test the result:

find . -type d -perm +022 -exec ls -la '{}' ;

The above lists the contents of the dirs found as well as the dirs.
You can use this to list files found – simpler:

find . -type d -perm +022 -ls

For more information, please type “man find” in the terminal.

Posted in web development, wordpress | Tagged , , , | Leave a comment
WordPress Loves AJAX