Dill Pickle Recipe


INGREDIENTS:

12-14 Persian cucumbers or 8-10 pickling cucumbers

4 garlic cloves, halved

2 teaspoons of mustard seeds

2 teaspoons of peppercorns

a few good-sized dill springs, per jar

2 cups of water

2 cups of distilled white vinegar

1/4 cup of cane sugar

2 tablespoons of sea salt

INSTRUCTIONS:

  1. To make dill pickle spears, slice the cucumbers lengthwise into quarters. To make dill pick chips, thinly slice them horizontally
  2. Divide the cucumbers among 4 (8-ounce) or 2 (16-ounce) jars. Divide the garlic, mustard seeds, peppercorns, and dill springs among each jar.
  3. Heat the water, vinegar, sugar, and sea salt in a medium saucepan over medium heat. Stir until the sugar and salt dissolve, about 1 minute. Let cool slightly and poor over the cucumbers. Set aside to cool to room temperature, then store the pickles in the fridge.
  4. Pickle spears will be lightly pickles in 2 days, but the best flavor will start to develop around day 5 or 6. Pickle chips will be lightly pickled in 1 day, and will become more flavorful every day after that. Store in the fridge for several weeks.

Keto Danish Butter Cookies (30 cookies)


Equipment

  • Baking Sheet
  • Mixing Bowls

Ingredients

  • 1.25 cups almond flour
  • 1/4 cup coconut flour
  • 1/3 cup Low Carb Sugar Substitute
  • 1 tsp baking powder
  • 6 tbsp butter, room temperature
  • 1/2 tsp vanilla extract

Instructions

  • Preheat oven to 350°F and line a baking sheet with parchment paper or a silicone mat. 
  • In a mixing bowl, combine almond flour, coconut flour, erythritol, and baking powder; mix well using a spoon.
  • Cut in the butter and vanilla and work it with your fingers until a dough forms.
  • Use your hands to roll the dough into 12 equal balls. Place the balls 2-inches apart on prepared baking sheet. Use a fork to flatten and create a striped pattern.
  • Bake the cookies for 11-14 minutes, or until browned around the edges. Transfer to wire rack to cool.
  • Best stored in an air tight container or zip top bag in the fridge up to 10 days.

Notes

Net Carbs: 2g per servingYields: 12 Cookies

Nutrition

Calories: 128kcal | Carbohydrates: 4g | Protein: 3g | Fat: 12g | Fiber: 2g

mplayer seamless loop in Raspberry Pi


Have you ever tried to run a video on an infinite loop with mplayer?

You will find that most players (including VLC) will do a ‘restart’ after each loop. That stuttering is very annoying when you are trying to build a kiosk mode screen display.

We can achieve a seamless infinite video loop with mplayer with a command like this:

mplayer -fs videofile.xyz -loop 0

Please note the “-loop 0” option is at the end. If you put this option before the file name, it will cause a restart on every loop. Apparently, this behavior comes from a very old quirk

Get 16v out of a MagSafe2 Apple Charger


If you read the specs for a MagSafe2 Apple Charger, it says output 16.6V 3.5A, which can be useful when you are looking for a 12V source power for i.e. a battery.

But, if you just cut the Magsafe2 cable and measure the voltage, you’ll read only around 0.3V.

What’s the trick?

This charger has an internal 16-bit microprocessor. You need to put a resistance between both terminals (i.e. 22K Ohm), to tell the microprocessor that there is a resistive load between terminals (same does your mac when you plug it).

When the microprocessor registers this load, after 1 second, it will deliver the 16V.

Now you can use this charger to regulate the output (maybe using an lm2596) and charge a 12V battery…

More information: http://www.righto.com/2013/06/teardown-and-exploration-of-magsafe.html

12V Battery Charging


Measuring current to detect when the battery is fully charged:

In normal (old age) battery chargers there will be the Ammeter connected in series between the battery and the battery charger.

When the battery is almost full. The current will gradually descend near zero. Because both voltages are almost the same. Until the current flows less.

Due to the V = IR rule, if the charging voltage V increases. It will cause the charging current (I)to decrease.

In modern battery charging circuits, The battery voltage will be measured. When the voltage is indicated that the battery is fully charged. The system will automatically cut off the power more convenient.

Reference: https://www.eleccircuit.com/how-many-amps-hours-to-charging-battery-full/

Flush DNS on Mac


Making DNS changes and wanting to force a flush on a Mac?

Here are the commands for the different mac versions:

MacOS VersionCommand
macOS 12 (Monterey)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
macOS 11 (Big Sur)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
macOS 10.15 (Catalina)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
macOS 10.14 (Mojave)sudo killall -HUP mDNSResponder
macOS 10.13 (High Sierra)sudo killall -HUP mDNSResponder
macOS 10.12 (Sierra)sudo killall -HUP mDNSResponder
OS X 10.11 (El Capitan)sudo killall -HUP mDNSResponder
OS X 10.10 (Yosemite)sudo discoveryutil udnsflushcaches
OS X 10.9 (Mavericks)sudo killall -HUP mDNSResponder
OS X 10.8 (Mountain Lion)sudo killall -HUP mDNSResponder
Mac OS X 10.7 (Lion)sudo killall -HUP mDNSResponder
Mac OS X 10.6 (Snow Leopard)sudo dscacheutil -flushcache
Mac OS X 10.5 (Leopard)sudo lookupd -flushcache
Mac OS X 10.4 (Tiger)lookupd -flushcache

Linux Kernel Tuning: task blocked for more than 120 seconds


One of the most viewed posts in 2022… I hope it helped resolving some linux performance issues…

Hernan Vivani's Blog

This might be old school, and maybe even boring reading. But, if you concern about performance on Linux servers, at some point, you will have to have a look to the kernel messages.

The problem:

When we run very stressful jobs running on large servers (large number of CPU’s and RAM memory), where IO activity is very high. It is pretty common to start seeing these messages on the ‘dmesg’ kernel output:

[24169.372862] INFO: task kswapd1:1140 blocked for more than 120 seconds.
[24169.375623] Tainted: G E 4.9.51-10.52.amzn1.x86_64 #1
[24169.378445] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[24169.382533] kswapd1 D 0 1140 2 0x00000000
[24169.385066] ffff8811605c5a00 0000000000000000 ffff8823645dc900 ffff882362844900
[24169.389208] ffff882371357c00 ffffc9001a13ba08 ffffffff8153896c ffffc9001a13ba18
[24169.393329] ffff881163ac92d8 ffff88115e87f400 ffff882362844900 ffff88115e87f46c
[24169.445313] Call Trace:
[24169.446981] [<ffffffff8153896c>] ? __schedule+0x23c/0x680
[24169.449454] [<ffffffff81538de6>] schedule+0x36/0x80
[24169.451790] [<ffffffff8153907e>] schedule_preempt_disabled+0xe/0x10
[24169.454509] [<ffffffff8153a8d5>] __mutex_lock_slowpath+0x95/0x110
[24169.457156] [<ffffffff8153a967>] mutex_lock+0x17/0x27
[24169.459546] [<ffffffffa0966d00>] xfs_reclaim_inodes_ag+0x2b0/0x330 [xfs]
[24169.462407] [<ffffffffa0967be3>] xfs_reclaim_inodes_nr+0x33/0x40 [xfs]
[24169.465203] [<ffffffffa0978f59>] xfs_fs_free_cached_objects+0x19/0x20 [xfs]
...

View original post 374 more words