Skip to content

Instantly share code, notes, and snippets.

View supersonictw's full-sized avatar
🦋

不知火 Shiranui supersonictw

🦋
View GitHub Profile
@hakerdefo
hakerdefo / sources.list
Created June 11, 2023 18:47
Debian 12 "bookworm" complete sources.list
deb https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware
@paolorechia
paolorechia / example_run.txt
Last active February 27, 2024 01:40
Vicuna Prompt Fetch Chuck Norris Joke
> Entering new AgentExecutor chain...
I should use the requests library to fetch the website's HTML
Action: Python REPL
Action Input:
response = requests.get('https://api.chucknorris.io/')
Observation: name 'requests' is not defined
Thought:I should import the requests library
Action: Python REPL
Action Input:
@ErnyTech
ErnyTech / qemu
Last active April 3, 2024 05:40
Qemu hook for Intel GVT-g
#!/bin/sh
GVT_DRIVER=i915
GVT_PCI=0000:00:02.0
function create_gpu {
local GVT_GUID="$1"
local MDEV_TYPE="$2"
pkexec sh -c "echo $GVT_GUID > /sys/bus/pci/drivers/$GVT_DRIVER/$GVT_PCI/mdev_supported_types/$MDEV_TYPE/create"
}
@cgmb
cgmb / debian-rocm-build.sh
Created November 28, 2021 21:46
Debian ROCm build script
#!/usr/bin/env bash
set -exuo pipefail
apt-get -qq update
apt-get -qq upgrade
apt-get -qq install build-essential cmake wget
DEB_WORKSPACE=$HOME # where to download and build the sources
DEB_HIP_ARCHITECTURES='gfx906:xnack-' # https://llvm.org/docs/AMDGPUUsage.html
@nephest
nephest / kvm-gpu-passthrough-on-debian-buster.md
Last active March 20, 2024 15:09
Setting up KVM with GPU passthrough in Debian Buster

Here's how to set up a Windows 10 virtual machine in KVM with PCI passthrough. The VM will have access to an NVIDIA graphics card while the host machine (running Debian Buster) uses Intel integrated graphics. This is mostly for my own reference so I don't forget how I did it.

Hardware

  • Intel i5 (an old one) with integrated graphics: this will be used as the graphics card for the host machine running Debian Buster
  • NVIDIA Geforce 1070: this will be used as the graphics card for the Windows 10 VM

Step 1: Enable IOMMU

In order to do hardware passthrough with KVM at all, you need to enable the Intel Vt-d virtualization extensions. Edit /etc/default/grub and edit the GRUB_CMDLINE_LINUX_DEFAULT line so that it reads like:

@unixfox
unixfox / howto.md
Last active April 24, 2024 15:01
Install Alpine Linux on Oracle Cloud ARM VPS with Ubuntu pre-installed
@azagniotov
azagniotov / beautiful.rest.api.docs.in.markdown.md
Last active May 13, 2024 04:40
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.
@iskolbin
iskolbin / tmate_for_ssh.md
Last active January 15, 2024 13:30
Ubuntu(systemd) tmate service for ssh

The motivation is: ssh to remote computer without port forwading, dynamic DNS and so on, the only thing needed is that the remote is connected to the Internet.

  1. On remote get tmate, put it in /usr/local/bin (apt version as of 18.04LTS is too old):
curl -L https://github.com/tmate-io/tmate/releases/download/2.4.0/tmate-2.4.0-static-linux-amd64.tar.xz|tar xJv
sudo mv tmate-2.4.0-static-linux-amd/tmate /usr/local/bin
  1. Put public keys in ~/.ssh/authorized_keys
@mwufi
mwufi / install_docker_in_colab.sh
Last active May 16, 2024 12:07
Install Docker in Google Colab!
# First let's update all the packages to the latest ones with the following command
sudo apt update -qq
# Now we want to install some prerequisite packages which will let us use HTTPS over apt
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq
# After that we will add the GPG key for the official Docker repository to the system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# We will add the Docker repository to our APT sources