Skip to content

Instantly share code, notes, and snippets.

@extremecoders-re
extremecoders-re / qemu-networking.md
Last active May 4, 2024 05:55
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@mill1000
mill1000 / README.md
Last active April 22, 2024 07:24
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

@jchandra74
jchandra74 / PowerShell Customization.md
Last active June 3, 2024 21:32
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@ftk
ftk / win2lin.cpp
Last active February 3, 2019 14:52
Wrapper for windows subsystem for linux: run ubuntu applications from windows
// Wrapper for windows subsystem for linux (Bash on Ubuntu on Windows)
// It allows running native ubuntu applications from Windows
// 1. Compile (on windows, the command below is for mingw-gcc):
// g++ -O3 -flto -fwhole-program -fvisibility=hidden -fno-exceptions -fno-rtti -s win2lin.cpp -o win2lin.exe
// 2. make a copy for each program
// for i in git python perl; do cp win2lin.exe ${i}.exe; done
// 3. put directory with exes in windows PATH
// 4. example (from cmd.exe):
// cat "c:\test 1.txt"
// will be translated to: bash -c "exec cat \"/mnt/c/test 1.txt\""
@mikoim
mikoim / README.md
Last active May 21, 2024 13:21
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@x2c3z4
x2c3z4 / host-network-setup.sh
Created August 1, 2016 04:10 — forked from yousong/qemustart.sh
Run OpenWrt on QEMU virtual machines with LAN and WAN network.
#
# The following script will
# - Create Linux bridge $BR_WAN, $BR_LAN
# - Install IP addresses and basic routes
# - Enable proxy_arp on $BR_WAN
# - Enable ip_forward
# - Enable MASQUERADE on $IF_INET
# - $BR_LAN, $BR_WAN has to be allowed in ~/.usr/etc/qemu/bridge.conf
#
@chaosong
chaosong / home_env.lua
Created March 28, 2016 11:06
nodemcu read dht22 and pms5003
function initWIFI()
print("Setting up WIFI...")
wifi.setmode(wifi.STATION)
wifi.sta.config("<wifi-id>", "<wifi-password>")
wifi.sta.connect()
tmr.alarm(1, 1000, 1,
function()
if wifi.sta.getip()== nil then
print("IP unavailable, Waiting...")
@ramiabraham
ramiabraham / rom_suffix_codes.md
Last active April 27, 2024 13:28
Video game rom suffix codes (decoded)

Video game rom codes

You wouldn't download a car...


Primary rom codes

Probably what you're looking for

  • [a] Alternate (alternate version of the game, usually trying a different output method)
  • [p] Pirate
@doobeh
doobeh / app.py
Created September 19, 2014 18:59
Application showing how to use Flask-HTTPAuth easily from multiple files.
from flask import Flask
from authy import auth
def create_app():
app = Flask(__name__)
app.config['SECRET_KEY'] = 'hmm.'
from views import mod as exampleMod
app.register_blueprint(exampleMod)
@ceilfors
ceilfors / ssh-copy-id.py
Last active June 3, 2023 01:48
ssh-copy-id for Windows
"""ssh-copy-id for Windows.
Example usage: python ssh-copy-id.py ceilfors@my-remote-machine
This script is dependent on msysgit by default as it requires scp and ssh.
For convenience you can also try that comes http://bliker.github.io/cmder/.
"""
import argparse, os
from subprocess import call