Skip to content

Instantly share code, notes, and snippets.

View Weiming-Hu's full-sized avatar
🎯
Focusing

Weiming Weiming-Hu

🎯
Focusing
View GitHub Profile
@Weiming-Hu
Weiming-Hu / find.sequences.R
Created November 27, 2019 21:41
A function to find continuous sequences from a vector.
#
# "`-''-/").___..--''"`-._
# (`6_ 6 ) `-. ( ).`-.__.`) WE ARE ...
# (_Y_.)' ._ ) `._ `. ``-..-' PENN STATE!
# _ ..`--'_..-_/ /--'_.' ,'
# (il),-'' (li),' ((!.-'
#
#
# Author: Weiming Hu (weiming@psu.edu) and Martina Calovi (mxc895@psu.edu)
```
x=1; for i in ../spread-*png; do counter=$(printf %03d $x); ln "$i" "$counter".png; x=$(($x+1)); done
ffmpeg -r 5 -i %03d.png -c:v libx264 -r 30 -pix_fmt yuv420p spread.mp4
-r 1/10 : Display each image for 10 seconds.
-i picture-%01d.png : Reads all pictures that starts with name “picture-“, following with 1 digit (%01d) and ending with .png. If the images name comes with 2 digits (I.e picture-10.png, picture11.png etc), use (%02d) in the above command.
-c:v libx264 : Output video codec (i.e h264).
-r 30 : framerate of output video
-pix_fmt yuv420p : Output video resolution
@Weiming-Hu
Weiming-Hu / Collection-of-Information-on-Climatic-Models.md
Last active April 16, 2018 22:20
Notes for learning about Climatic Models
@Weiming-Hu
Weiming-Hu / fill-raster-NA.R
Last active July 13, 2020 15:19
This function fills NA with interpolation. Only NA locations with valid up, down, left, and right values will be interpolated.
# "`-''-/").___..--''"`-._
# (`6_ 6 ) `-. ( ).`-.__.`) WE ARE ...
# (_Y_.)' ._ ) `._ `. ``-..-' PENN STATE!
# _ ..`--'_..-_/ /--'_.' ,'
# (il),-'' (li),' ((!.-'
#
# Author: Weiming Hu <wuh20@psu.edu>
# Geoinformatics and Earth Observation Laboratory (http://geolab.psu.edu)
# Department of Geography and Institute for CyberScience
# The Pennsylvania State University
@Weiming-Hu
Weiming-Hu / Tmux cheatsheet
Created October 6, 2017 18:09
Some useful notes for Tmux
# Tmux
### From the termianl
start tmux session with name
```
tmux new -s [name]
```
attach to a existed tmux session by name
@Weiming-Hu
Weiming-Hu / gsissh_supercomputers.md
Last active April 30, 2019 18:03
Setup/Renew gsissh to supercomputers

Guide to setup/renew gsissh to supercomputers

This is referenced from the gist of Vivek

download certificates from XSEDE

mkdir $HOME/.globus
cd $HOME/.globus
wget https://software.xsede.org/security/xsede-certs.tar.gz
@Weiming-Hu
Weiming-Hu / install_netcdf4.sh
Last active July 18, 2017 23:07
Install netCDF4 in Ubuntu
#!/bin/bash
# Script to install hdf5 and netCDF4 libraries on a Linux Ubuntu system
# After: https://code.google.com/p/netcdf4-python/wiki/UbuntuInstall
# And http://unidata.github.io/netcdf4-python/
# This script install the libraries to conventional places so that other
# programs can find it. However, to do this, it requires sudo permission
# You can check for newer version of the programs on