Skip to content

Instantly share code, notes, and snippets.

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

@ducbang
ducbang / ip.sh
Created November 17, 2022 03:19 — forked from 844196/ip.sh
#!/bin/bash
inc=$(ifconfig | awk -F':' '!/^lo/ && /^[a-z]/{print $1}')
for i in ${inc[*]}
do
ifconfig "${i}" 2>/dev/null | awk '$1=="inet"{print "⎆ "$2}'
done
@ducbang
ducbang / lemp.sh
Created November 17, 2022 00:14 — forked from saranemohan/lemp.sh
sudo apt-get update
sudo apt-get install nginx
sudo nginx -t
sudo systemctl restart nginx
sudo apt-get install mysql-server
@ducbang
ducbang / name-cheap-dynamic-dns.sh
Created November 16, 2022 11:30 — forked from Goddard/name-cheap-dynamic-dns.sh
auto update ip script for dynamic dns
curl -i -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET https://dynamicdns.park-your-domain.com/update?host=@&domain=[domain]&password=[update-password]&ip=[local-ip]
@ducbang
ducbang / BR over iSCSI.txt
Created October 28, 2022 02:34 — forked from dnguy030/BR over iSCSI.txt
Blu-ray over iSCSI
sudo apt install lsscsi
sudo apt install tgt
#If UFW is enabled then allow inbound TCP 3260 traffic
lsscsi -g
sudo vi /etc/tgt/conf.d/bluray.conf
#Here is a sample of how my file looks like
@ducbang
ducbang / KMS Client Setup Keys.txt
Created October 28, 2022 02:33 — forked from dnguy030/KMS Client Setup Keys.txt
KMS Client Setup Keys
KMS Client Setup Keys
https://docs.microsoft.com/en-us/windows-server/get-started/kmsclientkeys
Windows Server Semi-Annual Channel versions
Windows Server, version 1809
Windows Server Datacenter 6NMRW-2C8FM-D24W7-TQWMY-CWH2D
Windows Server Standard N2KJX-J94YW-TQVFB-DG9YT-724CC
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x
##########################################
# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
sudo apt-get update
sudo apt-get install -y apt-transport-https
fi
@ducbang
ducbang / code.js
Created October 25, 2022 04:02 — forked from tiptopcoder/code.js
Đánh giá môn học - Dùng cho portal của HCMUS - ĐH KHTN TP.HCM
/**
* [...]
* This script is not optimized. It's to kind to tell me if you have any better ideas.
* Script van chua hoan thien. Toi rat cam on neu ban co the cho toi cac y tuong khac
*
* @author Hong Trang D. Nguyen
* @version 1.00
* @since 01/01/2016
* @credits Quy Hoa L. Huynh, Ngoc Tien Nhan
*
@ducbang
ducbang / dynv6.sh
Created October 23, 2022 09:05 — forked from corny/dynv6.sh
Update script for dynv6.com to set your IPv4 address and IPv6 prefix
#!/bin/sh -e
hostname=$1
device=$2
file=$HOME/.dynv6.addr6
[ -e $file ] && old=`cat $file`
if [ -z "$hostname" -o -z "$token" ]; then
echo "Usage: token=<your-authentication-token> [netmask=64] $0 your-name.dynv6.net [device]"
exit 1
fi