Skip to content

Instantly share code, notes, and snippets.

View wiless's full-sized avatar
💭
I may be slow to respond.

wireless wiless

💭
I may be slow to respond.
View GitHub Profile
@wiless
wiless / quickplot.py
Last active March 9, 2020 04:38
Short reference file for plotting
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
#
# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)
#t=[0,1,2,4] # Note always have ","
@wiless
wiless / iperfgo.go
Created September 29, 2019 17:53
iperf async cmd stream
package main
import (
"fmt"
"os"
"strings"
"time"
"github.com/go-cmd/cmd"
)
package main
import (
"bufio"
"fmt"
"os"
"os/exec"
"strings"
)
{
"schema": {
"text": {
"type": "string",
"title": "Enter some text"
}
},
"form": [
{
"key": "text",
@wiless
wiless / dbusnetwatch.go
Created June 18, 2015 20:31
Monitor for change of SSID/Connection
package main
import (
"fmt"
"os"
"github.com/godbus/dbus"
)
// dbus-monitor --system "type='signal',sender='org.freedesktop.NetworkManager',interface='org.freedesktop.NetworkManager'"
@wiless
wiless / setupgolang.sh
Last active February 28, 2017 17:30
A script to setup environment go 1.8
#!/bin/sh
mkdir ~/Downloads
cd ~/Downloads
wget https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
sudo tar xvf ~/Downlods/go1.8.linux-amd64.tar.gz /opt/
@wiless
wiless / rpi2-arch-linux-to-sdcard.sh
Created August 25, 2016 20:06 — forked from pklaus/rpi2-arch-linux-to-sdcard.sh
Raspberry Pi 2: Arch Linux ARM to SDcard Script. This is for the Rapsberry Pi 2. For the RPi 1, see https://gist.github.com/pklaus/b92dfc72136d1509c2ed for RPi 1
#!/bin/bash
# <http://archlinuxarm.org/platforms/armv7/broadcom/raspberry-pi-2>
echo -e "\n\nArch Linux ARM to SD Card\n"
echo -e "for the Raspberry Pi 2\n\n"
echo -e "\nAll drives on this computer:\n"
ls -1 /dev/sd?
@wiless
wiless / rpi-arch-linux-to-sdcard.sh
Created August 25, 2016 20:06 — forked from pklaus/rpi-arch-linux-to-sdcard.sh
for the Raspberry Pi (1!): Arch Linux ARM to SD Card Script; See https://gist.github.com/pklaus/9dd4a7bf040788cda501 for RPi 2
#!/bin/bash
# <http://archlinuxarm.org/platforms/armv6/raspberry-pi>
echo -e "\n\nArch Linux ARM for Raspberry Pi to SD Card\n"
echo -e "Not meant for the Raspberry Pi 2 - \n"
echo -e " Check https://gist.github.com/pklaus/9dd4a7bf040788cda501 instead.\n\n"
echo -e "\nAll drives on this computer:\n"
ls -1 /dev/sd?
@wiless
wiless / reflectexample.go
Created June 29, 2014 09:04
Example of using reflect package in golang
package main
import (
"fmt"
"reflect"
)
func main() {
var nano car = car{5}
var donkey animal
@wiless
wiless / index.html
Created March 25, 2016 17:51
Simplest CSV plotter using c3js library
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Output Plot</title>
</head>
<body>
<h1>Tutorial <h1>
<h2> Plot of the CSV data stored in <b>output.csv</b> </h2>