Instantly share code, notes, and snippets.

# dan mackinlay danmackinlay

Last active February 16, 2023 15:57
Intel for display, Nvidia for computing
View intel-nvidia.md

# Intel for display, NVIDIA for computing

This guide will show you how to use Intel graphics for rendering display and NVIDIA graphics for CUDA computing on Ubuntu 18.04 / 20.04 desktop.

I made this work on an ordinary gaming PC with two graphics devices, an Intel UHD Graphics 630 plus an NVIDIA GeForce GTX 1080 Ti. Both of them can be shown via lspci | grep VGA.

00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)

Created November 7, 2017 13:08
Disable broken xhci device before suspend and avoid freeze.
View system-sleep-xhci.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/bin/sh # # This script should prevent the following suspend errors # which freezes the Dell Inspiron laptop. # # Put it in /usr/lib/systemd/system-sleep/xhci.sh # # The PCI 00:14.0 device is the usb xhci controller. # # kernel: [67445.560610] pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16
Created December 12, 2016 08:01
Find Raspberry Pi devices on your local networks.
View find-pis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/bin/sh # get broadcast addresses for each network net=ifconfig | grep -o -E "Bcast:(.*?) " | cut -f2 -d":" # loop over networks running the scan for n in $net; do # first find SSH machines silently to prime the arp table nmap -T4 -n -p 22 --open --min-parallelism 100 "$n/24" | grep -e "scan report for" -e "ssh" > /dev/null
Last active August 29, 2021 23:11

#LaTeX in IPython Notebook

With this extension you can use LaTeX-style references within IPython (Notebook) while still using markdown for formatting.

Required:

• ipython-dev
• biblio-py
• markdown
Created January 25, 2012 08:22 — forked from drifter/information_criticality_society.tex
View information_criticality_society.texjn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 information and Phase Transitions in Socio-Economic Systems Terry Bossomaier, Dan Mackinlay, Lionel Barnett... \section{Introduction} \label{sec:intro} Diamonds are not a good very long term investment! They are steadily turning into graphite. It will take millions of years, but the most stable form of carbon at room temperature and pressure is graphite. Thus diamonds will undergo a phase transition to graphite, albeit over a very long timescale. When we normally think of phase transitions we think of the states of matter, ice melting to water or water turning to steam. They are order/disorder transitions. In graphite the carbon atoms are linked together in layers. The layers can slide over one another giving graphite its excellent lubricant properties. In diamond the carbon atoms are linked together in a three dimensional structure with each carbon at the centre of a tetrahedron linked to carbons at all four corners. Thus carbon has to go through a major structural reorganization to change from diamond t
Created January 25, 2012 00:19 — forked from danmackinlay/information_criticality_society.tex
View information_criticality_society.tex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 information and Phase Transitions in Socio-Economic Systems Terry Bossomaier, Dan Mackinlay, Lionel Barnett... \section{Introduction} \label{sec:intro} Diamonds are not a good very long term investment! They are steadily turning into graphite. It will take millions of years, but the most stable form of carbon at room temperature and pressure is graphite. Thus diamonds will undergo a phase transition to graphite, albeit over a very long timescale. When we normally think of phase transitions we think of the states of matter, ice melting to water or water turning to steam. They are order/disorder transitions. In graphite the carbon atoms are linked together in layers. The layers can slide over one another giving graphite its excellent lubricant properties. In diamond the carbon atoms are linked together in a three dimensional structure with each carbon at the centre of a tetrahedron linked to carbons at all four corners. Thus carbon has to go through a major structural reorganization to change from diamond t
Last active February 14, 2023 01:51 — forked from endolith/peakdet.m
Peak detection in Python
View analytic_wfm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/usr/bin/python2 # Copyright (C) 2016 Sixten Bergman # License WTFPL # # This program is free software. It comes without any warranty, to the extent # permitted by applicable law. # You can redistribute it and/or modify it under the terms of the Do What The # Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See
Created April 27, 2011 05:46
MySQL to Sqlite converter
View mysql2sqlite.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/bin/sh # Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL KEY xxxxx from the # CREATE block and create them in separate commands _after_ all the INSERTs. # Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. # The mysqldump file is traversed only once. # Usage: $./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite # Example:$ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
Created April 2, 2011 08:02