Skip to content

Instantly share code, notes, and snippets.

@afonari
afonari / firefox_doh_with_dnscrypt-proxy_lets_encrypt_nextdns.md
Last active September 25, 2020 21:30
Firefox DOH with dnscrypt-proxy, Let's Encrypt and nextdns.io

This gist explains how to setup DOH for Firefox using dnscrypt-proxy and nextdns.io.

Get a Linux server with a static IP (DO droplet would work). Download and install dnscrypt-proxy. Edit dnscrypt-proxy.toml (see wiki):

[local_doh]
listen_addresses = ['123.456.789.1:3000']
path = "/dns-query"
cert_file = "fullchain.pem"
cert_key_file = "privkey.pem"
@afonari
afonari / gram_schmidt.py
Created October 17, 2017 18:36 — forked from iizukak/gram_schmidt.py
Gram-Schmidt Orthogonization using Numpy
import numpy as np
def gs_cofficient(v1, v2):
return np.dot(v2, v1) / np.dot(v1, v1)
def multiply(cofficient, v):
return map((lambda x : x * cofficient), v)
def proj(v1, v2):
return multiply(gs_cofficient(v1, v2) , v1)
@afonari
afonari / greek_alphabet.py
Created November 4, 2015 14:16 — forked from beniwohli/greek_alphabet.py
A Python dictionary mapping the Unicode codes of the greek alphabet to their names
greek_alphabet = {
u'\u0391': 'Alpha',
u'\u0392': 'Beta',
u'\u0393': 'Gamma',
u'\u0394': 'Delta',
u'\u0395': 'Epsilon',
u'\u0396': 'Zeta',
u'\u0397': 'Eta',
u'\u0398': 'Theta',
u'\u0399': 'Iota',

Using SSH tunnel to set-up secured connection (utorrent) in Windows XP under VMWare fusion (MacOS host)

Soft/web-ware needed

  1. tunnelr.com account or any other SSH tunnel provider.
  2. VMWare fusion.
  3. Windows XP.
  4. utorrent.

How to

  1. Start tunneling from MacOS Terminal:
#!/usr/bin/env bash
@afonari
afonari / .gitignore
Last active December 11, 2015 02:28
Unofficial Supporting Information (SI) for "Symmetry effects on nonlocal electron-phonon coupling in organic semiconductors" by Y. Li, Y. Yi, V. Coropceanu, and J.-L. Brédas.
*.pyc
VASP-displace version 1.0RC
MIT license, please see copyright description in the script, also.
Official web-page: http://alexandr-fonari.github.io/2013/05/24/displacing-atoms-along-normal-mode-VASP.html
Folders:
frequency-calc - frequency calculation (vasprun.xml from this folder is required to obtain DISPCAR).
d-0.0 - optimized geometry SCF.
d-0.1, d-0.5, d-1.0 - displaced geometries by 0.1, 0.5 and 1 characteristic length, respectively.