kabhijit's notes 

A collection of random things that might be useful to someone, sometime

About

CAUTION: Use any of the information on this site/page strictly at your own risk, irrespective of anything elsewhere on this page.


This page contains an assortment of unfiltered, unedited notes that I make from time to time; in the hope that someone else might find it useful. I have no intention of putting too much effort into maintaining or otherwise managing this page. If you notice errors / omissions please drop an email and I might fix it eventually.

You may use the table of contents on the right to navigate the site, or just use regular search (Ctrl+F) to search the entire page.

Xerox Printer Driver

The simplest, lightest, webserver? On Ubuntu:

python3 -m http.server

Xerox Printer Driver

See: U-Waterloo Document [Wayback Machine Mirror]  to install the drivers and add the printer.
Note - if you are on WiFi the "Add printer" dialogbox will hang...  you just need to turn off WiFi temporarily. This is explained in the waterloo link above.

and https://drive.google.com/file/d/1nhJBUhYwk0AH0bGwS0CnhXbKEx76nWcy/view?usp=drive_link 


Deduplication in Google Sheets

You have one column and you need to check if any of these entries appear in another column. Run the formula:

=if(B2=VLOOKUP(<SOURCECELL>,<TARGETRAGE>,1,FALSE), "MESSAGE_YES"   "MESSAGE_NO")

Moodle: Download all content (Slides, PDFs, notes, etc)

Moodle: Make a copy of a past course

Jabref Workflow

Correct Name/Email in Git Config

For Git >2.8:

git config --global user.useConfigOnly true

Any of your new repo will look for user.email only in their local .git/config file.

And the commit will not proceed if no user.email is found in the local git config.

From stackoverflow.com

Firefox and Google on IIT-DH Network

Kindle Setup

Create an Exam Paper (and solutions) with Latex

See https://gitea.iitdh.ac.in/kabhijit/LatexExamTemplate

Indian Currency Number Formatting in Excel / sheets

See https://www.raghunayak.com/2020/07/how-to-show-inrrs-in-lakh-crore-format.html

Darktable New repo

New URL String for repo in /etc/apt/sources.list.d/graphics\:darktable.list

deb http://download.opensuse.org/repositories/graphics:/darktable:/master/xUbuntu_20.04/ /

Note the slash at the dn

Institute Holidays in 2021 2022

[Experimental] ICAL File suitable for import into any Calendar Program: 

https://gitea.iitdh.ac.in/FossTools/HolidayCalendar

Mid-Semester Feedback / Check-in Feedback Questions:


Bluetooth Device Reset Process:

SBH24:

With the Headset off and connected to power, long press Play/Pause button  for approximately 5 seconds. The LED indicator will flash twice in orange.

SP510:

Press both the (power) button and the Vol – button simultaneously while charging.

Flip 4:

Power on the speaker. Press and hold Play and + buttons until the speaker turns off.





Moodle: Instructor's FAQs:


Working with Markdown (MD)

Markdown is a simple and very powerful way to create notes, documentation, tutorials and much more.


simple-scan breaks on upgrade to Ubuntu 20.04

I noticed that after an upgrade to Ubuntu 20.04 I could no longer use simple-scan.

Steps to identify the problem:

Simple Wikis with Gitea

IITDH-Gitea supports markdown based Wikis. Steps in brief:

Xournal++ vs Xournal

Xournal++ (package name xournalpp) is a vast improvement over Xournal, even though supposedly "un"stable.

Installation instructions and PPA for Ubuntu available here:  https://github.com/xournalpp/xournalpp 

Notes: Alt Shift right (select to end of line) happens to be the shortcut for layer visibility toggle - so you may find that all your text disappears. Re-enable using the same key combo OR layers drop-down menu at the bottom.

Ubuntu in-place Release Upgrade (18.04LTS to 20.04LTS)

This document describes the steps required to update Ubuntu 18.04 in-place from 18.04 to 20.04. I Strongly recommend that you back up all your data onto a separate device (like a removable hard drive) AND make sure to back up data/program files from other Operating systems on the machine as well. Usually the upgrade goes off without any issues but once in a while it will fail spectacularly and leave your machine in an un-bootable state. For this eventuality, a bootable USB with Ubuntu18.04 or Ubuntu 20.04 should be kept handy.

Process:


-------------------------------------------------------------

Compress scanned PDF Files Quickly

Ghostscript on Ubuntu (and other platforms) allows quick compression of scanned PDFs for on-screen viewing. The command is given below. Replace input.pdf and output.pdf with the correct filenames. Two compressions levels may be used depending on your requirement:

Reasonably good compression for screen viewing:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf


Agressive compression (May be too much)

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Fortinet Ethernet Authentication

Fortinet's authentication can be painful if it keeps timing out and a broswer window is needed to keep the "sesion" alive - especially on machines that are not rebooted each day. Simple solution:
Create a browser profile dedicated to Fortinet authentication and add the following URL as a bookmark:

http://internet.iitdh.ac.in:1000/logout?fdfcf4fbfffafafa 

https://internet.iitdh.ac.in:1003/logout?0a0f040c030d0d05

The parameter is just a dummy value (that happens to work). Accessing this URL will log out and close out any existing Fortinet authentication. Click on the login button and save your username and password. Since this browser profile is independent and standalone you can leave it running in the background.



NEW:

You also need to install a certificate to allow the initial authentication to happen. 

Get the certificate (*.cer file) from http://ftp.iitdh.ac.in/ then follow the instructions here:

https://intranet.iitdh.ac.in:444/ccs_ldap.php (Certificate Installation for Chrome and Firefox). Note that after installing the certificate you *probably* should restart the browser for the new certificate to be used.

Moodle Help Tutorial Videos

Just came across an excellent set of videos on Youtube that contain basics of setting up and using Moodle features (for instructors).

The playlist is here : https://www.youtube.com/playlist?list=PLef2vtHblB8boWyELKFOdyZ8LZ99OFCl8


Moodle "Release Grades"

IIT-DH Moodle server is currently running V3.5. 

To make life easy, create new assignments with "Use Marking Flow"set to "No".

If marking flow is enabled, each student's marks need to be "released" before the students can view it.

To do this:

Yes this is painful, so don't use the Marking workflow.

Moodle: Grant Extention on Deadline for specific students

https://youtu.be/wyXZyUKr__Q 

Youtube restrict to Domain

Uploaded videos to Youtube usually have 3 permission settings: Private, Unlisted and Public.

There is a third - Private to Domain only. To enable this,

Thanks to rajshekar.k for this tip.

Google Drive: Allow viewers to Download files

When uploading files (esp lecture videos) to Google Drive, make sure that students can download these.

To prevent/allow  viewers and commenters from printing, copying, or downloading your file:

Important: You can't apply this setting to a folder, but you can apply it to individual files in the folder.

IIT-DH Gitea HTTPS Access...

will fail since the gitea.iitdh.ac.in certificate is self signed (or something like that). So you cannot do something like

"git clone https://gitea.iidh.ac.in/..."

Solution: Use ssh for git clone/push/pull OR add an exception according to this:

https://stackoverflow.com/questions/11621768/how-can-i-make-git-accept-a-self-signed-certificate

IIT-DH VPN access on Linux

IIT-DH uses Fortinet VPN service.

On Ubuntu, install the OpenFortiVPN client from Synaptic / Apt.

Then create a config file ~/.fortinetvpn.conf with the following content:

host = vpn.iitdh.ac.in

port = 10443

username = yourusernamehere

password = yourpasswordhere

# trusted-cert =

trusted-cert = 8a49b3744adef161954cb9b57fa87f40a4b1158d4c61d9182e62e7c27f0d3c89

where trusted-cert is the certificate key. This is the certificate key right now. If it ever changes, comment it out and the server will tell you the correct key when you try to connect.

Launch using the command:

openfortivpn -c ~/.fortinetvpn.conf

Camera solutions for Online Teaching

Smartphone as document camera:

Option #1:

Install DroidCam App on your Android Phone and the Droid Cam client program on your Windows machine.

Launch the app on phone; the laptop can connect to it via USB or WiFi. Appears as a webcam device to any videoconferencing tool, e.g. Google Meet, Skype, etc. Needs a tripod of some sort.

Option #2:

Install IPCam app on your android phone. The video feed can be accessed in a browser.

Cross-platform usable. Frame rates are low when used with Google Meet + Share Chrome Tab

 

Moodle: Bulk Enrolment of students

(Guide for Instructors)

How to add a list of email IDs into Moodle: https://youtu.be/gsfg8So66d0

More documentation of this feature (plugin) is here: https://github.com/moodleuulm/moodle-local_bulkenrol

Moodle: Add Blocks to page

(Guide for Instructors)

After login, expand the left-side menu and click on "Add a Block" at the bottom left corner. This will allow you to add a number of useful and convenient functionalities to your Moodle page.

A firefox Theme in IITDH colors?

It's nice to be able to customise the firefox theme, but there doesn't seem to be one that matches (or is even close) to the institute colors (Purple and Marigold) - so I cobbled together a theme file, which can be seen and downloaded here:

https://addons.mozilla.org/en-US/firefox/addon/iit-dharwad-theme/ 

It is still in the draft stage, but feedback is welcome. 

File Template: "Silence Please"

Ever been interrupted by loud conversation or noise during class? Print and post this!

(PDF and PPT formats)



SilencePlease.pptx
SilencePlease.pdf

Encryption and Signatures for Email & Git

Simple system for digitally signing (e.g email or git commits) and/or encrypting data (usually email). This text is only a description of how to set it up. If you need to know why / features, please look elsewhere. Also these instructions are only meant for Ubuntu.

Notes: PGP was a proprietary system. OpenPGP is an open source framework/standard developed by the IETF. GnuPG is an open-source implementation that is "compatible with"(?) OpenPGP and PGP, and is today supported by most email systems (e.g. Thunderbird).


Setup Steps for Ubuntu 20.xx or so:


Next stop:



FFMPEG Quick Reference:

Remove Audio from a video file:

ffmpeg -i 20230514113502_0060.mp4 -c copy -an 20230514113502_0060-A.mp4

Concatenate multiple files

(from https://stackoverflow.com/a/11175851)

$ cat mylist.txt

file '/path/to/file1'

file '/path/to/file2'

file '/path/to/file3'


$ ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4