<commit_before>KEYS/
  CTRL+ALT+T  new terminal

  CTRL+ALT+F1 tty1...
  ALT+F7      gui tty

CONFIG/

  change tty(console) font
  #UTF-8;Latin2;Terminus;16
  sudo dpkg-reconfigure console-setup

  #enable root su
  sudo usermod root -p <password>
  sudo passwd root
  su
  
  vi ~/.exrc
    #fix arrow-keys issue
    add "set nocompatible"  
    #fix backspace disabled
    set backspace=2
    
  #vi fix config for root
  sudo -i touch /root/.exrc
  sudo -i vi /root/.exrc
    add "set nocompatible"
    add "set backspace=2"
    
  #add user (do not use useradd unless setting up everything manually)
  adduser primo
  passwd <PASSWORD>
  
  deluser primo
  
  #list groups
  groups primo
  #-a append
  sudo usermod -a -G adm,sudo,plugdev,sambashare primo
  #change fullname
  sudo usermod -c "primo" primo

INSTALL/
  
  download to /tmp => extract
  install to /opt
  sudo -i ln -s /opt/Sublime/sublime_text /usr/bin/sub 
  sudo -i ln -s /opt/google/chrome/chrome /usr/bin/chrome

  sudo dpkg -i /path/to/deb/file 
  sudo apt-get install unity-tweak-tool
  
  list:
   dpkg -l|grep -i "java"
  
  uninstall:
   sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
   which java
   which javac
   
  #query available packages
  apt-cache search java |grep openjdk


CMD/

  tar zxvf jre-8u45-linux-x64.tar.gz
  
  export JAVA_HOME="/usr/java/jre1.8.0_45/"
  
  which java:
  /usr/bin/java
  
  alias ls='ls -halF'
  
  history | grep blahblah
  
  #list disks/partitions
  lsblk
  sudo sfdisk -l -uM
  sudo fdisk -l
  df -h
  df -h --output=source,fstype,size,used,avail,pcent,target
  #relation dir-partition
  df tmp/
  
  #what is my windows manager?
  echo $XDG_CURRENT_DESKTOP
  
  #print all env vars
  printenv
  #print exported vars, not all bash variables
  env
  
  #run fsck
    #unmount!
    sudo unmount /dev/sda1
    #check if unmounted (sda1 shouldn't appear anymore)
    df -h --output=source,fstype,target
    #run fsck
    sudo -i fsck -f -v /dev/sda1
    #mount back 
    mount /dev/sda1
    
  #enable verbose login
  sudo vi /etc/default/grub
    GRUB_TERMINAL=console
    GRUB_GFXMODE=800x600

HOW-TO DEBUG/
  
  tail -f /var/log/syslog
  tail -f /var/log/kern.log
  
  last

UBUNTU/
  
  #console font
  sudo dpkg-reconfigure console-setup
  
  #windows manager fonts
  sudo apt-get install unity-tweak-tool
  sudo unity-tweak-tool

  #disable apport (crash report)
  sudo service apport stop
  sudo -i vi /etc/default/apport
    enabled=0
  
  #fsck gui
  sudo apt-get install gparted
  sudo gparted
  
  #defrag
  n/a for ext3/ext4 which have a "self-cleaning” mechanism

DISK PARTITION/
  
  /root   system partition
  /swap   ram swap (size = 1.5 or 2 x RAM)
  /home   everything else  - diff partition => os upgrade is non-event for /home
  
  ?/tmp    couple of Mega
  ?/usr    1-2 Gb
  
  /boot    kernel image, ramdisk image, b ootloader configuration

FHS
  /etc/bash.bashrc
  /opt/
      eclipse
      sublime
      google/chrome
  /sbin
      fdisk
      fsck
  /usr/bin/
      sub -> /opt/sublime/sublime_text
  /usr/lib/jvm/
  /home/mardare/.bashrc<commit_msg>Update notes-linux.txt<commit_after>KEYS/
  CTRL+ALT+T  new terminal

  CTRL+ALT+F1 tty1...
  ALT+F7      gui tty

CONFIG/

  change tty(console) font
  #UTF-8;Latin2;Terminus;16
  sudo dpkg-reconfigure console-setup

  #enable root su
  sudo usermod root -p <password>
  sudo passwd root
  su
  
  vi ~/.exrc
    #fix arrow-keys issue
    add "set nocompatible"  
    #fix backspace disabled
    set backspace=2
    
  #vi fix config for root
  sudo -i touch /root/.exrc
  sudo -i vi /root/.exrc
    add "set nocompatible"
    add "set backspace=2"
    
  #add user (do not use useradd unless setting up everything manually)
  adduser primo
  passwd primo
  
  deluser primo
  
  #list groups
  groups primo
  #-a append
  sudo usermod -a -G adm,sudo,plugdev,sambashare primo
  #change fullname
  sudo usermod -c "primo" primo

INSTALL/
  
  download to /tmp => extract
  install to /opt
  sudo -i ln -s /opt/Sublime/sublime_text /usr/bin/sub 
  sudo -i ln -s /opt/google/chrome/chrome /usr/bin/chrome

  sudo dpkg -i /path/to/deb/file 
  sudo apt-get install unity-tweak-tool
  
  list:
   dpkg -l|grep -i "java"
  
  uninstall:
   sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
   which java
   which javac
   
  #query available packages
  apt-cache search java |grep openjdk


CMD/

  tar zxvf jre-8u45-linux-x64.tar.gz
  
  export JAVA_HOME="/usr/java/jre1.8.0_45/"
  
  which java:
  /usr/bin/java
  
  alias ls='ls -halF'
  
  history | grep blahblah
  
  #list disks/partitions
  lsblk
  sudo sfdisk -l -uM
  sudo fdisk -l
  df -h
  df -h --output=source,fstype,size,used,avail,pcent,target
  #relation dir-partition
  df tmp/
  
  #what is my windows manager?
  echo $XDG_CURRENT_DESKTOP
  
  #print all env vars
  printenv
  #print exported vars, not all bash variables
  env
  
  #run fsck
    #unmount!
    sudo unmount /dev/sda1
    #check if unmounted (sda1 shouldn't appear anymore)
    df -h --output=source,fstype,target
    #run fsck
    sudo -i fsck -f -v /dev/sda1
    #mount back 
    mount /dev/sda1
    
  #enable verbose login
  sudo vi /etc/default/grub
    GRUB_TERMINAL=console
    GRUB_GFXMODE=800x600

HOW-TO DEBUG/
  
  tail -f /var/log/syslog
  tail -f /var/log/kern.log
  
  last

UBUNTU/
  
  #console font
  sudo dpkg-reconfigure console-setup
  
  #windows manager fonts
  sudo apt-get install unity-tweak-tool
  sudo unity-tweak-tool

  #disable apport (crash report)
  sudo service apport stop
  sudo -i vi /etc/default/apport
    enabled=0
  
  #fsck gui
  sudo apt-get install gparted
  sudo gparted
  
  #defrag
  n/a for ext3/ext4 which have a "self-cleaning” mechanism

DISK PARTITION/
  
  /root   system partition
  /swap   ram swap (size = 1.5 or 2 x RAM)
  /home   everything else  - diff partition => os upgrade is non-event for /home
  
  ?/tmp    couple of Mega
  ?/usr    1-2 Gb
  
  /boot    kernel image, ramdisk image, b ootloader configuration

FHS
  /etc/bash.bashrc
  /opt/
      eclipse
      sublime
      google/chrome
  /sbin
      fdisk
      fsck
  /usr
    /bin/
      sub -> /opt/sublime/sublime_text
    /java/jre1.8.0_45/bin/java    
    /lib/jvm/
  /home/mardare/.bashrc
{'fraction_non_alphanumeric': 0.08917707332692923, 'fraction_numerical': 0.012968299711815562, 'mean_word_length': 2.3105458399576047, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5074458', 'n_tokens_mistral': 2545, 'n_tokens_neox': 2404, 'n_words': 696}