Skip to content

Instantly share code, notes, and snippets.

View gdlmx's full-sized avatar

Mingxuan Lin gdlmx

View GitHub Profile
@gdlmx
gdlmx / DAX3.py
Created October 25, 2018 15:14
Pegasus 4.8.4 Python 3
# Copyright 2010 University Of Southern California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS" BASIS,
@gdlmx
gdlmx / Conda_condor.make
Last active August 9, 2019 13:53
HTCondor built with Python3 and Globus GSI
# Used by conda-build with the Anaconda GCC compilers:
# gcc_linux-64=7 gxx_linux-64 libgcc-ng=7
CONDAHOME?=$(CONDA_PREFIX)
GLOBUSHOME:=$(PWD)/../globus/usr
CONDORVER:=8.7.9
SRCDIR:=../condor-$(CONDORVER)
GCCROOT=$(CONDAHOME)/x86_64-conda_cos6-linux-gnu
@gdlmx
gdlmx / mount-net-drive.ps1
Created May 26, 2018 12:55
Mount Network Drive
$cred_file = "${env:\userprofile}\net-drive-cred.xml"
function GetCredentialFromVault([String]$domain ) {
$x = $domain -split "@//"
$UserName = $x[0]
Try{
$vault = Import-CliXml -Path $cred_file
} Catch [System.IO.FileNotFoundException]{
$vault = @{}
@gdlmx
gdlmx / build-DAMASK.sh
Last active July 21, 2023 11:48
Build script for DAMASK v2.0.2
#!/bin/bash
set -e
#INTELROOT=$( which ifort | sed -e 's:bin/\w*/*ifort::' )
#source $INTELROOT/bin/compilervars.sh intel64
function getsrc () {
local filename=$(basename "$1")
local dirname=${filename%%-*}
[ -d ${dirname}*/ ] || ( wget "$1" && tar -xf "$filename" && rm "$filename" )
@gdlmx
gdlmx / abaqus_python
Last active May 3, 2018 00:18
Abaqus Python
#!/bin/bash
# module load abaqus #dependencies#
ABQHOME=/opt/abaqus6/2017a
export LD_LIBRARY_PATH="${ABQHOME}/SIMULIA/CAE:${ABQHOME}/SIMULIA/CAE/linux_a64:${ABQHOME}/SIMULIA/CAE/linux_a64/code:${ABQHOME}/SIMULIA/CAE/linux_a64/code/bin:${ABQHOME}/SIMULIA/CAE/linux_a64/code/bin/SMAExternal:${ABQHOME}/SIMULIA/CAE/linux_a64/CAEresources:${ABQHOME}/SIMULIA/CAE/linux_a64/SMA:${ABQHOME}/SIMULIA/CAE/linux_a64/code/bin/SMAExternal/Interop:${ABQHOME}/SIMULIA/CAE/linux_a64/code/bin/SMAExternal/Elysium:${ABQHOME}/SIMULIA/CAE/linux_a64/tools/SMApy/python2.7/lib/python2.7/lib-dynload:${ABQHOME}/SIMULIA/installation:${ABQHOME}/SimulationServices/V6R2017x/linux_a64/code/bin:$LD_LIBRARY_PATH"
export PATH="${ABQHOME}/SIMULIA/CAE/linux_a64/code/bin/:$PATH"
export PYTHONPATH="${ABQHOME}/SIMULIA/CAE:${ABQHOME}/SIMULIA/CAE/linux_a64:${ABQHOME}/SIMULIA/CAE/linux_a64/code:${ABQHOME}/SIMULIA/CAE/linux_a64/code/bin:${ABQHOME}/SIMULIA/CAE/linux_a64/code/bin/SMAExternal:${ABQHOME}/SIMULIA/CAE/linux_a64/CAEresources:${ABQHOME}/SIMULIA/C
@gdlmx
gdlmx / check-Alien-Owner.ps1
Last active May 2, 2018 17:33
Powershell recipes
Param(
[string]$containerPath,
[string]$OwnerName
)
gci -recurse $containerPath | ? { $_.PSIsContainer -eq $False } | ? { (Get-ACL -LiteralPath $_.FullName).Owner -ne $OwnerName }
@gdlmx
gdlmx / DisableUWPStartupTask.ps1
Created April 21, 2018 12:41
Disable Startup Task of Windows UWP
# Windows task manager cannot disable some auto startup UWP Apps
# This script provides an alternative method to disable those Apps
# Refs:
# https://docs.microsoft.com/en-us/uwp/api/windows.applicationmodel.startuptask
# Author: Mingxuan Lin
function DisableUWPStartupTask ([String]$Name) {
$p = Get-AppxPackage -Name $Name
$PkgFN=$p.PackageFamilyName
Get-Item -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\$PkgFN\*StartupTask" | foreach {
@gdlmx
gdlmx / ANSI_color_demo.py
Created February 5, 2018 19:02
Print ANSI Color in Python
#!/usr/bin/env python
import os,sys
class BCOLOR:
if sys.stdout.isatty():
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
@gdlmx
gdlmx / HTTP_client_UNIX_socket.md
Last active January 20, 2024 13:24
HTTP over UNIX domain sockets
@gdlmx
gdlmx / Sci_workflow_management.md
Last active April 26, 2023 16:55
Scientific workflow management systems