Ubuntu

GRUB Rescue

2019-01-06. Category & Tags: GRUB, Rescue, Boot, linux, Ubuntu

When being forced into GRUB rescue mode, run ls and ls <one_partition> to check available partitions and find the one that we should boot from [ref]. Then set prefix & root [ref]: set root=(hdX,Y) set prefix=(hdX,Y)/boot/grub insmod normal normal To avoid doing this every time, it is recommened to use a live-USB/ISO to repair GRUB (usually only Desktop version can be in live-USB and easy to setup WIFI). (// it should be also ok to do this without USB if there is a nix system working on current HDD). ...

Install & Use R & RStudio

2017-05-08. Category & Tags: R, Install, Ubuntu, linux, Rstudio

R IN WINDOWS # Download here and install. R IN UBUNTU 18.04 # sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && \ sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/' && \ sudo apt update && \ sudo apt install -y r-base r-base-dev libcurl4-openssl-dev libssl-dev build-essential && \ sudo -i R # install packages as root, so all users can use. Commonly used packages: install.packages(c('devtools', 'digest', 'repr', 'IRdisplay', 'crayon', 'pbdZMQ', 'ggplot2', 'IRkernel', 'ggpubr')) DigitalOcean ...

Mount NTFS in Linux Ubuntu

2017-03-13. Category & Tags: NTFS, Ubuntu

Make mount point: mkdir /mnt/win Find the partition lsblk Temp Mount mount -t ntfs-3g /dev/sda4 /mnt/win Easy Fstab Mount with All Permissions 1.find uuid: sudo blkid |grep ntfs 2.add in fstab: UUID=asdf1234 /mnt/win10c ntfs-3g defaults,windows_names,locale=en_US.utf8 0 0 For advanced permission control, see askubuntu

Force Ubuntu desktop Boot into Text Console Mode

2016-12-15. Category & Tags: linux, Ubuntu, Console, X

Tested in ubuntu deskop 16. short url: s_force-text SOLUTION # sudo cp /etc/default/grub /etc/default/grub.bak && \ sudo sed -ie 's/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="text"/g' /etc/default/grub && \ sudo sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="text"/g' /etc/default/grub && \ sudo sed -ie 's/#GRUB_TERMINAL/GRUB_TERMINAL/g' /etc/default/grub && \ sudo update-grub && \ sudo systemctl enable multi-user.target --force && \ sudo systemctl set-default multi-user.target && \ sudo reboot OBS: sometimes, by changing “multi-user.target” is enough, but sometimes we have to update grub. Have not dug into the reason. ...

Completely Automatic Unattended Install of Ubuntu

2016-12-14. Category & Tags: linux, Automatic, Ubuntu, Installation

OBS 1: this works only for ubuntu server edition, not desktop version. tested in ubuntu 16 x64. OBS 2: remember to change some parts to real values, near: # modify to real value !!! OBS 3: my version need some files in .iso file: “10_linux” & “sources.list”. Warn: the default ks.cfg partition settings will erase the entire disk, and use LVM. See also: Boot Partitions, Install Multi-OS easy2boot PREPARE, AS ROOT # sudo -s ...

Locale In Case Of

2016-05-31. Category & Tags: linux, locale, Ubuntu

Reconfig Locale # Option 1: mkdir -p /var/lib/locales/supported.d/ && \ echo "en_GB.UTF-8 UTF-8" > /var/lib/locales/supported.d/gb && \ echo "zh_CN.UTF-8 UTF-8" > /var/lib/locales/supported.d/zh && \ echo "sv_SE.UTF-8 UTF-8" > /var/lib/locales/supported.d/se && \ locale-gen Option 2: dpkg-reconfigure locales can use first character of locale-name to nevigate. ref

NIX (unix OR”linux” OR”ubuntu” OR”kubuntu” OR”redhat” OR”debian” OR”centos” OR”fedora”)

2013-07-24. Category & Tags: linux, Ubuntu

See also: play/test distributions online: /nix-online distribution comparison: /nix-distro bit.ly/s_distro How To Set Up PC as a Router: /router-how-to Install # automaic / unattended installation of ubuntu # http://askubuntu.com/questions/122505/how-do-i-create-a-completely-unattended-install-of-ubuntu Completely-Automatic-Unattended-Install-of-Ubuntu-Auto-system-config-kickstart multi systems selection # multi-operating-system-installation init after installation # linux-init Boot & Reboot # linux, ubuntu emergency safe reboot Boot to text console terminal mode [Ubuntu Kubuntu Nix Linux] GRUB rescue mode Common Performance Improvement Tools # 相见恨晚的 15 个 Linux 神器 命令行忘性大?这个开源备忘工具一次解决你的所有烦恼 Git # bit. ...

linux,ubuntu添加开机自动运行程序方法autorun

2011-12-19. Category & Tags: Leading autorun, Leading, linux, Ubuntu

1. 开机自动运行 # Linux加载后, 它将初始化硬件和设备驱动, 然后运行第一个进程init。init根据配置 文件继续引导过程,启动其它进程。通常情况下,修改放置在 /etc/rc或 /etc/rc.d 或 /etc/rc?.d 目录下的脚本文件,可以使init自动启动其它程序。例如:编辑 /etc/rc.d/rc.local 文件(该文件通常是系统最后启动的脚本), 在文件最末加上一行“xinit”或“startx”,可以在开机启动后直接进入X-Window。 2. 登录自动运行 # 用户登录时,bash先自动执行系统管理员建立的全局登录script : /ect/profile 然后bash在用户起始目录下按顺序查找三个特殊文件中的一个: /.bash_profile、 /.bash_login、 /.profile, 但只执行最先找到的一个。因此,只需根据实际需要在上述文件中加入命令就可以实 现用户登录时自动运行某些程序(类似于DOS下的Autoexec.bat)。 3. 退出自动运行 # 退出登录时,bash自动执行个人的退出登录脚本 /.bash_logout。 例如,在/.bash_logout中加入命令“tar -cvzf c.source.tgz *.c”,则在每次退出 登录时自动执行 “tar” 命令备份 *.c 文件。 4. 定时自动运行 # Linux有一个称为crond的守护程序,主要功能是周期性地检查 /var/spool/cron目录 下的一组命令文件的内容,并在设定的时间执行这些文件中的命令。用户可以通过 crontab 命令来建立、修改、删除这些命令文件。 例如,建立文件crondFile,内容为“00 9 23 Jan * HappyBirthday”,运行“crontab cronFile”命令后,每当元月23日上午9:00系统自动执行“HappyBirthday”的程序(“* ”表示不管当天是星期几)。 5. 定时自动运行一次 # 定时执行命令at 与crond 类似(但它只执行一次):命令在给定的时间执行,但不自 动重复。at命令的一般格式为:at [ -f file ] time ,在指定的时间执行file文件 ...