This file contains hidden or 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
/** | |
Copied most of the read from: | |
https://gist.github.com/FergusInLondon/fec6aebabc3c9e61e284983618f40730 | |
Added write portion at the end | |
*/ | |
#define _GNU_SOURCE | |
#include <sys/uio.h> | |
#include <stdio.h> |
This file contains hidden or 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
def version_tuple(v): | |
"""Converts a version string to a tuple""" | |
return tuple(map(int, (v.split(".")))) | |
def meets_version(va, vb): | |
"""Check if a version string meets a minimum version. | |
Parameters | |
---------- |
This file contains hidden or 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
#!/usr/bin/python | |
"""Iteratively decrease the core and cache voltage offset until system | |
becomes unstable. | |
Requires: | |
- undervolt | |
start by running | |
$ sudo modprobe msr |
This file contains hidden or 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
""" | |
Simple script to turn the keyboard into a basic piano. | |
Install dependancies with: | |
$ pip install pynput pysinewave | |
$ sudo apt install libportaudio2 | |
This script has the bonus "feature" to listen the entire keyboard input, so | |
when it's running, when typing outside of the terminal it will still play |
This file contains hidden or 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
# KEYBOARD CONFIGURATION FILE | |
# place at /etc/default/keyboard | |
# swaps capslock and ctrl | |
# swap right control with right alt | |
# Consult the keyboard(5) manual page. | |
XKBMODEL="pc105" |
This file contains hidden or 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
""" | |
Implements a simple version check for a client/server pair. | |
Used when you want to verify if your server version is a minimum | |
value. | |
The decorator allows arguments within the decorator itself. | |
""" |
This file contains hidden or 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
"""Simple stress test for pymapdl""" | |
from ansys.mapdl.core import launch_mapdl, LocalMapdlPool | |
pool = LocalMapdlPool(10, nproc=1) | |
# mapdl =launch_mapdl() | |
def make_kp(mapdl): | |
mapdl.clear() | |
mapdl.prep7() |
This file contains hidden or 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
import re | |
import shutil | |
from pathlib import Path | |
import os | |
from typing import Optional, Union | |
from ansys.mapdl.core.mapdl_types import * | |
This file contains hidden or 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
""" | |
Basic example to show how to turn a set of points into a surface, assign values, | |
and plot it using PyVista. | |
Points are stored in "data.csv". Points are structured and it's possible, though | |
slightly harder, to create a pyvista.StructuredGrid using them. Instead, its | |
much easier to simply to use the delaunay_2d filter. | |
""" | |
import numpy as np |
This file contains hidden or 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
# enter the solver routine and solve | |
mapdl.slashsolu() | |
output = mapdl.solve() | |
# write output to disk | |
with open('mapdl_output.txt', 'w') as fid: | |
fid.write(outout) |
OlderNewer