Skip to content

Instantly share code, notes, and snippets.

@stupidloud
stupidloud / tus可恢复上传协议.md
Last active March 22, 2025 10:38
tus 可恢复上传协议
@stupidloud
stupidloud / install.sh
Last active June 27, 2023 02:50 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off mitigations=off /g' /etc/default/grub
update-grub; update-grub2
echo "blacklist virtio_balloon" | tee /etc/modprobe.d/blacklist.conf && update-initramfs -u
sed -i '/i915/d' /etc/modprobe.d/blacklist-hetzner.conf || true
sed -i 's/nomodeset//' /etc/default/grub /etc/default/grub.d/hetzner.cfg || true
grub2-mkconfig -o /boot/grub2/grub.cfg
#update-grub
@stupidloud
stupidloud / upload-github-release-asset.sh
Last active March 1, 2021 02:41 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
@stupidloud
stupidloud / vim with ariline.md
Last active October 30, 2022 06:12
debian/ubunt/raspbian(raspberry pi) install powerline/vim-airline

Install packages

apt update && apt install powerline powerline-gitstatus vim-airline vim-airline-themes vim-fugitive

bash configuration

add these lines to the bottom of /etc/bash.bashrc

if [ -f /usr/share/powerline/bindings/bash/powerline.sh ]; then
  powerline-daemon -q
  POWERLINE_BASH_CONTINUATION=1
@stupidloud
stupidloud / set_firewall_rule.sh
Last active November 23, 2019 09:59
openwrt路由器访问光猫设置
MODEMIP=192.168.1.1 #光猫ip
MODEM_NET=`echo $MODEMIP | cut -d "." -f 1-3`
ROUTER_WAN_PORT_IP=192.168.1.100 #openwrt的ip地址
WAN_PORT=eth1 #修改为你自己的
ifconfig $WAN_PORT $ROUTER_WAN_PORT_IP netmask 255.255.255.0 broadcast $MODEM_NET.255
iptables -A forwarding_rule -d $MODEMIP -j ACCEPT
iptables -t nat -A postrouting_rule -d $MODEMIP -o $WAN_PORT -j MASQUERADE