Skip to main content

Posts

How to fix "command aws.codeWhisperer.rejectCodeSuggestion not found"

AWS CodeWhisperer and GitHub Copilot don't get along in VSCode. Rejecting code suggestions sometimes triggers the pop-up (repeatedly) "command aws.codeWhisperer.rejectCodeSuggestion not found." This is especially annoying when using Vim since it breaks the Escape key which is interpreted by VSCode as rejecting code suggestions. Go to Command Palette (Command+Shift+P) Search for: Open Keyboard Shortcuts (JSON) Add: { "key": "escape", "command": "-aws.codeWhisperer.rejectCodeSuggestion", "when": "aws.codewhisperer.connected && inlineSuggestionVisible && !editorReadonly || isCloud9 && suggestWidgetVisible && !editorReadonly" } Restart VS code

Vegan Tamale Sauce

Vegan Tamale Sauce Tamale Sauce with Chili Powder Here's a straightforward recipe for a flavorful tamale sauce: Ingredients: 2 tablespoons vegetable oil 2 tablespoons all-purpose flour 1/4 cup chili powder (adjust according to your preference for heat) 2 cups chicken or vegetable broth 1 can (8 ounces) tomato sauce 1 teaspoon ground cumin 1/2 teaspoon garlic powder 1/2 teaspoon onion powder Salt to taste Instructions: Make the Roux: In a medium saucepan, heat the oil over medium heat. Add the flour and stir together for about 1 minute, or until the mixture becomes a light, golden roux. Add Chili Powder: Stir in the chili powder to the roux and cook for another minute. Add Liquids: Slowly pour in the chicken or vegetable broth while stirring constantly to prevent lumps. Add the tomato sauce to the mixture. Season the Sauce: Stir in the ground cumin, garlic powder, and onion powder. Season with salt to taste. Simmer: Bring the sauce to a simmer and let it co...

Do not buy Watercop on Amazon

The Watercop Classic is an excellent product especially when combined with the SmartConnect wifi module that can shut off your water main from anywhere on the globe without paying a monthly fee. But beware! Only older models are sold on Amazon. The old Watercop Classics put the motor and switch in one box. The new design separates the more sensitive switch electronics from the motor that opens and closes the valve. I have owned both designs and can attest that I will never again place electronics anywhere near a water pipe, not to mention the corrosion from rain and humidity. The Watercop is more expensive to purchase and is more difficult to install but unless you want a brick or you enjoy paying for Flo each month (and it's also vulnerable to water and weather damage), it's the financially smart choice. I bought the 75 foot cable so the switch could be located indoors. The hard part of course was running the cable under the house.

How safe is your password?

As this diagram shows, a password consisting of three four-letter words smashed together with camelCase is more secure than 8-character passwords that are impossible to remember. Length is what matters.

Test in production

Unit tests and staging environments are nice and all but how do you know whether your latest release works? SaaS vendors must test in production. Consider your users to be testers, or, better: create test users and run nonstop tests in production deliberately. As this  article  says: “ Certain services need to know that an account isn't real, so we don't count or bill users like production accounts or match them with a production user. With these cases handled, all other services essentially treat all accounts, production or test, exactly the same. ”

Terris’ Easy Spicy Vegan Black Beans

Black beans are full of protein and smoky flavor. This easy vegan spicy black bean dish is delish solo and in Mexican classics. Serves: 6 Prep: 10 minutes (if you use canned beans) Cook: 15 minutes Ingredients 2 Tbsp olive oil 1 small yellow onion, diced  1 tsp cumin 2 cloves garlic, pressed 1 14.5oz can diced tomatoes or fresh alternative. Tomatoes are the key ingredient. Do not decrease the amount. 1 tsp dried cilantro 1 or 2  🌶🌶  peppers with 1 tsp sauce from a can of chipotle peppers in adobo sauce (such as from La Costeña). These peppers supply the heat. Try with one pepper first and upgrade if you dare (seriously though, they are pretty mild). Do not use the whole can! 2 15oz cans black beans without spices, drained (or start from dry - see you tomorrow!) 1 tsp black pepper 1 tsp salt, or to taste Instructions Heat the oil, onions, cumin, dried cilantro, and garlic over low heat for 10 minutes  While heating, purée tomatoes, peppers, and adobo sauce in a...

Terris' Vegan Ma Po Tofu

MaPo Tofu is a delicious  and easy side dish or main course. Pair with  Sichuan shredded potatoes for a satisfying meal! Serves: 4 Prep: 10 minutes Cook: 10 minutes Ingredients Firm or extra firm tofu, 14 oz (1 package), cut into small cubes Soy Sauce, 2 Tbsp Chili Black Bean Sauce , 2 Tbsp Sesame Seed Oil, 2 Tbsp Sichuan pepper , ground, 1 tsp Garlic, pressed, 4 cloves Vegetable broth, 1 cup Cornstarch or arrowroot powder , 1 Tbsp Water, 1 Tbsp Directions Heat (low) the oil and garlic for 3 minutes Add the pepper and chili bean paste Heat (medium-low) for 2 minutes Add vegetable broth, soy sauce, and tofu Simmer (medium-high) for 5 minutes Turn off heat Mix water and cornstarch or arrowroot powder Stir

Terris' Spicy Vegan Lentil Casserole

Lentils with Indian flavors Most of the liquid will be absorbed by the lentils so this dish will be more of a cassole than a soup. This recipe yields 10-12 large bowls. Great for leftovers and lunch-at-work! Credits: I started with this recipe . Estimates: Prep time: 30 mins, depending on whether you have help chopping Cook time: 30 mins Ingredients 1 bay leaf 1 Tbsp salt 2 tsp cumin 2 tsp curry powder 2 tsp roasted paprika 1/2 tsp garam masala 1/2 tsp roasted chipotle powder  4 yellow potatoes 6 oz crimini mushrooms, sliced 1 cup dry lentils 1 fresh jalapeño finely chopped 1 large yellow onion 1 pound cherry tomatoes - or add two more tomatoes 1 large whole tomato 3 carrots, chopped 1 lb cauliflower, chopped 1 lb broccoli florets, chopped 6 oz tomato paste 2 Tbsp olive oil 1 lemon, juiced (about 2 tablespoons) 3 cups vegetable broth 1 cup water Instructions Sautee the oil, garlic, and onions for 5 minutes in medium-low heat in press...

MySQL: This stored procedure inserts 'empty' rows into a specified table

This stored procedure accepts two arguments: a table name and a row count. It inserts the specified number of rows into the specified table. Of course, all columns in the table must either have default values or allow NULL. DROP PROCEDURE InsertDimension; DELIMITER $$ CREATE PROCEDURE InsertDimension(IN TableName VARCHAR(50), IN NumRows INT) BEGIN DECLARE i INT; SET i = 1; SET @sql_text = concat('INSERT INTO ', TableName, ' VALUES ()' ); PREPARE stmt FROM @sql_text; START TRANSACTION; WHILE i <= NumRows DO EXECUTE stmt; SET i = i + 1; END WHILE; COMMIT; DEALLOCATE PREPARE stmt; END$$ DELIMITER ;

Collecting and graphing metrics via Apache Camel, Statsd, and Graphite

If you're curious about Apache Camel's metrics reporting via Dropwizard , this guide will help you get Graphite running in a Docker container. Then you will run an instrumented Camel application and view its metrics via Graphite's browser UI. (1) Install Docker There are many ways to do this depending on your platform. Google it. (2) Install and run the Docker container for Statsd and Graphite Refer to  https://github.com/hopsoft/docker-graphite-statsd The instructions infer that you can run the container without specifying port mappings. This is plain wrong. So use the following command to start the container: docker run -d --name graphite --restart=always -p 80:80 -p 8125:8125/udp hopsoft/graphite-statsd It is not necessary to enable Graphite's UDP listener. Statsd receives metrics via UDP and forwards them to Graphite over TCP. (3) On Windows and OSX, determine the IP address of the graphite Docker container On Linux, you can use localhost. On Win...

Load testing with Java: Pound on a resource with multiple threads

Load testing involves multiple threads or processes performing operations against a resource. For example, execute a query against a database server via 50 concurrent threads. The tricky part is waiting for the threads to start up before the commands are actually executed, in order to make sure that the resource is truly getting hammered. Here's an example of how to accomplish this in Java. It is possible to refactor the following code into a utility accepts two parameters: the number of threads and a lambda expression which can be passed as a Runnable object. final int numThreads = 50; ExecutorService executor = Executors.newFixedThreadPool(numThreads); CountDownLatch ready = new CountDownLatch(numThreads); CountDownLatch start = new CountDownLatch(1); CountDownLatch done = new CountDownLatch(numThreads); for (int j = 0 ; j < numThreads ; j++) {    executor.execute(() -> { ready.countDown(); try {    start.await(); /...

Running 2560x1080 on LG 29UM57-P on an old MacBook Pro OSX El Capitan

Yes. A mid-2011 MacBook Pro running OSX El Capitan can drive a 2560x1080 monitor via HDMI. I was not able to get 60 Hz working. I am settling with 53 Hz. I tried many settings before finding something that works. The refresh rate seems fine to me. Maybe the text could be clearer but for a $200 monitor running this resolution, I'll take it. Apple MacBook 2015 retina resolution is 2560 x 1800. Consider buying a better monitor that may literally give you fewer headaches. Install  SwitchResX Follow the instructions for disabling SIP After rebooting, run SwitchResX via System Preferences Select your LG monitor Click Custom Resolutions Click the + icon  Enter these settings  ( source ) Exit SwitchResX and save Reboot Run SwitchResX via System Preferences Select your LG monitor Click Current Resolutions Select the 2560x1080, 53 Hz setting Enable SIP If you discover better settings, please leave a comment.

Use pstree instead of ps

pstree -alp This magic incantation displays the process list as a tree, showing process IDs (-p) and arguments (-a), on lines long enough to fully show all the arguments (-l). Make it part of your toolbox! You can remember this command via the phrase process-tree-Alps! You're welcome!

Monitor changes in available disk space

for (;;) {         @x = `df /common`;         @y = ($x[2]=~ /(\d+)/g);         $avail = $y[2];         if ($last) {                 my $delta = $avail - $last;                  print "$delta";         }         print $x[2];         $last = $avail;         sleep 5; }

An ingenious way to find Java on POSIX systems

This is Perl code. _java_bin returns the full path to the java executable. From http://search.cpan.org/~dolmen/DateTime-TimeZone-HPUX-1.04/lib/DateTime/TimeZone/HPUX.pm our @JAVA_HOMES = ( '/opt/java1.4', ); { my $_java_bin; sub _java_bin { return $_java_bin if defined $_java_bin; $_java_bin = ''; # Default value: java not found (false) foreach ( (map { ("$_/jre/bin/java", "$_/bin/java") } (exists $ENV{JAVA_HOME} ? ($ENV{JAVA_HOME}) : ()), @JAVA_HOMES, ), (map { "$_/java" } split(/:/, $ENV{PATH}) ), ) { next unless -x "$_"; $_java_bin = $_; last; } return $_java_bin; } }

Find the 10 largest directories on POSIX

This script outputs the number of 1,024 byte blocks consumed by each of the 10 largest directories in the provided directory, or in the current directory if no arguments are provided. From: Warren Young Date: Wed, 30 Jan 2013 21:08:33 -0700 "This script helps me find the 10 biggest pigs on any system with a basic POSIX user environment." #!/bin/sh if [ $# -eq 0 ] then     dir=. else     if [ ! -d $1 ]     then         echo usage: $0 [directory] [options]         echo         echo "  Prints kb in use in directory; if directory isn't"         echo "  given, '.' is assumed."         echo         echo "  If you give options, they are passed to du, in addition"         echo "  to the -sk options the script provides."         echo    ...