Skip to content

Instantly share code, notes, and snippets.

View jyalim's full-sized avatar
🌵

Jason Yalim jyalim

🌵
View GitHub Profile
@jyalim
jyalim / remote-gfx-UbuntuDesktop.bash
Last active August 29, 2015 14:24
Remote access to Graphics Card on Ubuntu 14.04 or later
#!/usr/bin/env bash
# Run with sudo
# Allow tcp forwarding through lightDM, username must be login name
username=$USER
if [[ $username == 'root' ]] && [[ -n $SUDO_USER ]]; then
username=$SUDO_USER
fi
confdir=/etc/lightdm/lightdm.conf.d
@jyalim
jyalim / sshd-setup-suggestions-UbuntuDesktop.bash
Last active August 29, 2015 14:24
sshd (ssh server) on Ubuntu 15.04 or later (systemctl)
sudo apt-get update && sudo apt-get install -y openssh-server
## ---
# Change daemon settings such as default port, X11 forwarding (ensure is on), and root login:
# | OPTION | default | recommended
# -------------------------------------------------------------
# Port 22 Something > 2000
# PermitRootLogin without-password no
# X11Forwarding yes yes
sudo vim /etc/ssh/sshd.config
#!/usr/bin/env bash
stime=$((30*60)) # 30 min
app_path=$HOME/eth-net-intelligence-api
app_file=$app_path/app.json
cd $app_path
pm2 start $app_file
while true; do
@jyalim
jyalim / paloma-fix.sh
Last active August 29, 2015 14:19
Paloma-Fix
https://bbs.archlinux.org/viewtopic.php?id=151044
http://ubuntuforums.org/showthread.php?t=2102522
sudo apt-get install libgl1-mesa-dri:i386
@jyalim
jyalim / build-hdf5.sh
Last active February 20, 2024 05:40
Build HDF5 with Intel Compilers
#!/usr/bin/env bash
# https://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-hdf5-with-intel-compilers
## PREREQS
# 1) szip 2.1
export CC=icc
export CXX=icpc
export FC=ifort
export CFLAGS='-O3 -xHost -ip'
export CXXFLAGS='-O3 -xHost -ip'
@jyalim
jyalim / bashrc-mod.sh
Created April 9, 2015 23:28
Adds /usr/local/openmpi install to env
ompi=/usr/local/openmpi
export PATH=$ompi/bin:$PATH
export LD_LIBRARY_PATH=$ompi/lib:$LD_LIBRARY_PATH
export CPATH=$ompi/include:$CPATH
export INCLUDE=$ompi/include:$INCLUDE
export MANPATH=$ompi/share/man:$MANPATH
@jyalim
jyalim / openmpi-download-and-build.sh
Last active August 29, 2015 14:18
Sample OpenMPI Build
# make sure to source intel compilers vars
wget 'http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.4.tar.bz2'
tar xjf openmpi-1.8.4.tar.bz2
./configure CC=/opt/intel/path/to/icc FC=/opt/intel/path/to/ifort CXX=/opt/intel/path/to/icpc --prefix=/opt
make -j $(nproc)
make install
@jyalim
jyalim / ninja-job.bash
Last active August 29, 2015 14:18
On remote Linux, track system load averaging and implement job with e-mail notification
#!/usr/bin/env bash
# NOTE ASSUMPTION OF LINUX
# NOTE ENVIRONMENT VARIABLES THAT MUST BE SET IN ADVANCE (OR REPLACED):
# export EMAIL='user@server.domain'
# export JOB='python path/to/src.py'
# export JOBNAME='python post processing'
# RUN THIS SCRIPT WITH NOHUP OR SCREEN OR TMUX
loadavg() {
@jyalim
jyalim / parallel-epstopdf.bash
Created March 19, 2015 22:05
batch epstopdf before LaTeX
#!/usr/bin/env bash
# Assumes that script is run from directory with ./*eps
# and NO EXISTING PDF
wc="--will-cite"
parallel $wc --progress epstopdf ::: *eps
parallel $wc mv {} {/.}-eps-converted-to.pdf ::: *pdf
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# TODO:
# http://www.itdojo.com/osx-airport-cli-tool-not-just-for-airport-aps/
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport