Skip to content

Instantly share code, notes, and snippets.

@dloman
dloman / xvfb
Last active September 12, 2023 12:32 — forked from jterrace/xvfb
### BEGIN INIT INFO
# Provides: Xvfb
# Required-Start: $local_fs $remote_fs
# Required-Stop:
# X-Start-Before:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Loads X Virtual Frame Buffer
### END INIT INFO
@dloman
dloman / quadrature rotary encoder
Created October 16, 2013 21:47
quadrature encoder -> servo
#include <Servo.h>
Servo MyServo;
void setup()
{
// encoder pin on interrupt 0 (pin 2)
attachInterrupt(0, encoderPinChangeA, CHANGE);
// encoder pin on interrupt 1 (pin 3)
attachInterrupt(1, encoderPinChangeB, CHANGE);
@dloman
dloman / gist:7011907
Created October 16, 2013 17:47
Python script for getting number of new messages on an exchange server
#!/usr/bin/python
##Gets Number of New Emails
##Daniel Loman 10/15/2013
import getpass, imaplib, pickle
########################################################################################
########################################################################################
def GetNumberOfMessages():
Mailbox = imaplib.IMAP4("server.address")
AuthenticationToken = pickle.load(open(AuthFileLocation,'rb'))
Mailbox.authenticate("NTLM", AuthenticationToken)