Showing posts with label date. Show all posts
Showing posts with label date. Show all posts

Top 5 small java libraries for projects (functional, date, etc.)

For some time now most of my Java projects revolve around the Spring Boot Stack which contains pretty much everything you can need, however there's a list of small libraries and utilities that I love to use in my projects

Below is my top 5 small libraries I use in my projects

  • TotallyLazy : enhances the functional standard library with some syntaxic sugar
  • Lombok : because who wants to write setters/getters manually
  • JodaTime Yes, yes I know I should use now the new java API but I still like Joda best!
  • jOOλ : More functional sweetness
  • Apache Commons : Multi-purpose library

The above are my way-to-go small libraries for my projects, of course there are some specific libraries for a given case Jackson JSON or Caffeine Cache

Linux change timezone and force ntpd synchronization

This short article shows how to change the timezone of the Linux distribution as well as forcing the synchronisation of date/time with the ntpd servers

This applies specifically applies to CentOS so some changes might be possible depending on the distribution
1.Change timezone
cp /etc/localtime /root/old.timezone
rm /etc/localtime
ln –s /usr/share/zoneinfo/Europe/Zurich /etc/localtime
2.Add ntpd servers to you configuration file (optional)

Edit (or create) the /etc/ntpd.conf and add the appropriate ntpd servers :

server xxx.xxx.xxx.xxx
server xxx.xxx.xxx.xxx
note: xxx.xxx.xxx.xxx is the ip or domain name of the server
3.Stop the ntpd daemon

/etc/init.d/ntpd stop

4.Force the date update

Force the update of the date with the new timezone and eventually the ntpd servers


ntpdate xxx.xxx.xxx.xxx

5.Stop the ntpd daemon

/etc/init.d/ntpd start

6.Stop the ntpd daemon

date

OSX show used ports or listening applications with their PID

On OSX you can display applications listening on a given port using the lsof the commands described below will show listening application...