Skip to content

Instantly share code, notes, and snippets.

View alazyer's full-sized avatar

Yuliang Zhang alazyer

  • Nanjing
View GitHub Profile
@alazyer
alazyer / shallow_update_git.md
Created June 15, 2022 01:37 — forked from gobinathm/shallow_update_git.md
Fix for Remote rejected shallow update not allowed after changing Git remote URL

Some Time there is a shallow update not allowed issue in your cloned GIT repo.

This means that you have to unshallow your repository. To do so you will need to add your old remote again.

git remote add origin <path-to-old-remote> After that we use git fetch to fetch the remaining history from the old remote (as suggested in this answer).

git fetch --unshallow origin And now you should be able to push into your new remote repository.

@alazyer
alazyer / filebeat.yml
Last active July 23, 2021 05:53
filebeat
‎‎​
#!/bin/sh
# https://github.com/bigswitch/deployment-support/blob/master/openstack/clean-devices.sh
set -e
for qvb in `ifconfig -a | grep qvb | cut -d' ' -f1`
do
`sudo ip link set $qvb down`
`sudo ip link delete $qvb`

Python Socket 编程详细介绍

Python 提供了两个基本的 socket 模块:

  • Socket 它提供了标准的BSD Socket API。
  • SocketServer 它提供了服务器重心,可以简化网络服务器的开发。

下面讲解下 Socket模块功能。

Socket 类型

@alazyer
alazyer / cloud_router_vnfd.yaml
Created June 26, 2017 09:32 — forked from Ladas/cloud_router_vnfd.yaml
Working NSD and VNFD
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: OPNFV-Demo-flavor
# NOT USED
#imports:
# - tacker_nfv_defs.yaml
# - tacker_defs.yaml
metadata:
安装完win7后,再安装Ubuntu默认启动项则成了ubuntu,要想改成默认启动win7的话需要对ubuntu中配置文件进行修改。
sudo gedit /boot/grub/grub.cfg
将 set default="0" 改为 set default="4"即可。
原来的0表示开机的时候选择的是第一个启动项,即Ubuntu,
改为4后就是我们想要的win7了。中间还有三个分别是
advanced option for Ubuntu,
Memory test (memtest86+)
1. create a mysite.conf file in the /etc/apache2/sites-available directory. Fill it with
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
# configure the wsgi script
WSGIScriptAlias / wsgi.py
WSGIPythonHome virtualenv dir
WSGIPythonPath project_root: site-packages_dir_in_the_virtualenv
<VirtualHost *:8000>
To get the version info of the Apache installed on my ubuntu,
open a terminal and type:
1. apache2 -v
or
2. /usr/sbin/apache2 -v
#!/usr/bin/env python
"""
"""
import random
import igraph
from numpy import mean, nan_to_num, nan
from pprint import pprint
import nose
import logging
logging.basicConfig(level=logging.DEBUG)
# The YUM package is too old for use with ruby-sqlite3, use the autoconf package from www.sqlite.org
cd /opt
wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
tar xvzf sqlite-autoconf-3070701.tar.gz
ln -s /opt/sqlite-autoconf-3070701 /opt/sqlite3
cd /opt/sqlite3
./configure --prefix=/opt/sqlite3
make
make install