Skip to content

Instantly share code, notes, and snippets.

@hlx98007
hlx98007 / iplookup
Created December 20, 2019 19:27
一个可以在command line下查看归属地的工具,支持域名/IPv4/IPv6
#!/bin/bash
function valid_ipv6()
{
local regex='^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$'
local var="$1"
if [[ $var =~ $regex ]]; then
echo 0
else
echo 1
@hlx98007
hlx98007 / he-ipv6.service
Last active December 8, 2016 00:56
Hurricane Electric TunnelBroker systemd unit file
[Unit]
Description=Activate IPv6
After=network-online.target
[Service]
Type=oneshot
ExecStart=/bin/sh /root/ipv6.sh
ExecStartPost=/usr/sbin/ping6 -c1 ipv6.google.com
[Install]
@hlx98007
hlx98007 / vpnc-script
Created April 21, 2016 12:07
vpnc-script
#!/bin/sh
#
# Originally part of vpnc source code:
# © 2005-2012 Maurice Massar, Jörg Mayer, Antonio Borneo et al.
# © 2009-2012 David Woodhouse <dwmw2@infradead.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
---
driver:
name: opennebula
opennebula_endpoint: http://10.236.31.240/zone
oneauth_file: /tmp/auth
template_name: CHEF-TESTVM
vm_hostname: chef-testvm-001
public_key_path: /root/.ssh/id_rsa.pub
username: local
memory: 4096