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 collections | |
from collections import namedtuple | |
Robot = namedtuple('Robot', 'base, hinge1, arm_len, hinge2, wrist, hand') | |
Robot.base = 260 | |
Robot.hinge1 = 20 | |
Robot.arm_len = 120 | |
Robot.hinge2 = 150 | |
Robot.wrist = 90 |
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/bash | |
export LC_ALL=C.UTF-8 | |
export LANG=C.UTF-8 | |
curl -o /tmp/firefox.tar.bz2 -L "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US" | |
if [[ $(file -b --mime-type /tmp/firefox.tar.bz2) = 'application/x-bzip2' ]]; then | |
sudo mkdir -p /opt | |
sudo rm -rvf /opt/firefox | |
sudo tar -xvf /tmp/firefox.tar.bz2 -C /opt/ |
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
curl -o /tmp/vagrant.deb "$(curl -fsL "https://releases.hashicorp.com$(curl -fsL "https://releases.hashicorp.com/vagrant" | grep 'href="/vagrant/' | head -n 1 | grep -o '".*"' | tr -d '"' )" | grep "amd64\.deb" | head -n 1 | grep -o 'href=".*"' | sed 's/href=//' | tr -d '"')" | |
sudo dpkg -i /tmp/vagrant.deb | |
rm -f /tmp/vagrant.deb |
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 | |
[[ "$(uname -s)" = 'Darwin' ]] && REALPATH=grealpath || REALPATH=realpath | |
[[ "$(uname -s)" = 'Darwin' ]] && DIRNAME=gdirname || DIRNAME=dirname | |
if ! (type "$REALPATH" && type "$DIRNAME") > /dev/null; then | |
echo "$(basename "${BASH_SOURCE[0]}") requires $REALPATH and $DIRNAME" | |
exit 1 | |
fi | |
SCRIPT_PATH="$($DIRNAME $($REALPATH -e "${BASH_SOURCE[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
#!/usr/bin/env bash | |
# wwg.sh | |
# a wrapper script for wg/wg-quick/systemctl wireguard operations | |
# https://gist.github.com/mmguero/53f4c9c04ac49c330800e463e4620808/edit | |
# The idea is you create your wireguard config file (eg, `wg0.conf`), | |
# then run `wwg.sh enc wg0.conf` to encrypt it. Then, you can use `wwg.sh up wg0.conf` | |
# which will temporarily decrypt the file, run `wg-quick up` for that interface with |
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
mkdir -p ~/.config/systemd/user/ | |
sudo loginctl enable-linger $USER | |
--------------------------------------- | |
~/.config/systemd/user/foobar.service | |
--------------------------------------- | |
[Unit] | |
AssertPathExists=/home/johndoe/foo | |
[Service] |
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
unless Vagrant.has_plugin?("vagrant-sshfs") | |
raise 'vagrant-sshfs plugin is not installed!' | |
end | |
unless Vagrant.has_plugin?("vagrant-reload") | |
raise 'vagrant-reload plugin is not installed!' | |
end | |
# hack: https://github.com/hashicorp/vagrant/issues/8878#issuecomment-345112810 | |
class VagrantPlugins::ProviderVirtualBox::Action::Network |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.define "vagrant-windows-10-preview" | |
config.vm.box = "StefanScherer/windows_10" | |
config.vm.communicator = "winrm" | |
# Admin username and password (see also WSL username/password setup in WSL_Debian_Setup.ps1) |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "macos/highsierra" | |
config.vm.guest = :freebsd | |
config.vm.communicator = "ssh" | |
# nfs doesn't currently work either |
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
# hack: https://github.com/hashicorp/vagrant/issues/8878#issuecomment-345112810 | |
class VagrantPlugins::ProviderVirtualBox::Action::Network | |
def dhcp_server_matches_config?(dhcp_server, config) | |
true | |
end | |
end | |
Vagrant.configure("2") do |config| | |
config.vm.box = "bento/ubuntu-21.04" |
OlderNewer