Tuesday, January 15, 2019

checking whether ports are being listened to

Git

current revision

# 
git rev-parse HEAD

commit diffs

git diff HEAD^ HEAD

see a file from 4 revisions ago
git show HEAD~4:src/main.c

List of remote branches

git ls-remote --heads origin

remove remote branch

git push origin --delete feature/xxx

Commits which are only in one branch :
git cherry -v develop mybranch

Files modified on a branch
git diff --name-only develop

Code review

git cherry -v develop feature/foo | gawk '{print $2}' | xargs git show

SSL

Displaying a certificate, example the one of gnupg.org
echo | openssl s_client -showcerts -servername gnupg.org -connect gnupg.org:443 2>/dev/null | openssl x509 -inform pem -noout -text

External ip address

curl ipinfo.io/ip

File permissions

On FreeBSD octal file permissions 
stat -f "%0Lp" /foo/bar
On ubuntu
stat -c "%a %n" *

Restarting audio on apple

sudo launchctl stop com.apple.audio.coreaudiod

GPG

getting keygrip information for a particular homedir

gpg --homedir /home/blake/bla --fingerprint --with-keygrip blake@cyb.org

exporting a secret key

gpg --export-secret-keys --armor john@example.com > john-privkey.asc

exporting a public key

gpg --armor --export you@example.com > mykey.asc

encrypting a document using a key

gpg --output doc.gpg --encrypt --recipient blake@cyb.org doc

decrypting the document using a key


gpg --output doc --decrypt doc.gpg

Sunday, March 29, 2015

Jenkins Literate Plugin


Jenkins has a literate plugin allowing to configure projects based on a README.md file at the root of the project. This blog post by Stephen Connolly titled Literate builds, WTF? gives more details.

What matters to me is that this plugin gives to developers the means to make Jenkins build a project differently depending on the branch. So I suppose that by using this literate plugin, one can support migrations where one moves from one build tool to another (say from Apache Ant to Apache Maven, or from Apache Maven to Gradle, ...) or where one moves from one JDK to another (say from JDK6 to JDK 8). Because with git it is possible to create a lot of branches very quickly one cannot really hope to have a buildmaster who is going to keep track of the ebb and flow of branches and make sure that all the branches which require JDK 8 will be configured in Jenkins to actually build with JDK 8.

Travis CI has the same functionality of adapting to the branch being built, because of the fact that Travis CI is using a travis.yml file. Uhhmm I have not tried it personally yet, but this is what reading the available documentation suggests.

Saturday, December 13, 2014

Apache Ivy 2.4.0

Today Nicolas Lalevée has created a new release candidate Ivy 2.4.0.
Currently looking at the release candidate.
See vote email here

Friday, November 21, 2014

Configuration Drift

Recently in my day job I encountered an issue. Our continuous integration system is setup to build a Java project which is hosted in a Git/Atlassian Stash repository.

The java project is using native libraries (*.so on linux) which are referenced by one of our third party jars.

One of our feature branches wants to use the version 8 of this third party, the rest of the branches use the version 7.

The build agents run with a LD_LIBRARY_PATH containing the folder for the version 7 of the library.

The continuous integration server that we are using - TeamCity - can set environment variables - but I am not aware of a way of telling TeamCity to set up different environment variables for the same build configuration depending upon the feature branch being build currently.

Also I would not want to enter this requirement in the build configuration, because I would have to change the build configuration every time a developer does a merge.

I mentioned this problem under the keyword configuration drift in an issue TW-18911 of the bug tracker of JetBrains.

Today I looked at Travis CI. The documentation of Travis CI explains that Travis is using Travis.yml files which are checked in in the root of the source tree of the projects to be built. And Travis.yml is taken from the branch being built. Since Travis users can specify for instance the major version of the JDK to use for the build, they can build one feature branch with Java 1.7 and another with Java 1.8, and the developer preparing the change can even have the elegance to check in the change in Travis.yml at the same time that he starts making use of Java 1.8 and maybe changing his pom.xml or build.xml to indicate that the code needs to be compiled with source=1.8.

CruiseControl has a potential solution to this type of problem if one sets up one project per module to build and per branch. CruiseControl configuration supports includes. One can make a directory structure for the project configuration where each branch's configuration is in a separate folder. That's not a great solution either as it requires some scripting to setup this file/folder structure, and it must be done in advance of actually starting builds on a branch.

Conclusion : CI systems which want to be really helpful for agile teams should allow the developers to document basic facts about the build process in the source tree itself. In TeamCity's world, that would be at least the build steps page of the configuration.

As far as I know, Jenkins is configured from a web page and the configuration of the build steps does not come from a descriptor supplied by the developers and branch dependent either.


Sunday, August 31, 2014

Managing users in a web application

I am working at home on an exercise to create the skeleton of a commercial web site. Today I am working on the user management. One of the problems is how do you handle passwords. I have found these documents Storing passwords in Java web application and Jasypt: Java simplified encryption which explain me how to deal with this issue.

I have created a self-signed certificate for my application using this how to Create a Self Signed Certificate.

The examples here Main.scala and MySslConfiguration help me.

I am realizing that I can run as myself my application under port 443 on MacOS, because this is a UNIX like system. Changing the code to run under 8443.

Also I might need the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.

I was not immediately lucky with MySslConfiguration. I am now using the sample found on the email thread titled Spray-can 1.3.1 ssl error no cipher suites in common

Saturday, May 31, 2014

Mac OS X Server Maverick upgrade

Today I have dealt with the aftermath of a Mac OS X Server Maverick upgrade.

Mac OS X Server has an integrated http server. The configuration files for the http server are now under /Library/Server/Web/Config/apache2

During the upgrade the configuration files are transformed.

In my case the loading of the .so files for Subversion in the httpd_server_app.conf file was removed, a special site file svn.conf was disabled by being renamed to svn.conf.SyntaxError, Also ProxyPass directives present in several of my site files were removed.

Maybe I should communicate these problems upstream to Apple ... or stop using the web server of Maverick and set up my own.

Oh and on top of that my Mail services were not working any more. I was not able to receive outside mail any more. It looks like I was receiving outside mail on port 465 and this does not work any more, I have had to open the port 25.

Sunday, May 25, 2014

Screen Sharing Issues with my Mac Mini running Maverick

Hi,

I have recently upgraded my Mac Mini to Mavericks.

The screen sharing from an IMac running Mavericks too is bad. When my mouse pointer is on the screen sharing window, the mouse pointer moves slowly by itself making it difficult to click on the proper window or control.

I found that article http://www.tristanbettany.com/2013/06/17/slow-screen-sharing-in-osx-vnc-performance-issues/ which gives a potential workaround.

In fact I am ending up using JollysFastVNC which works great.