Skip to content

Instantly share code, notes, and snippets.

Chetan Kunte ckunte

Block or report user

Report or block ckunte

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ckunte / 2019-wa.ics
Last active Apr 14, 2019
WA 2019-21 Holidays
View 2019-wa.ics
SUMMARY:WA: Good Friday
SUMMARY:WA: Easter Monday
ckunte / wcrest.csv
Last active Jan 30, 2019
Wave crest heights
View wcrest.csv
Platform Storm wave crest (m) Abnormal wave crest (m) Remarks
Angel 18.0 23.0 Abnormal => 2000-y return period
Crux 14.0 18.0/22.0 Abnormal => 1000-y/10000-y return period
NR2 16.0 21.0/22.0 Abnormal => 2000-y/10000-y return period
Pohokura N.A. 16.0 Abnormal => 1000-y return period
Pearl 6.0 8.0 Abnormal => 10000-y return period
ckunte / ea-chain.png
Last active Dec 4, 2018
Stud and Studless Chain stiffnesses per DNVGL-OS-E301 (2018)
ckunte /
Last active Aug 19, 2018
Sending bad sites to a kitchen sink (updating hosts file)
#!/usr/bin/env bash
curl -s | sed 's/^||//' > /etc/hosts
ckunte / pro_form.tex
Created Mar 13, 2018
Pro. membership form
View pro_form.tex
\documentclass[a4paper,12pt]{article} % Page size
\usepackage[pdftex,bookmarks,colorlinks,pdfusetitle]{hyperref} % Document properties, etc.
\def\LayoutTextField#1#2{#2} % override default in hyperref
\def\lbl#1{\hbox to 5cm{#1\dotfill\strut}}%
ckunte /
Last active Aug 24, 2018
Minimum reserve buoyancies of jackets and other characteristics
#!/usr/bin/env python
# encoding: utf-8
""" -- 2018 ckunte
import numpy as np
import matplotlib.pyplot as plt
buoyancydata = np.loadtxt('buoyancy.csv', dtype='float,\
float,float,float',delimiter=',', usecols=(1,2,3,4),\
ckunte /
Last active Jun 4, 2018
Compressing pdf files with ghostscript. (The ebook option, I think, offers the best compression without loss of quality.)
#!/usr/bin/env bash
# -*- coding: UTF-8 -*-
# compress all pdf files in a folder -- 2018 ckunte
for i in *.pdf; do gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compr_$i $i; done
ckunte / w2p.bat
Last active Oct 5, 2017
Save both files in the folder containing Word files and run .\w2p.bat in PowerShell to batch convert all Word files in the folder to PDF files.
View w2p.bat
echo off
for %%X in (*.doc) do cscript.exe //nologo word2pdf.js "%%X"
ckunte /
Created Sep 26, 2017
Setting zsh as default shell on Windows 7 + Cygwin
  1. Search for edit env in the Start menu search to find Edit environment variables for your account. Click on it.

  2. Click New... in User variables.. and in the following menu, enter:

     Variable name : SHELL
     Variable value: /usr/bin/zsh

    Press OK, and OK.

  3. Close and restart Cygwin Terminal, and it should start with zsh.

ckunte /
Created Sep 26, 2017
When run from a parent folder, this script combines all pdf files contained within subfolders, e.g., this is useful in combining platform-wise layout drawings.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
2014 ckunte
import os
import platform
platforms = os.walk('.').next()[1]
for platform in platforms:
You can’t perform that action at this time.