Skip to content

Instantly share code, notes, and snippets.

View houming818's full-sized avatar

houming818 houming818

View GitHub Profile
@houming818
houming818 / vimrc
Created June 16, 2022 10:25
vimrc老版本
"""""""""""""""""""""""""""""""""
" BEGIN OF VIMRC "
" Author : houming818 "
" Email : [email protected] "
" Version: 1.0 "
"""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""
" INIT "
" 初始化 "
lxc-start dev-01_aodh_container-759dcdae 20201127093610.435 INFO network - network.c:instantiate_veth:143 - Retrieved mtu 1500
lxc-start dev-01_aodh_container-759dcdae 20201127093610.437 ERROR utils - utils.c:run_command_internal:1648 - Failed to exec command
lxc-start dev-01_aodh_container-759dcdae 20201127093610.437 ERROR network - network.c:lxc_ovs_attach_bridge:2008 - Failed to attach "br-mgmt" to openvswitch bridge "75$
dcdae_ens33": lxc-start: dev-01_aodh_container-759dcdae: utils.c: run_command_internal: 1648 Failed to exec command
lxc-start dev-01_aodh_container-759dcdae 20201127093610.437 ERROR network - network.c:instantiate_veth:173 - Operation not permitted - Failed to attach "759dcdae_ens33$
to bridge "br-mgmt"
lxc-start dev-01_aodh_container-759dcdae 20201127093610.465 ERROR network - network.c:lxc_create_network_priv:2577 - Failed to create network device
lxc-start dev-01_aodh_container-759dcdae 20201127093610.465 ERROR start - start.c:lxc_spawn:1682 - Failed to create the n
root@pc01 /root$iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:bootps
ACCEPT tcp -- anywhere anywhere tcp dpt:bootps
Chain FORWARD (policy ACCEPT)
target prot opt source destination
@houming818
houming818 / nginx-websocket-proxy.conf
Created November 15, 2017 07:15 — forked from uorat/nginx-websocket-proxy.conf
Nginx Reverse Proxy for WebSocket
upstream websocket {
server localhost:3000;
}
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/websocket.access.log main;
@houming818
houming818 / $HOME\.ssh\config
Last active November 15, 2017 06:16
由$HOME/.ssh/config配置,优化github.com下git协议的可靠性.简称:git翻墙
Host github.com
Hostname ssh.github.com
Port 443
@houming818
houming818 / dbrouter.py
Created September 30, 2017 05:53
DBRouter class for django
class DBRouter(object):
"""
A router to control all database operations on models in the auth application.
"""
def db_for_read(self, model, **hints):
"""
Attempts to read auth models go to auth_db.
"""
if model._meta.app_label in settings.DATABASES.keys():
return model._meta.app_label
@houming818
houming818 / file_pipe_socket.py
Last active September 30, 2017 08:02
pipe a file to a tcp socket and send to other host.
def __runner(server_id, host, port, filename):
LOGGER.debug('start %s', os.getpid())
LOGGER.debug('start ppid %s', os.getppid())
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(1.0)
server_address = (host, port)
try:
sock.connect(server_address)
except socket.error as err:
return {'retcode': err.errno, 'stdout': '', 'stderr': str(err)}
@houming818
houming818 / gist:36269351bb41cc6e477e1c54faffaed1
Created September 8, 2017 09:06
[example][tutorial] openresty insert data into MySQL with MySQL connection pool.
lua_package_path '/usr/local/openresty/lualib/?.lua;;';
lua_package_cpath '/usr/local/openresety/lualib/?.so;;';
server {
listen 7020;
access_log logs/tredis.access.log main;
lua_need_request_body on;
@houming818
houming818 / summary.md
Last active September 6, 2017 13:49
summary for the inodes out of usage.

this is the xfs_info out_put:

[root@localhost home]# xfs_info /home
meta-data=/dev/mapper/centos-home isize=256    agcount=4, agsize=28938752 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=115755008, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal               bsize=4096   blocks=56521, version=2
@houming818
houming818 / ddns.sh
Last active March 20, 2019 11:36
auto update the public IP for the record in dnspod. 自动更新dnspod解析记录的脚本
#!/bin/sh
# HOST STATUS
hostname=""
public_ip=""
# RECORD STATUS
code=""
value=""
message=""