Skip to content

Instantly share code, notes, and snippets.

@originalsouth
originalsouth / .tmux.conf
Last active October 8, 2019 10:11
My tmux configuration
#Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'pwittchen/tmux-plugin-ip'
#Generic
set -sg escape-time 0
set -g base-index 1
@originalsouth
originalsouth / .gnuplot
Created May 15, 2017 12:26
gnuplot configuration file
set datafile separator ";"
pi=acos(-1)
e=exp(1)
set samples 1000
@originalsouth
originalsouth / mm.zsh
Last active May 16, 2017 11:56
"mailman send an email to ... when program this program/simulation is done"
#!/usr/bin/env zsh
TO=root@localhost #EMAIL address of the recipient
HOST=127.0.0.1 #HOSTNAME with SSMTP service
main()
{
START=$(date +%s)
STARTT="$(date)"
OUT="$(mktemp mm.XXXXXXXXXX)"
echo "##[mm]: launched in folder $(pwd) with pid $$" > $OUT
echo "##[mm] received output:" >> $OUT
@originalsouth
originalsouth / cm.zsh
Last active May 17, 2017 09:18
Launch a bunch of tasks concurrently
#!/bin/env zsh
TASKS="${TASKS:=100}"
CONCURRENCY="${CONCURRENCY:=8}"
main()
{
for t in `seq $TASKS`
do
$@ $t &
while [ $(ps --no-headers -o pid --ppid=$$ | wc -w) -gt $CONCURRENCY ]
do
@originalsouth
originalsouth / .zshrc
Last active April 27, 2024 14:19
zsh configuration
# Filename: /etc/skel/.zshrc
# Purpose: config file for zsh (z shell)
# Authors: (c) grml-team (grml.org)
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
################################################################################
# Nowadays, grml's zsh setup lives in only *one* zshrc file.
# That is the global one: /etc/zsh/zshrc (from grml-etc-core).
# It is best to leave *this* file untouched and do personal changes to
# your zsh setup via ${HOME}/.zshrc.local which is loaded at the end of
@originalsouth
originalsouth / nm.zsh
Created May 22, 2017 10:55
launch a command in the background and notify the user when it's done
#!/usr/bin/env zsh
main()
{
START=$(date +%s)
STARTT="$(date)"
OUT="$(mktemp nm.XXXXXXXXXX)"
echo "the launchpath was $(pwd) with pid $$" > $OUT
echo "the received output is:" >> $OUT
if [ "$1" = "-" ]
then
@originalsouth
originalsouth / disloc.cc
Created June 1, 2017 23:15
Draw a dislocation svg
#include "tlv/tlv.h"
int main()
{
std::vector<int> x={38,149,264,396,520,640,764,93,208,327,452,573,693,60,169,286,388,498,619,747,118,242,389,552,695,55,195,322,450,592,739,118,262,398,525,661,58,195,332,450,593,738};
std::vector<int> y={33,33,33,31,32,45,39,141,139,131,132,139,147,249,255,253,222,254,231,261,358,356,342,360,359,466,461,461,464,464,460,562,560,565,569,565,652,647,651,654,650,647};
const int N=x.size();
const int R=25;
const int L=10;
tlv::svg img(798,690);
#!/usr/bin/env python2
import sys
import numpy as np
fname=sys.argv[1]
x,y,z,nnn=np.loadtxt(fname,delimiter=';',usecols=(1,2,3,10),unpack=True)
from mayavi import mlab
mlab.options.offscreen=True
mlab.figure(1,fgcolor=(0,0,0),bgcolor=(1,1,1),size=(1280,1024))
pts=mlab.points3d(x,y,z,nnn,scale_mode='none',scale_factor=0.0,colormap='jet',vmin=3.0,vmax=8.0)
mesh=mlab.pipeline.delaunay2d(pts)
@originalsouth
originalsouth / outline_type3.zsh
Last active July 21, 2017 15:00
Outline pdf images with type 3 fonts
#!/usr/bin/env zsh
if [[ $# -eq 0 ]]
then
echo 'outline_type3.zsh [option/files]'
echo 'options:'
echo "\t-f\ttoggle overwrite"
else
overwite=false
for file in "$@"
do
@originalsouth
originalsouth / LaTeX-Makefile
Last active July 31, 2017 11:23
Generic LaTeX project Makefile
file.pdf: file.tex
-@latexmk -logfilewarninglist -use-make -pdf -norc -f -latexoption=-shell-escape -interaction=nonstopmode file.tex
@echo " "
rubber-info --check file.tex
@echo " "
rubber-info --boxes file.tex
-@pdftotext file.pdf - | wc
@date
cp: file.pdf