Skip to content

Instantly share code, notes, and snippets.

@cwang392
cwang392 / chmod-400.cmd
Created October 14, 2018 02:53 — forked from jaskiratr/chmod-400.cmd
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r
@cwang392
cwang392 / mwe-resonances-TE-TM-vacuum.py
Created January 10, 2018 22:49 — forked from anonymous/mwe-resonances-TE-TM-vacuum.py
Find TE and TM resonances of a axisymmetric cavity of arbitrary shape in rz (Minimal working example)
#!/usr/bin/python2
# -*- coding: utf8 -*-
"""
Usage: %(scriptName)s
FEniCS RF cylindrical cavity eigenvalue problem test.
Computes the TE and TM eigenmodes of a cavity using the E field.
No losses are considered. Permittivity is currently not considered.
TODO: Implement induced surface current integral on boundary to estimate Q factor