This file contains hidden or 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 machine | |
| import time | |
| # Define the chip select pin | |
| cs_pin = machine.Pin(17, machine.Pin.OUT) | |
| # Initialize SPI communication | |
| spi = machine.SPI(0, baudrate=1000000, polarity=0, phase=0) | |
| # Set the chip select pin high to disable the device |
This file contains hidden or 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 | |
| dev=wwan0 | |
| systemd_networkd_file=/etc/systemd/network/30-wwan0.network | |
| ready_status=$(mbimcli -d /dev/cdc-wdm0 -p --query-subscriber-ready-status) | |
| if [[ $ready_status == *"initialized"* ]]; then | |
| connect_state=$(mbimcli -d /dev/cdc-wdm0 -p --query-connection-state) |
This file contains hidden or 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 time | |
| import board | |
| import adafruit_sht4x | |
| import microcontroller | |
| import socketpool | |
| import wifi | |
| from adafruit_httpserver.mime_type import MIMEType | |
| from adafruit_httpserver.request import HTTPRequest |
This file contains hidden or 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
| # create folders if does not exist | |
| mkdir -p ~/.fonts | |
| mkdir -p ~/.config/fontconfig/ | |
| # download noto color emoji font from https://www.google.com/get/noto/#emoji-zsye-color | |
| # extract NotoColorEmoji.ttf file into ~/.fonts/ | |
| # create font config file | |
| cat << 'EOF' > ~/.config/fontconfig/fonts.conf | |
| <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd"> |
This file contains hidden or 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
| #Reference: https://www.smarthomebeginner.com/docker-home-media-server-2018-basic | |
| #Requirement: Set environmental variables: USERDIR, PUID, PGID, MYSQL_ROOT_PASSWORD, and TZ as explained in the reference. | |
| version: "2.4" | |
| services: | |
| ######### FRONTENDS ########## | |
| # Portainer - WebUI for Containers | |
| portainer: |
This file contains hidden or 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 | |
| # The MIT License (MIT) | |
| # Copyright (c) 2013 Alvin Abad | |
| if [ $# -eq 0 ]; then | |
| echo "Git wrapper script that can specify an ssh-key file | |
| Usage: | |
| git.sh -i ssh-key-file git-command | |
| " |
This file contains hidden or 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 | |
| $files = [ | |
| '2017/06/14/a.txt', | |
| '2017/06/14/b.txt', | |
| '2017/06/14/d.txt', | |
| '2017/06/14/d.txt', | |
| '2016/06/14/a.txt', | |
| '2016/06/14/b.txt', | |
| '2016/06/14/d.txt', | |
| '2016/06/14/d.txt', |
This file contains hidden or 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
| package main | |
| import ( | |
| git "github.com/libgit2/git2go" | |
| "log" | |
| ) | |
| func credentialsCallback(url string, username string, allowedTypes git.CredType) (git.ErrorCode, *git.Cred) { | |
| ret, cred := git.NewCredSshKey("git", "/home/vagrant/.ssh/id_rsa.pub", "/home/vagrant/.ssh/id_rsa", "") | |
| return git.ErrorCode(ret), &cred |
This file contains hidden or 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 = "precise64" | |
| config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
| src_dir = './' | |
| doc_root = '/vagrant_data/webroot' | |
| app_name = File.basename(File.dirname(__FILE__)) | |
| config.vm.network :forwarded_port, guest: 80, host: 8080 |
This file contains hidden or 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
| apt-get update | |
| apt-get install -q -y python-software-properties | |
| add-apt-repository ppa:ondrej/php5 | |
| add-apt-repository ppa:chris-lea/node.js | |
| apt-get install -q -y php5 php5-fpm php5-mssql php5-gd php5-imagick php5-mysql php5-curl php5-cli php5-pgsql | |
| apt-get remove -q -y apache2 | |
| apt-get install -q -y nginx mysql-server git curl nodejs | |
| curl -sS https://getcomposer.org/installer | php | |
| mv composer.phar /usr/local/bin/composer |