dhcp-script=/etc/detect_new_device.sh
Reference:
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 |
#!/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 |
/** | |
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); |
#!/bin/sh | |
# run this script on ROUTER | |
ipaddr=$1 | |
# recv checksum | |
check=$(nc $ipaddr 1235) | |
echo "Received checksum: $check" |
# ------------------------------------------------------------------------ | |
# 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 ~ |
dhcp-script=/etc/detect_new_device.sh
Reference:
// 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" | |
) |
#!/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' |
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 |