Skip to main content

Posts

Jira server Firefox mobile

Make Jira server to deliver the mobile version when using Firefox Mobile. My use case I mostly receive Jira notifications by Email, read on my telephone.
When I want to comment the notification from my telephone, I usually choose Firefox Mobile.
Problem Unfortunately (dunno if it has to do with fortune), Firefox Mobile is not a supported web browser, so that Atlassian has made the choice to deliver the desktop version if the client is the client browses with an unsupported browser.
Solution I have an Apache reverse proxy in front of my Jira instance: I can force a Redirection to the mobile URL if I match the Firefox Mobile User-Agent.

... RewriteCond "%{HTTP_USER_AGENT}" "^Mozilla\/[1-9]\.0 \(Android [1-9]\.0\.0; Mobile; rv:[1-9][1-9]\.0\) Gecko\/[1-9][1-9]\.0 Firefox\/[1-9][1-9]\.0$" RewriteRule "^/browse/(.+)$" "https://jira.rktmb.org/plugins/servlet/mobile#issue/$1" [R,L,NE] RewriteRule "^/browse/(.+)#add-comment$…
Recent posts

Confluence REST add Page

How to add a Confluence Page as a child of an existing page via the REST API Then Confluence API examples are good, but they don't mention how to specify a parent page, under which I want the newly created page must be.
Thanks to https://community.atlassian.com/t5/Confluence-questions/Updating-a-confluence-page-with-Rest-API-problem-with-ancestors/qaq-p/74667 and https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-specify-parent-page-of-new-updated-page-in-Confluence/qaq-p/488096 , this is the solution:
curl -u mihamina:my_password -X POST -H 'Content-Type: application/json' -d '{ "type":"page", "title":"Andrana", "ancestors":[{"id":"61145092"}], "space":{"key":"MVT"}, "body":{"storage":{"value":"This is a new page", "representat…

Vsftpd LXC ERR500

VSFTPD in container list error 500 When running VSFTPD in a container (LXC here, did not try on Docker), default configuration makes directory listing unavailable.
Listing directory content generate an Error 500: $ lftp ftp://192.168.99.58/os/ cd ok, cwd=/os lftp 192.168.99.58:/os> ls ls: Fatal error: 500 OOPS: This is due to the fact VSFTPD use "seccomp" (well, dont ask what it is: I dont know) In order to work arround, I just had to add this line to the VSFTPD configuration: seccomp_sandbox=NO There are many references to this, no need for me to be anotehre reference, I just wrote this article as a reminder for myself:

https://bugs.launchpad.net/serverguide/+bug/1302096https://www.linuxquestions.org/questions/gentoo-87/vsftpd-error-500-vsf_sysutil_bind-priv_sock_get_int-priv_sock_get_cmd-4175436938/https://technologytales.com/2013/09/21/turning-off-seccomp-sandbox-in-vsftpd/

disorder file awk

Randomize a file lines with AWKThe goal here is simple:

I have a file (music playlist, user list,...)I want to disorder it, just like I woul beat the cardsI asked this a long time ago on Usenet (fr.comp.os.unix), and I got this anwser from St├ęphane CHAZELAS.

If the file is not too big:
awk < fichier '{a[n++]=$0} END{for(srand();n--;a[i]=b) {b=a[n];a[n]=a[i=int(rand()*NR)]}; while(++n<NR)print a[n]}'
Otherwise:

awk < fichier 'BEGIN{srand()}{print rand(),$0}'  | sort -k1,1 | cut -d -f2-
I write it down here just for the archives

mediadrop direct publishing

Make uploaded videos directly published At ESTI I needed a special feature:

Students need to upload videos as anonymousAs soon as uploaded, videos need to be in the published state

Mediadrop default workflow is to have videos go through a precise workflow, as stated in the documentation.
Of course this is not what I want.
I looked for a way to hack it in order to get what I want.

I achieved this with these too commits:

https://bitbucket.esti.mg/mediadrop/commits/5f9fhttps://bitbucket.esti.mg/mediadrop/commits/0857
Drawbacks This is a dirty hack. To make it clean, I need make it configurable through the administration interface, which is not the case as is.
That will be the next step, but let's go live for the moment.

centos kickstart gdm

Starting GDM after a Kickstart installation When installing CentOS7 from Kickstart, GDM is not starting at boot.
This is because the default target is "multi-user":

ls -l /etc/systemd/system/default.target lrwxrwxrwx. 1 root root 41 Mar 24 01:53 /etc/systemd/system/default.target -> /usr/lib/systemd/system/multi-user.target
To solve this, I put these lines in the "%post" section:

%post rm /etc/systemd/system/display-manager.service rm /etc/systemd/system/default.target ln -sf /usr/lib/systemd/system/graphical.target /etc/systemd/system/default.target ln -sf /usr/lib/systemd/system/gdm.service /etc/systemd/system/display-manager.service %end

HAProxy HTTPS SSH Bitbucket

Atlassian Bitbucket Bitbucket is a software developped by Atlassian and I define it like an interface to Git, in order to make it more friendly.
There is a bunch of software in Bitbucket, acting as layers in order to facilitate collaboration on code.
Last but not least, Bitbucket has a good integration with Jira, which is one of the main reasons I choosed it to be our tool at ESTI.
I thank Atlassian very much for metting ESTI use community licence of both Jira and Bitbucket.

The goal: HTTPS and SSH on regular ports Default HTTP and SSH port for Bitbucket is neither 443 nor 22. Their are configurable and it would be possible to directly make Bitbucket face those ports, but we dont like that, we'd rather setup a HAProxy instance that will forward the ports for us.
Prerequisite for that is to have a HTTPS certificate. It might be self signed or not. The one I use is not self-signed, and I bought it to Gandi, which provides an intermediate SHA2 certificate.

To sum it up, I have in my…