Skip to content

Instantly share code, notes, and snippets.

@khiemdoan
khiemdoan / Ubuntu Setup.md
Last active November 14, 2023 09:50
This note about software, config in my Ubuntu.

Ubuntu Setup

This note about software, config in my Ubuntu.

Change swap size

sudo swapoff -a
sudo fallocate -l 1G /swap.img
sudo chmod 600 /swap.img
@khiemdoan
khiemdoan / Postman Installer.sh
Last active May 26, 2018 14:40
Postman Installer for Ubuntu
#!/bin/sh
# Auto install Postman
# Khiem Doan <doankhiem.crazy@gmail.com>
# use for Ubuntu
postman_download_url='https://dl.pstmn.io/download/latest/linux64'
file_name='/tmp/postman-linux-x64.tar.gz'
destination_dir='/usr/share/postman'
symbolic_link='/usr/bin/postman'
@khiemdoan
khiemdoan / remove_vietnamese_tones.py
Last active July 1, 2019 03:46
Remove Vietnamese Accent
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Remove Vietnamese tones function"""
"""Author: Khiem Doan"""
uni_chars_l = 'áàảãạâấầẩẫậăắằẳẵặđèéẻẽẹêếềểễệíìỉĩịóòỏõọôốồổỗộơớờởỡợúùủũụưứừửữựýỳỷỹỵ'
uni_chars_u = 'ÁÀẢÃẠÂẤẦẨẪẬĂẮẰẲẴẶĐÈÉẺẼẸÊẾỀỂỄỆÍÌỈĨỊÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢÚÙỦŨỤƯỨỪỬỮỰÝỲỶỸỴ'
no_tone_chars_l = 'a'*17 + 'd' + 'e'*11 + 'i'*5 + 'o'*17 + 'u'*11 + 'y'*5
#!/bin/sh
# Auto install Google Chrome
# Khiem Doan <doankhiem.crazy@gmail.com>
# use for Ubuntu
sudo rm -f /etc/apt/sources.list.d/google-chrome.list
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt update
// KhiemDH - 2019-06-26
#ifndef _DBG_PRINT_KHIEMDH_
#define _DBG_PRINT_KHIEMDH_
#ifndef _DEBUG
#define DbgPrint(_exp, ...) __noop

Manjaro Setup

This note is about softwares, configs in my Manjaro.

Update mirrorlist with the fastest mirrors

sudo pacman-mirrors --fasttrack && sudo pacman -Syyu

Snap

import logging
import logging.handlers
from pathlib import Path
from utils import Filesystem
__author__ = 'KhiemDH'
__github__ = 'https://github.com/khiemdoan'
__email__ = 'doankhiem.crazy@gmail.com'
from IPython.display import display

def summary_data(data):
    print(f'Dataframe dimensions: {data.shape}')
    tab_info = pd.DataFrame(data.dtypes).T.rename(index={0: 'column type'})
    tab_info = tab_info.append(pd.DataFrame(data.isnull().sum()).T.rename(index={0: 'null values (nb)'}))
    tab_info = tab_info.append(pd.DataFrame(data.isnull().sum() / data.shape[0] * 100).T.rename(index={0: 'null values (%)'}))
    display(tab_info)

VLC media player

sudo snap install vlc

GitKraken

sudo snap install gitkraken

Linux configs

Hardware clock in local time

sudo timedatectl set-local-rtc 1 --adjust-system-clock

Increasing the amount of inotify watchers

If you are running Debian, RedHat, or another similar Linux distribution, run the following in a terminal: