Now that you have a virtual machine running Xubuntu 17.10, it's useful to learn how to update software and install new software packages. This tutorial will be an applied example of how to do so. We'll go over how to configure your VM to permit a connection to it through PuTTY.
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
shopt -s nullglob | |
let playlist_duration_ms=0 | |
for song_file in *.{mp3,ogg,m4a,flac,wav}; do | |
playlist_duration_ms=$(expr $playlist_duration_ms + $(mediainfo --Inform="Audio;%Duration%" "$song_file")) | |
done | |
let playlist_duration_secs=$(expr $playlist_duration_ms / 1000) | |
let playlist_duration_mins=$(expr $playlist_duration_ms / 60000) | |
let playlist_duration_remaining_secs=$(expr $playlist_duration_secs - $(expr $playlist_duration_mins \* 60)) | |
echo $playlist_duration_mins minutes, $playlist_duration_remaining_secs seconds | |
shopt -u nullglob |
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
# | |
# Default settings for the simulation | |
# | |
## Scenario settings | |
Scenario.name = default_scenario | |
Scenario.simulateConnections = true | |
Scenario.updateInterval = 0.1 | |
# 43200s == 12h | |
Scenario.endTime = 43200 |
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
# Doug McGeehan (djmvfb@mst.edu) | |
# Bouncing-eliminating BinaryState object. | |
import time | |
class BinaryState: | |
"""Prevent bouncing of the signal when the button is pressed.""" | |
def __init__(self, initial_state=0): |
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
# Doug McGeehan (djmvfb@mst.edu) | |
# | |
# This script expects raw scanned images to be named in the following format: | |
# ${prefix}_f.tiff for obverse scans, and | |
# ${prefix}_b.tiff for reverse scans. | |
# We need both of these files to perform the final merging. When you perform | |
# the scan, make sure to keep the ingots in approximately the same location | |
# on the scanner. | |
# | |
# First, you need multicrop. Download it from here: |
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
# The KIC Bookeye 4 stupidly outputs files in the following format: | |
# | |
# KIC Image.png | |
# KIC Image 1.png | |
# KIC Image 2.png | |
# ... | |
# KIC Image 9.png | |
# KIC Image 10.png | |
# KIC Image 11.png | |
# ... |
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
class MobileHost(Phone): | |
def __init__(self, *args, **kwargs): | |
Phone.__init__(self, *args, **kwargs) | |
self.counter = 0 | |
self.Flag = False | |
self.tokenMH = False | |
def request(self): | |
self.counter += 1 # NOT sure what we are doing with this |
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
from bintrees import rbtree | |
single_rotator = rbtree.jsw_single | |
def augmented_rotator(root, direction): | |
new_root = single_rotator(root, direction) | |
new_root.size = root.size | |
root.size = 1 + (0 if root.left is None else root.left.size)\ | |
+ (0 if root.right is None else root.right.size) | |
return new_root |
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 sys | |
import os | |
import csv | |
import collections | |
keys = [ | |
"Timestamp", | |
"State", | |
"Company Name", |
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
<?php | |
if (!isset($_POST["submit"])) | |
{ | |
?> | |
<html> | |
<body> | |
<form method="post" action="<?php echo $PHP_SELF; ?>"> | |
<table width="500px"> |
NewerOlder