Egg Drop Soup

  • 1 egg
  • 2 1/2 cups chicken broth
  • 1 tbsp corn starch mixed with 1tbsp water
  • 1 tsp finely chopped tops of green onions
  • Pinch of white pepper
  • Dash of sesame oil

In a small bowl, beat egg slightly; set aside. Bring chicken broth to a boil over high heat. Add corn starch mixture to the broth stirring until it comes to a boil again. Reduce heat to medium-low. Hold the pan with beaten egg about 12 to 15″ above the pan and slowly pour egg into the pan while stirring in one direction. Remove pan from heat after egg is poured in. Sprinkle soup with green onion, pepper and sesame oil.

The secret to thinner threads of egg is to turn off the heat before pouring in the egg.

Deleting a File Using the Inode Number

Sometimes you will accidentally create a file that has special characters in the file name which then prevents you from running commands on it.  In that case, you can resort to accessing the file via it’s inode number.

To do so:

$ ls -il | more

In the directory in which the file that you want to examine resides

This will output a list of files, the first column being the inode number.

You can then run the following command to delete it, where 123456789 is the inode number:

$ find . -inum 123456789 -exec rm -i {} \;

Of course, you can -exec other commands to modify the file as well.

Retuning a MySQL Query in CSV

The following is an example of how to run a query on the command line to output the result of a MySQL query to a CSV file.

Create a text file with the your query, query.sql:

SELECT * FROM hosts;

The run the following command:

mysql –skip-column-names -uuser -ppassword database < query.sql | sed ‘s/\t/”,”/g;s/^/”/;s/$/”/;’ > filename.csv

This will run the MySQL query and output the results to a text file in .csv format.

The sed commands do the following:

Replace all ‘tabs’ with “,”

s/\t/”,”/g;

Print a ” at the beginning of the line

s/^/”/;

Print a ” at the end of the line

s/$/”/;

If you have a single column of data that is returned and want that in CSV, run an additional sed command on the output:

sed ‘:a;N;$!ba;s/\n/,/g’ > filename.csv