I was moving to a different web hosting Linux dedicated server, and I needed to move all my files over. I first tried to copy via "scp" all the website folders and files, but ran into a problem where scp was not copying symbolic links but instead was following the links and copying the same files repeatedly. I figured that I better use tar to create a tarball of my directories and files. I ran it with gzip compression and it really slowed down my server. No biggie but what I really wanted was to have tar skip huge files such as "access_log" and "error_log" created by apache. After doing some research here are the steps I went about doing this:
1)run "screen" (screen allows you to open up a connected instance of your shell, and in case you get disconnected by your ssh client, the command you ran after running screen still keeps running, and you can "re-attach" to the screen later).
2)make a text file called tar_skip_files.txt, and add file names line-by-line that you want tar to skip; wildcards are allowed. In this case my file looked like this:
[root@myserver]# cat tar_skip_files.txt
access_log
error_log
3)Run tar with the "eXclude" switch. The "z" invokes gzip compression. Here is an example:
tar cvfz websites.tgz /home/websites -X tar_skip_files.txt
Then scp the tarball over to your new server and you're in business!
Saturday, March 21, 2009
Sunday, March 15, 2009
Prevent Website Javascript from Disabling/Hiding Browser Menu and Address Bar in Firefox
Using Firefox, I was trying to print a transaction list from my bank's website. Once I selected the date range for the transactions to be printed, I'd hit a button on the report web page that says "Continue". After hitting that button, a new window appeared with an icon and a link that says "Print this page". When I clicked on it, the Windows print dialog box popped up. But I wanted to print preview first. The problem was that the new window listing the transactions was missing the menu bar. Normally I'd go to File, and then select Print Preview before I print in Firefox, but without the menu bar I was lost. So I looked for a hotkey for Firefox to do the print preview, and apparently it's Alt-F, then V. It didn't work in this menu-less window- I guess that since the menu bar was gone, the hotkey(s) to access it were of no use.
The bank website obviously was using javascript to disable the menu bar- why- I don't really know- to annoy customers like me perhaps. I couldn't disable javascript because then I couldn't even log into the site. I then went to Tools, Options, and unchecked the box that says Scripts will be allowed to do the following for "Disable or replace context menus". No go. I then went on the Firefox Addons site and found an addon called "Javascript Options", version 1.2.6.
After installing the Firefox extension and restarting the browser, I noticed new options in the same Javascript options area of Firefox. In the "Windows" section of the options window, several boxes were checked including "Hide the menubar", "Hide the toobar", "Hide the location bar", and "Hide the scrollbars". I unchecked all of them, then tried again (no need to restart Firefox) and voila, the new transaction window I was trying to print now has the menu bar so I can do a print preview on it.
This is a great extension, and I recommend everyone to look at the print preview first before printing web pages and documents. You can find that something doesn't look right- text getting cut off, or see that you can actually fit that extra line in the second page onto the first page by playing with the scaling options. Save some paper here and there, save the planet ;-)
The bank website obviously was using javascript to disable the menu bar- why- I don't really know- to annoy customers like me perhaps. I couldn't disable javascript because then I couldn't even log into the site. I then went to Tools, Options, and unchecked the box that says Scripts will be allowed to do the following for "Disable or replace context menus". No go. I then went on the Firefox Addons site and found an addon called "Javascript Options", version 1.2.6.
After installing the Firefox extension and restarting the browser, I noticed new options in the same Javascript options area of Firefox. In the "Windows" section of the options window, several boxes were checked including "Hide the menubar", "Hide the toobar", "Hide the location bar", and "Hide the scrollbars". I unchecked all of them, then tried again (no need to restart Firefox) and voila, the new transaction window I was trying to print now has the menu bar so I can do a print preview on it.This is a great extension, and I recommend everyone to look at the print preview first before printing web pages and documents. You can find that something doesn't look right- text getting cut off, or see that you can actually fit that extra line in the second page onto the first page by playing with the scaling options. Save some paper here and there, save the planet ;-)
Subscribe to:
Posts (Atom)