Skip to content

Instantly share code, notes, and snippets.

View metzenseifner's full-sized avatar

Jonathan Lee Komar metzenseifner

  • The Alps
View GitHub Profile
@metzenseifner
metzenseifner / xelatex.py
Last active December 15, 2015 13:49
Python command to execute xelatex and allow spaces in filename. It can be used with TeXShop by pasting /usr/bin/pdflatex.py --file-line-error --shell-escape --synctex=1 in the "Latex" box below pdfTeX. You have to replace the path to pdflatex.py with the path of your choosing (whereever you saved pdflatex.py). converting xelatex.py to pdflatex.p…
#!/usr/bin/python
import os, sys, shutil, subprocess
OUTPUT_ARGUMENT = '--output-directory='
DEFAULT_OUTPUT_PATH = '/Users/Jonathan/tmp'
# Grab the output directory from the arguments
output_arg_specified = False
output_dir = None
@metzenseifner
metzenseifner / texifyWord.applescript
Last active December 17, 2015 08:49
Convert Simple Microsoft Word Doc/Docx to Unicode Latex (Xelatex) No attempt made, with the exception of some quotes, to make this non-unicode, pure latex.
(*
Notes:
Ver. 2.11
Created by macmadness86 on 29.12.2013
Author of TeX Tutorials on YouTube
http://www.youtube.com/user/XeTeXTutorials?feature=watch
StackExchange User
http://stackoverflow.com/users/1236128/macmadness86
@metzenseifner
metzenseifner / Color Columns.applescript
Created February 18, 2014 23:37
Color Columns for Excel
tell application "Microsoft Excel"
set act_doc to active sheet
set sel_range to selection
set column_list to columns of sel_range
set sel_count to count of cells of sel_range
set the_Count to 1
set row_Count to count of rows of sel_range
set last_row to row_Count
@metzenseifner
metzenseifner / Count Selected Cells.applescript
Created February 18, 2014 23:38
Count Selected Cells (display dialog)
tell application "Microsoft Excel"
display dialog "You have selected " & (count large of selection as string) & " cells."
end tell
@metzenseifner
metzenseifner / arch_gui_kde_pkglist.sh
Last active October 3, 2016 09:10
Package list to quickly set up a window manager (xorg) + display manager (sddm) + desktop environment (KDE Plasma) in Arch Linux.
# Iterate this file with yaourt
xorg-server
xorg-xinit
plasma-meta
kde-applications-meta
sddm
grafana
guake
terminator
%\documentclass{article}
\documentclass[xcolor=table]{beamer}
%\usepackage[envcountsect]{beamerarticle}
\mode<article>{\usepackage{fullpage}}
\mode<presentation>{
%\setbeamertemplate{background canvas}[vertical shading][bottom=blue!70!white,top=white!95!black]% content colors
%\setbeamertemplate{sidebar left}{\vspace*{\fill}}
%\usetheme{Antibes}% Affect heirarchy in top bar only mode
\usetheme{CambridgeUS}% Adds footer bar with slide info
\usecolortheme{beaver}% outer theme colors
\documentclass{article}
\usepackage{fontspec}
\usepackage{longtable}
\usepackage{array}
\usepackage{booktabs}
\usepackage{xparse}
\usepackage{fontawesome}
\usepackage{lipsum}
%
\makeatletter
#!/bin/sh
# Prints a line, date, and output of "ip a" to some host over ssh.
# Useful to acquire IP addresses of headless machines when DNS is unavailable.
# Requirements: root privileges, wifi connects to ssid automatically e.g. systemd-networkd + wpa_supplicant
user=username
host=whatever.com
ssid=yourwifiname
if [ "$(iwgetid -r)" = "$ssid" ]
@metzenseifner
metzenseifner / beacon.service
Created March 9, 2017 09:26
beacon.service
[Unit]
Description=Make my IP known. Send results of $(ip a) to another machine over ssh as a text file prefixed with "beacon-".
After=network.target
[Service]
ExecStart=/bin/sh /usr/local/sbin/beacon.sh
[Install]
WantedBy=multi-user.target
@metzenseifner
metzenseifner / xvnc.socket
Last active March 15, 2017 09:51
TigerVNC Server Socket
# make sym link from /etc/systemd/system/xvnc.socket
# to /etc/systemd/system/socket.target.wants to enable
[Unit]
Description=XVNC Server
[Socket]
ListenStream=5900
Accept=yes