RSync to Mirror Local Files

The rsync utility was meant to be used to sync files across the network — to or from an rsync server. For some time, I had a group of friends who shared documents off of my rsync server. Anyone with access could run an rsync command and sync their computer up with the group’s documents. With the advent of online file storage and collaborative editing, this was no longer needed. But I still use rsync to make sure my laptop has a local copy of a folder on the server. Mount /path/to/folder/contents/to/copy to the SMB or NFS share, and the following rsync command ensures the laptop’s /path/to/where/contents/should/be/placed has an exact mirror of the contents of the server folder

rsync –archive –verbose –update –delete “/path/to/folder/contents/to/copy/” “/path/to/where/contents/should/be/placed/”

–archive is a grouping of:
-r recursive
-l copy symlinks
-p preserve permissions
-t preserve modification timestamps
-g preserve group
-o preserve owner
–devices preserve device files (su only)
–specials preserve special files

Python: Generate Transcript of Video File

There’s a speech_recognition module in Python that transcribes an audio file — since ffmpeg can convert a video file to mp3, that means you can also use Python to transcribe a video file.

# requires pocketsphinx from CMU if using sphinx for speech to text recognition
import os
import speech_recognition as sr
import ffmpeg

strFFMPEGBinaryLocation = 'c:/tmp/ffmpeg/bin/ffmpeg.exe'
strCurrentDirectory = os.getcwd()

strInputVideo = "\"Z:/Path To/My Video/file.MP4\""
strOutputFileName = "converted.wav"
# Convert mp4 to wav file
strffmpeg_convert_mp4_to_wav = f'{strFFMPEGBinaryLocation} -i {strInputVideo} {strCurrentDirectory}/{strOutputFileName}'
os.system(strffmpeg_convert_mp4_to_wav)

# Run converted wav file through speech recognizer
r = sr.Recognizer()
audio = sr.AudioFile(f'{strCurrentDirectory}/{strOutputFileName}')

with audio as source:
	#audio = r.record(source, 90)				# Would need API key to process longer audio?
	#text = r.recognize_google(audio)
	audio = r.record(source)
	text = r.recognize_sphinx(audio)
print(text)

PowerShell: Mass Active Directory Password Changes

We have a bunch of accounts that function as extra mailboxes — all conveniently housed in on OU. The following PowerShell command sets the password for all of the accounts in one go. Not terribly useful for “real world” use … but useful for testing (and probably something I’ll end up using again)

$OUpath = ‘ou=Mail Aliases,dc=example,dc=com’
$strNewPassword = “What3v3rYu0W@nt1tT0B3”

Get-ADUser -Filter * -SearchBase $OUpath | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText $strNewPassword -Force)

Beany Soup

Ingredients:

  • Onion, diced
  • Garlic, minced
  • 1 tsp butter or olive oil
  • Ham bone or bones from smoked pork shoulder (not completely clean)
  • Dried bean assortment: pinto, red kidney, white kidney (cannellini), pink beans, great northern, baby lima, huge lima, black beans, green split peas, black-eye peas, yellow split peas, chickpeas, red lentils, green lentils
  • Smoked pork

Method:

In a pressure cooker, saute onions and garlic for a few minutes in butter or olive oil.

Remove from heat. Add about a pound of the bean mixture to a pressure cooker, add the bones (if using ham bone, don’t add salt; if using pork bones, add salt), then fill the pot with water to slightly under halfway. Pressure cook on high for about 35 minutes. Allow to naturally depressurize.

Liquid should be thickened from the beans cooking and flavored from the bones. Remove the bones and add more salt as needed.

Add smoked pork, and stir to combine. Allow to simmer until pork is heated.

Notes: We keep containers of various dried beans and peas. They’re really cheap, keep practically forever (especially since we got the vacuum sealer attachment that seals up Ball jars!), and cook fairly quickly in the pressure cooker. For this dried bean mixture, I just grabbed about half a cup of all of the larger beans and a quarter cup of the smaller split peas and lentils. In total, it’s about a pound of dried beans.

For Anya — Bill of Rights QuickRef

Since Anya is working on memorizing the Bill of Rights, I wanted a really quick list for her to review:

  1. Religion, speech, press, assembly, and petition government for redress
  2. Keep and bear arms
  3. No quartering soldiers
  4. Freedom from unreasonable search and seizure (secure in person, house, papers)
  5. Right to due process, freedom from self incrimination, no double jeopardy
  6. Right to speedy trial, public trial, jury of peers
  7. Right to trial by jury in civil cases
  8. Freedom from excessive bail, cruel and unusual punishment
  9. Other rights reserved for people
  10. Other rights reserved to states

Anya’s 11th Birthday Cake: Orange Chocolate

This year, Anya wanted an orange cake decorated with pieces of orange … but she also wanted chocolate. So we made an orange chocolate cake with orange chocolate buttercream. Very tasty!

Chocolate Orange Cake

  • 2 cups all purpose flour
  • 1 1/2 cup sugar
  • 3/4 cup cocoa powder
  • 2 tsp baking soda
  • 3/4 tsp baking powder
  • 1 tsp salt
  • zest of two oranges
  • 1 cup buttermilk
  • 1/2 cup vegetable oil
  • 1 cup decaffeinated coffee, cooled
  • 4 medium eggs

Preheat oven to 325F. Butter and flour two 8″ cake pans.
Whisk all dry ingredients (including orange zest) together.
Whisk all wet ingredients together.
Slowly stir wet ingredients into dry ingredients.
Pour batter into pans and bake for 35-40 minutes.
Remove from oven, allow pans to cool for approx 15 minutes, then turn cakes onto cooling rack to cool completely.

Chocolate Orange Buttercream Frosting

  • 2 cups unsalted butter
  • 1 Tbsp orange emulsion
  • 1/8 tsp salt
  • 5 cups powdered sugar
  • 1/2 cup heavy whipping cream
  • 10 oz dark chocolate chips

Whip the butter in the blender until light and fluffy. Add orange emulsion and salt.
Heat the whipping cream, remove from heat, and stir in chocolate chips to melt.
Slowly sift powdered sugar into butter while continuing to blend on lowest speed.
Once powdered sugar has been incorporated, add melted chocolate a scoop at a time and continue to blend on lowest speed until it has all been incorporated.

General Tao’s … Turkey

Ingredients

  • Four turkey thighs, deboned and cut into bite-sized pieces
  • 2 Tbsp Shaoxing wine
  • 1/2 cup stock
  • 1/2 tsp salt
  • 1/2 tsp ground pepper
  • 1 Tbsp sesame oil
  • 1/4 cup sesame seeds
  • 1/4 cup all purpose flour
  • 3/4 cup corn starch

Combine all ingredients except turkey and mix into a thick paste. Then fold in turkey pieces and coat well.

Add a handful of chili peppers to the oil before frying — the turkey is fried in chili oil. Fry, remove from oil, and drain on paper towel.

Sauce:

  • 1 cup stock
  • 1/2 cup soy sauce
  • 1/2 cup maple syrup or brown sugar
  • 2 Tbsp rice wine vinegar (or apple cider vinegar)
  • 2 Tbsp Shaoxing wine
  • 2 Tbsp corn starch

Combine all sauce ingredients in a sauce pan and heat until thickened. Serve with a veggie (roasted broccoli, garden peas) and rice. I sprinkled ground Aji Lemon Drop pepper powder over the rice, sauce, and peas. Then topped with fried turkey to keep it crispy.

 

Causes Unknown

I keep hearing that Nikki Haley failed to mention slavery as a cause of the civil war  at this New Hampshire town hall. She *did* mention slavery as a cause, she just did so in coded speech common among racists.

 

States rights!

The state’s right to do what?

Why, the right to make their own laws and do what is right for that state!

OK, but like an example of one of these laws other than forcing people into slavery?

Umm … oh, wow. Will you look at the time! Gotta go!

 

I lived in the US south for years and had some version of this conversation so frequently it was depressing.  There were other rights – South Carolina trying to nullify federal tariffs was a problem in the lead up to the war, too. But (1) hardly the biggest concern and (2) literally not something I’ve ever found a modern states rights person mention. That’s more the realm of civil war historians.

Crochet Project: Anya Scarf

Anya taught me how to knit, and I am slowly knitting her a scarf … but it’s more of a fancy going out scarf than a “keeping warm” scarf. I found the same yarn that I am using for our sofa blanket in a variegated color (Tidepool), and I used that to make a really warm scarf. I started off knitting, but the Bernat Blanket yarn doesn’t knit well for me — I managed to get about three rows in after more than an hour of working on it! Took that out, grabbed a crochet hook, and used double crochet stitches. Two days later, voila! She’s got a warm, snuggly scarf. Just in time for … 60 degree weather. It’ll get cold eventually. And her scarf is standing by!