Skip to content

Instantly share code, notes, and snippets.

View fcangialosi's full-sized avatar

Frank Cangialosi fcangialosi

View GitHub Profile
@fcangialosi
fcangialosi / abs-pos-box.tex
Created April 5, 2021 17:47
add absolute position box to latex document
% before begin{document}
\usepackage[absolute]{textpos}
% after begin{document}
% first arg is width of box
% second arg is (vertical,horizontal) position
\begin{textblock}{13.5}(1,0.25)\fbox{
\begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
\scriptsize
Text here
@fcangialosi
fcangialosi / EXAMPLE.service
Created September 2, 2017 20:46
Automatically start long-running script on boot and keep it running with systemd
[Unit]
Description=Description of this service
[Service]
Type=simple
ExecStart=/usr/bin/nohup /path/to/server.sh
Restart=always
RestartSec=30
StandardOutput=/path/to/log
StandardError=/path/to/log
@fcangialosi
fcangialosi / README.md
Last active August 21, 2017 16:34
git simple automatic per-commit version numbers

This gist shows how to automatically increment and add version numbers to your commit messages and source code.

The major and minor version numbers are managed manually using git tag, while the per-commit numbers are managed automatically with git hooks.

This example uses the following version numbering scheme:

v{MAJOR}.{MINOR}-c{COMMIT#}

Start out by running git tag -a v1.0 for the initial release

@fcangialosi
fcangialosi / README.md
Last active August 10, 2017 09:25
DIY GitHub Build Server

DIY GitHub Build Server

This gist shows how to setup a simple build server with Apache.

GitHub sends a push request to the server each time the repository is updated.

Apache handles this request and runs a python script in response, which pulls from the repository and creates a new build.

This assumes the Apache user is called "www-data" with a home directory of /var/www/ and that project files live in /var/www/PROJECT

@fcangialosi
fcangialosi / task_mmu.patch
Last active September 26, 2015 17:15
Small modification to linux kernel (v3.13.0) that adds *which* pages have been accessed to the /proc/pid/smaps interface
267c267,269
< struct inode *inode = file_inode(vma->vm_file);
---
> struct inode *inode;
> file = vma_pr_or_file(vma);
> inode = file_inode(file);
440a443,457
> #define MAX_REF_BUFF 4096
> #define END_OF_REF_BUFFER -1
> static unsigned long *referenced_list;