Skip to main content

Posts

Showing posts from September, 2017

Auto start VirtualBox guest on system reboot (Ubuntu 16.04)

Here's how to turn on guest OS in VirtualBox automatically when host PC is turned on. In this guide I use Ubuntu 16.04 LTS 64bit and VirtualBox 5.1.22 All we need to do is create a file with the extension * .service and put in the /lib/systemd/system folder. In this guide use the autostartvbox.service file name as an example. sudo nano /lib/systemd/system/autostartvbox.service   The contents of the file are as follows #!/bin/sh [ Unit ] Description = Autostart VBOX Guest on Boot [ Service ] User = your_user ExecStart = /usr/bin/VBoxHeadless --startvm VirtualBox_Guest_Name [ Install ] WantedBy = multi-user.target     allows the service to run when the system boot with the following command sudo systemctl enable autostartvbox.service     If successful then the feedback obtained is as follows Created symlink from /etc/systemd/system/multi-user.target.wants/autostartvbox.service to /lib/systemd/system/autostartvbox.service     Restart the PC t

Ubuntu Server 16.04: Minimum GUI

As we know that Ubuntu Server by default does not have a GUI. But sometimes in certain cases, we need a GUI on Ubuntu Server. For example Ubuntu Server as the host of the virtual client (KVM, VirtualBox, VMware or other virtual applications). Although VirtualBox has a headless server configuration, having a GUI still makes it much easier in terms of virtual client maintenance. If we do a search on google, many articles or tutorials that discuss how to install GUI on Ubuntu Server. Where in general the command used the command for the installation as follows sudo apt-get install --no-install-recommends ubuntu-desktop If the command is executed, after restarting the server, it will display a GUI like the desktop version of Ubuntu. The --no-install-recommends argument should be used to avoid unnecessary package installations, such as multimedia applications, browsers, office applications and other desktop applications commonly found on desktop ubuntu installations. In general, m

Ubuntu Server 16.04 : Connection via USB Android Tethering

As we know that Ubuntu Server by default does not have a GUI. It is certainly quite difficult to make internet connection via USB Android. Here's how to connect internet via USB and have been tried in Ubuntu Server version 16.04 LTS. Make sure your android phone already has internet connection Connect your android phone with server via USB cable From your android phone, click Settings menu -> Wireless and Network -> More -> Tethering & portable hotspo t and enable USB tethering In the ubuntu server terminal, use the command sudo ifconfig -a Sample display of this command enp0s29f7u5 Link encap:Ethernet HWaddr 08:00:27:38:7b:49 inet addr:192.168.201.7 Bcast:192.168.201.1 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe38:7b49/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3593205 errors:0 dropped:0 overruns:0 frame:0 TX packets:4328737 errors:0 dropped:0 overruns:0

The most commonly used Apache POI function

Set Cell Style   XSSFWorkbook workbook = new XSSFWorkbook (); XSSFSheet sheet = Workbook . createSheet ( "sheet title" ); XSSFRow row ; XSSFCell cell ; int indexRow , indexColumn ; row = sheet . createRow ( indexRow ); cell = row . createCell ( indexColumn ); CellStyle style = workbook . createCellStyle (); cell . setCellStyle ( style ); Wrap Style CellStyle wrap_style = workbook . createCellStyle (); wrap_style . setWrapText (CellStyle percent_style = workbook.createCellStyle(); percent_style.setDataFormat(workbook.createDataFormat().getFormat("0.00%")); true ); Border Style XSSFWorkbook workbook = new XSSFWorkbook (); CellStyle border_style = workbook . createCellStyle (); border_style . setBorderLeft ( BorderStyle . THIN ); border_style . setBorderRight ( BorderStyle . THIN ); border_style . setBorderTop ( BorderStyle . THIN ); border_style . setBorderBottom ( BorderStyle . THIN ); Bold Style Font font = workb

Allows remote control of any hosts in MySQL 5.7 (Ubuntu)

To allow remote control of mysql server, in addition to setting user privileges to be anyhost '%', we also need to configure config file in /etc/mysql/mysql.conf.d/mysqld.cnf sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf Replace the IP address on the bind-address with the desired IP address or use 0.0.0.0 to allow all IP addresses # # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind - address = 0.0 . 0.0 #    Restart mysql server to enable configuration sudo service mysql restart

Hello World!

This is my first post for this blog. This blog is used to keep important notes to fight forgotten, also for sharing information for others. In the future, this blog is likely to be more content about technology, programming, and operating systems. Through this first article I say 'Hello World!'