Skip to content

Instantly share code, notes, and snippets.

View tinhtun's full-sized avatar
🇲🇲

Tin Htun tinhtun

🇲🇲
View GitHub Profile
  • For some reasons, your apt is gone and get errror message like apt command not found
  • Download the apt package for your ubuntu version here http://security.ubuntu.com/ubuntu/pool/main/a/apt/
  • For example, get apt 1.6 for Ubuntu 18.04.2 LTS
  • Force install apt package and run apt-get update
wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.6.1_amd64.deb
sudo dpkg -i --force-all apt_1.6.1_amd64.deb
sudo apt-get update

Ther problem of this phone is that for some reason, night display option is activeated by default and cannot be deactivated from the settings. Here is how to fix it by using ADB shell commands.

  • Download ADB(windows/mac)
  • Enable Developer Option
  • Enable USB Debugging
  • Connect Phone to PC with USB cable
  • Run these commands
adb shell settings put secure night_display_activated 0
adb shell settings put secure night_display_auto_mode 0
@tinhtun
tinhtun / linux-commands.md
Last active October 19, 2018 05:13
#tinhtun #linux

Permissions

Add tomcat8 group to current login user

usermod -a -G tomcat8 $USER

Put the tomcat user as the owner of the folder of tomcat

chown -R tomcat8:tomcat8 /var/lib/tomcat8

Owner can read, write, execute. Everyone else can read, execute.

chmod -R 755 /var/lib/tomcat8/logs

@tinhtun
tinhtun / git-commands.md
Last active October 24, 2018 01:37
#tinhtun #git

Git Commands

Photo from Google

Configuration

$ git config --global user.name "John Doe"
$ git config --global user.email "john@example.com"
$ git config --global --list
package com.tinhtun;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;
import java.util.stream.Collectors;

How to read and write excel files in Java using Apache POI

Maven Dependency

<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.17</version>
</dependency>
@tinhtun
tinhtun / journal-october-2017.md
Created October 6, 2017 03:33
#tinhtun #journal #october #2017
@tinhtun
tinhtun / install-docker-mint.sh
Created July 26, 2017 17:45 — forked from mmcc/install-docker-mint.sh
Install Docker on Linux Mint 17
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sh -c 'echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list'
# Install docker
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-get install linux-image-extra-$(uname -r)
sudo apt-get install docker-engine
sudo service docker start
@tinhtun
tinhtun / journal-february-2017.md
Created February 15, 2017 01:40
#tinhtun #journal #february #2017
@tinhtun
tinhtun / mmwrap.html
Created January 10, 2017 04:25 — forked from eimg/mmwrap.html
Inserting ZWSP between every syllables for better text wrapping for Myanmar text.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Break Wrap</title>
<style>
body {
background: #efefdd;
}