Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am fredjoseph on github.
  • I am fredjoseph (https://keybase.io/fredjoseph) on keybase.
  • I have a public key ASAUP31ohpKOKZXGMac1INGln02a5em4A0N8DoSiJdKaIQo

To claim this, I am signing this object:

@fredjoseph
fredjoseph / lfrc
Last active April 6, 2020 20:22
[lf configuration file] configuration file for windows - Location : C:\Users\<user>\AppData\Local\lf\lfrc
# This configuration file adds some commands to lf file manager for windows.
# Requirements :
# - git-for-windows
# - highlight
# interpreter for shell commands (needs to be POSIX compatible)
set shell cmd
# set '-eu' options for shell commands
# These options are used to have safer shell commands. Option '-e' is used to
@fredjoseph
fredjoseph / docker.md
Last active December 2, 2021 08:46
[Docker]

Docker is an open platform for developing, shipping, and running applications. It is the standard de facto for packaging and sharing apps – from desktop to the cloud.

To achieve its goal, Docker is using containers.

The container has the following characteristics:

  • A container is a package for the software and all required libraries.
  • As soon as is launched, a container determines a runtime environment for your application.
  • A container is lighter than a virtual machine, so that it can be launched way faster.
  • A container is distributed in the form of an image, which consists of multiple layers. Multiple containers can reuse these layers.
@fredjoseph
fredjoseph / OpenVPN.md
Last active June 13, 2024 10:45
[OpenVPN] Multi-TAP

OpenVPN, by default, installs only one TAP network interface. If you want to connect to multiple VPNs simultaneously you need a TAP interface for each VPN.

Add an additional TAP adapter

  • Open a command prompr with administrative rights
  • Go to the TAP install folder C:\Program Files\TAP-Windows\bin
  • Launch the addtap.bat script, the result will be :
    "devcon.exe" install "C:\Program Files\TAP-Windows\driver\OemWin2k.inf" tap0901
    

Device node created. Install is complete when drivers are installed...

@fredjoseph
fredjoseph / user-aliases.cmd
Last active March 7, 2020 11:36
[Cmder] my user aliases
;= @echo off
;= rem Call DOSKEY and use this file as the macrofile
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0%
;= rem In batch mode, jump to the end of the file
;= goto:eof
;= Add aliases below here
e.=explorer .
ls=ls --show-control-chars -F --color $*
pwd=cd
clear=cls
@fredjoseph
fredjoseph / Hsqldb.md
Last active May 31, 2020 10:26
[HSQLDB] How to connect with Spring Boot app

In-memory database

For connecting to in-memory HSQL database, we need to launch a db browser in the same JVM instance.

First, we need to add the following code in a Configuration class of the Spring application.

    @PostConstruct
    public void startDBManager() {
        //hsqldb
        DatabaseManagerSwing.main(new String[] { "--url", "jdbc:hsqldb:mem:testdb", "--user", "sa", "--password", "" });
 }
@fredjoseph
fredjoseph / Vagrant.md
Last active May 31, 2020 10:07
Vagrant

Error

If an error 'initialize': negative string size (or size too big) occurs, the solution is to remove the index file in ~\.vagrant.d\data\machine-index

Disk size

Vagrant doesn’t provide any out-of-the-box option to configure or to change the disk size. The disk size of a VM totally depends on the base image used for the VM. Moreover, most Vagrant boxes use VMDK disks which cannot be resized!

vagrant-disksize plugin

This plugin allows to resize the disk size.

@fredjoseph
fredjoseph / clink_shortcuts.md
Last active March 20, 2019 08:54
Clink shortcuts
@fredjoseph
fredjoseph / gitbash_prompt.md
Last active June 3, 2019 08:03
[Git Bash] Custom Prompt

The goal is to display the status of a git repository directly in the prompt.

Solution 1

  • Update the .bashrc file with the following lines
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
export GIT_PS1_SHOWUPSTREAM="auto verbose"
export GIT_PS1_SHOWCOLORHINTS=1
@fredjoseph
fredjoseph / .zsh_aliases
Last active March 19, 2020 04:29
ZSH aliases
alias ls="ls --color=auto -v -h --group-directories-first"
unalias fd 2>/dev/null
alias mvn-quick-install="mvn clean install -DskipTests -T2C"
alias iless="less -iMSx4 -FXR"
# Kill all the tabs in Chrome to free up memory
# [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description
alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill"
alias chromiumkill="ps ux | grep '[c]hromium --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill"