Renaming files

To renamed from ‘*.abcd.def’ to ‘*.abc’;

find ./ -depth -name "*.abcd.def" -exec sh -c 'mv "$1" "${1%.abcd.def}.abc"' _ {} \;

When using GIT;

find ./ -depth -name "*.abcd.def" -exec sh -c 'git mv "$1" "${1%.abcd.def}.abc"' _ {} \;

Source; https://askubuntu.com/questions/35922/how-to-change-extension-of-multiple-files-from-command-line

AGM Batteries – State of charge

The below figures are in volts

State of Charge Sealed or Flooded Lead Acid Gel battery AGM battery
100% 12.70+ 12.85+ 12.80+
75% 12.40 12.65 12.60
50% 12.20 12.35 12.30
25% 12.00 12.00 12.00
0% 11.80 11.80 11.80

Ref; http://www.energymatters.com.au/components/battery-voltage-discharge/

Other notes;

11.5v = 50%
12v = 70%
12.8 – 128v = 100%

12.3v / 12.4v – 13v
Solar panel should be +5v on top of the battery voltage

Accounting – Depreciating Fixed Assets in Xero

For depreciating fixed assets in Xero (using cash accounting), this was found on the Xero community forums;

Like Peter said, the entries created by the fixed asset system are treated as non-cash.

If you need depreciation in non-cash reports, I have a clunky workaround. You can just do a journal to reverse those entries created by the FA system, and then create a cash journal for the same amounts.

Step by step it’s something like this:
– generate a depreciation schedule report for the report period (for reference)
– create a manual journal entry, un-check the “show in cash reports” checkbox, and reverse the amounts of depreciation that the Fixed Asset system has generated. (credit depreciation expense and debit depreciation asset) So you can just do the one journal for a whole year’s amount, unless you need a monthly cash p&l.
– copy the journal you just created, check the “show in cash reports” checkbox, and reverse the journal you just posted (debit depn expense and credit depn asset).

Ref: https://community.xero.com/business/discussion/5447191

Jam and Cream Sponge Cake

Ingredients

  • 2/3 cup (100g)
  • 1/4 teaspoon baking powder
  • 4 eggs
  • 1/2 cup (110g) caster sugar
  • 50g unsalted butter, melted and cooled
  • 1/2 cup (125ml) single (pouring) cream
  • 1 cup (320g) strawberry jam
  • fresh raspberries, to decorate
  • icing sugar, for dusting

Method

  1. Preheat oven to 180 degrees.
  2. Sift the flower and baking powder 3 times & set aside
  3. Place eggs and sugar in an electric mixer and whisk on high speed for 10-12 mins, or until pale, thick and tripled in volume
  4. Sift half the flour mixture of the egg mixture and using a large metal spoon, gently fold to combine
  5. Repeat with the remaining flour
  6. Add the butter and gently fold to combine
  7. Divide the mixture between 2x 20cm round & lightly greased shallow cake tins lined with non-stick baking paper
  8. Bake for 16-18 mins or until sponges are springy to the touch and come away from the sides of the tings
  9. Remove from the tins and cool completely on wire racks
  10. Whisk the cream until soft peaks form
  11. Spread one cake with the jam, top with the cream and berries
  12. Sandwich the with the remaining cake
  13. Dust with icing sugar to serve

Serves 6-8

You can also try this with strawberries, lemon curd, or passionfruit pulp

SSL Keys for JWT

https://help.ubuntu.com/community/SSH/OpenSSH/Keys
http://unix.stackexchange.com/questions/26924/how-do-i-convert-a-ssh-keygen-public-key-into-a-format-that-openssl-pem-read-bio

Generate 4096 bit keys;

ssh-keygen -t rsa -b 4096

Convert to PEM format;

openssl rsa -in ms-test -pubout -outform pem > ms-test.pub-509

Pancakes

Serves enough for breakfast for 2 (approx. 3 each)

Ingredients

1 egg
1 cup self-raising flour
1 cup milk
half a teaspoon of vanilla essence

Method

Whisk the eggs, milk and vanilla together. Stir in sugar. Sift in flour & whisk till just combined.

Heat non-stick frypan, add about a teaspoon of butter (on the pan), and cook a ladle-full of mix at a time.

Serve with jam/cream/icecream/sugar & lemon juice/nutella/etc.
Enjoy!

Updating SSL certs for Jetty servers

So i’m using a standard SSL cert like any other server would have (with a cert for the domain, and intermediate cert)

The following combines the intermediate & server cert into one. Goes in order of your server cert first, followed by intermediate, next intermediate (if needed), etc.

sudo cat my-domain.crt intermediate.crt > cert-chain.txt

These then convert the chain cert & key into a pkcs12 format

openssl pkcs12 -export -inkey my-domain.key -in cert-chain.txt -out my-domain.pkcs12

This then uses the pkcs12 file and imports it into your keystore. I used a new keystore as i’ve only got the one domain on the Jetty server

sudo keytool -importkeystore -srckeystore my-domain.pkcs12 -srcstoretype PKCS12 -destkeystore keystore

These came from a number of Stack Overflow articles (accidentally closed them prior to writing this — sorry guys!)