Skip to content

Instantly share code, notes, and snippets.

View unkcpz's full-sized avatar

Jusong Yu unkcpz

  • Swiss
View GitHub Profile
@unkcpz
unkcpz / sftp-tmp.go
Last active April 2, 2019 07:32
mkdir a tmp directory over sftp.
package main
import (
"log"
"os"
"time"
"path"
"io"
"fmt"
"sync"
@unkcpz
unkcpz / manual.md
Last active January 11, 2019 02:11
sagar 安装 无联网

step1

确定需要的requirements-pyx.txt,从本地生成,如下,python2.7的用户下载requirements-py2.txt, python3.5用户下载requirements-py3.txt

step2

创建文件夹并将requirements-pyx.txt放在文件夹中,并在联网的linux机器上执行:

$ mkdir pip_dir
$ cp requirements.txt pip_dir/
$ cd pip_dir/
@unkcpz
unkcpz / manual.md
Created January 11, 2019 02:01
sagar 安装 无联网

step1

确定需要的requirements-pyx.txt,从本地生成,如下,python2.7的用户下载requirements-py2.txt, python3.5用户下载requirements-py3.txt

step2

创建文件夹并将requirements-pyx.txt放在文件夹中,并在联网的linux机器上执行:

$ pip download -r requirements.txt
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
@unkcpz
unkcpz / Dockerfile
Created August 29, 2018 08:10
使用Docker为aiida创建postgresql数据库
# Use an official postgres 9.6.10 image
FROM postgres:9.6.10
# Set the working directory to /docker-entrypoint-initdb.d
WORKDIR /docker-entrypoint-initdb.d
# Copy the current directory contents into the container at /docker-entrypoint-initdb.d
ADD postgres-conf/* /docker-entrypoint-initdb.d
@unkcpz
unkcpz / stalonetrayrc
Last active October 9, 2018 07:23
xmonad config
# vim:filetype=config:tw=80:et
#
# This is sample ~/.stalonetrayrc, resembling default configuration.
# Remember: command line parameters take precedence.
#
# Directives introduced in 0.8 are marked with "NEW in 0.8"
#
####################################################################
#
# stalonetray understands following directives
@unkcpz
unkcpz / supermicro-ipmi-mac-address.md
Created July 21, 2018 07:12 — forked from DavidWittman/supermicro-ipmi-mac-address.md
Pull the LAN1/eth0 MAC address from SuperMicro IPMI

You can find the MAC address for LAN1/eth0 (not the BMC MAC) via the SuperMicro IPMI interface by running the following command:

$ ipmitool -U $IPMI_USER -P $IPMI_PASS -H $IPMI_HOST raw 0x30 0x21 | tail -c 18

The eth0 MAC address will be output in this format:

00 25 90 f0 be ef
@unkcpz
unkcpz / .Xdefaults
Created July 10, 2018 01:36 — forked from yevgenko/.Xdefaults
URxvt settings with solarized theme
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
import numpy as np
#
# Delaunay reduction (originally from phonopy)
#
def get_Delaunay_reduction(lattice, tolerance):
extended_bases = np.zeros((4, 3), dtype=float)
extended_bases[:3,:] = np.transpose(lattice)
extended_bases[3] = -np.sum(lattice, axis=1)
@unkcpz
unkcpz / intel-compiler-2017update7
Last active May 18, 2018 06:32
modulefile-ohpc
#%Module######################################################################
##
## intel compiler modulefile
##
proc ModulesHelp { } {
puts stderr "Sets up the paths you need to use intel compilers."
puts stderr "If this module files doesn't work well , U can try: ."
puts stderr "source /opt/ohpc/pub/apps/intel/parallel_studio_xe_2017_update7/bin/compilervars.sh intel64"
puts stderr "If this command couldn't work as well , connect our technical support staff"
}