Skip to content

Instantly share code, notes, and snippets.

View higebu's full-sized avatar
🏠
Working from home

Yuya Kusakabe higebu

🏠
Working from home
View GitHub Profile
@higebu
higebu / git-pull-hard
Last active March 12, 2024 11:44
git-pull-hard
#!/bin/bash
current_branch=$(git branch --show-current)
tracking_branch=$(git branch -vv | grep ${current_branch} | grep -oP '\[\K[^]]*(?=\])' | cut -d':' -f1)
if [ -z "$tracking_branch" ]; then
echo "No tracking branch found for ${current_branch}"
exit 1
fi
@higebu
higebu / install_nginx_on_debian.sh
Created March 5, 2024 23:54
Install Nginx on Debian
#!/bin/bash
codename=$(lsb_release -c -s)
sudo wget https://nginx.org/keys/nginx_signing.key -O /etc/apt/keyrings/nginx_signing.key
cat <<EOF | sudo tee /etc/apt/sources.list.d/nginx.list
deb [signed-by=/etc/apt/keyrings/nginx_signing.key] https://nginx.org/packages/debian/ $codename nginx
deb-src [signed-by=/etc/apt/keyrings/nginx_signing.key] https://nginx.org/packages/debian/ $codename nginx
EOF
sudo apt-get update
sudo apt-get install -y nginx
@higebu
higebu / vrf_on_github_actions.yml
Created February 13, 2024 01:07
VRF on GitHub Actions
name: use vrf
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
@higebu
higebu / setup_snmp_trap_monitoring_for_vcsa_with_zabbix.md
Last active December 22, 2023 09:28
Setup SNMP Trap monitoring for vCenter Server Appliance with Zabbix

Setup SNMP Trap monitoring for vCenter Server Appliance with Zabbix

Environment

  • VCSA 6.0
  • Zabbix 3.0
    • on Ubuntu 14.04

Zabbix Server side

@higebu
higebu / vyos_vm_on_lxd.md
Last active August 1, 2023 14:46
VyOS VM on LXD

Import vyos image

lxc image import --alias vyos {path to lxd image file}

Init vyos instance

lxc profile set default security.secureboot=false
@higebu
higebu / build_vyos_with_debian_sid.md
Last active July 31, 2023 23:47
WIP: Build VyOS with Debian sid
  1. git clone and checkout branch
git clone https://github.com/higebu/vyos-build.git
cd vyos-build
git checkout sid
  1. Run docker image
@higebu
higebu / cloud-init-config-for-github-runner.yml
Last active July 4, 2023 06:31
cloud-init config for GitHub-hosted runner on Ubuntu 20.04
package_update: true
package_upgrade: true
groups:
- docker
- lxd
users:
- default
- name: runner
gecos: GitHub-hosted runner User
groups: docker, lxd
@higebu
higebu / connect_with_specific_source_port.go
Created May 16, 2016 03:48
Golang: Connect with specific source port
package main
import (
"bufio"
"fmt"
"log"
"net"
)
func main() {
@higebu
higebu / ietf116_hackathon_gobgp_configuration.md
Last active April 10, 2023 06:49
IETF116 Hackathon GoBGP Configuration

OS

Ubuntu 22.04

cloud-init

#cloud-config
hostname: gobgp
manage_etc_hosts: True