Posts

List git activity history on all your projects

For Linux users, you can, with only one command line, get all your development activities for the last week. Use full to do your weekly report.

Let's do :

find . -type d -name '.git' -exec echo {} \; -exec git -C {} log --author=[username] --since="1 weeks ago" \;


Enjoy!

Set Ubuntu user password in Windows 10

As I tried to make sudo command from my Ubuntu 18.04 running inside Windows 10 (Yes you can get Ubuntu running inside Windows 10 from the Microsoft Store! Awesome!), I realized I didn't set any password to my current user, which is needed to run a sudo command.

So, to do that, you first have to know you current Ubuntu username (asked when you install Ubuntu from the Microsoft store). Suppose your user is alex. We will do :


Switch current Ubuntu user to root. To do that, open a Windows 10 Command or Powershell console and run :  ubuntu1804 config --default-user rootOpen your Ubuntu App (from the Windows 10 start menu). This will open Ubuntu bash in root instead of your userRun 'passwd alex' to set alex password and close your Ubuntu shellSwitch Ubuntu back to alex as default user by running the following command from your current Windows 10 Command or Powershell console :  ubuntu1804 config --default-user alex That's all. When you will start again Ubuntn App, you will be…

Put your Tomcat behind a reverse proxy on CentOS

Image
I have an API service with an embedded tomcat running on port 8080 on a CentOS server. I don't want to expose it directory and I want to access this API threw HTTPS (port 443). If I access to it on 'classic' http (port 80)

A simple solution is to deploy an Apache httpd server on my CentOS and use is as reverse proxy.




Step 1 : install Apache httpd server
yum install httpd
yum install mod_ssl

Open /etc/https/conf/httpd.conf file and add the directive Listen 443 after Listen 80 to enable apache to listen to port 443

Step 2 : Install your certificate files
First all all, you can to install your certificate by copying  your three files to a directory of your choice. For me, it's /etc/ssl like this :


000000000 4 -rw-r--r--.   1 root root 1674  9 janv. 18:20 intermediate-CA.key
000000000 4 -rw-r--r--.   1 root root 1708  9 janv. 18:20 private.key
000000000 4 -rw-r--r--.   1 root root 2248  9 janv. 18:20 public.key

Everything is x509 key encoded in base64
private.key is the key yo…

OpenJDK11 not supported by Eclipse? What ?

That's I discovered recently. I admit that my Eclipse is a little it outdated. Hopefully, this is a well known bug and you can easily install an official Eclipse extention just like this :


Open Help Menu -> Install new software.Add the following URL and you shoud seed a plugin to enable jdk 11 support.

http://download.eclipse.org/eclipse/updates/4.9-P-builds

Enjoy :)

Install Shutter screen capture tool on Ubuntu 18.04 and later

Shutter, an excellent screen capture tool, is no more part of official Ubuntu repository. Hopefully, there's a solution :


sudo add-apt-repository ppa:linuxuprising/shutter sudo apt-get update sudo apt install shutter
(Source : https://www.linuxuprising.com/2018/10/shutter-removed-from-ubuntu-1810-and.html)

Display Javascript console logs with jsfiddle

Jsfiddle is mainly made to test javascript code in a web context (aka with HTML and CSS). But, if you just want to use is to test backend code, you probably want to see results in the console. This can be done by adding the following library to your project :

https://rawgit.com/eu81273/jsfiddle-console/master/console.js

You can also take a look at this example :

https://jsfiddle.net/p24wbehf/1/

Install Microsoft Visual Studio Code on a chromebook

My chromebook is fantastic! As it supports Linux integration feature, I can open a terminal and install every Debian based packages I want such as Microsoft Visual Studio Code. Let's go!


Step 1 - Import the Microsoft GPG key :
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
Step 2 - Add the Visual Studio Code repository :
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
Step 3 - Install the latest version of Visual Studio Code
sudo apt update sudo apt install code That's all!


Install Node.js on a chromebook

If you have a chromebook which supports Linux experimental integration feature (look for this in your global parameters), then you can open a bash terminal. The Linux behind the scene seems to be Debian based.

So, to install Node.js, forget the classic way with sudo apt-get install nodejs because you will get an old release. Instead of that, you can to this :

Step 1 – Add Node.js PPA
sudo apt-get install curl software-properties-common curl -sL https://deb.nodesource.com/setup_12.x | sudo bash - Step 2 – Install Node.js
sudo apt-get install nodejs That's all!

(source : https://tecadmin.net/install-latest-nodejs-npm-on-debian/)