SpringBoot creating UserDetailsService authentication with login and signup form example

There are plenty of online tutorials showing how to create database-based authentication for Spring. Some of them use SQL query to authenticate user and retrieve its roles, some use DAO… but none of them worked well for me and all of them had some major problems, even like SQL Injection. So, in this post I […]

Rust – get user’s home directory

fn main() { let mut path: PathBuf = get_app_dir(); path.push(".config"); path.set_file_name("properties"); path.set_extension("ini"); let str_path = path.to_str().unwrap(); if str_path.len() != 0 && path_exists(&path) { println!("Path {} exists", str_path); } }   fn get_app_dir() -> PathBuf { let dir: PathBuf = match env::home_dir() { Some(path) => PathBuf::from(path), None => PathBuf::from(""), }; dir }   pub fn path_exists(path: […]

XXX loves opensource…

…that’s why we published our product on OSI-compatible license! We <3 open-source! Well, does Microsoft/Google/Apple/Netflix/XXX really love open-source? No, they don’t. In fact they do more to extinguish open source by fighting them with patent wars, you don’t hear about, developing DRM, you hear about when it’s too late and dropping support for some key-products […]

Setting up SonarQube for Android Gradle project to improve code quality

I’m working on a new Android project which I inherited. Well, I forked it because I didn’t feel welcomed to contribute to the project and I see a lot of places where improvements are needed. First, I need to improve the codebase. Previous developers didn’t care about any Java coding guidelines from Oracle, Google, CERT […]

Choose GitLab for your next open source project

GitLab.com is a competitor of Github. It’s a service provider for git-based source code repositories that offers much more than it’s bigger brother. In this post I will try to convince you to try it out for your next project. GitLab is not only a simple git hosting; its features impact the whole development process, […]

JHLabs for Android

My major project in Java (Android) involved image manipulation where I used JHLabs. I found there was no easy way to add JHLabs support for Android without extracting sources and manually adding them to the project. So there it is now: https://gitlab.com/agilob/JHLabs_android It’s compatible with gradle build system, so you can easily add it to […]

[Java] – Regular expression to match IPv4 address

I saw such question on SO. There was no solution with RegEx so… I was bored I think. public static boolean isValid(String ip) { boolean isvalid;   isvalid = ip.matches( "(([0-9]|[0-9]{0,2}|1[0-9]*{0,2}|2[0-5][0-5]|0{0,3}).){3}" + "([0-9]|[0-9]{0,2}|1[0-9]*{0,2}|2[0-5][0-5]|0{0,3})" );   return isvalid; }public static boolean isValid(String ip) { boolean isvalid; isvalid = ip.matches( "(([0-9]|[0-9]{0,2}|1[0-9]*{0,2}|2[0-5][0-5]|0{0,3}).){3}" + "([0-9]|[0-9]{0,2}|1[0-9]*{0,2}|2[0-5][0-5]|0{0,3})" ); return isvalid; }

Copy one table from one database to another and replace values in one of the columns

This blog is also available in .onion domain. Both blogs have different databases, DB users and passwords, different WordPress configurations, and as a result, they have different data in DB column. After publishing a new post here, I do not want to manually copy posts from here to there and I want images from b.agilob.net […]

Static code analysis in QtCreator with CppCheck

Just a simple tutorial to show you how to add static code analysis plugin in QtCreator on Liunx. Start by downloading plugin dedicated to QtCreator from here. Unpack .zip and you will get two directories which you have to copy to /usr/lib/qtcreator/plugins/. You can copy only libQtcCppcheck.so, if you don’t need Russian translation. cp lib/qtcreator/plugins/libQtcCppcheck.so […]