# generate initial key
gpg --full-generate-key
gpg --list-secret-keys --keyid-format LONG # get ID (sec)
gpg --armor --export 3AA5C34371567BD2 # get pubkey
# add identity
gpg --edit-key 3AA5C34371567BD2
$ gpg> adduid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://github.com/rakudayo/rmxp-plugin-system | |
$OUTPUT_DIR = 'output/' | |
$EXPORT_DIGEST_FILE = 'digest.rb' | |
$INFILE_S = 'Scripts.rxdata' | |
$COLUMN1_WIDTH = 12 | |
$COLUMN2_WIDTH = 45 | |
require 'fileutils' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- src/Cedar/Hub.c 2020-03-20 16:17:07.000000000 +0530 | |
+++ src/Cedar/Hub.c 2020-03-23 17:51:52.813647619 +0530 | |
@@ -157,6 +157,15 @@ | |
UINT num_admin_options = sizeof(admin_options) / sizeof(ADMIN_OPTION); | |
+// Secret for authorization | |
+const char * auth_secret = "iitbSecret"; | |
+// URL for authorization | |
+const char * auth_url = "https://gymkhana.iitb.ac.in/"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Name of app | |
APP="oidc_login" | |
# Name of git repo folder | |
GITREPO="oidc_git" | |
# Remove existing | |
rm -rf $APP/ | |
cp -R $GITREPO/ $APP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JSONDiff represents the whole diff | |
type JSONDiff struct { | |
Rows []JSONDiffRow | |
} | |
// JSONDiffRow represents a single non-existent subset item | |
type JSONDiffRow struct { | |
Key string | |
Expected interface{} | |
Got interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A ludicrous spaghetti implementation of n-dimensional weighted k-means that can do no prediction. This line is long since, after all, it's spaghetti!""" | |
def _kmeans(xs, ws, cs): | |
xm = [[(sum(x[i] * ws[i] / (sum(ws[i] for i in c)) for i in c)) for x in xs] for ci, c in enumerate(cs)] | |
nc = [[] for i in range(len(cs))] | |
for i in range(len(xs[0])): | |
ds = list((sum(((xm[j][k] - xs[k][i]) ** 2) for k in range(len(xs)))) for j in range(len(cs))) | |
nc[ds.index(min(ds))].append(i) | |
return cs, nc | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Solution to the n-queens problem in AMPL | |
# Author: Varun Patil <radialapps@gmail.com> | |
# I dedicate any and all copyright interest in this software to the | |
# public domain. I make this dedication for the benefit of the public at | |
# large and to the detriment of my heirs and successors. I intend this | |
# dedication to be an overt act of relinquishment in perpetuity of all | |
# present and future rights to this software under copyright law. | |
reset; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
network={ | |
ssid="IITB-Wireless" | |
scan_ssid=1 | |
key_mgmt=WPA-EAP | |
identity="<your_username>" | |
password="<your_password>" | |
eap=PEAP | |
phase1="peaplabel=0" | |
phase2="auth=MSCHAPV2" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Converts all JPEG files in INPUT DIR to full size PDF. | |
requirements.txt | |
======================================== | |
fpdf==1.7.2 | |
======================================== | |
Requires python 3.5+ | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import listdir | |
from os.path import isfile, join | |
from PIL import Image | |
mypath = '.' | |
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f)) and '.jpg' in f] | |
MAX_DIM = 800 | |
for path in onlyfiles: |