vendredi 12 février 2021

Jira and Confluence DB setup PostgreSQL

Atlassian Confluence 

https://confluence.atlassian.com/doc/configuring-a-datasource-connection-937166084.html

$ sudo -u postgres psql postgres
postgres=# CREATE USER confluence;
CREATE ROLE
postgres=# ALTER USER confluence with PASSWORD 'confluencepwd';
ALTER ROLE
postgres=# CREATE DATABASE confluencedb WITH OWNER = confluence ENCODING 'UNICODE' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0;
CREATE DATABASE
postgres=# \q


choose the "production install" to make sure you're offered the DB configuration option

Confluence 5.5 confluence.cfg.xml :

confluence5.5$ cat confluence.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>

<confluence-configuration>
  <setupStep>finishsetup</setupStep>
  <setupType>custom</setupType>
  <buildNumber>5528</buildNumber>
  <properties>
    <property name="attachments.dir">${confluenceHome}/attachments</property>
    <property name="confluence.license.hash">zdDzjZdbADawoyURqdGzoPaZBAgZKUHUYsHVjDZIEvvPyszv2XGziugEuwkSfQ&tg;Gdt6xeE2Xd9zIm1EpkgsJaGpbCyrw</property>
    <property name="confluence.license.message">zbAbzjWIpGHwCEPxwadtQDNsBirASzeAvdenNYxIEfgRidiyujEcxrnDWSbWuGVKbgehfZHRPfcxbDFasXfbofNaPgcAwQJuzycjPPOPFvpjyUgxKytaugGgBKevkPAgDRJwDOcKFdTNguqgEqzjtXoOHFbACGavHChWJweOuokZevvxXiTBydzgzbrcXhFWQIHDrqeEHaPXCgzCBqjVBdTyNYCrADHZKIDhcpxTNCjJjewXaicAOvssJvkRQcBqeyoeKcuXyrtvtyDXefYaeffWFbiQYcTBPAdBPGtenCKxZqpubCHYPdaXuqvSARJcuQBzBFvkuovnVJNNDBPpvSDAZpaOaJDOTkqvCXjoIxeDCsqkqdwwsfwnvXWsyzyITiQRPNShDmUESMzT5Imuvab8oNWjYvUj9Xe24N4jL6Wt8GLkwcyaWLBYZgSPeqPgRLozPuPlPjMObtRzOHaqj4m3e4o5KssixIGh&yg;1vT6qpRg0INFzR6OmnAkxOstG9OwNOCev&tg;a7tX9rxXs6u8i1jDyhH3ldYs8QUaqXeMrknEN5cxbIXbp9QAEjM7Z7AMHlaH4mcUgCc1B61j&yg;k&yg;7Ek&tg;fux6A9pr&yg;&yg;Ht&tg;hmHH2q5TFZd5EcZOqJQrp0nFuX9Gi1skZYGOxW&tg;BygPOwDXLkVZpe8WQPAqYCSedTpKGR2nDkWVETxEILEU&tg;kOeNoTlfbviJq4a5egI6eLA6Me3jlfBQL7f9pw&yg;fwS5zmtQJOOz7L&tg;qph1b&yg;DK8pTZNrkCzi4i38f</property>
    <property name="confluence.setup.server.id">O00E-3J0Z-TL49-EXW7</property>
    <property name="confluence.webapp.context.path"></property>
    <property name="hibernate.c3p0.acquire_increment">1</property>
    <property name="hibernate.c3p0.idle_test_period">100</property>
    <property name="hibernate.c3p0.max_size">30</property>
    <property name="hibernate.c3p0.max_statements">0</property>
    <property name="hibernate.c3p0.min_size">0</property>
    <property name="hibernate.c3p0.timeout">30</property>
    <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
    <property name="hibernate.connection.isolation">2</property>
    <property name="hibernate.connection.password">confluencepwd</property>
    <property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/confluencedb</property>
    <property name="hibernate.connection.username">confluence</property>
    <property name="hibernate.database.lower_non_ascii_supported">false</property>
    <property name="hibernate.dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
    <property name="hibernate.setup">true</property>
    <property name="lucene.index.dir">${localHome}/index</property>
    <property name="webwork.multipart.saveDir">${localHome}/temp</property>
  </properties>
</confluence-configuration>



Confluence 6.13.19 confluence.cfg.xml 
<?xml version="1.0" encoding="UTF-8"?>

<confluence-configuration>
  <setupStep>complete</setupStep>
  <setupType>custom</setupType>
  <buildNumber>7901</buildNumber>
  <properties>
    <property name="access.mode">READ_WRITE</property>
    <property name="admin.ui.allow.daily.backup.custom.location">false</property>
    <property name="admin.ui.allow.manual.backup.download">false</property>
    <property name="admin.ui.allow.site.support.email">false</property>
    <property name="atlassian.license.message">NNNOoN0BQNbCrAc9xI1CtmNHuh/7X0v80EtzME/dxvMBjZxPL8d+fhlzxbBefeX1OrKs27UAe0FGK iFpAa36ChpxmYxkbAmNJX8hoaroopBWk4Mg2Ev9DwHSVIaBPr5L1dI11Jkv5BEp0HDA6EeVF5Rk2 xucHHW2H1WqpSKWEcXiHMYmgXUifEXVRtJtHFTFSMKtHtIx975cLECoXTNWpNar+4nW6ghuorWCz OqFyi1Ul/nC3SB5VdUm5gmqE4H7w9uf4toOOIgxbGtsvPyIg3CEJm30emrwdvpzizdKP3+23GeQi e1z1co1yzEWxZMkOMml5V9/1rzTksbWEWEBcYMRmRZ3IyDbRPFyzLEwBg8ytr/T3gNZpXqwgIcnc X7Vm04xavyaxddq8hxkbQTWxFBt7i6JIkZCwUT1tKbdGuFT3dCw94Xwy+ZLorFPGNGo1NDgA80X0 PTA0kuRPrWf2GH8oonbLruehk/uO4RfhHbjYNVHN70z74+a+XYnayGBhydYW82HVG4PSRna3Jf1k 1m9QN7Jp7sdpRJhgb1yK02uc</property>
    <property name="attachments.dir">${confluenceHome}/attachments</property>
    <property name="confluence.database.choice">postgresql</property>
    <property name="confluence.database.connection.type">database-type-standard</property>
    <property name="confluence.setup.server.id">SERVER-ID</property>
    <property name="confluence.webapp.context.path"></property>
    <property name="hibernate.c3p0.acquire_increment">1</property>
    <property name="hibernate.c3p0.idle_test_period">100</property>
    <property name="hibernate.c3p0.max_size">60</property>
    <property name="hibernate.c3p0.max_statements">0</property>
    <property name="hibernate.c3p0.min_size">20</property>
    <property name="hibernate.c3p0.preferredTestQuery">select 1</property>
    <property name="hibernate.c3p0.timeout">30</property>
    <property name="hibernate.c3p0.validate">false</property>
    <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
    <property name="hibernate.connection.isolation">2</property>
    <property name="hibernate.connection.password">confluencepwd</property>
    <property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/confluencedb</property>
    <property name="hibernate.connection.username">confluencedbuser</property>
    <property name="hibernate.database.lower_non_ascii_supported">true</property>
    <property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.PostgreSQLDialect</property>
    <property name="hibernate.setup">true</property>
    <property name="jwt.private.key">ZVVT/tVONQNAOtxduxvT9j0ONDRSNNFPOhtjttoxNtRNNbVOtDPDXUoNQgeeET8v/rvaFZCT1XjVJIAl2RhnB1xq5MkWkNoelY+BI3HYicksyT36sySKYJTcsyfG1sPDejf/RniqrH0aU72CL5bOmY/kHlC2TjUF9sokDG+52Y0trfRHKAyehAHqcfiI53LT1fOoV8Q9tSScy7iVdU44qG2XfOMI2wI0Kx2ttwxUVEC4R5Y7kPuQBxH8eQ1kg8RiqZBGhZXUhZ/U7J5hiJ3IweoRZsvRg1W2DgXwNDn0zbcwstUwl/vb+H0JX55f3ZN1eKwqeWG1q8RN/qThvSH/oSiydoGP9XYJhxnV1YxaLiiFp0mnB0Z9Zro3D6hE5OizH/B2vFpXc354xArlalDPL/kG48j9K1xCNaQ6DEXaBD6J39FD/FNPvco9RxH9bRt6rQTtbzOW44HbK/zGIUWofJ39JjL9dSrWm53SrnBt8lB3LcKrGrXwV2suCkjbn3tKEpg7zXHhQsE4muwhDyLHaItZ4HonxW8kfgcxa7fODj3YTz9W+8xPNjRNNDXPNLOenofE3/++mK8O069T9wQdAtm5X5KPCBtLD6OwMaYAuNXxYGPBUkkKL++tFQvdYCGhjPUR6FSm5wHMzIDU6zYx4m1MdLmIPdU2AIaCghAHiHercrpnKRCsqy91yNUW6zHJahVf9qgekfgdmExTm909Ou+wGviqy6504hn4Y/k0r+YLxziR7HZDmAGHD8TOIhrcZNUz82/IP9LzEuc0A3n7Xwza/bVXtMfIEDScegV+RIdtD6biFgE0CoWs78C4hRTkIyKUhY4zMK7ZN/abQzRJGgoGVQrydsXuTqpAnHPkxXBf4qUwGKLJJpjfqBScCC6CRjhD+6rvGsZNm1TFSTMU2W6RK9bPWlJkVWeuoDbsIkpjXALg4pCbQEU+YHoeRqQ1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5h6jA6xHn7+62Uvb7nKrGs/on0igA2kk4oyDckmd+akx5+QXagMdeQZcyQPgcqyEdPOMOJJRNAWk+EdtCRPtpRNxnXoH3SMKxTNTIjqjYt9EvwmPs+RXwzd1zSGlOKNl2PHJL6EzDYzu4py0ys3iUBL0pDUvDCr14AYnR4xItE/ypystGQXNCy7QNzfCJ3xQkrHGnCZAH3EfgnVJ8NjhbPTjCwSxwD9INq/eWlOBmMm9S4i0/H3ds9tAbBl+R7aKv4Dm76O/L95uwfrQ6L5W1DvyxgLQsArCRuaDbG0sKv+TaGVig6JwAg2OIOpLW1ZfS9iviwuoHeY184oDlmhgrSD123123</property>
    <property name="jwt.public.key">ZVVObwNAOtxduxvT9j0ONDRSNNBPNL8NZVVOvtXPNLRNxPu2jN7n60EiVi3bc0wQkgFfPSyGpguYzwgMUrJpFpDT68v/wyq1P76pK5Eg+a5EIl1udK5oR9KjxX8YCkTe3KyAWk+9w2BnNpl/8IZw9ufO0iK28HR/hqv9VUeOSSmMn7wIUnoY1rq2OgoNJlCN/LOEnMr7lXu+BUH9veNJIqb1qS5AbVV5OlRG+OBF+8DbDmcSCXj9posOY3GQx7wPu7wCk+1hoe1g1L62kQU4uYqFqxYFbjRTgWdXL34O48i4dCyASvhroAmNAn143nlH9KsONC3EebuIC2ko5nz0jiFv1ecTvAF5W2Y70aAZ2wgQCGUz90BexrDo5yCmgbxaPdq+rWQKfc8xNzC8H+CZCI9MQjWj+xRFcmxByg/HxC0tNbdJ/EWSCnOVBatkbXWtFrBSXS/5x1ElJ7Sg/IfTCnuKvp+qkKzwbCZwg2XI3x3vblAa4G8pXTg4S0KYr5vyYt30rZ4L7xWJSW1LQBST2cPsZoYnMW+7NHZAlkciFsiWNtZONNR=</property>
    <property name="lucene.index.dir">${localHome}/index</property>
    <property name="synchrony.encryption.disabled">true</property>
    <property name="synchrony.proxy.enabled">true</property>
    <property name="webwork.multipart.saveDir">${localHome}/temp</property>
  </properties>
</confluence-configuration>



Atlassian Jira 

pg_ctl -D /usr/local/var/postgres start && brew services start postgresql
psql postgres
CREATE ROLE otrs WITH LOGIN PASSWORD 'otrs';
ALTER ROLE otrs CREATEDB;
\q
 
#create user and db
psql postgres -U otrs
CREATE DATABASE otrs;
GRANT ALL PRIVILEGES ON DATABASE otrs TO otrs;
 
#show databases
\list
 
#import dump
psql -h localhost -d otrs -U otrs -f /Users/tokamak/Desktop/IN/MISSIONS/TOTAL/OTRS/Files/psql_otrs_dump.sql
 
#show all db sizes
SELECT
    pg_database.datname,
    pg_size_pretty(pg_database_size(pg_database.datname)) AS size
    FROM pg_database;
 
 
 
#Create jiradb and user
CREATE USER jiradbuser WITH PASSWORD 'jiraSQL';
CREATE DATABASE jiradb WITH ENCODING 'UNICODE' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0;
GRANT ALL PRIVILEGES ON DATABASE jiradb TO jiradbuser;

jeudi 21 janvier 2021

Opsgenie webinar / ressources

opsgenie is a tool allowing filtering and routing of monitoring-triggered alerts (nagios, AWS SNS, datadog, ...) to specific channels (SMS, phone-call, Slack, Jira, ...).

Main features on top of this :

  • time-table (who's on-call) 
  • alerts / incident resolution centralization
  • third party integrations with 100+ tools


Opsgenie Learning Center :  https://docs.opsgenie.com/


[video] Opsgenie : "What do we do?"  https://www.youtube.com/watch?v=yphtZ9z2TtA&feature=youtu.be

[video] Opsgenie: "First Look" https://www.youtube.com/watch?v=pyM2dROKn6g

Opsgenie Pricing : https://www.atlassian.com/software/opsgenie/pricing



Implement nagios to opsgenie Heartbeats :





vendredi 18 décembre 2020

Webinar notes : General Assembly / Instagram


Add new lines in description texts 

https://apps4lifehost.com/Instagram/CaptionMaker.html


Schedule (free plans)


  • https://later.com/pricing/  30 / month
  • https://www.planoly.com/pricing 30 / month

Hashtags Tools 
  • Keyword Tool : https://keywordtool.io/ 
  • Instagram Tags (app ?)
    • http://www.instagramtags.com/

  • Hashtags (app ?)
  • Hashtagify (app ?)
10k - 10 M Posts per day ~ sweet spot

others
https://ingramer.com/tools/instagram-hashtag-generator/

mardi 15 décembre 2020

opinion-size-age-shape-colour-origin-material-purpose Noun.

 from a book called The Elements of Eloquence: How to Turn the Perfect English Phrase. 

Adjectives, writes the author, professional stickler Mark Forsyth, “absolutely have to be in this order:

 opinion-size-age-shape-colour-origin-material-purpose Noun. 

So you can have a lovely little old rectangular green French silver whittling knife. But if you mess with that order in the slightest you’ll sound like a maniac.” 



https://getpocket.com/explore/item/how-non-english-speakers-are-taught-this-crazy-english-grammar-rule-you-know-but-have-never-heard-of

mardi 1 décembre 2020

ansible FQCN for modules names > 2.10

 Starting in ansible 2.10, ansible now recommends using the FQCN for each module (Fully Qualified Collection Name) 

This might become mandatory in a future release.

To identify the redirection from the default / previous/ still working to the FQCN :

# ansible-playbook deploy.yaml -vv
redirecting (type:module) ansible.builtin.timezone to community.general.timezone



namely, this is an example for the helm (example from Montreal Ansible meetup on 30-sept-2020)



mercredi 25 novembre 2020

OpsGenie : AWS SNS message to Jira Description Wiki markup (+ links to S3 logs and SSM output)

If you're using the AWS SNS opsgenie integration and want to publish to JIRA, you can for example use the following code to present the data in a slightly better way : 


I this use-case I'm using the SNS channel to publish outputs from a system manager (AWS SSM) command that also publishes it's outputs to an S3, so we're using this extraction to provide the direct links to the s3 logs and the SSM run command history.

And in the end, we copy the message we received from the SNS channel "raw"..


In Opsgenie, in the specific Amazon SNS integration (Incoming Amazon SNS), in the Alert Fields, you can for example modify the "Description" so that it transforms the Message received like this :


h3. Details
|| AWS region | {{ TopicArn.extract(/arn:aws:sns:([^:]*):.*/) }}  |
|| Status | {{ Message.extract(/.*"status":"([^"]*)".*/) }} |
|| Instance ID |   {{ Message.extract(/.*"instanceId":"([^"]*)".*/) }}  [(aws link)|https://{{ TopicArn.extract(/arn:aws:sns:([^:]*):.*/) }}.console.aws.amazon.com/ec2/v2/home?region={{ TopicArn.extract(/arn:aws:sns:([^:]*):.*/) }}#InstanceDetails:instanceId={{ Message.extract(/.*"instanceId":"([^"]*)".*/) }}]|
|| Command ID | {{ Message.extract(/.*"commandId":"([^"]*)".*/) }} [(aws cmd)|https://console.aws.amazon.com/systems-manager/run-command/{{ Message.extract(/.*"commandId":"([^"]*)".*/) }}]  [(s3 logs)|https://console.aws.amazon.com/s3/buckets/ssm-output/ssm-log/{{ Message.extract(/.*"commandId":"([^"]*)".*/) }}/{{ Message.extract(/.*"instanceId":"([^"]*)".*/) }}/?region={{ TopicArn.extract(/arn:aws:sns:([^:]*):.*/) }}&showversions=false ]  
|
|| documentName | {{ Message.extract(/.*"documentName":"([^"]*)".*/) }} |
|| requestedDateTime | {{ Message.extract(/.*"requestedDateTime":"([^"]*)".*/) }} |
|| eventTime | {{ Message.extract(/.*"eventTime":"([^"]*)".*/) }} |
h3. Opsgenie info
|| EventType | {{eventType}} |
|| Timestamp (opsgenie) | {{Timestamp}}|
|| Tags | {{tags}} |
|| TopicArn | {{TopicArn}} |
|| Actions | {{actions}} |
h3. Original Message (raw): 
{code}
{{Message}}
{code}



Nb: this might only be available in certain OpsGenie subscriptions unfortunately :-(  

mardi 3 novembre 2020

Gitops & git tracking modifications & Nagios


Context : 

I needed to have all my nagios files on my computer to be able to run some python scripts trying to figure out what refactoring needed to be done, and identifying gaps in the configuration I inherited.

I took that opportunity to version all our nagios configuration files, with a git repository configured at the /usr/local/nagios/etc level.


That proved itself useful to gain some confidence that we're not going to loose anything.


Initial idea was taken from :  


Script to automatically commit changes done in Nagios and push them to the central repo. 
NB : still a few things to investigate, but ...

auto-git-commit-push.sh

#!/bin/bash
cd /usr/local/nagios/etc \
&& /bin/git pull \
&& /bin/git add -A \
&& /bin/git commit -m "updated nagios dynamic files $(date) -- automatic commit" \
&& /bin/git push origin master \
&&  /bin/git pull \
&& if ! $(grep -lr '<<<<<<<' . ) ; then grep -lr '<<<<<<<' . | xargs git checkout --ours; ./$0; fi


identified issues :
* why so many conflicts while we are only modifying and thus commiting files locally and pushing them !?
* I thought about putting in place a workflow that would take the files from the git repository and push them to nagios import with some git hooks, but I eventually found the Nagios REST API which is way easier to delivery to the team handling those creations : just 1 script per use-case and they'll do everything at once.

lundi 26 octobre 2020

make some internet noise / anti-recommendation algorithms tools

 http://makeinternetnoise.com/ : opens random webpages every 5 sec. This creates some artificial clutter in your web history => recommendation algorithms are lost.

(source : https://getpocket.com/explore/item/how-to-disappear )


Com' - Empathetic Communication (Atlassian skillbuilder / accreditation ressource)

 


empathy vs sympathy : https://www.youtube.com/watch?v=1Evwgu369Jw

https://www.amazon.com/Leadership-Step-Become-Person-Others/dp/0814437931

https://www.amazon.com/Your-Brain-Work-Strategies-Distraction/dp/0061771295

https://www.amazon.com/Business-Communication-Strategies-Skills-management/dp/003033067X

https://www.amazon.com/Dark-Side-Interpersonal-Communication/dp/080585780X

https://www.amazon.com/Leadership-Step-Become-Person-Others/dp/0814437931


lundi 12 octobre 2020

Mac Os X - mount issues on /Users after upgrade to mac os X 10.15 / error 77

 fixing /Users defined partition after an upgrade of mac os X.

The Mac I was using was configured before I got it, and I needed to upgrade it to use some more recent applications, but I ran into some issues due to a specific configuration of the /Users partition being located on a different partition than the OS data.

I could not mount it properly, due to 2 errors (might have been possible to mount it directly in HFS, but I also fixed it during the debug, just publishing my fix here with both steps).

Error :

sudo mount -uw /Users

Password:

mount_apfs: volume could not be mounted: Operation not permitted

mount: /Users failed with 77


Step 1 : convert from HFS to APFS

with Disk Utility tool > menu "Edit" > "Convert to APFS"...


Step 2 : edit mount description

/etc/fstab, edited with (sudo) vifs 

was :

UUID=12QW345E-1234-5678-123QWE123QWE /Users hfs auto

changed to :

UUID=12QW345E-1234-5678-123QWE123QWE /Users apfs rw 1 2


Step 3 : grant mount on /Users


Boot in recovery mode ( mac + R )

Launch (menu Utilities) > Terminal

csrutil status
csrutil enable --without fs

reboot