Tuesday, December 4, 2012

LDAP+NFS+Kerberos on Ubuntu 12.04

I always wanted to have a setup in our teaching laboratories with the following requirements:
  1. A centralized authentication server where student accounts are stored.
  2. A remote server where user home directories are located.
Once a student has been authenticated in the authentication server, the remote user home directory is mounted on the machine the student logged in. This setup will allow the student to access his/her files on any machine in the laboratory.

A good guide on how to achieve this is available here. Although I followed the steps presented in the guide, it took me a few days to make it work.










Figure 1. Topology

Server Machine
  • eth0: 10.0.4.x (via DHCP, provides Internet access)
  • eth1: 192.168.9.254  (local network)
  • server name: server9
  • domain name: server9.pclab9.ics.uplb.edu.ph
Some tips:
  • If a "Permission denied." error occurs when creating/editing files, remove the "sec=krb5" option in the NFS settings (both in the /etc/exports on the server and in the /etc/auto.home on the client.)
  • In order for users to login to Unity, install the nscd package.

Tuesday, August 7, 2012

System information commands in Linux

General CPU Information


$cat /proc/cpuinfo
$lscpu


Processor Utilization


$top
$sudo apt-get install sysstat
$mpstat -P ALL
$sar
$iostat

Memory Information/Usage


$cat /proc/meminfo
$free


Network Startistics


$netstat


Security camera in Ubuntu

Using Motion you can setup a security camera using an ordinary web camera and Ubuntu.
1. First we need to install Motion.


$sudo apt-get install motion


2. Insert the USB camera and check if was properly detected.


$lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0ac8:301b Z-Star Microelectronics Corp. ZC0301 Webcam


3. Edit /etc/motion/motion.conf and specify the target directory where to dump the images and videos. Also enable daemon mode.


# Start in daemon (background) mode and release terminal (default: off)
daemon on

...

# Target base directory for pictures and films
# Recommended to use absolute path. (Default: current working directory)
target_dir /home/jachermocilla/motion



4. Start the Motion daemon.


$sudo /etc/init.d/motion start


5. Sample output from the setup is shown below.













6. The above setup works if we have plenty of disk space. If we have limited disk space, we need to delete some old files from target_dir. This script does just that. However, we need to make some customization in the script because it works using the df command.

Replace 

   USAGE=`df -h | grep "$MOUNT" | awk '{ print $5 }' | sed s/%//g`

with

   USAGE=`du "$MOUNT" | awk '{ print $1 }' | sed s/M//g`


7. Run the script on a separate terminal.


$chmod u+x deleteoldfiles.sh
$./deleteoldfiles.sh /home/jachermocilla/motion 40000


Sunday, July 15, 2012

My Ubuntu linux post-install app checklist

(Last Update: 31 July 2023)

I mainly use Ubuntu Desktop now as my main OS. I upgrade to the latest LTS after a year of its release.  

Currently in use: 22.04 LTS

What packages do I add after installing a new version?
  • gnome-shell-extensions, gnome-shell-extension-manager
  • wget
  • curl
  • VLC
  • OpenVPN
  • GVim
  • Git, GitHub CLI
  • net-tools
  • msttcorefonts 
  • ubuntu-restricted-extras
  • TexStudio/TexMaker
  • Pandoc
  • build tools (build-essential, gcc-multilib, gcc, automake, autoconf, perl, python, nasm ) 
  • Java Development Kit
  • Open SSH server
  • Zotero
  • Mendeley
  • Calibre
  • xchm
  • Gimp
  • Sound Recorder
  • Wireshark
  • Oracle VirtualBox
  • Transmission
  • KeePass2
  • Unison (use release from github instead of from apt)
  • Master PDF Editor
  • Docker and Docker Compose
  • Python venv for
    • Sphinx
    • Pelican
    • Flask
  • Android Studio
  • NVM and node
  • Terminator
  • Tmux
  • GNU Screen
  • Freemind
  • Google Chrome
  • Brave Browser
  • Tor Browser
  • Zoom
  • OBS
  • Slack
  • Discord
  • Peek (GIF Recorder)
  • virt-manager
  • LibreOffice (calc,writer,impress)
  • Clockify
  • VSCode 
  • custom dotfiles (posh, terminator, vim, bash)
  • VeraCrypt
  • Putty
  • Bibtex2html
  • youtube-dl
  • Network monitoring: iftop, nethogs
  • ShotCut
  • QasMixer
  • Postgres and PGAdmin
  • Xournal
  • Remmina
  • Nerd Fonts
  • ..more to be added


--- DROPPED/DEPRECATED/ON DEMAND ---
  • tightvncserver, xtightvncviewer
  • BurpSuite
  • Wine
  • Dropbox
  • pdfedit
  • Samba
  • Flash plugin
  • Acrobat Reader
  • Subversion
  • ftp
  • Microsoft Office 
  • display drivers
  • audio drivers
  • gnome-shell-extension-system-monitor
-- FOR HISTORICAL PURPOSES --

Ubuntu specific
  • build-essentials
  • Installing acrobat-reader
    • sudo add-apt-repository "deb http://archive.canonical.com/ precise partner"
    • sudo apt-get update
    • sudo apt-get install acroread
Fedora specific

Monday, July 9, 2012

Timeline of Registration Systems in UPLB

(Last update: 24 November 2022)

pre 1998 - Manual
1998 - REGIST c/o Dr. Ricolindo L. Carino
2004 - SystemOne v1 c/o Prof. Rodolfo Duldulao Jr.
2007 - SystemOne v2 (Decaf) c/o Prof. Rodolfo Duldulao Jr.
2016 (January) - SystemOne v3 (Reborn) c/o Prof. Rommel Bulalacao
2016 (August) - Student Academic Information System (SAIS)
2022 (September) - DX Academic Management Information System (DX AMIS) + SAIS

As a student of UPLB, you might be wondering how the physical machines that run SystemOne looks like. Below are some pictures of Eduardo, Discoro, and Eliezer (database server).

Teaching Load Credit Computation

(Notes from Prof. Marge Paterno)
In summary:
      * Course credits (CC) for labs is 1.0 only (to be used for column 8 only)
        while Teaching Load Credits (TLC) for labs is 1.5 (to be used for the
        last column)
      * CC is equal to TLC in the case of lectures, lect/discussion classes and
        SP
      * For the last column, apply the multipliers on the Teaching Load Credits
        (TLC) rather than on Course Credits (CC).

*For column #8 for COURSE CREDITS (CC) without multipliers:
                           Lab: CC = 1.0
                Lect (2hrs/wk): CC = 2.0
     Lect/Discussion (3hrs/wk): CC = 3.0
              CMSC 190 1 unit : CC = 1.0
              CMSC 190 2 units: CC = 2.0

*For column #10 (last column) for TEACHING LOAD CREDITS with 
MULTIPLIERS
(TLCM):

     STEP 1: Determine TEACHING LOAD CREDITS w/o multipliers (TLC):
                           Lab: TLC = 1.5
                Lect (2hrs/wk): TLC = 2.0
     Lect/Discussion (3hrs/wk): TLC = 3.0
              CMSC 190 1 unit : TLC = 1.0
              CMSC 190 2 units: TLC = 2.0

     STEP 2: Apply corresponding multiplier to TLC to obtain TLCM:

       *** For UNDERGRAD courses:
           Lab class (any number of students):
             TLCM = TLC (i.e., no multiplier)

           Lect (2hrs/wk) or Lect/Discussion (3hrs/wk):
             # of students <=40:  TLCM = TLC
             # of students  >40:  TLCM = TLC*[(# of students - 40)/120 + 1]
            [# of students >160:  TLCM = TLC*2.0]

           For CMSC 190
             TLCM = TLC*(# of students)*(0.5/3)

            // Hence, for 190(1 unit) : TLCM = n/2 * 1/3, maximum of 3 units
            //        for 190(2 units): TLCM = n/2 * 2/3, maximum of 3 units

           For IT 1 Lecture only (if # of students >= 25)
             multiply TLCM further by 1.33  // multiplier for GE lecture courses

       *** For GRAD courses:
           Lect or Lect/Discussion or Lab
             # of students <= 4:        TLCM = TLC
             # of students >4 and <= 9: TLCM = TLC*1.25
             # of students >9:          TLCM = TLC*1.5

Wednesday, July 4, 2012

Disable SSH login, allow FTP in Ubuntu

In our IT 210 class, we need students to be able to upload files to a web server using FTP but disable SSH login to the server. To do this in Ubuntu, edit
/etc/ssh/sshd_config
and add the line
DenyUsers stud1 stud2
Then restart SSH using
$sudo /etc/init.d/ssh restart

Tuesday, March 6, 2012

Philippine Computing Science Congress 2012 Report

I attended the recently concluded PCSC 2012 at De La Salle University - Canlubang last March 1-3, 2012. The conference site is available here. Although I did not submit any research paper in the conference, I decided to attend anyway just to get a feel of the state of computing science research in the Philippines.

There were two invited talks by professors from the National University of Singapore(NUS) and one from a researcher in US. The first invited talk was about the use of Graphics Processing Units to speed up computations in computational geometry. The second talk was about Support Vector Machines (SVM). The last was on Natural Language Processing (NLP).

This year, the conference featured "Turing Talks" to commemorate Allan Turing's 100th birth year. Distinguished professors from UPLB(Dr. Albacea), UPD(Dr. Caro), ADMU(Dr. Saldana), and DLSU(Dr. Azcarraga) delivered the talks.

The researches presented covered areas in Algorithms, Complexity Theory, Image Processing, NLP, and Information Systems.According to the program committee, there were 60 paper submissions but only a few were accepted for oral presentation. The best paper was Data Association for an Adaptive Multi-target Particle Filter Tracking System from ADMU.

Overall the conference was very nice. Regarding the state of computing research, there is still much to improve. Also, sad to, say my research area on systems is not well represented in the conference. The closest was a poster presentation from ADMU about location estimation based on the frames passed over a wireless network.

The best part of the conference, however,  was when I won a Lenovo from the raffle!