Skip to content

Instantly share code, notes, and snippets.

@wjladams
wjladams / wills_code.m
Last active January 18, 2024 02:38
Some matlab code to read from a cool device
% lock in script
% to run script the NI-488.2 driver is nessary
%lockinamp is the stanford research systems model sr810 dsp lock-in
%amplifier
%funcgen is the rohde & schwarz signal generator smy01
lockinamp = 0;
funcgen = 0;
lockinamp = visadev("GPIB0::8::INSTR");
funcgen = visadev("GPIB0::28::INSTR");
stfr = 18500;
@wjladams
wjladams / example.py
Created July 2, 2023 16:36
Using pyinstaller
#!/usr/bin/env python
# This is a simple script that needs the tkinter and pandas libraries
# to test pyinstaller correctly wrapping these libraries.ex
import pandas as pd
from tkinter.filedialog import askopenfilename
filename = askopenfilename(initialdir="../data")
if filename is None:
exit(0)
df = pd.read_excel(filename)
print(df.head())
import numpy as np
def f(p,t,m,vi):
return np.sqrt(2*p*t/m+vi**2)
vi=0 # starts at rest
m = 1000 # in kg
delta_t=0.01
# Peak horsepower at wheel
p = 700 * 747 # 700 hp * 747 conversion to Watts
total_dist = 0.25 * 1609.344
dist = 0
@wjladams
wjladams / References.md
Last active January 30, 2021 14:02
Getting ubuntu installed on Macbook air
@wjladams
wjladams / blz.sh
Created September 17, 2019 13:44
Fixing my mpow bluetooth headphones on xubuntu and perhaps ubuntu also
#!/bin/sh
sudo hcitool cmd 0x3F 0x01C 0x01 0x02 0x00 0x01 0x01
@wjladams
wjladams / fedora-issue.md
Last active June 3, 2023 13:22
Running Jupyter as service on ubuntu with systemd

On SELinux systems (including fedora) you need to allow the system to execute things in the anaconda directory. To do this you need to run (replacing /home/wjadams with your home directory)

sudo semanage fcontext -a -t bin_t '/home/wjadams/anaconda3/bin.*'
sudo chcon -Rv -u system_u -t bin_t '/home/wjadams/anaconda3/bin'
sudo restorecon -R -v '/home/wjadams/anaconda3/bin'

And then the system should allow you to run jupyter-notebook from that directory

@wjladams
wjladams / readme.md
Last active February 10, 2019 22:27
New Server steps
  1. Install spotify from here:
# 1. Add the Spotify repository signing keys to be able to verify downloaded packages
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 931FF8E79F0876134EDDBDCCA87FF9DF48BF1C90

# 2. Add the Spotify repository
echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list

# 3. Update list of available packages
@wjladams
wjladams / ConfigureApache.md
Last active February 10, 2019 18:47
Installing stuff for R Shiny Server
@wjladams
wjladams / run.sh
Created February 9, 2019 13:47
Install R on Ubuntu (needed to use R-Studio Server)
# Create the apt list entry for the cran r repository
# This is the repo for Cosmic, if you need another one
cat deb https://cloud.r-project.org/bin/linux/ubuntu cosmic-cran35/ > /etc/apt/sources.list.d/rpojcran.list
# Add the signing key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9
@wjladams
wjladams / sierpinski_gasket_notes.md
Created January 17, 2019 14:47
Sierpinski gasket notes