Skip to content

Instantly share code, notes, and snippets.

View ihidchaos's full-sized avatar

GuoYuchao ihidchaos

  • HooRii Technology Co., Ltd
  • China
  • 21:17 (UTC +08:00)
View GitHub Profile
@joulgs
joulgs / terminal.txt
Last active May 16, 2024 09:38
How install libssl1.1 on ubuntu 22.04
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
@bst27
bst27 / gitea-backup.sh
Created August 18, 2020 07:15
A Gitea backup script for Docker: It creates a .zip backup of Gitea running inside Docker and moves the backup file to the current working directory.
#!/bin/bash
# This script creates a .zip backup of gitea running inside docker and copies the backup file to the current working directory
echo "Creating gitea backup inside docker containter ..."
docker exec -u git -it -w /tmp $(docker ps -qf "name=gitea_server_1") bash -c '/app/gitea/gitea dump -c /data/gitea/conf/app.ini --file /tmp/gitea-dump.zip'
echo "Copying backup file from the container to the host machine ..."
docker cp $(docker ps -qf "name=gitea_server_1"):/tmp/gitea-dump.zip /tmp
@userid
userid / netlink1.c
Last active February 2, 2024 02:40
使用rtnetlink监听和判断网卡的状态变化
/**
http://guochongxin.github.io/c/c/c++/linux/netlink/rj45/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/%E7%BD%91%E5%8D%A1/2014/12/05/tong_guo_netlink_jian_ce_wang_xian_cha_ba
最近有个需求需要检测RJ45网卡的网线有没有接上,而最近正在了解Netlink相关资料,刚好也看下通过Netlink可以进行检测,故在此做下粗略笔记:
1.首先要创建一个Netlink Socket,在用户层使用如下参数来调用socket()函数:
fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
@BigNerd95
BigNerd95 / recv_fw.sh
Last active May 11, 2020 18:20
Fast update scripts for LEDE/OpenWRT
#!/bin/sh
# run this script on ROUTER
ipaddr=$1
# recv checksum
check=$(nc $ipaddr 1235)
echo "Received checksum: $check"
@braian87b
braian87b / image-builder-openwrt-lede.sh
Last active February 20, 2024 03:01
Image-Builder Procedure for OpenWRT - LEDE
# ------------------------------------------------------------------------
# Image-Builder Procedure for OpenWRT - LEDE (In this case using Debian x64 NetInstall virtual machine)
# ------------------------------------------------------------------------
su
apt-get update # Optional, make and upgrade too in case it has too many old pakackes.
apt-get install make aria2 screen ncftp -y
screen -
cd ~
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active February 10, 2024 09:16
Detect new network devices connecting to OpenWrt and send text message
@mjohnsullivan
mjohnsullivan / parse_json.go
Created December 14, 2015 23:17
Parse JSON objects with arbitrary key names in Go using interfaces and type assertions
// Parsing arbitrary JSON using interfaces in Go
// Demonstrates how to parse JSON with abritrary key names
// See https://blog.golang.org/json-and-go for more info on generic JSON parsing
package main
import (
"encoding/json"
"fmt"
)
@tongpu
tongpu / uci-guest-wifi.sh
Last active July 14, 2023 12:20
uci script for OpenWRT guest WiFi configuration
#!/bin/sh
uci batch << EOF
add network switch_vlan
set network.@switch_vlan[-1].device='switch0'
set network.@switch_vlan[-1].ports='1t 5t'
set network.@switch_vlan[-1].vlan='2'
set network.guest='interface'
set network.guest.type='bridge'
@ruzickap
ruzickap / openwrt_guest_wifi.sh
Created May 2, 2014 09:52
OpenWrt - Guest WiFi configuration
uci set network.wifi_open=interface
uci set network.wifi_open.type=bridge
uci set network.wifi_open.proto=static
uci set network.wifi_open.ipaddr=10.0.0.1
uci set network.wifi_open.netmask=255.255.255.0
uci add wireless wifi-iface
uci set wireless.@wifi-iface[-1].device=radio0
uci set wireless.@wifi-iface[-1].mode=ap
uci set wireless.@wifi-iface[-1].ssid=medlanky.xvx.cz