Monday, August 23, 2021

Debian Bullseye: upgrade from Debian Buster XFCE

 

Edit /etc/apt/sources.list

# main security
deb https://security.debian.org/debian-security bullseye-security/updates main
#deb-src https://security.debian.org/debian-security bullseye-security/updates main

# main mirror Indonesia
deb http://kebo.pens.ac.id/debian bullseye main
deb http://kebo.pens.ac.id/debian bullseye-updates main

# NON FREE
deb https://deb.debian.org/debian bullseye main contrib non-free

# BACKPORTS
deb https://deb.debian.org/debian bullseye-backports main

Update without new packages

# apt upgrade --without-new-pkgs

During upgrade, you need to restart some services.

Restart, open root terminal and make full upgrade (required more than 800MB)

# apt full-upgrade

Restart your PC.

Clean up unused installer

# apt-get autoclean && apt-get autoremove -y

If you get trouble connecting to internet (can not resolve servername) after upgrading edit /etc/resolv.conf

search 8.8.8.8 1.1.1.1
nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 1.1.1.1

Restart your networking

# systemctl restart networking

If you install dnsmasq and get trouble connecting to internet (can not resolve servername) after upgrading, edit /etc/dnsmasq.conf

#no-resolv
# dedetok 2021-08-18
no-resolv
server=8.8.8.8
server=1.1.1.1

Reboot

Wednesday, August 4, 2021

jdk11: Eclipse MariaDB Connector/J

 

Minimum Java Project JavaSe-1.8.

Adding MariaDB Connector/J 2.7.3 to Eclipse 2021-06:

  1. Download MariaDB Connector/J 2.7.3 (stable) from https://downloads.mariadb.org/connector-java/2.7.3/
  2. Put JAR file in [Workspace] -> [project_name] -> lib (create folder lib)
  3. Right click on Package Explorer -> [project_name] -> Properties
  4. Java Build Path -> Library -> Add External JARs, point it to [Workspace]/[project_name]/lib/mariadb-java-client-2.7.3.jar
  5. Click Apply and Close

Example code to access MariaDB database

package com.dedetok;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class TesCon {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        String muser = "my_user";
        String mpass = "my_password";
        String murl = "jdbc:mariadb://localhost:3306/my_database_name";
        Class.forName("org.mariadb.jdbc.Driver");
        Connection connection = DriverManager.getConnection(murl, muser, mpass);
        System.out.println("ok");
    }
}

Sunday, July 18, 2021

Android Studio: moving project from windows to Debian 10

Backup:

  1. all files in
    [Workspace] -> [app_name]
    backup jks and iml file
  2. Folder
    [Workspace] -> [app_name] -> [app]
    Exclude folder release and build

DO NOT BACKUP: Hiden folder (.gradle, .idea), gradle

Restore all folder structure into your new Workspace folder in new OS

Before you open your project in new OS, adjust your files depend on your your SDK, SDK version and Buildtool version, edit file

[workspace] -> [app_name]
local.properties
    sdk.dir=/home/[username]/Android/Sdk

[workspace] -> [app_name] -> [app]
build.gradle
    compileSdkVersion 31
    buildToolsVersion "31.0.0"
    ...
        targetSdkVersion 31

You can safely open your project, Android Studio will make same adjustment, download some necessary library and reconfigure your project.

Tested on

  • Debian Buster
  • Android Studio 4.2.x
  • moving project from windows to Debian

Thursday, July 15, 2021

Debian Buster (Debian 10): install mysql workbench

 

Download mysql workbench from https://downloads.mysql.com/archives/workbench/

I use mysql-workbench-community version 8.0.19 for ubuntu 18.04 i.e. mysql-workbench-community_8.0.19-1ubuntu18.04_amd64

Install libtinfo5

# apt-get install  libtinfo5

Install mysql workbench using dpkg

# dpkg -i mysql-workbench-community_8.0.19-1ubuntu18.04_amd64

NOTE:

  • only mysql workbench community for Ubuntu 18.04 will work on Debian Buster (10)

Monday, July 5, 2021

Debian Buster: LAMP + PhpMyadmin

 

LAMP: Linux Apache2 MariaDB PHP + PhpMyyadmin

Install mariadb

# apt-get install mariadb-server  mariadb-client  

Set mysql root password

# mysqladmin -u root password [yourpassword]

Install Apache2 and PHP

# apt-get install apache2 php libapache2-mod-php php-gd php-mysql

Disable autostart

# systemctl disable mariadb
# systemctl disable apache2

install phpmyadmin

  1. Install depedency php-twig (> 2.9) from backport
    # apt-get install -t buster-backports php-twig
  2. Install phpmydmin
    # apt-get install phpmyadmin php-bz2 php-curl php-tcpdf php-zip
Using browser open http://localhost/phpmyadmin/index.php