-
Notifications
You must be signed in to change notification settings - Fork 0
New Ubuntu
add this to top of .profile
file.
export TERM="xterm-256color"
- to make tmux color working
check
$ tput colors
256
/etc/network/interfaces
example
auto enp0s5
iface enp0s5 inet static
address 1.2.3.4
netmask 255.255.255.0
network 1.2.3.0
broadcast 1.2.3.255
gateway 1.2.3.1
dns-nameservers 164.124.101.2 8.8.8.8
sudo apt-get update
sudo apt-get install ssh vim samba git build-essential
sudo apt-get install cmake pkg-config autoconf libtool
sudo apt-get install xutils-dev ifconfig
sudo apt-get install tree htop tmux
ssh-keygen -t rsa
Add client id_rsa.pub content to server ~/.ssh/authorized_keys
And fix file attribbute
chmod 600 ~/.ssh/authorized_keys
sudo timedatectl set-timezone Asia/Seoul
Check
timedatectl
# partition
sudo fdisk /dev/sdb
# in fdisk
n: new partition
p: primary
1: partition 1
# and then First sector 2048, Last sector some number
w: write table to disk and exit
# format
sudo mkfs.ext4 /dev/sdb1
# /etc/fstab for mount
/dev/sdb1 /home/maxwell/u ext4 defaults 0 2
# mount all
sudo mount -a
lsblk -o +UUID,MODEL,MOUNTPOINT,SIZE
# make 8G swap
sudo dd if=/dev/zero of=/var/swapfile bs=2048 count=4194304
sudo chmod 600 /var/swapfile
sudo swapoff -a
sudo mkswap /var/swapfile
sudo swapon /var/swapfile
grep SwapTotal /proc/meminfo
Edit /etc/fstab
to reflect above changes
swapfile
in roots is managed by system daemon
sudo systemctl status swapfile.swap
to disable
sudo systemctl mask swapfile.swap
to enable
sudo systemctl unmask swapfile.swap
current
$ sudo systemctl status swapfile.swap
○ swapfile.swap
Loaded: masked (Reason: Unit swapfile.swap is masked.)
Active: inactive (dead)
sudo touch /forcefsck
and reboot
sudo smbpasswd -a maxwell
# don't copy above line. "-" is not what you are looking at.
sudo vi /etc/samba/smb.conf
For smb only accounts
# add dummy account
sudo adduser --no-create-home --disabled-password --disabled-login smbusername
# add smb account
sudo smbpasswd -a smbusername
add to global
[global]
nt acl support = no
add to share folder
[...]
map archive = no
add to share folder
[...]
acl allow execute always = True
add to global
[global]
allocation roundup size = 4096
from https://ubuntuforums.org/showthread.php?t=2268135
sudo dumpe2fs /dev/sda1 | grep -e 'Block size'
sudo systemctl restart smbd
(1) update global
item with
usershare allow guests = no
(2) connect with \\WORKGROUP\user
reference
install package
sudo apt-get install nfs-kernel-server
/etc/exports
file setting
/home/maxwell/usbdisk 192.168.1.0/255.255.255.0(rw,sync,no_subtree_check,no_root_squash)
where set 192.168.1.0
to your client IP sub net
If you want to make the client write as UID/GUID(1000/1000) of the NFS server which has different UID/GUID in the client
/home/maxwell/usbdisk 192.168.1.0/255.255.255.0(anonuid=1000,anongid=1000,rw,sync,no_subtree_check,no_root_squash,all_squash)
Add anonuid=1000,anongid=1000,all_squash
service check, start if not running
sudo service nfs-kernel-server status
sudo service nfs-kernel-server start
reload configuration
sudo exportfs -r
check status
rpcinfo -p
package
sudo apt-get install nfs-common
mount
sudo mount 192.168.1.10:/home/maxwell/usbdisk /home/maxwell/usbdisk
where change 192.168.1.10
to your NFS server IP
install package
sudo apt-get install ntpdate
sync time
sudo ntpdate ntp.ubuntu.com
Text
sudo systemctl set-default multi-user.target
X dm
sudo systemctl set-default graphical.target
Get
sudo systemctl get-default
Reinstall
sudo apt-get install --reinstall ubuntu-desktop
https://www.stewright.me/2012/09/tutorial-install-apache-php-and-mysql-on-raspberry-pi/
sudo apt-get install apache2 apache2-doc apache2-utils
sudo apt-get install libapache2-mod-php php php-pear
sudo apt-get install php-mysql
sudo apt-get install mysql-server mysql-client
for Raspbian
sudo apt-get install apache2 apache2-doc apache2-utils
sudo apt-get install php php-pear
sudo apt-get install php7-mysql libapache2-mod-php7 php7-xcache
sudo apt-get install mysql-server mysql-client
- Add
mobile.conf
atconf-available
folder withIndexHeadInsert "<meta name='viewport' content='width=device-width, initial-scale=1'>"
- Make an alias of this file in
conf-enabled
folder - restart apache2
cd /etc/update-motd.d/
Edit whatever the files inside
sudo adduser newuser
sudo apt-get install cmake ninja-build
sudo apt-get install qemu qemu-user-static binfmt-support debootstrap
sudo apt-get install libxml2-dev libxml2-utils python2.7-dev
sudo apt-get install swig libunwind8-dev liblttng-ust-dev uuid-dev
# clang
sudo apt-get install clang-3.9 liblldb-3.9-dev
# sudo apt-get install clang-3.8 lldb-3.8-dev
# for arm
sudo apt-get install binutils-arm-linux-gnueabihf
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
# for armel
sudo apt-get install libc6-armel-cross libc6-dev-armel-cross
sudo apt-get install binutils-arm-linux-gnueabi
Python 2.x, 3.x use both
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 20
# choose
sudo update-alternatives --config python
sudo dpkg --configure -a
sudo dpkg -P --force-depends [package] [package] ...
sudo apt clean
sudo apt -f install
sudo apt install [package] [package] ...
Check this: nvidia page
Storage is keep doing things...
sudo chmod -x /etc/cron.daily/mlocate
disable auto update
sudo apt-get remove unattended-upgrades
sudo touch /etc/cloud/cloud-init.disabled
-
http://askubuntu.com/questions/122209/how-do-i-modify-or-disable-the-huds-use-of-the-alt-key
- Settings > Keyboard > Shortcuts > "Key to show the HUD" >> "BACKSPACE" to disable it
- Search "compizconfig-settings-manager" in software center
- Ubuntu Unity Plugin > "Key to show the menu bar while pressed" >> disable it
- And in Launcher tab, "Key to show the Dash, Launcher and Help Overlay" >> disable it
- To disable, click on the button and uncheck "Enabled" checkbox
- Reboot
- edit /etc/resolvconf/resolv.conf.d/head file
- update resolve file
sudo resolvconf --enable-updates
sudo resolvconf -u
- check
nslookup
> server
Running in my Linux... and makes my HDD busy...
- updatedb - update a database for mlocate
- locate - find files by name
dpkg --list | grep linux-image
sudo apt-get --purge remove linux-image-4.4.0-2*
...
sudo apt-get --purge remove linux-image-extra-4.4.0-2*
...
sudo update-grub2
sudo systemctl reboot
sudo apt-get remove gnome-software
sudo apt-get purge gnome-software
# can remove in 16.04
sudo apt-get remove evolution-data-server
# desktop logged on but no app running and ssh connected
$ free
total used free shared buff/cache available
Mem: 4037772 361320 3157348 11612 519104 3404660
Swap: 4192252 0 4192252
For Raspberry Pi 2 running Ubuntu 16.04
sudo apt-get remove snapd
echo '/home/maxwell/u/tmp/core_%e.%p' | sudo tee /proc/sys/kernel/core_pattern
Reference
To change text console size... open /etc/default/grub
and
GRUB_CMDLINE_LINUX_DEFAULT="text"
GRUB_CMDLINE_LINUX="text"
and then run update-grub
and reboot
sudo update-grub
sudo reboot
(gdb) r
Starting program: /home/.../hello
Program received signal SIGSEGV, Segmentation fault.
0x76fd9822 in ?? () from /lib/ld-linux-armhf.so.3
Need to install libc debug files
sudo apt-get install libc6-dbg
First, download the JDK
Then, Install
sudo mkdir -p /usr/lib/jvm
cd /usr/lib/jvm
sudo tar xvf ~/Download/jdk-8u144-linux-x64.tar.gz
sudo ln -s jdk1.8.0_131 jdk
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk/bin/javac" 1
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk/bin/java" 1
Add to envioronment
export JAVA_HOME=/usr/lib/jvm/jdk
vi ~/.profile
export HTTP_PROXY=http://127.0.0.1:8080/
export HTTPS_PROXY=http://127.0.0.1:8080/
why HTTPS_PROXY=http://
?
vi /etc/apt/apt.conf.d/90proxy
Acquire::http::proxy "http://127.0.0.1:8080/";
Acquire::https::proxy "http://127.0.0.1:8080/";
Acquire::ftp::proxy "ftp://127.0.0.1:8080/";
vi ~/.wgetrc
use_proxy=yes
http_proxy=127.0.0.1:8080
https_proxy=127.0.0.1:8080
ref: https://stackoverflow.com/questions/11211705/setting-proxy-in-wget
git config --global https.proxy http://127.0.0.1:8080/
git config --global http.proxy http://127.0.0.1:8080/
sudo apt install gnome-tweak-tool
Gnome Tweaks -> Keyboard & Mouse -> Additional Layout Options -> Caps Lock key behavior.
https://help.ubuntu.com/community/Mount/USB
1 Run
dconf-editor
2 Open
org - gnome - desktop - media-handling
3 Turn off/on switch
- Go to /usr/local/share/ca-certificates/
- Copy the .crt file
- Permissions 644
sudo update-ca-certificates