Skip to content

Instantly share code, notes, and snippets.

@0x0177b11f
0x0177b11f / git-detach.sh
Created September 7, 2018 04:22
git-detach
#!/bin/bash
git checkout --orphan temp $1
git commit -m "history start point"
git rebase --onto temp $1 master
git branch -D temp
@0x0177b11f
0x0177b11f / .bashrc
Last active July 30, 2022 22:52
my bashrc file
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
set -g default-terminal "screen-256color"
# https://superuser.com/questions/585007/tmux-configure-length-of-titles
set -g window-status-format '#I:#(pwd="#{pane_current_path}"; echo ${pwd####*/})#F'
set -g window-status-current-format '#I:#(pwd="#{pane_current_path}"; echo ${pwd####*/})#F'
@0x0177b11f
0x0177b11f / libvirt-atomic.xml
Last active February 22, 2018 13:23
libvirt-atomic.xml
<domain type='kvm'>
<name>atomic</name>
<uuid>f507aed5-0bb1-4893-8c48-5a7dac1e1a3c</uuid>
<memory unit='MiB'>2048</memory>
<currentMemory unit='MiB'>2048</currentMemory>
<vcpu>4</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
#!/usr/bin/bash
# Fedora is /usr/bin/bash
# Ubuntu use /bin/bash
MAIN_DEVICE=enp6s0
MAIN_CONNECTION=enp6s0
nmcli con add ifname br0 type bridge con-name hostbr0
nmcli con add type bridge-slave ifname ${MAIN_DEVICE} master hostbr0 con-name br-slave
# tcp bbr
net.core.default_qdisc=fq_codel
net.ipv4.tcp_congestion_control=bbr
# swap
vm.swappiness=10
# forward
net.ipv4.ip_forward=1
net.ipv6.conf.default.forwarding=1