Introduction

Sakai is our LMS at Loyola University Chicago. This post will include some setups I often use and since these steps are needed only every semester, I prefer to write them down as a reminder for myself, while hoping that the post would also be useful for my readers. This post will be expanded in the future as new setups needed.

Motivation

Labster integration with Sakai had some unresolved issues in the Fall 2022 semester. The Gradebook sync problems seem to occur when one adds Labster simulations through the Assignments module.

I did not want to transfer grades manually not only because I have many students but also I am concerned by the data consistency. Instead, I developed the following workflow to do the manual grade import by a mechanical and repeatable manner.

Workflow

1. Exporting Grades from the Labster Dashboard

Download All grade data from Labster dashboard (Figure 1). You would get all of your class grades available in the Labster server in .csv format, which means:

  • All simulations
  • All attempts per student
  • Grades in percent values
  • Progress percentages
  • Durations
  • Data and time

Figure 1
Figure 1. All grade data.

2. Excel Manipulations

To import grades into Sakai Gradebook, UVID is required as first column in .CSV file. It can be extracted from Email column by the following steps:

  • Insert a new column next to Email column.
  • Select Email column.
  • Click Data > Text to Columns.
  • Select Delimited > Delimiters > Other: @. (Figure 2)
  • Click Finish.

Figure 2
Figure 2. Extract UVID values from email addresses.

  • Rename Email column to Student ID and copy it as first column.
  • Rename Last Name as Name and delete all columns except Student ID, Name, Simulation name, and Score (/100). (Figure 3)

Figure 3
Figure 3. Required Excel columns.

  • Rename Simulation name to actual sim name and append the max points in brackets. e.g. Lab Safety [110] and calculate each grade accordingly with zero decimals. And delete Score (/100) column. (Note that you must copy and paste the values Lab Safety [110] before you delete this column.) (Figure 4)

Figure 4
Figure 4. Scale the grades.

  • The remove duplicate attempts and assign the highest score, sort by Student ID > A to Z and Lab Safety [110] > Largest to Smallest (Figure 5)

Figure 5
Figure 5. Sort the grades.

  • Select Student ID column and click Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values. (Figure 6)

Figure 6
Figure 6. Highlight duplicate Student IDs.

  • Delete all values except the highest score for every student (Figure 7). Sakai does not show any errors for blank lines, so I keep them to save time.

Figure 7
Figure 7. keep only max scores for each student.

  • Finally, save this worksheet as a new .csv file. e.g. Lab-Safety.csv.
  • Import Lab-Safety.csv using Sakai > Gradebook > Import/Export menu.

Conclusion

I hope this workflow is useful. Please let me know if you use this method and how you like it. Also, please let me know if you have alternative solutions.

Introduction

LaTeX has long been my main typesetting environment. This post has some handy dandy codes that I daily use for Beamer class.

Beamer presentations can quickly get overly large compilation times and generate large PDF outputs. In Compressed PDFs, I describe several methods to optimize these processes.

My Beamer Template

\documentclass[ignorenonframetext]{beamer}
\include{preamble}

\title[]{}
\date{} 

\begin{document}
\frame{\maketitle}
%\begin{frame}{Contents}
%\tableofcontents	
%\end{frame}

\end{document}

preamble.tex is in the root folder, which has the following code:

%%% or uncomment this for the article version
% \documentclass[11pt]{article} \usepackage{beamerarticle}  

%%% or uncomment this for handouts
%\documentclass[handout,ignorenonframetext]{beamer}


\mode<article>
{
  \usepackage{fullpage} 
  \usepackage{pgf}
  \usepackage{hyperref}
  \setjobnamebeamerversion{example.beamer}
}

\mode<presentation> 
{
  \beamertemplatenavigationsymbolsempty % remove navigation symbols
  \usecolortheme{seagull} % default, albatross, seagull , crane, beaver, beetle, seahorse, wolverine
  \usefonttheme{serif} % serif, structureitalicserif, structurebold 
}

\mode<handout>
{
%%% In handout mode give the individual pages a light grey background
\setbeamercolor{background canvas}{bg=black!5}
%%% Put more than one frame on each page to save paper.
\usepackage{pgfpages} 
\pgfpagesuselayout{4 on 1}[letterpaper,border shrink=3mm, landscape]
% \pgfpagesuselayout{2 on 1}[letterpaper,border shrink=5mm, portrait]
% \setbeameroption{show notes}
}

\setbeamertemplate{footline}[frame number] % slide number at the bottom

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{siunitx} % Format scientific units
\usepackage{chemformula} % Format Chemical Formulae
\usepackage{tabularx} % Make complex tables

\author[]{Murat Kahveci, Ph.D.}
\subject{}
\institute[Loyola University Chicago]{
  Department of Chemistry \& Biochemistry\\
  Loyola University Chicago}

%\titlegraphic{\includegraphics[height=1cm]{./figures/luc.png}}

% symbols of equations and their definitions
% USAGE
% \whereInEq{ symbol(units) & definition \\}
\newcommand{\whereInEq}[1]{
\noindent where \quad
{\footnotesize
\begin{tabularx}{.8\textwidth} {
  | r 
   >{\raggedright\arraybackslash}X }
	#1
\end{tabularx}
\bigskip
}
}

Common Commands

New Frame

With bullet points.

\frame{ 
  \frametitle{}

  \begin{itemize}
  \item
  \end{itemize}

}

Equations

I prefer align which requires \usepackage{amsmath} in preamble and allows multiple lines of equations:

\begin{align}
\end{align}

Chem formula and equations. \usepackage{chemformula} in preamble:

\ch{}

To write the units in more elegant way:

\si
\SI{}{}

\si or \SI command dependencies in preamble:

\usepackage{siunitx}
\sisetup{load-configurations = abbreviations, binary-units = true}
\DeclareSIUnit\px{px}

Figures

\begin{figure}[hbt]
  \centering
  \frame{\includegraphics[width=0.65\textwidth]{./figures/}}
%  \caption{}
%  \label{fig:}
\end{figure}

Tables

Simple table:

\begin{table}[hbt]
  \begin{tabular}{l|cc}
    & & \\
    \hline
    & & \\
    & &
  \end{tabular}
  \caption{}
\end{table}

Complex table is easier with the tabularx package. Invoke \usepackage{tabularx} and \usepackage{booktabs} in preamble.

\begin{frame}{}
\begin{table}[]
	\begin{tabularx}{\linewidth}{l>{\raggedright}X}
		\toprule
		\textbf{Option}			& \textbf{Description} \tabularnewline
		\midrule
		 & newpxtext and newpxtext fonts will be used (pdfLaTeX) \tabularnewline
		 & Vertically align columns\tabularnewline
		\bottomrule
	\end{tabularx}
	\label{tbl:}
\end{table}
\end{frame}

Title Page

%Title page
\title[About Beamer] %optional
{About the Beamer class in presentation making}

\subtitle{A short story}

\author[Arthur, Doe] % (optional)
{A.~B.~Arthur\inst{1} \and J.~Doe\inst{2}}

\institute[VFU] % (optional)
{
  \inst{1}%
  Faculty of Physics\\
  Very Famous University
  \and
  \inst{2}%
  Faculty of Chemistry\\
  Very Famous University
}

\date[VLC 2014] % (optional)
{Very Large Conference, April 2014}

\logo{\includegraphics[height=1.5cm]{lion-logo.jpg}}

Make Title Page

\frame{\titlepage}

Table of Contents

TOC after the title page:

\begin{frame}
\frametitle{Table of Contents}
\tableofcontents
\end{frame}

TOC is placed at the beginning of each section; current section is highlighted:

\AtBeginSection[]
{
  \begin{frame}
    \frametitle{Table of Contents}
    \tableofcontents[currentsection]
  \end{frame}
}

Visibility of Text

\begin{frame}
\frametitle{Sample frame title}
\begin{itemize}
    \item<1-> Text visible on slide 1
    \item<2-> Text visible on slide 2
    \item<3-> Text visible on slides 3
    \item<4-> Text visible on slide 4
\end{itemize}
\end{frame}

\pause Command

\begin{frame}
In this slide \pause

the text will be partially visible \pause

And finally everything will be there
\end{frame}

Text Highlighting

Text highlighting can be achieved in several ways.

\begin{frame}
\frametitle{Sample frame title}

In this slide, some important text will be
\alert{highlighted} because it's important.
Please, don't abuse it.

\begin{block}{Remark}
Sample text
\end{block}

\begin{alertblock}{Important theorem}
Sample text in red box
\end{alertblock}

\begin{examples}
Sample text in green box. The title of the block is ``Examples".
\end{examples}
\end{frame}

Make Two-Column Slide

\begin{frame}
\frametitle{}
\begin{columns}
    \column{0.5\textwidth}
    \column{0.5\textwidth}
\end{columns}
\end{frame}

Introduction

LaTeX has long been my main typesetting environment. This post has some handy dandy codes that I daily use.

Compression of Existing PDFs

Typical output as a result of LaTeX compilations is in PDF format. PDF is perfect for cross-platform usability. LaTeX don’t compress images in the PDF outputs. Thus, depending on the number of images and their sizes, one might get a large PDF file.

A common approach is the let Ghostscript (gs) optimize and compress the PDF after its generation with pdflatex.

The following command can be invoked on a LINUX like machine. It takes foo.pdf and saves its compressed version as compressed.pdf with the parameters specified. I mostly use these settings1 for Beamer presentations for about 70% reductions in file sizes without any noticiable loss of quality on screen views.

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/prepress -dPrinted=false -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf foo.pdf

Batch Resize Images

Overly large image files can significantly prolong the compilation process. The following command will raster images with a .jpg extension to 600 px width or height in a folder. This gives a decent image quality for Beamer presentations, while making the PDF files significantly smaller.

sips -Z 600 *.jpg

Automator on Mac OS can be used to make and run this command as a program with decent GUI interaction but I like Terminal as the whole process is much simpler.

Automator is based on AppleScript Language however many daily tasks can be done easily without any coding. I thought it might be useful to mention Automator here for more complex manipulations.

Photographic images saved as .png can also result in very large file sizes: .jpg is usually a much more space-efficient format for photographs. Line drawings, plots and diagrams are better saved as .png or .pdf, in general. .pdf images can also compile faster compared to .png files if their file sizes are comparable, as the compile process then doesn’t need to call libpng2.


  1. -dPrinted=false preserves the cross-references. 

  2. See https://www.overleaf.com for more information. 

Introduction

LaTeX has long been my main typesetting environment. This post has some handy dandy codes that I daily use.

Embedding a PDF File within

The following command is used in the document environment and embeds the specified PDF file.

\portitem
  {} % title
  {./path-to/file.pdf} % file name
  {n} % n = page number + 1

To achieve a clean layout, remove headers and footers in file.pdf. Typically, outer PDF will carry out its headers and footers. This approach also provides a seamless integration.

Command in preamble:

\newcommand{\portitem}[3]{
	\phantomsection  \addcontentsline{toc}{section}{#1} % toc entry
	\rhead{\textsc{#1}}
	\setcounter{pg}{1}
	\whiledo{\value{pg}<#3}{ % page number +1
		\includepdf[pages=\thepg,scale=1,pagecommand={\pagestyle{fancy}}]{#2} % file name
		\addtocounter{pg}{1} 
	}
}

Package dependencies in preamble:

\usepackage{pdfpages}
\usepackage{ifthen}
\newcounter{pg}

Stamping Unique IDs

Often I print out documents with multiple copies. When it comes to exams, usually I scan the documents and do my grading electronically. Having unique IDs on every copy printed provides better file handling in this process.

\documentclass[letterpaper,10pt]{article}

\usepackage{pdfpages}
\usepackage{fancyhdr}
\usepackage{color}
\usepackage{multido}

% What is the starting number?
\def\startnumber{1}

% How many exams do we need?
\def\numberofexams{90}

% Which is the input PDF file?
\def\examfile{CHEM111-lab-manuals-2022-08-25}

% This is to control the placement of the number.  
\textwidth  440pt
\textheight 590pt

% We use headers to output the serial number
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt} % No header line
\renewcommand{\footrulewidth}{0pt} % No footer line
\cfoot{}

% Actual command to include the serial number
\rfoot{\Huge\textcolor{gray!25}{\textsf{%
			% Some number padding - for up to 999 exams
			\ifnum\numberexam<100 0\fi%
			\ifnum\numberexam<10 0\fi%
			\numberexam}
}}

% And here comes the single loop across all documents
% pagecommand by itself adds nothing, 
% but causes our new headers and footers to be printed
\begin{document}
	\multido{\numberexam=\startnumber+1}{\numberofexams}{%
		\includepdf[pages=-,pagecommand=\strut]{\examfile}
	}
\end{document}

Introduction

LaTeX has long been my main typesetting environment. This post has some handy dandy codes that I daily use.

Exam Template

Below is the template I developed over time based on the Exam class. It is quite flexible and functional.

\documentclass[
% answers 
,addpoints]{exam}

\newcommand{\class}{CHEM 173}
\def\day{1}  % exam / quiz / worksheet #
\def\topic{} % title

\pagestyle{head} % head (for printing); empty (for embedding)

\input{_preamble}
\begin{document}
\input{_instructions} 

\begin{questions}	
	
\question[10] 	
		
\end{questions}

\end{document}

\input{_preamble} file codes:

\runningheader{\class}{Lab \day\ Worksheet}{Page \thepage\ of \numpages}
\runningheadrule
%\framedsolutions
\unframedsolutions

\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amssymb}
\usepackage{multicol} % Multi column environment 
\usepackage{siunitx} % Format scientific units
\usepackage{chemformula} % Format Chemical Formulae
\usepackage{adjustbox}
\usepackage{tabularx}

%% MoveQuestionNextPage
\newcommand{\MoveQuestionNextPage}{
  \ifprintanswers \else 
     \clearpage
  \fi
}%

%% Color settings
\definecolor{blue-violet}{rgb}{0.54, 0.17, 0.89}
\SolutionEmphasis{\color{blue-violet}}
\CorrectChoiceEmphasis{\color{blue-violet}\bfseries}

\input{_instructions} file codes:

\ifprintanswers 
\firstpageheader{\class}{Lab \day\ Worksheet}{\examdate}
\firstpageheadrule
\begin{center}
	{\color{blue-violet}{\large{\textbf{KEY}}}}
\end{center}

\else

\noindent
\begin{tabular*}{\textwidth}{@{}l @{\extracolsep{\fill}} r @{\extracolsep{5pt}} l@{}}
\textbf{\class\ - Worksheet} & \textbf{Name:} & \fillin \fillin \\
\textbf{Lab \day. \topic} &\textbf{Date:} & \fillin \fillin \\
\textbf{Section: \fillin} &\textbf{TA:} & \fillin \fillin \\
\end{tabular*}\\
\rule[1ex]{\textwidth}{2pt}

%This worksheet contains \numpages\ pages and \numquestions\ questions. Please add all the names of  "contributing group members." 
%
%\begin{center}
%
%Grade Table (for teacher use only)\\
%\addpoints
%\resizebox{\textwidth}{!}{
%\gradetable[h][questions]
%}
%\end{center}
%
%\noindent
%\rule[1ex]{\textwidth}{2pt} 
\fi

Add a Question with Solution Box

\question

\begin{solutionorbox}[\fill] 
\end{solutionorbox}

Add a Multiple Choice Question

One line:

\begin{oneparchoices}
    \choice
\end{oneparchoices}

Multiple lines:

\begin{choices}
    \choice
\end{choices}

Add a Multipart Question

\question

\begin{parts}
    \part
    \begin{solutionorbox}[\fill] 
    \end{solutionorbox}
    
    \part
    \begin{solutionorbox}[\fill] 
    \end{solutionorbox}    
\end{parts}

Add a Two-Column Question (Layout)

\begin{minipage}{0.6\textwidth}
    \question 

\begin{oneparchoices}
	\choice	  
	\CorrectChoice	  
\end{oneparchoices}	

    \begin{solution} 
    \end{solution}
    
\end{minipage}
\begin{minipage}{0.4\textwidth}
    \fbox{\includegraphics[width=.94\textwidth]{}}
\end{minipage}

Add Bonus Questions/Parts

\bonusquestion[5]
\bonuspart[5]

Move Question to Next Page

Move question/part to the next page to satisfy space requirements. \MoveQuestionNextPage is omitted while Exam Key is generated because key does not need any answer space for data entry.

\MoveQuestionNextPage

Command in preamble:

\newcommand{\MoveQuestionNextPage}{
    \ifprintanswers \else 
        \clearpage
    \fi
}

Checkboxes

\begin{checkboxes}
    \choice
\end{checkboxes}

Changing checkbox style locally:

{
\checkboxchar{$\Box$}
\begin{checkboxes}
    \choice 
\end{checkboxes}
}

Changing choice items style locally:

{
\renewcommand*\thechoice{\arabic{choice}}
\renewcommand*\choicelabel{\thechoice)}
\question[2] 

\begin{multicols}{2}
\begin{choices}
    \choice
\end{choices}
\end{multicols}
}

Make Formatted Textareas

Empty box:

\makeemptybox{1.5in}
\makeemptybox{\fill}

Fill with lines:

\fillwithlines{\fill}

Fill with dotted lines:

\fillwithdottedlines{8em}

Introduction

Sakai is our LMS at Loyola University Chicago. This post will include some setups I often use and since these steps are needed only every semester, I prefer to write them down as a reminder for myself, while hoping that the post would also be useful for my readers. This post will be expanded in the future as new setups needed.

Common Tasks

1. Copying a Course from a Project Page in Sakai

As an instructor, login Sakai and navigate to your new course that you need to add new content. Follow these steps:

  • Site Info > Import from Site, if one imports from a Project Site within Sakai. You should be added to the Project Site in order to see it as an import option.
  • As a precaution, I always select I would like to merge my data in the next step.
  • Select the Project Site that you want to copy its contents. A nice feature of Import from Site in Sakai is you can import from multiple Project Sites in this step.
  • The import process is typically completed in 2 minutes.
  • On 8/28/2022: My test today turned out to be with errors, actually. The issue was Assignments and Tests & Quizzes modules failed to import. After the third attempt with I would like to replace my data option selected, those modules were copied as expected. As I did not see any error messages, I had no idea about the source of this error.

2. Adding a TA to Your Course

An instructor cannot add or remove course participants including TAs. It has to be done via the ITS Service Portal.

3. Achieving Group-Based Tasks

3.1 Make Groups

Make groups within a course by:

  • Site Info > Manage Groups > Bulk Creation
  • Export student names and IDs using Gradebook > Export. Ude fault file type which is .CSV.
  • Insert a new column as the first column. Make groups in this column. Typically, we have two groups in CHEM 111. We assign students by alternating Group labels as A and B until all students are complete. Default order of names are by last name; keep this order unchanged for simplicity.
  • Make sure that the second column is User ID. See Figure 1 for data formatting rules.
  • Delete all the rest of the columns, and the first row (no headers).
  • Import the .CSV file using the file dialog in Figure 1.
  • All students are assigned to a group once Bulk Create Groups button is clicked.

Figure 1
Figure 1. Import screen: File selection.

3.2 Make Group-Based Assignments

  • Click Edit an existing assignment (or make a new assignment).
  • Scroll down and find Assign To > Each individual member of the selected group(s) (for individual assignments) > Select a Group to assign. See Figure 2.

Figure 2
Figure 2. Assign an assignment to a group.

3.3 Make Group-Based Announcements

  • Click Announcements > Add.
  • Scroll down and find Access > Display this announcement to selected groups only. See Figure 3.
  • I always set Email Notification to High - All group members, which will trigger an email message to only specified group. Kind of a need! We target only certain groups…

Figure 3
Figure 3. Assign an announcement to a group.

3.4 Make Group-Based Tests & Quizzes

  • Click Edit and existing test or quiz.
  • Click Settings > Availability and Submissions > Assessment released to > select a group (See Figure 4).

Figure 4
Figure 4. Assign a quiz or test to a group.

3.5 Sending Group-Based Emails

This feature is quite handy if you want to email data files to a group.

  • Click Email and Compose.
  • To > Groups > select a group to send the message (See Figure 5).

Figure 5
Figure 5. Sending an email to a group.

3.6 Gradebook with Group-Based Scores

Once all grade items are assigned to a grade category, groups don’t make any difference in weighed grade calculations. e.g. Figure 6 shows a class’s Lab 2 grades. Lab 2 score will be calculated equally if a student’s score resides in Group A or B.

Figure 6
Figure 6. Groups don’t make any difference in weighed grade calculations.

3.7 Group-Based Resources

Resources module is no exception when it comes to sharing documents group-wise.

  • Click Resources and Edit existing file.
  • Under Edit Details > Availability and Access > Display this file to selected groups only. > select a group (See Figure 7).
  • As seen in Figure 7, one can do more detailed groups for different activities. e.g. I have groups for Datasets.

Figure 7
Figure 7. Assign a file to a group.

On August 12, 2022

Good morning! This is Shaan. I wanted to email you for the great experience in the summer semester. I want to thank you for answering my questions always and being understanding of my situation at times as well. You taught very well, and I hope I can be in your classroom again soon or reach out to you soon. I will be updating you with my endeavors and how I do in the rest of college. Thanks!

Shaan

Shaan1 took CHEM 102 General Chemistry II (lecture) in Summer 2022.

  1. This email correspondence was posted with Shaan’s written permission via email on 8/12/2022. 

Introduction

Debian 11 installation can be cumbersome for new Linux users, especially if one plans to use Debian 11 as a main OS to deliver a fully functional desktop environment. This page includes the main steps I prefer as a chemistry professor, while keeping in mind the efficiency of the OS, such as its availability for technical writing, common data analysis tools, and cost-free options.

Motivation

On August 1, 2022, during CHEM 102 lecture break, I had a conversation with my student on how Linux OS can be efficient for scientific studies. I love Linux OS just because it is free, stable, and there is significant amount of open-source software available for scientific community. Thus, I hope this page would be helpful for my students, who is willing to try and see a major Linux distro: Debian 11. Too, I will be using this page for my new installations to speed up the process.

Steep Learning Curve

When it comes to switching to a new operating system (OS), it naturally means a steep learning curve. However, learning Linux OS will definitely be a self-rewarding effort. In my experience, I discover new software in Linux environment and try to locate an alternative version for Mac OS or Windows OS (i.e. as office computer alternatives). You can achive many basic tasks in a Linux desktop as a beginner, too.

Main Installation

Downlad latest firware version of Debian: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware. This link includes non-free firmware to make things easier on some systems requiring proprietary but redistributable firmware. See http://wiki.debian.org/Firmware for more details.

This download will be an .ISO image file and requires about 4 GB space. Make a bootable USB drive. balenaEtcher could be very handy in this step.

Post-Install Instructions

Add user to sudoers file

Enter root shell by typing SU In the Terminal/Konsole.

Verify that sudo is installed:

sudo apt install sudo

Edit sudoers file:

sudo nano /etc/sudoers

Add your user below %sudo

# Allow members of group sudo to execute any command
%sudo	ALL=(ALL:ALL) ALL
matt    ALL=(ALL:ALL) ALL

Enable Contrib and Non-Free Packages

Open main software properties menu using terminal/konsole:

sudo software-properties-kde

Enable all listed options containing MAIN, CONTRIB, NON-FREE

If you installed Debian from a pre-built ISO you may need to disabled the CDROM: Repository to avoid errors. To do this use the OTHER SOFTWARE tab and make sure cdrom: is NOT checked.

To enable Update checking, go to the UPDATES tab and enable Check for update. As well as any other update options you desire.

Adding Backports Repository (Optional)

To install an application from the backports repository, you must first add the repository to your system.

sudo nano /etc/apt/sources.list

Go to the end of the file and paste the below lines:

deb http://deb.debian.org/debian/ bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye-backports main contrib non-free
sudo apt update

To install an application from the backport repository, you must specify the source of the package in terminal/konsole.

sudo apt -t bullseye-backports install <package name>

Enable 32-bit Package Downloads (Required for some applications)

sudo dpkg --add-architecture i386
sudo apt update

Find Fastest Mirrors (Optional)

Install netselect-apt:

sudo apt install netselect-apt

Run command:

netselect-apt

A list of mirrors ranked by speed will be places in your home directory Copy this list to /etc/apt/sources.list

Refresh package index:

sudo apt-get update

Snap and Flatpak Packages

Enable support for Snap and Flatpak packages in the Discover package manager:

sudo apt install plasma-discover-backend-snap
sudo apt install plasma-discover-backend-flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Changes will take effect after rebooting the system.

Basic Package Installers

sudo apt install synaptic

For Gnome/GTK Desktops use gdebi:

sudo apt install gdebi

For KDE/QT Desktops use qapt installer:

sudo apt install qapt-deb-installer
sudo apt install qapt-utils

Caution: qapt sometimes fails to install necessary dependencies.

Non-free Codecs and Other Media Components (Optional)

These must be installed seperatly to avoid errors/conflicts.

sudo apt install ffmpeg
sudo apt install libavcodec-extra
sudo apt install ttf-mscorefonts-installer
sudo apt install libdvdcss2
sudo apt install libdvd-pkg
sudo dpkg-reconfigure libdvd-pkg
sudo apt install ffmpegthumbnailer
sudo apt install ffmpegthumbs
sudo apt install gstreamer1.0-plugins-bad
sudo apt install gstreamer1.0-plugins-ugly
sudo apt install gstreamer1.0-libav
sudo apt install gstreamer1.0-tools
sudo apt install gstreamer1.0-vaapi
sudo apt install tumbler-plugins-extra
sudo apt-get install kdegraphics-thumbnailers

Install Linux Firmware and Base Packages

sudo apt install firmware-linux firmware-linux-nonfree firmware-misc-nonfree
sudo apt install linux-headers-$(uname -r) dkms

Use the isenkram-cli package to auto-install missing firmware requested by Kernel.

sudo apt install isenkram-cli
sudo isenkram-autoinstall-firmware

Utility Applications

sudo apt install rar unrar p7zip-rar

Fix QT Themeing on GTK based Desktops

sudo apt install qt5-style-plugins
echo "export QT_QPA_PLATFORMTHEME=gtk2" >> ~/.profile

Reboot.

Install Nvidia Drivers

Only use if you have Nvidia Hardware.

sudo apt install nvidia-detect
nvidia-detect

Install the recommended driver shown. Example:

sudo apt install linux-headers-$(uname -r) nvidia-legacy-340xx-driver

Create an Xorg configuration for your gpu.

mkdir /etc/X11/xorg.conf.d
nano /etc/X11/xorg.conf.d/20-nvidia.conf

Now add below contents to the file and save.

Section "Device"
Identifier "My GPU"
Driver "nvidia"
EndSection

Reboot.

WiFi

Install and enable all Wifi Functions for Broadcom WiFi.

The default non-free firmware only gives you basic functionality. To get the most out of your Brodcom WiFi chip, install the following firmware packages.

sudo apt install broadcom-sta-dkms broadcom-sta-common firmware-brcm80211

Reboot.

Install Bluetooth Packages

sudo apt install bluetooth bluez bluez-firmware bluez-cups bluez-tools firmware-atheros firmware-iwlwifi pulseaudio-module-bluetooth pulseaudio-module-zeroconf

Reboot.

Install Virt-Manager/QEMU Virtual Machine Manager

Install on HOST:

sudo apt install qemu qemu-system qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager libvirt-daemon-system virtinst qemu-utils virt-viewer spice-client-gtk gir1.2-spiceclientgtk-3.0 gir1.2-spiceclientglib-2.0 ebtables
sudo virsh net-start default
sudo virsh net-autostart default
sudo modprobe vhost_net
sudo usermod -G libvirt -a $USER
sudo usermod -G kvm -a $USER

Install on Linux GUEST:

sudo apt install spice-vdagent xserver-xorg-video-qxl xserver-xspice libspice-protocol-dev qemu-guest-agent

For Windows GUEST:

Install virtio-win-guest-tools.exe, virt-viewer, and UsbDk. See the following documentation for instructions.

Installing Virtualbox on Supported Hardware

sudo apt install gnupg2
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bullseye contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
sudo apt update
sudo apt install linux-headers-$(uname -r) dkms
sudo apt install virtualbox-6.1
sudo gpasswd -a $USER vboxusers

Download Guest Additions here: https://www.virtualbox.org/wiki/Downloads

Improve Font Rendering in Debian (Optional)

Show hidden files in file manager.

Create file /home/user/.fonts.conf.

Copy and paste the following text into file:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
  <match target="font">
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
  </match>
</fontconfig>

Reboot.

Open KDE Settings as Root

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dbus-launch systemsettings5

Hide Partitions on Boot (Optional)

Create a new file /etc/udev/rules.d/99-hide-partitions.rules and add one line per partition you want to hide like so: (change “sda*” to match the partition you wish to hide)

KERNEL=="sda1",ENV{UDISKS_IGNORE}="1"
KERNEL=="sda2",ENV{UDISKS_IGNORE}="1"

You should be able to dynamically activate it as root:

# udevadm trigger --verbose

Backup / Restore installed APT packages

Backup your packages list to your home directory. Get a packages list:

dpkg --get-selections > ~/Package.list

Copy list of repositories to your home directory:

sudo cp /etc/apt/sources.list ~/sources.list

Export repo keys to your home directory:

sudo apt-key exportall > ~/Repo.keys

Restore packages from your home directory:

sudo apt-key add ~/Repo.keys
sudo cp ~/sources.list /etc/apt/sources.list
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install dselect
sudo apt-get install $(cat ~/Package.list | awk '{print $1}')

Please note that if SUDO is not configured, simply use root terminal or SU.

CRITICAL: Any packages installed using a .DEB file or other source not included in your repositories/sources.list, must be removed from Package.list before restoring to avoid errors. These packages will need to be reinstalled manually.

Install microcode

Microcode is CPU firmware that controls how the processor works. It’s recommended to have the latest microcode to improve your CPU workings.

Open Synaptic Package Manager > Search for microcode > Install either intel-microcode or amd-microcode depending on your CPU.

Configure Swappiness

Decreasing swappiness value is one of the best ways to improve the performance of your system. This forces your Linux system to use RAM, instead of the hard drive. For those of you unfamiliar with Linux swap, check out our post on Linux swap.

Check the current swappiness value by executing:

cat /proc/sys/vm/swappiness
# 60 (default)

Open /etc/sysctl.conf file as an administrator:

sudo nano /etc/sysctl.conf

At the end of the file, add vm.swappiness=10 which will reduce swap usage.

Press CTRL + O to save changes and CTRL + X to exit the nano editor.

Reboot.

Install Firewall

Although there are not many viruses for Linux, it’s advisable to have a firewall that protects against network intrusions.

sudo apt install ufw
sudo ufw enable

We also have a dedicated post on the firewall in Linux so make sure to check it out for more advanced usage.

Install BackUp Program

BackUp programs are often overlooked. That is also the case with Debian 11 which doesn’t have backups by default. I always back up my system and good backups have saved me a few times!

Timeshift is the gold standard for system backups in Linux. It’s also very easy to install and configure.

Open Software Center > Search for Timeshift > Click Install

Upon opening the Timeshift, you’ll probably notice the Wizard button in the top right side of the app. As the name suggests, this is a user-friendly way of configuring backup.

Run Wizard and follow these steps:

  1. Snapshot Type: Select RSYNC
  2. Snapshot Location: Select the disk where you would like your snapshots to be stored.
  3. Snapshot Levels: You can choose how many snapshots Timeshift will perform/store on a monthly, weekly, daily, hourly and boot basis.
  4. User home directories: Allows you to decide which folders Timeshift will back up. You should prioritize your home directory, but depending on your space, it won’t hurt to include /root directory as well.

That’s it for Timeshift! In case you accidentally lose your data, open Timeshift, click Restore, select a snapshot that contains the files that you would like to recover and that’s it!

References

  1. Matthew Moore - Tech Café. Things you should do after installing Debian 11 KDE. Retrieved on 8/3/2022.
  2. Average Linux User. 20 Essentials Things to Do After Installing Debian 11. Retrieved on 8/3/2022.