Scanning for CR/LF, want valid bash script

Quick Conversion Command

find . -name "*" -type f -exec dos2unix {} \;

Sample Script

#!/bin/sh
# MAKE SURE TO ALWAYS SAVE THIS FILE AS UNIX FORMAT.</code>

# Date: Monday, November 17, 2008 8:30 AM
# Author: Maurice Ruckman
#
# Description: Scan scripts directory looking for CR/LF which indicates
# a script was not saved in UNIX format. This would cause the script
# to fail.

grep -l -r $'\r\n' /devl/scripts > scan_for_crlf.output.txt

if [ -s scan_for_crlf.output.txt ]; then
echo "FAILURE CR/LF DETECTED IN SCRIPTS FOLDER"
echo "Found CR/LF when scanning scripts folder" | mailx -s "FAILURE FAILURE FAILURE CR/LF DETECTED IN SCRIPTS FOLDER" mruckman@hollandamerica.com
else
echo "ALL OKAY"
echo "All scripts passed test scan." | mailx -s "Scripts Folder Passed Scan" mruckman@hollandamerica.com
fi
find "/home/jboss1/workspace/HAL" -type f -name "*.java" > list.txt

We can easily convert the code with dos2unix

and find the problem code with something like this:

grep -l -r $'\r\n' /home/jboss1/workspace/HAL

or just convert everything by scripting it, here's a start

find "/home/jboss1/workspace/HAL" -type f -name "*.java"

Attempt to speed up FTP in Ubuntu

Try installing FileZilla instead.

sudo gedit /etc/modprobe.d/aliases

Replace

alias net-pf-10 ipv6

with

alias net-pf-10 off

and reboot.  After that, 'ifconfig' should no longer show any scary looking hex-notated IP addresses.

Update: It did not help FTP speed.  Change rolled back...

How to remove red eye in PhotoShop

Create a new layer and paint color of iris, use guassian blur 1.0, blend layers saturation, duplicate this layer and use hue saturation

Refer: http://graphicssoft.about.com/library/nosearch/n-psredeye.htm

Difficulty: Easy
Time Required: 5 minutes
Here's How:

1. Open the image.
2. Go to Image > Duplicate and close the original.
3. In Photoshop 6 or earlier, go to View > New View. In Photoshop 7 go to Window > Documents > New Window. This will open a duplicate window of the same image.
4. Zoom one of the windows so that you can see the eyes as large as possible. Set the other window view to 100%.
5. Arrange the two windows so you can see both the zoomed view and the 100% view at the same time.
6. Create a new layer.
7. Use the eyedropper to pick up a color from the iris of the eye. It should be a fairly gray tint with a hint of the eye color.
8. Paint over the red part of the eye on the new layer, being careful not to paint over the eyelids.
9. Go to Filters > Blur > Gaussian and give it about a 1 pixel blur to soften the edges.
10. Set the layer blend mode to Saturation. This will take the red out without removing the highlights, but in many cases it leaves the eyes too gray and hollow looking.
11. If that's the case, duplicate the saturation layer and change the blend mode to Hue. That should put some color back in while still preserving the highlights.
12. If the color is too strong after adding a Hue layer, lower the opacity of the Hue layer.
13. When you're happy with the results you can merge the extra layers down.

Tips:

1. If you need to darken the pupil area, use the burn tool. It should only take a couple of taps with the burn tool to darken the pupils.
2. Before merging your layers, use the eraser tool to clean up any overspray from painting outsideof the iris.
3. Watch an animated demonstration of how to remove redeye in Photoshop.
4. This technique works in Photoshop 4 and up, including Photoshop LE and Photoshop Elements.

Page Flipping Animation

Use JavaScript to emulate a web booking where the user can flip the pages.

http://www.sitepoint.com/blogs/2007/07/20/javascript-sprite-animation-using-jquery/

Changing WordPress home page

Check out: http://codex.wordpress.org/Template_Tags/wp_list_categories
This page may help too with what I'm going to say next: http://codex.wordpress.org/Template_Hierarchy

Your going to want to copy your current theme's index.php file, name it home.php. Then go in and replace the_content(); or the_excerpt(); with wp_list_categories();

I would also replace the post title line, which has the_title(); in it, to be a non-linking title that says "Categories" or something.

That's the basic idea... I bet there are going to be some things your going to want to change about it, such as the text size.

Windows shortcut keys

There are a number of keyboard shortcuts and combinations that you can make use of instead of your mouse or your taskbar options. This article will give you the list of the most common shortcuts used while using a Windows operating system.

Windows System

  • Windows Key: will open the Start menu
  • Windows Key+Break: will display the System Properties dialogue box
  • Windows Key+D: will minimize the windows to show the Desktop
  • Windows Key+E: will open Internet Explorer
  • Windows Key+F: will open the Search option for files and folders
  • Windows Key+F+CTRL: will open Search option for computer
  • Windows Key+F1: will display Help/Assistance option
  • Windows Key+L: will lock your Desktop
  • Windows Key+M: will minimize or restore all windows
  • Windows Key+R: will open the RUN option
  • Windows Key+TAB: will switch between open items
  • Windows Key+U: will open Utility Manager
  • ALT+ Hyphen: will display the Multiple Document Interface child window’s System menu
  • ALT+ ENTER: will view the properties for the selected object
  • ALT+ ESC: will cycle through the items in the order that they were opened
  • ALT+ F4: will close all the window that is open
  • ALT+ SPACEBAR: will display the System menu
  • ALT+TAB: switch from one open program to another on your taskbar.
  • F1: used to request help/assistance
  • SHIFT: If you press and hold down the SHIFT key while inserting a CD-ROM it will skip the automatic-run feature
  • SHIFT+DELETE: will delete the file permanently
  • CTRL+ESC: will open the Start Menu
  • CTRL+SHIFT+ESC: will open task manager non-full screen

In a General Folder and text programs

  • Ctrl + A: will select all items
  • Ctrl + B: will organize your Favorites in Internet Explorer
  • Ctrl + C: will copy the selected item
  • Ctrl + F: will open the Search options
  • Ctrl + H: will allow you to replace some text
  • Ctrl + N: will create a new folder
  • Ctrl + O: will open a new document
  • Ctrl + P: will print the selected document
  • Ctrl + S: will save the current document
  • Ctrl + V: will copy the selected item
  • Ctrl + W: will close the current window
  • Ctrl + X: will cut the current item
  • Ctrl + Y: will repeat the last action that has been cancelled
  • Ctrl + Z: will undo the last action

In a General Folder

  • F10: Opens Menu Bar options
  • CTRL+F4: list the address menu paths
  • SHIFT+F10: Opens right click shortcut menu
  • ALT+DOWN ARROW: will open a drop-down list box
  • ALT+SPACE: will list the window's System menu
  • ALT+Underlined Letter in Menu: Opens the menu

For a Selected Item a Folder

  • F2: used to rename the item
  • F3: Opens the Search option
  • F5: will refresh the current folder
  • F6: will move along the panes in Windows Explorer
  • CTRL+ X: Cut an item
  • CTRL+ C: Copy an item
  • CTRL+ V: Paste an item
  • SHIFT+DELETE: will delete this item permanently.
  • ALT+ENTER: will open the properties option for the selected item.
  • CTRL+ G: will open the “Go To” Folder tool (in Windows 95 Windows Explorer only)
  • CTRL+ A: will select all the items in the current window
  • BACKSPACE: will switch to the parent folder

For Microsoft Word

  • CTRL+ N: will promptly open a Word document
  • CTRL+ O: will open a previously saved Word document
  • CTRL+ W: will close the current window without exiting Word
  • CTRL+ S: will save the current document
  • CTRL+ P: will promptly print the current document
  • CTRL+ Z: will undo the last action
  • CTRL+ Y: will restore an undone action
  • CTRL+ X: will cut the selected text
  • CTRL+ C: will copy the selected text
  • CTRL+ V: will paste the selected text
  • CTRL+ A: will select the whole document
  • CTRL+ F: will search for a specific text in the current document
  • CTRL+ B: will bold the selected text
  • CTRL+ I: will put in italics the selected text
  • CTRL+ U: will underline the selected text

For Microsoft Excel

  • CTRL+ N: will promptly open an Excel document
  • CTRL+ O: will open a previously saved Excel document
  • CTRL+ W: will close the current window without exiting Excel
  • CTRL+ S: will save the current document
  • CTRL+ P: will promptly print the current document
  • CTRL+ Z: will undo the last action
  • CTRL+ Y: will restore an undone action
  • CTRL+ X: will cut the selected text
  • CTRL+ C: will copy the selected text
  • CTRL+ V: will paste the selected text
  • CTRL+ A: will select the whole document
  • CTRL+ F: will search for a specific text in the current document
  • CTRL+ B: will bold the selected text
  • CTRL+ I: will put in italics the selected text
  • CTRL+ U: will underline the selected text
  • F1: will prompt the Help option
  • F2: will edit the document
  • F3: will paste the name
  • F4: will repeat the last action
  • F5: will open the Go To option
  • F6: will switch to the next pane
  • F7: will launch the Spell Check option
  • F8: will allow the Extend Mode
  • F9: will recalculate all workbooks
  • F10: will activate the menu bar
  • F11: will open a new chart
  • F12: will save the document.

For Microsoft PowerPoint

  • F4: will repeat the last action
  • F5: will start a slide show
  • F6: will switch to the next pane in a clockwise way
  • CTRL+ EQUAL SIGN: will apply a subscript formatting
  • CTRL+ ADDITION SIGN: will apply a superscript formatting
  • CTRL+ BACKSPACE: will delete a word
  • CTRL+ F: will find a particular text
  • CTRL+ K: will insert a hyperlink
  • CTRL+ M: will insert a slide
  • CTRL+ I: will set the text into italics
  • CTRL+ D: will copy the current slide
  • CTRL+ O: will open a previously saved PowerPoint file
  • CTRL+ T: will open a Font dialogue
  • CTRL+ Y: will repeat last action
  • CTRL+ G: to view guides
  • SHIFT+ ALT+ LEFT ARROW: will promote a paragraph
  • SHIFT+ F3: will capitalize the text
  • SHIFT+ALT+ RIGHT ARROW: will demote a paragraph
  • SHIFT+F6: will switch to the previous pane in an anticlockwise way.

For Internet Explorer

  • F1: will display the Internet Explorer help
  • F11: will allow the full screen option
  • TAB KEY: will enable you to move through the items, address bar and links on your webpage
  • ALT+HOME: will go to your home page
  • ALT+LEFT ARROW: will go to the previous page
  • SHIFT+F10: will display a shortcut menu for the link
  • CTRL+TAB: will move forward between tabs
  • SHIFT+CTRL+TAB: will move back between frames
  • UP ARROW KEY: will scroll towards the beginning of the webpage
  • DOWN ARROW KEY: will scroll towards the end to the webpage
  • PAGE UP: will scroll by sections towards the beginning of the webpage
  • PAGE DOWN: will scroll by sections towards the end of the webpage
  • HOME: will move directly to the beginning of the webpage
  • END: will move directly to the end of the webpage
  • CTRL+F: will find some text on the page
  • F5: will refresh the current page
  • ESC: will stop loading the page
  • CTRL+ N: will open a new window
  • CTRL+ E: will open the Search option in the Explorer bar
  • CTRL+ I: will open the Favorites option in Explorer bar
  • CTRL+ H: will open the History option in Explorer bar

Install ffmpeg Ubuntu

sudo apt-get install ffmpeg

convert .flv to .mpg using ffmpeg

First you need to download your .flv file to a folder and you need to Open a terminal window and go in to the .flv file folder and type the following command

ffmpeg -i jokes.flv -ab 56 -ar 22050 -b 500 -s 320×240 jokes.mpg

Currently untested, but possible way to convert to MPG4.  It properly converted the flv to an mp4 but when I tried to burn the mp4 to DVD using Nero the audio was lost.  Properly need to properly convert the audio.

According to google search, the AC3 filter must be installed, that did not do the trick Ubuntu must have used some other codec to encode the audio where VLC had the built-in codecs.
http://ac3filter.net/project/1/releases (ac3filter_1_51a.exe)

ffmpeg -i inputfile.flv -acodec copy -vcodec mpeg4 outputfile.mp4

jokes.flv is the file you want to convert, so the name must be the same as the source file.You can name jokes.mpg whatever you want as long as it has the .mpg extension.

-b bitrate: set the video bitrate in kbit/s (default = 200 kb/s)
-ab bitrate: set the audio bitrate in kbit/s (default = 64)
-ar sample rate: set the audio samplerate in Hz (default = 44100 Hz)
-s size: set frame size. The format is WxH (default 160×128 )

Update:

I was able to convert an FLV file directly to DVD using the application DeVeDe.  It's a bit basic but it was able to create a DVD with a menu system too.  The audio ended up being on Track 3 for the test.  It looks like audio moves around a little and I don't know how to specifiy where to put it.  The program writes its output to an ISO which you can then test.