Skip to content

Instantly share code, notes, and snippets.

View highgain86j's full-sized avatar

Tahiro Hashizume highgain86j

View GitHub Profile
@brandonros
brandonros / stm32f407g-disc1-dfu-mode.md
Last active August 28, 2024 17:30
STM32F407G-DISC1/STM32F4DISCOVERY DFU mode
  1. Take every jumper off except JP1. Take both jumpers off CN3. Take the jumpers JP2 and JP3 off from the bottom of the board.
  2. Put a jumper between BOOT0 and VDD.
  3. Connect with a wire PA9 to 5V.
  4. Connect the device using the micro USB port, not the mini-USB port.
  5. sudo dfu-util -d 0483:df11 -a 0 -s 0x08000000 -D build/Example_Project.bin
  6. Unplug the device.
  7. Disconnect the BOOT0 jumper.
  8. Plug the device in.
@basamoahjnr
basamoahjnr / pjsip_wizard.conf
Last active June 3, 2023 12:05
sample pjsip_wizard configuration file
[user_defaults](!)
type = wizard
transport = transport-ipv4
accepts_registrations = yes
sends_registrations = no
accepts_auth = yes
sends_auth = no
has_hint = yes
hint_context = internal
endpoint/context = internal
@liamr
liamr / autovst.py
Last active July 2, 2021 10:16
.aupreset to .fxp.
/*
From: https://forum.juce.com/t/script-to-convert-aupreset-to-fxp/7919
Author: https://forum.juce.com/u/yairadix
I made a small Python script to convert .aupreset files to .fxp format (VST presets).
Hopefully others may find it useful too.
Our use case for it was creating our factory presets for SurferEQ once in Logic and then converting them to other formats.
This script could be easily adapted to convert the other way around. (it uses the Construct library to describe the fxb format declaratively for both parsing and building)
*/
@probonopd
probonopd / CX300.md
Last active October 21, 2022 21:44
Polycom CX300 Linux HID

Polycom CX300 under Linux

The Polycom CX300 and similar Plantronics Calisto 540 (P540-M), snom UC600 are originally optimized for Microsoft Lync (Skype for Business) for Windows and Mac but can also be used with Linux. It shows up as a USB audio playback and recording device (this part works immediately out of the box) plus some USB HID (this needs to be made work; see below).

polycom

Questions

Please use the comments function below if you know the answer to any of the questions

@mill1000
mill1000 / README.md
Last active July 5, 2024 08:18
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43

Prerequisites

const byte adcPin = 0; // A0
const int MAX_RESULTS = 256;
volatile int results [MAX_RESULTS];
volatile int resultNumber;
// ADC complete ISR
ISR (ADC_vect)
{
if (resultNumber >= MAX_RESULTS)
ADCSRA = 0; // turn off ADC
@koniu
koniu / icetest
Last active March 11, 2018 16:36
icecast test script
#!/bin/bash
#
# run concurrent curls which download from URL to /dev/null. output total
# and average counts to results directory.
#
# url to request from
URL="$1"
# max concurrent curls to kick off
conn="$2"
@foosel
foosel / README.md
Last active January 12, 2023 16:25
Getting the fingerprint reader of a Thinkpad x240 to work under Ubuntu 14.04

lsusb lists the fingerprint reader in the x240 as follows:

Bus 002 Device 003: ID 138a:0017 Validity Sensors, Inc.

There exists experimental driver support for this in a fork of libfprint for vfs5011 sensors, however you'll need to compile the driver yourself. To get the fingerprint sensor to work for lightdm login, su etc, follow these steps.

  1. Install fingerprint-gui:

    sudo add-apt-repository ppa:fingerprint/fingerprint-gui
    
@CLCL
CLCL / CentOS6-L2TP-IPsec.md
Last active September 26, 2022 18:21
L2TP/IPsec(AndroidやiPhoneからのVPN接続)を経路を用意すべくVPSにL2TP/IPsecサーバを設置するとき、ネットにある情報だとなかなかつながらないから、標準環境としてAWSのCentOS 6.3 x86_64 Release Media(ami-3fe8603e)の起動直後から最短距離で設定する方法をまとめた。

CentOS 6でとにかくL2TP/IPsecサーバ

  • AWSでEC2のインスタンスを借りる
  • 今回は東京リージョンのCentOS 6.3 x86_64 Release MediaのAIM(ami-3fe8603e)でインスタンスを建てる
  • Security Group: L2TP/IPsec(Inbound 22/TCP: SSH, 500/UDP: ISAKMP, 1701/UDP: L2TP, 4500/UDP: IPSec NAT Traversal)を許可
  • ec2-54-249-173-214.ap-northeast-1.compute.amazonaws.com(グローバルIPアドレス:54.249.173.214)にrootでログイン

SELinuxを無効にする

[root@ip-10-132-164-105 ~]# setenforce 0
@dbader
dbader / fontdemo.py
Last active September 18, 2024 17:20
For my Raspberry Pi internet radio project I needed a way to render text suitable for a low resolution monochrome LCD. This article describes how to render 1-bit text using FreeType and Python. See http://dbader.org/blog/monochrome-font-rendering-with-freetype-and-python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Needs freetype-py>=1.0
# For more info see:
# http://dbader.org/blog/monochrome-font-rendering-with-freetype-and-python
# The MIT License (MIT)
#
# Copyright (c) 2013 Daniel Bader (http://dbader.org)