Skip to content

Instantly share code, notes, and snippets.

View panda1100's full-sized avatar

Yoshiaki Senda panda1100

View GitHub Profile
@panda1100
panda1100 / openfoam4.1.modulefile
Last active January 31, 2017 00:25
modulefile for OpenFOAM 4.1(/etc/environment-modules/modules/openfoam/4.1)
#%Module1.0
## OpenFOAM 4.1 & ParaView 5.0.1
proc ModulesHelp {} {
puts stderr "OpenFOAM 4.1 & ParaView 5.0.1\n"
}
module-whatis "OpenFOAM 4.1 & ParaView 5.0.1"
@panda1100
panda1100 / settings.sh
Last active January 24, 2018 01:28
settings.sh file for building OpenFOAM-3.0.x with Gcc-5.4, GMP-6.1.2, OpenMPI 1.10.7 (add OPAL_LIBDIR for portable OpenMPI) on Debian9(Stretch)
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
@panda1100
panda1100 / paraview-superbuild.sh
Created January 30, 2018 04:23
paraview superbuild example procedures
git clone --recursive https://gitlab.kitware.com/paraview/paraview-superbuild.git
cd paraview-superbuild
git fetch origin # ensure you have the latest state from the main repo
git checkout v5.4.0 # replace `v5.4.1` with tag name of your choice
git submodule init
git submodule update
mkdir ../build #cmake complains build_dir must not located under git repo
cd ../build
export CC=/PATH/TO/YOUR_GCC/bin/gcc
export CXX=/PATH/TO/YOUR_GCC/bin/g++
@panda1100
panda1100 / hook-openpyxl.py
Created September 29, 2018 13:42 — forked from GaryLee/hook-openpyxl.py
Fix ".constants.json" not found issue when using Pyinstaller to pack openpyxl.
# When you're encountering following error.
# > IOError: [Errno 2] No such file or directory: 'C:\\Users\\username\\AppData\\Local\\Temp\\_MEI502322\\openpyxl\\.constants.json'
#
# This solution tested under Python 2.7.10 and Pyinstaller 3.0.
#
# Put this file to your script folder.
# Add this hook to your distribution by
# > pyinstaller --onefile --additional-hooks-dir=. yourscript.py
#
from PyInstaller.utils.hooks import collect_data_files
import pandas as pd
from os import listdir
from os.path import splitext
for filename in listdir():
csv = pd.read_csv(filename, header=None)
writer = pd.ExcelWriter('{0}.xlsx'.format(splitext(filename)[0]))
csv.to_excel(writer, 'Sheet1', index=False, header=False)
writer.save()
for f in `find *.png `
do
convert $f ${f%.*}.eps
#convert -density 300 $f ${f%.*}.pdf
#pdftops -eps ${f%.*}.pdf
#rm ${f%.*}.pdf
done
#!/bin/bash
SCRIPTDIR=$( cd "$(dirname "$0")" ; pwd -P )
SCRIPTFILE=`basename "$0"`
profile_id=f038cf34b6d040eda5339059f5a4a92f
function start(){
sudo pritunl-client start $profile_id
}
#!/bin/bash
docker run --rm -v `pwd`:/root/files --name $1 -it ubuntu:16.04 /bin/bash
@panda1100
panda1100 / mkimage_vyos.sh
Created January 29, 2019 05:56 — forked from kurochan/mkimage_vyos.sh
mkimage_vyos.sh
#!/bin/bash
# You need to install overlayroot
# sudo apt-get install overlayroot
LANG=C
set -e
set -x
@panda1100
panda1100 / main.go
Created October 29, 2021 08:54 — forked from lizrice/main.go
Container from scratch
package main
// @lizrice, mostly copied from @doctor_julz: https://gist.github.com/julz/c0017fa7a40de0543001
import (
"fmt"
"os"
"os/exec"
"syscall"
)