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/env bash | |
# A script to run every time I set up a new personal Ubuntu machine to get it the way I want it. | |
# Many of these come from https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/ | |
# Update the system and add other package sources | |
sudo apt update && sudo apt upgrade | |
sudo apt install snapd | |
# Install media codecs | |
sudo apt install ubuntu-restricted-extras |
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/env bash | |
# Convenience script for setting up docker and docker-compose on Ubuntu. | |
# Steps essentially copied and pasted from: | |
# https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
# https://docs.docker.com/compose/install/ | |
# Uninstall any existing docker installations | |
sudo apt-get remove docker docker-engine docker.io containerd runc |
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 bash | |
# Using python to get the RA, DEC from a wcs file: https://groups.google.com/d/msg/astrometry/0ICnBUecOx8/S1to9wayBQAJ | |
# Physical meaning of "Field rotation angle": https://groups.google.com/d/msg/astrometry/KEPzYd7fHis/hGDGMUwMBgAJ | |
# Possible program flaw of rotation near poles: https://groups.google.com/d/msg/astrometry/Uicir_i1E_o/nJsjjDeEBwAJ | |
solve-field \ | |
--no-plots \ | |
--no-verify \ |
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 | |
WORKSPACE_DIR="/tmp" | |
# basic linux install/build libs, python, and other support | |
cd $WORKSPACE_DIR && \ | |
apt install -y make && \ | |
apt-get update && \ | |
apt-get install -y build-essential python python-pip netpbm zlib1g-dev libcairo2-dev libjpeg-dev libcfitsio-dev && \ | |
pip install numpy scipy pyfits && \ |
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
# For Ubuntu 18.04 Melodic | |
# INSTALL ROS | |
# Setup your sources.list | |
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' | |
# Set up your keys | |
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 | |
# Installation | |
sudo apt update | |
sudo apt install ros-melodic-desktop-full |
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
cd ~ | |
mkdir -p hummingbird_ws/src | |
cd hummingbird_ws/src | |
catkin_init_workspace | |
git clone https://magiccvs.byu.edu/gitlab/hummingbird/hb_student.git | |
git clone https://magiccvs.byu.edu/gitlab/hummingbird/hb.git | |
cd hb | |
git checkout --track origin/fall_2020 |
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
const int P25 = 2; | |
const int P50 = 3; | |
const int P75 = 4; | |
const int P100 = 5; | |
const int SENSOR = A0; | |
void setup() | |
{ | |
pinMode(P25, OUTPUT); | |
pinMode(P50, OUTPUT); |
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
import os | |
import sys | |
import requests | |
from bs4 import BeautifulSoup | |
def notify(title, text): | |
os.system(""" | |
osascript -e 'display notification "{}" with title "{}"' |
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
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v2.3.0 | |
hooks: | |
- id: check-yaml | |
- id: check-json | |
- id: check-merge-conflict | |
- id: mixed-line-ending | |
- id: end-of-file-fixer | |
types: [python] |
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
""" | |
Example taken from https://www.klayout.de/forum/discussion/2246/clip-gds-to-image | |
This example images the full GDS and saves it to some shape specified. | |
""" | |
from klayout import lay | |
in_file = "path/to/some.gds" | |
out_file = "out.png" | |
layer_file = "path/to/some/layers.lyp" |