Skip to content

Instantly share code, notes, and snippets.

View archerslaw's full-sized avatar
:octocat:
Focusing

Archers Law archerslaw

:octocat:
Focusing
View GitHub Profile
@archerslaw
archerslaw / curl-POST
Created January 4, 2018 06:32
curl POST
curl 169.254.169.254/openstack/latest/password -Method POST -Body "sluoxxxx"
@archerslaw
archerslaw / use the openvswitch tool to setup OVS network for KVM.
Created February 28, 2015 04:54
use the openvswitch tool to setup OVS network for KVM.
# yum install openvswitch -y
# systemctl start openvswitch.service | #service openvswitch start
# chkconfig openswitch on
# ovs-vsctl --help
Open vSwitch commands:
init initialize database, if not yet initialized
show print overview of database contents
emer-reset reset configuration to clean state
@archerslaw
archerslaw / use the bridge-utils tool to setup bridge network for KVM.
Last active May 18, 2016 15:59
use the bridge-utils tool to setup bridge network for KVM.
1.install the bridge-utils tool.
# yum install bridge-utils
2.check the brctl man help.
# brctl --help
Usage: brctl [commands]
commands:
addbr <bridge> add bridge
delbr <bridge> delete bridge
addif <bridge> <device> add interface to bridge
@archerslaw
archerslaw / a userfull modules(inspect) for python users.
Created October 8, 2014 07:50
a userfull modules(inspect) for python users.
###inspect - Get useful information from live Python objects.
This module can gives you the source code from the function name. It has several different functions which is very useful when you debug. Please check the details with help().
Example:
>>> import inspect
>>> import re
>>> a = inspect.getsource(re.split)
>>> print a
def split(pattern, string, maxsplit=0):
@archerslaw
archerslaw / solve the "no network with matching name 'default'" problem.
Last active March 7, 2023 06:01
solve the "no network with matching name 'default'" problem.
# virsh create rhel7.xml
error: Failed to create domain from rhel7.xml
error: Network not found: no network with matching name 'default'
# virsh net-list --all
Name State Autostart Persistent
----------------------------------------------------------
default active no yes
# virsh net-define /dev/stdin <<EOF
@archerslaw
archerslaw / pycharm installation and instructions.
Last active August 29, 2015 14:04
pycharm installation and instructions.
- Pycharm Community Edition FREE
http://www.jetbrains.com/pycharm/download/
- Installation Instructions:
Copy the pycharm-*.tar.gz to the desired installation location
(make sure you have rw permissions for that directory)
Unpack the pycharm-*.tar.gz using the following command:
tar xfz pycharm-*.tar.gz
@archerslaw
archerslaw / Install Sublime Text (a Text Editor) in RHEL_CentOS_Fedora and Debian_Ubuntu.
Created July 23, 2014 04:59
Install Sublime Text (a Text Editor) in RHEL_CentOS_Fedora and Debian_Ubuntu.
Sublime Text is a most popular, lightweight and smart cross-platform text and source code editor with a Python API, that available for Linux, Windows and Mac OS X. It is really an awesome application for programming and offers a wide range of file types to manage has it supports syntax highlighting for C, C++, C#, CSS, HTML, Java, JavaScript, PHP, Groovy, LaTeX and the list goes on.
- On 32-Bit Systems
# cd ~
# wget http://c758482.r82.cf2.rackcdn.com/Sublime\ Text\ 2.0.2.tar.bz2
# tar vxjf Sublime\ Text\ 2.0.2.tar.bz2
- On 64-Bit Systems
# cd ~
# wget http://c758482.r82.cf2.rackcdn.com/Sublime\ Text\ 2.0.2\ x64.tar.bz2
# tar vxjf Sublime\ Text\ 2.0.2\ x64.tar.bz2
@archerslaw
archerslaw / Using yum with a Proxy Server.
Last active August 29, 2015 14:04
Using yum with a Proxy Server.
1.Refer to the man page for yum.conf for information on HTTP settings that may be modified for compatibility with nonstandard web proxy servers.
2.Configuring Proxy Server Access
To enable all yum operations to use a proxy server, specify the proxy server details in /etc/yum.conf. The proxy setting must specify the proxy server as a complete URL, including the TCP port number. If your proxy server requires a username and password, specify these by adding proxy_username and proxy_password settings.
e.g.:http://squid.corp.redhat.com:3128
# vim /etc/yum.conf
# The proxy server - proxy server:port number
proxy=http://URL:PORT
# The account details for yum connections(optional)
proxy_username=YOUR-PROXY-USERNAME
proxy_password=YOUR-PROXY-PASSWORD
@archerslaw
archerslaw / modify the vimrc configure file.
Created July 3, 2014 06:08
modify the vimrc configure file.
# vim /etc/vimrc
...
" Don't wake up system with blinking cursor:
" http://www.linuxpowertop.org/known.php
let &guicursor = &guicursor . ",a:blinkon0"
filetype plugin indent on
autocmd FileType python setlocal et sta sw=4 sts=4
set tabstop=4
set shiftwidth=4
set softtabstop=4
@archerslaw
archerslaw / Do S3 S4 and resume it.
Last active August 29, 2015 14:02
Do ACPI (S3 S4) and resume it.
e.g.:...-global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0
I. How to do S3
Linux guest:
# pm-suspend
Windows guest :
Preparation: For do S3,install qxl driver:
Control panel--->Device manager--->Display Adapters-->update
a.win7,winXP,win2003: Click Start-->Turn Off computer-->choose Sleep
b.win2012 win8 win2008:Control panel-->Power Options-->Change what the power buttons do-->Power button settins-->select "Sleep"-->save changes