Skip to content

Instantly share code, notes, and snippets.

View shalk's full-sized avatar
🎯
Focusing

shalk(xiao kun) shalk

🎯
Focusing
View GitHub Profile
# http://www.yzhang.net/blog/2013-03-07-pptp-vpn-ec2.html
# Run this in a root bash environment
#
# modify the <password>
yum -y update
wget http://poptop.sourceforge.net/yum/stable/rhel6/x86_64/pptpd-1.4.0-1.el6.x86_64.rpm
yum -y localinstall pptpd-1.4.0-1.el6.x86_64.rpm
echo localip 192.168.9.1 >> /etc/pptpd.conf
@shalk
shalk / gist:202d0862d7d3e0d884d8
Created October 10, 2014 03:30
expect example
#!/bin/bash
Ip='192.168.1.6' # 循环就行
RemoteUser='user' # 普通用户
RemotePasswd='userpasswd' # 普通用户的密码
RemoteRootPasswd='rootpasswd'
/usr/bin/expect -c "
set timeout -1
spawn ssh -t -p $Port -o StrictHostKeyChecking=no $RemoteUser@$Ip
expect {
password {
@shalk
shalk / gist:37a6564213a17ac89391
Created September 26, 2014 09:31
suse11sp3 to vcell
#!/bin/bash
# This script make suse11sp3 to vcell0901 + snapshot-bugfix
# shalk 2014-09-26
unzip -f vcell-extra.zip
unzip -f snapshot-bugfix.zip
cd extra
echo "install sugon extra rpm"
@shalk
shalk / susepxe
Last active August 29, 2015 14:04
安装好一台suse11SP2,将iso,autoinst.xml 和susepxe.sh 上传到/root目录,修改脚本中开头的参数,再sh susepxe.sh 就建立PXE服务器,可以批量安装SUSE
#!/bin/bash
# prepare:
# a server installed suse 11 sp2
# ISO of suse
# autoinst.xml
# this script
# usage:
# modify this script's line between 18 ~ 26
# make this parameter correct
# description:
@shalk
shalk / gist:55910d90435bb6be74f1
Last active August 29, 2015 14:03
suse 11 sp3 安装 Fabric
python -V
if [ $? != 0 ] ; then
echo "python not installed"
fi
#
rpm -ivh python-devel-2.6.0-8.12.2.x86_64.rpm
fail(){
@shalk
shalk / gist:ed102f8d5c393f693d1c
Created June 13, 2014 08:20
redhat 6 serial use centos‘s yum repo redhat6系列使用centos的yum 源,卸载自带的yum软件即可
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
rpm -qa | grep yum | xargs rpm -e --nodeps
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
@shalk
shalk / gist:0a80a273502816e44598
Created May 29, 2014 03:13
config no password for cluster 集群无密码访问
#!/usr/bin/env perl
use strict;
#use lib './nopass/lib/perl5/';
#use Smart::Comments;
use Expect;
use Getopt::Long;
my $username = "root";
[root@localhost ~]# cat 1.pl
#!/usr/bin/env perl
use 5.010;
use strict;
use Expect;
#use Smart::Comments;
my $cmd = "perl simulate.pl";
my $timeout = 30;
my $qa = {
@shalk
shalk / gist:8e6d5c30244b21a95814
Created May 15, 2014 06:30
perl 使用expect 模块, 问答都放在hash中,类似的修改问答和 命令就行了; perl use expect module ,all Question /Answer in Hash
#!/usr/bin/env perl
use 5.010;
use strict;
use Expect;
my $cmd = "perl simulate.pl";
my $timeout = 30;
my @question_list = qw/name age home/;
my $qa = {
"name" => "shalk\n",
@shalk
shalk / gist:9382089
Last active November 4, 2017 04:36
硬件信息采集 information collection
#!/bin/bash
#
# Function:
# This script can collect Infomation of System OS,CPU,MEM,DISK,NETWORK,and so on.
#
# I modify the script from a example from internet
# Thanks to the origin author.
# Have Fun!
# 2014-04-23 by shalk
# Todo :