Skip to content

Instantly share code, notes, and snippets.

@prajjwald
prajjwald / tithi_calc_test.py
Last active December 2, 2023 21:13
Calculate Approximate Tithi using the skyfield python library
# Modified from example at https://rhodesmill.org/skyfield/examples.html showing elongation calculation for Venus
# This program is very approximate, and very inefficient. I'm just playing around with both the skyfield library,
# as well as with the Hindu solar sidereal calendar (Tithi/Panchanga), to see if I can calculate it directly.
# This calendar is used widely in Nepal and India.
from skyfield.api import load
from skyfield.framelib import ecliptic_frame
import datetime
ts = load.timescale()
@prajjwald
prajjwald / changes.ppd
Created November 12, 2023 03:08
Setting CUPS PPD to override minimum margin
*% vi:set syntax=ppd:
*% find the corresponding lines in the file you are looking for, and change them to the numbers below:
*% e.g.
*DefaultImageableArea: Letter
*% Original: *ImageableArea Letter: "14.173 14.173 597.827 777.827"
*% To:
*ImageableArea Letter: "0 0 612 792"
@prajjwald
prajjwald / opensuse_polkit.md
Last active November 5, 2023 05:45
Opensuse polkit changes for allowing wheel user to use user (vs. root) authentication

Opensuse polkit changes for allowing wheel user to use user (vs. root) authentication

Overview

Opensuse seems to have a different philosophy regarding security, compared to Ubuntu, which I used for a long time.

Getting things working the way I wanted them to, namely:

  1. Non-wheel users should follow the out-of-the-box authentication settings
  2. wheel users should be able to use their own passwords to authenticate

Using box.com on Ubuntu - fairly painlessly

If you're impatient, feel free to skip right to the [Installation](#Installation and Configuration) instructions.

Background

box.com doesn't provide an official linux client anymore, and it has deprecated webdav support since the past few years. That being said, davfs (webdav commandline client) can still be used to mount box.com folders.

There's also rclone, which I'll talk about in this gist. Rclone boasts support for over 40 cloud providers, including dropbox, box.com, Google drive, OneDrive, Mega, Pcloud, Nextcloud, and many more. That's pretty cool - though I currently use native clients provided by most providers, I might consider switching to using rclone for some.