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

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

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!)

Capistrano & supervisord

The following checks if the supervisor ‘service’ config file exists, and if not, adds it and notifies supervisord that there’s a new service to load in.

After that, the supervisor service is restarted.

task :restart_supervisord, :roles => :web do
   run "if [ ! -f /etc/supervisor/conf.d/microservice-abc.conf ]; then #{sudo} ln -s #{latest_release}/supervisord.conf /etc/supervisor/conf.d/microservice-abc.conf && #{sudo} supervisorctl reread && #{sudo} supervisorctl update ; fi"
   run "#{sudo} supervisorctl restart microservice-abc:"
end

For the want of a nail…

“For the want of a nail the shoe was lost,
For the want of a shoe the horse was lost,
For the want of a horse the rider was lost,
For the want of a rider the battle was lost,
For the want of a battle the kingdom was lost,
And all for the want of a horseshoe-nail.”

https://en.wikipedia.org/wiki/For_Want_of_a_Nail