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)
Currently not available.
Needs moodle version > 3.10 (we are running 3.5)
use DownThemAll instead
Moodle: Make a copy of a past course
Log into Moodle
Identify the course name / short course name of the SOURCE (e.g. Course Name = EE311 Electrical Machines and Power Electronics Lab 2021 Autumn).
Open the course you want to populate (DESTINATION).
Open Course Administration Menu (gear icon in the top right, then click More)
Under the first menu, click Import. Do not click on the Import Button under the Question Bank sub-list.
Enter the course to import from (using the course name string identified in step 2).
Click through the next few screens to configure what should be imported. In general, most default settings should be fine.
Jabref Workflow
Install Latest Jabref (This text is for v5.9 on Ubuntu 22.04.1)
For most things, look at the Jabref Forum (https://discourse.jabref.org/)
Adding a new Entry:
Go to the source.
Get the bibtex source, add it into jabref (New Entry > )
Download the PDF version into the Master/Files folder and then rename it to the citekey.
In Jabref, select the entry and press F7 to auto-link the entry to the downloaded PDF.
Viewing / Reading:
Select the entry and Press F4 to open the PDF
Use the viewed flag if you are using the three pass method:
Pass1 = Add entry to Jabref; Pass2 = "skimmed" setting in viewed; Pass3 = Read
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
For some reason, Firefox throws an error when trying to access Google services: SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT
Solution:
Open Firefox
Enter about:config in the address bar
Search for security.tls.enable_0rtt_data and set this parameter to false
Create an Exam Paper (and solutions) with Latex
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
Webapp to help assign marks/grade mapping
https://kumanna.gitlab.io/elm-grading-assistant/
Also:
https://psunthar.github.io/interactiveGradingApplication/stable_v1/home.html
Course Catalog Spreadsheet
https://docs.google.com/spreadsheets/d/1QqqL1mGvvNDI8lcwSVxYajL_FE7E2VYi/edit?pli=1#gid=986495467
Institute Holidays in 2021 2022
[Experimental] ICAL File suitable for import into any Calendar Program:
Mid-Semester Feedback / Check-in Feedback Questions:
How is the overall pace of the course?
How "comfortable" are you with the topics so far
Which teaching tool/system do you prefer?
Document Camera, Slides, Voice+Camera, etc
For this course, your internet connection / bandwidth is:
Great, just enough, Not enough, but I manage somehow, Not manageable
Regarding the lecture / class videos
Watch Mostly Live / Watch mostly Asynchronously/ Either-or
If internet bandwidth were not an issue, would you prefer watching class lectures
Synchronously or Asynchronously
Platform(s) you regularly use to access this course (Select all that apply)
Laptop, Desktop, Mobile, Tab
How important is time-flexibility?
Very important -> not imp
Regarding your audio equipment (select all that apply to you):
Camera, headphone, mic, speakers
Do you prefer seeing the instructors face (video) during lecture ?
Do you ever *avoid* asking questions in the live class?
Sometimes, rarely, often
If you have avoided asking a question in class, it is primarily because:
_____
How much *Total* time do you spend on this course for *all* activities: videos, homework, self study, etc. (avg hours per week) (1 - 168)
How does this number (of hours per week) compare with other course *this* semester? Do you spend more time on other courses, or less, or about the same?
Name something that other instructors/courses do (In IITDH or outside) that can/should be incorporated into EE205?
If could change one thing about this course, what would it be?
Has online education taken over all your time and life? Or do you get time do do things you enjoy, like hobbies, recreation, sports, etc.
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:
Inline math mode in questions: use \( \alpha+\beta = 0 \)
Equation mode: use \[ \alpha+\beta = 0 \] or $$\alpha+\beta = 0 $$
Working with Markdown (MD)
Markdown is a simple and very powerful way to create notes, documentation, tutorials and much more.
+Benefits:
Plain text, can be read directly.
No fancy software needed to view / edit / process
Version controllable
-Downsides:
Do not permit complicated formatting
Syntax
There is no single unified standard syntax.
Safest is to stick to the CommonMark Syntax
Github supports a superset of CommonMark (called Github-flavored markdown)
Good Markdown editor software:
Brackets:
Good for html, markdown and much more.
Needs a plugin for MD preview.
Originally created by Adobe, No longer supported by Adobe. Not sure future status
Remarkable
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:
Start simple-scan from a terminal with debugging messages "on": $ simple-scan -d The output error message contains ...I/O Error... which means that simple-scan cant access the scanner. Seems to be a permissions or driver issue.
Can Ubuntu access the scanner? $ lsusbyes scanner shows up
Can the scan drivers identify it as a scanner?$ sane-find-scanner$ scanimage -LYes, scanner shows up.
Is the problem with simple-scan? Try scanning from command line:$ scanimage -d hpaio:/usb/HP_LaserJet_MFP_M227-M231?serial=XXXNXNNNNNSame error: Something about GPIO Error
Try this solution on AskUbuntu:$ sudo apt update$ sudo apt install snmp snmp-mibs-downloader$ sudo apt install --reinstall hplip
Still no ice.
Try scanning with hp-scan:$ hp-scan...error: SANE: Error during device I/O (code=9)...Error Code 9 seems to indicate a plugin problem; so lets try re-installing plugin
Download the correct plugin and the signature (asc) files from the HP Website . Make sure to download the correct version, and place them in the same folder.
$ hp-plugin -i
# Select p, then enter path to downloaded plugin files.
# Success!Unplug- and re-plugin the printer USB cable.
Simple-scan is working again!
Simple Wikis with Gitea
IITDH-Gitea supports markdown based Wikis. Steps in brief:
Create a new repo in Gitea.
Under Project settings, make sure to enable Wiki. Other features such as Issue tracker, project etc can be disabled.
Create the main page on the Wiki. Add / edit content using the browser interface.
To edit locally:
git-clone the wiki part of the repo. The clone URL can be seen on top of the wiki homepage, and should look like git@gitea.iitdh.ac.in:username/reponame.wiki.git
Install Gollum to edit the Wiki pages locally: gem install gollum
Run Gollum to serve the wiki pages locally. This also allows "live" editing
Start the server: $> gollum /path/to/cloned/repo
Point your browser to $> localhost:4567
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:
Update all packages first, reboot.
Run sudo do-release-upgrade
Confirm selections and select Yes to proceed
Third Party Sources will get disabled during upgrade (i.e. IITDH repos, PPAs, and other third Party software sources)
Download size / speed checked, enter to confirm [T = 0]
Download complete, installation has started [1540] Took slightly more time than estimated at the start by the downloader.
NTP Conf file conflict: Keep current version to retain IITDH NTP Synchronisation [T = 1 hour]
ImageMagick Configuration File (policy.xml) Conflict
I recall having changed this to allow PDF conversion or something
Original file copied to desktop, package maintainer’s version installed now.
Modprobe blacklist.conf Conflict
The file had some content added for USB Wi-Fi stick
etc/Sysctl.conf
Settings affect Insync: re-install Insync after the
All Done, Restart! [T = 2 hours]
-------------------------------------------------------------
Re-enable FTP to allow access to IITDH repos:
https://askubuntu.com/questions/1187236/how-to-re-enable-ftp-on-secondary-ubuntu-debian-server-to-pull-updates-from-mainNeed to re-enable third-party sources in /etc/apt/sources.list
Re-install Insync
Re-add the repo/PPA for NextCloud:https://launchpad.net/~nextcloud-devs/+archive/ubuntu/client
Reboot a couple of times and then reload/re-start Gnome Shell (Alt+F2, r, Enter) to make sure all Shell extensions re-load/re-start properly. If needed, here is a direct list of essential extensions:
https://extensions.gnome.org/extension/615/appindicator-support/
https://extensions.gnome.org/extension/964/do-not-disturb-button/
https://extensions.gnome.org/extension/946/panel-world-clock-lite/
https://extensions.gnome.org/extension/72/recent-items/ https://extensions.gnome.org/extension/905/refresh-wifi-connections/
https://extensions.gnome.org/extension/906/sound-output-device-chooser/
https://extensions.gnome.org/extension/921/multi-monitors-add-on/
Sudo apt-get auto-remove
Sudo apt-get clean
Reboot!
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:
Open the assignment
Click on "View all submissions"
Scroll all the way down and expand "Options", and make sure the filter is set appropriately.
Next, select all the submissions using the check-box at the top, and then use the "With Selected" dropdown to "Set Marking Workflow State" then click on set the workflow state to "Released"
Yes this is painful, so don't use the Marking workflow.
Moodle: Grant Extention on Deadline for specific students
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,
in studio.google.com, go to the "videos" tab in the side pane
find the video you want to restrict, and click on "details". It is the "pencil" icon.
in the top right, click on the three vertically aligned dots(next to "undo changes" and "save")
click on "share privately"
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:
Open the homescreen for Google Drive, Google Docs, Google Sheets, or Google Slides.
Select one or more files you want to limit.
Click Share or Share.
At the top, click Settings (the little gear icon)
(Un)check Viewers and commenters can see the option to download, print, and copy as desired
Click Save & Done.
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)
![](https://www.google.com/images/icons/product/drive-32.png)
![](https://www.google.com/images/icons/product/drive-32.png)
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:
Install GnuPG, Thunderbird 78 or later.
Launch Seahorse, and create a GPG Key. Select a key size of at least 4096 bits. Enter the passphrase carefully (for this initial tutorial you may want to write it down)
Once the key is ready, click export to export the public and private halves of the key to two files which you can store somewhere.
Take the public part and upload it to something like ubuntu keyserver
Import the private part into Thunderbird (Account settings > End to End Encryption > Add Keys..)
Get the *public* key for the recipient you intend to email.
Compose email, then click on "Security" button to select signature only or encryption.
Next stop:
git-secret to save encrypted data directly into git.
Sign everyone's keys.
Question: How to check if a particular published key has been signed by peoiple I know?
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