Skip to content

Instantly share code, notes, and snippets.

@ppkliu
ppkliu / tds3034.py
Created Sep 6, 2021 — forked from hypoxic/tds3034.py
Code used to capture a waveform from the Tek TDS3000 series and send it to python
View tds3034.py
# Hypoxic Capture via TDS 3034B
# Requires pyvisa and NI-VISA, not tested much, but figured I'd share as it would be helpful for others
import pyvisa
import numpy as np
import time as time
class Tek:
def __init__(self, source = "CH1"):
self.timeout = 5.0
@ppkliu
ppkliu / scpi_tcp.py
Created May 22, 2021 — forked from pklaus/scpi_tcp.py
Python script to send commands to a Rigol scope (or any LXI/SCPI instrument) from first principles.
View scpi_tcp.py
#!/usr/bin/env python
"""
Zeroconf Discovery for Rigol DS1000Z-series scopes
--------------------------------------------------
Documentation worth looking at:
* http://lxistandard.org/Documents/Specifications/LXI%20Device%20Specification%202011%20rev%201.4.pdf
* http://lxistandard.org/GuidesForUsingLXI/Introducing%20LXI%20To%20Your%20Network%20Administrator%20May%2024_2013.pdf
* http://lxistandard.org/GuidesForUsingLXI/LXI_Getting_Started_Guide_May_1_2013.pdf
@ppkliu
ppkliu / docker-compose-backup.sh
Created Jan 28, 2021 — forked from pirate/docker-compose-backup.sh
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
View docker-compose-backup.sh
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
@ppkliu
ppkliu / fetch_stocks_price.py
Created Mar 4, 2017 — forked from dolphinsue319/fetch_stocks_price.py
Fetch Taiwan OTC stocks price.
View fetch_stocks_price.py
# coding=utf-8
import StringIO
import csv
import requests
from bs4 import BeautifulSoup
import time
import random
from Models import *