Useful Commands and Recipes

  1. To snip a part of a PDF (e.g., splitting your paper into a main paper and appendix), we can use the tool pdftk. On Ubuntu, we can use:
  2. 
    	sudo apt install pdftk
    	
    Then use the command:
    
    	pdftk main.pdf cat 1-12 output main-paper.pdf
    	pdftk main.pdf cat 13-16 output main-appendix.pdf
    	
  3. To post your code repo anonymously in a paper submission, we can use: Anonymous GitHub and paste our GitHub to generate a URL.Here is how you can do it for an ACM submission (based on acmart) - here if we remove the anonymous flag (say for camera-ready), the repo url will automatically be substituted with its original URL. TODO: Test on ECRTS format(Lipics), RTSS format (IEEEtran)
  4. 
    	\documentclass[sigconf,anonymous]{acmart}
    	\newcommand{\repourl}{https://github.com/ashishkashinath/my-cool-repo}
    	\makeatletter
    	\if@ACM@anonymous 
    		\renewcommand{\repourl}{anonymous-github-url}
      	\fi
    	\makeatother
    
    	\begin{document}
    	\author{Ashish Kashinath}
    	\title{Title}
    	\maketitle
    	Here is my code: \url{\repourl}.
    	\end{document}
    	
  5. Finding differences in LaTeX files and viewing the diffs is tricky when there are dependencies defined elsewhere e.g, \newcommand{}, \input{} and \include{}. So to get the diff between LaTeX files, one can use the following 2-step approach: (tested on Debian Linux):
  6. To view diff's in general - you can use diff command in Linux. I also use the GUI-based Meld tool on Debian Linux. To share a diff, I use mergely.com
  7. Occasionally, in git, I have needed to create and switch to an empty branch. As of Git 2.23, wecan use git switch --orphan <new branch> to create an empty branch with no history. Unlike git checkout --orphan, all tracked files will be removed.
  8. 
    	git switch --orphan 
    	git commit --allow-empty -m "Initial commit on orphan branch"
    	git push -u origin 
    	
  9. I worked at Intel in the past and Intel VTune is my favorite profiler on x86 platforms, especially in combination with Perf. While VTune can usually glean information from Hardware Performance Counters on x86 (provided one installs sampling drivers), it is tougher to get fine-grained information while running on a VM. Some VTune links: