Entries Tagged as ''

openvpn的客户端配置

我的客户端是一台openvpn client

配置文件如下:

[@41.108 ~]# cat /etc/openvpn/client.conf  

client

dev tun

proto udp

remote 192.168.13.15 1194

nobind

user nobody

group nobody

persist-key

persist-tun

ca ca.crt

cert client.crt

key client.key

tls-auth ta.key 1

ns-cert-type server

comp-lzo

verb 3

mute 20

我用openvpn搭的vpn server的配置文件:openvpn.conf

者是跑在一台freebsd上面的openvpn server

bash-2.05b# cat /usr/local/etc/openvpn/openvpn.conf           

local 192.168.13.15

port 1194

proto udp

dev tun

ca ca.crt

cert server.crt

key server.key

crl-verify vpncrl.pem

dh dh1024.pem

server 172.16.13.0 255.255.255.0

ifconfig-pool-persist ipp.txt

push "redirect-gateway"

keepalive 10 120

tls-auth ta.key 0

comp-lzo

max-clients 10

user nobody

group nobody

persist-key

persist-tun

status openvpn-status.log

log         openvpn.log

log-append  openvpn.log

verb 3

mute 20

离开NO的日子里

时间过得真快呀

一眨眼

我到这个公司、这个部门已经快5年了

想想5年前

正是互联网行业的第一个春天

年少轻狂的我

那是一年换一个公司呀

没想到

经历过短暂失业的我

对于这份工作是如此的在意

我都有点佩服我自己了

呵呵

居然在一个公司的一个部门呆了5年时间之久

我想如果不是公司搬家

我可能会在长安街上的那幢写字楼里的某一个固定位置呆上5年也不一定哟

(公司搬家前,3年多的时间我一直就坐在那个位置没动过,这在公司我想应该是少有的)

在这5年间

我娶妻生子

我置业安家

这5年,可能是我人生中最重要的5年

5年来

我一直就呆在NO部门

领导换了一茬又一茬

不变的唯有像我一样的普通员工

连老板都说我们部门是忠诚度很高的部门:)

忠诚度高也没见加薪

呵呵

做一个优秀的系统管理员曾经是我的理想

(现在好像都没有“理想”了:)

从参加工作到现在

倒也是一直在为之而努力

但到现在

这个目标好像还没有完全达到:(

今天是我作为NO的员工最后一次值晚班

下周我就要搬到一个几乎全是年轻人的团队里去了

面临着新的工作、新的挑战

我不但有点好奇

还有点兴奋

嗯啦

看来我还没老

呵呵

apache2.2 released

http://httpd.apache.org/docs/2.2/new_features_2_2.html

相对于以前的版本

2.2的配置文件更结构清晰了

因为他把原来一个配置文件httpd.conf

变成了分功能的conf.d/*.conf

不过需要在httpd.conf中把相应的注释去掉才行

而且

从2.2的版本还是

缺省打开了大文件支持

这样再碰上大于2G的文件的时候

系统也不会有问题

unix下怎样删除文件名以”-”开头的文件呢

原文是英文的,在这里

最简单的办法就是

rm ./-filename

(这里"-filename"在当前目录下)

很多命令,尤其是那些使用"getopt(3)"做常规参数解析的

会接受"–"作为参数,而且这意味着“这是最后一个选项”

所以,你的rm的版本也许能够操作"rm — -filename"这种方式

还有一些没有用getopt()的版本的rm认为单个"-"跟上面提到的"–"一样的作用

所以在这种版本的rm,可以用命令"rm - -filename"

Mailing Attachments from UNIX(从UNIX下发带附件的邮件)

Sending email with attachments on UNIX systems(UNIX系统下发带附件的邮件)

以下的例子都使用了下面的这几个变量

TXTFILE=/tmp/textfile

ATTFILE=/tmp/binary_file

SUBJECT="Your attachment"

MAILTO=user@where.ever

一共可以有n种办法

下面列出几种

  1. uuencode
    uuencode $ATTFILE $ATTFILE | \
        mail -s "$SUBJECT" $MAILTO
        (uuencode $FILE1 $FILE1; uuencode $FILE2\
        $FILE2)| mail -s "$SUBJECT" $MAILTO
  2. simple shell commands
    echo "From: $LOGNAME\n\
        To: $MAILTO\nSubject: $SUBJECT\n\
        Mime-Version: 1.0\n\
        Content-Type: text/plain\n\
        " > /tmp/file
        cat $TXTFILE >> /tmp/file
        /usr/lib/sendmail -t -oi < /tmp/file
        
  3. metamail
       metasend -b -s "$SUBJECT"\
        -f $TXTFILE -m text/plain -e none -n \
        -f $ATTFILE -m application/octet-stream \
        -e base64 -t $MAILTO
        
  4. mpack
       mpack -s "$SUBJECT" -c \
        application/octet-stream $ATTFILE $MAILTO
        
  5. mutt
       mutt -a $ATTFILE -s "$SUBJECT" $MAILTO <\
        $TXTFILE
        
  6. Elm
       elm -s"$SUBJECT" -A $ATTFILE $MAILTO < $TXTFIL 
  7. Pine - (to be investigated but it doesn’t look good; maybe the c-client?)
  8. uuenview
        uuenview -m $MAILTO -b -a $ATTFILE < $TXTFILE
  9. nail
    nail -s "$SUBJECT" -a $ATTFILE $MAILTO < $TXTFILE
        
  10. Z-Mail
    For a single file:
        cat $TXTFILE | zmail.small -subject "$SUBJECT"\
        -attach application/octet-stream:${ATTFILE}\
        $MAILTO Bart Schaefer offers the following\
        for multiple attachments.\
        (untested by myself)
        zmail.small -rf /dev/null -e \
        'mail -z -s "$SUBJECT" $MAILTO' \
        -e 'compcmd attach-file $ATTACHFILE \
        application/msword base64 \
        "$DESCRIPTION"' \
        -e! 'compcmd send'

为本站做了个极简单的favicon

用techtips的两个T

配以本站缺省的theme的颜色–黄色

做了个简单的favicon

就是这样子

升级sun fire v20z的sp的firmware的情况

按照文档一步一步走

ssh登上这台sun fire v20z的sp

sp update flash all -i 192.168.111.111

此时在192.168.111.111这台update server上看到升级已经开始的log

但是到log显示传升级的image到正在升级的sp上了的时候

发现原来连到运行升级的程序的sp的session居然断了

按照以往的经验

感觉这次升级是失败了

于是停掉update server

又试了n回

都是这样

于是开始怀疑文档:)

终于有一次

当session断掉后

我没有停掉update server

突然某一刻我看update server上的log显示升级过程居然还在继续!!

于是我知道有戏了

果然

再过几分钟

升级完毕

再连上去

系统软件已经是新的版本了

sun fire v20z机器的远程管理

公司机房有2台巨强的sun fire v20z的机器

这个机器也有远程管理口

一直以来也不知道怎么用的

直到今天出了点事情

如果有远程管理的话就可以不去机房

但是……

所以痛定思痛

我翻了下文档把远程管理配上了

这里是文档,文档来自http://www.sun.com/products-n-solutions/hardware/docs/html/817-5246-16/chap2.html#pgfId-999743

Configuring the Service Processor


The Sun Fire V20z and Sun Fire V40z servers include a dedicated SP for complete server independence and maximum availability of server management. The SP is an embedded PowerPC that provides the following functions:

  • Environmental monitoring of the platform (such as temperatures, voltages, fan speeds and panel switches)

     

  • Alert messages when problems occur

     

  • Remote control of server operations (boot, shutdown and reboot of the server’s operating system, turning the server’s power on and off, stopping the server’s boot process in BIOS, and upgrading BIOS)

     

After supplying AC power to the server, you are ready to begin configuring the SP by setting an IP address and associated network settings for the SP. You can configure the SP network settings by using DHCP or by using a static IP address.

Defining SP Network Settings

This section contains two alternate methods you can use to define SP network settings:

Assigning SP Network Settings Using DHCP

The following procedure describes how to set the SP network settings using DHCP from the Operator Panel. If your network does not use DHCP, or you want to assign a static IP address to the SP, follow the instructions in Assigning Static SP Network Settings.

1. Press any operator panel button on the server front panel (see FIGURE 2-1).

The LCD panel displays the first menu option:

Menu:

Server Menu


FIGURE 2-1 Operator Panel Buttons



2. Press the Forward button until you reach the SP menu:

Menu:

SP menu

3. Press the Select button to display the SP menu options.

SP Menu:

Set SP IP info?

4. Press the Select button.

The following prompt appears with the default response:

SP use DHCP?

No

5. Press the Forward button to change to Yes, then press the Select button.

6. Press the Select button at the confirmation prompt.

SP use DHCP:

Yes?

The server attempts to contact a DHCP server for an IP address. When the server receives a DHCP response, the LCD panel displays the DHCP-assigned SP IP addresses. The SP address is configured and the server is ready for use.




7. Continue with Creating the Initial Manager Account for instructions on creating the initial manager account.


Assigning Static SP Network Settings

From the operator panel, follow these steps to set the SP network settings using a static IP address. You must specify a subnet mask and default gateway. This example uses the following sample settings:

IP Address: 10.10.30.5

Subnet Mask: 255.255.255.0

Default Gateway: 10.10.30.254

1. Press any operator panel button on the server front panel (see FIGURE 2-1).

The LCD panel displays the first menu option:

Menu:

Server Menu

2. Press the Forward operator panel button until you reach the SP menu:

Menu:

SP menu

3. Press the Select operator panel button to display the SP menu options.

SP Menu:

Set SP IP info?

4. Press the Select operator panel button. The following prompt displays with the default response:

SP use DHCP?

No

5. Press the Select operator panel button.

The LCD displays as follows:

SP IP Address:

0.0.0.0

6. With the cursor in the first field, increase or decrease the value using the Back or Forward operator panel button.

This field can hold a value between 0 and 255.

SP IP Address:

10.0.0.0

7. After reaching your desired value, press the Select operator panel button to advance the cursor to the next field.

SP IP Address:

10.0.0.0

8. Repeat Step 6 and Step 7 for each field until the desired IP address is displayed, then use the Enter button combination to save the IP Address.

The process continues to the next network setting, the Subnet Mask. The LCD displays as follows:

SP netmask:

255.255.255.0

9. Edit the subnet mask setting in the same manner as you did for the IP address. When finished, use the Enter button combination to save the subnet mask.

The process continues to the next network setting, the default gateway. The LCD displays as follows:

SP IP Gateway

10.10.30.1

10. Edit the default gateway setting in the same manner as you did for the IP address and the subnet mask. When finished, use the Enter button combination to save the default gateway.

The LCD displays the following confirmation prompt:

Use new IP data:

Yes?

11. Press the Select operator panel button to use the new data, or use the Cancel button combination to disregard.

The SP address is now configured and the server is ready for use.


12. Continue with Creating the Initial Manager Account.

Creating the Initial Manager Account

After you install the server and configure the SP’s network settings, you must create the initial manager account. You can then perform initial configuration of the server and create additional user accounts. Only the administrator who does the initial system configuration can create the initial manager account.

A setup account is included with each server. This setup account has no password. When you log in to the SP the first time using the setup account, you are prompted to define the initial manager account with a password and an optional public key.

Usernames and passwords are strings that consist of any alphanumeric character, underscore, hyphen, or period.

  • Usernames must be unique and must begin with an alphabetic character.

     

  • Passwords can contain any printable character and are case-sensitive.

     

  • A username or a password is limited to 32 characters and cannot be a null or an empty string.

     

There are two methods you can use to create the initial manager account:

Creating the Initial Account From a Command Line

Log in to the setup account and create the initial manager account by following this procedure:

1. Using an SSHv1 or SSHv2 client, connect to the IP address of the SP.

2. Authenticate as the user setup with no password required:

# ssh sp_ip_address -l setup

3. Follow the on-screen prompts to create the initial manager account.

After you create the initial manager account, the setup account is deleted and you are logged out of the server. You can then log in using the new initial manager account, from which you can create other user accounts.


After you create the initial manager account, continue with Defining a Name for the Server or Server Management and Platform Software.

Creating the Initial Account From the SM Console

To create the initial manager account from the SM Console:

1. Enter the SP name or IP address as the URL or address in a browser, to enter the SM Console.


2. At the Create Initial Manager-Level User ID screen, enter a user ID for this account.

3. Enter a password for the account.

4. Re-enter the password to confirm.

5. Click the check mark button.

6. Use the SM Console to select initial configuration options.

After you create the initial manager-level user, the Initial Configuration Checklist screen displays in the SM Console. This enables you to determine the options you want for the initial setup of the SP.

The Initial Configuration Checklist is a table that lists the SM Console menu options and the commands you use to configure each option. It also includes links to the online help that provides instructions for each option.




After you create the initial manager account, continue with Defining a Name for the Server or Server Management and Platform Software.

Defining a Name for the Server

If desired, you can define a name for the server that will be displayed in the operator-panel LCD when the SP is idle. After you define a name, the name and the IP address of the SP alternate every few seconds in the LCD.


1. When the server is in background state, press any operator-panel button (see FIGURE 2-1).

After you press a button, the LCD panel displays the first menu option:

Menu:

Server Menu

2. Press the Forward button until you reach the Panel menu:

Menu:

Panel menu

3. Press the Select button to display the Panel menu options.

4. Press the Forward button until the Name for LCD menu option displays:

Panel Menu:

Name for LCD?

5. Press the Select button to enable data entry.

6. Enter an alphanumeric string to display on the first line of the LCD.

You can enter letters A through Z, digits 0 through 9, hyphen and space.

a. Use the Forward and Back buttons to locate the character you wish to enter in each field.

b. Press the Select button when you locate the character you want.

c. Repeat this process until the entire name is complete.

7. Use the Enter button combination (Forward plus Select) to save your entry.

北京办护照网上下载申请表,5个工作日取证

转贴自:http://www.bjgaj.gov.cn/other_column/office_guide/passport_detail.jsp



申办公民个人因私护照





1.北京市居民申请护照



    您准备出国探亲、访友、旅游、留学、定居、就业或从事商务等其他非公务活动,需要申办《中华人民共和国普通护照》,请您持身份证或户口簿到户口所在地派出所,或公安分(县)局出入境管理部门,或北京市公安局出入境管理处及海淀、朝阳受理点领取《中国公民因私出入国(境)申请表》。按照附发的办理护照须知要求填写申请表,属于登记备案的国家工作人员须出具意见并加盖公章,准备与出境事由相应的证明材料。

    本人携带全部原件和A4规格的复印件,到北京市公安局出入境管理处及海淀、朝阳受理点提交申请。申请时须提交填写完整的申请表原件,贴近期2寸淡蓝色背景彩色证件照1张;与出境事由相应的证明材料;户口簿、居民身份证原件和户口簿首页、本人资料页、变更页和居民身份证的复印件。

    5个工作日后,携带本人户口簿、身份证和取证回执单,交付200元工本费即可领取取护照。

    办公地点:东城区安定门东大街2号

    办公时间:星期一到星期六(法定节假日除外) 8:30~16:30

    乘车路线:乘坐44路、13路、116路、807路、106路、117路、特2路公交车,北小街豁口下车。乘坐地铁在雍和宫站下车往东即到。

    出入境海淀受理点地址:海淀区阜成路67号(空军总院斜对面)

    出入境朝阳受理点地址:朝阳区京广大厦商务楼二层

    受理点办公时间:星期一到星期五(法定节假日除外)海淀受理点:上午8:30-11:30、下午1:00-5:00

    朝阳受理点:上午9:00-11:30、下午1:00-4:30



2.领取申请表



    您准备出国探亲、访友、旅游、留学、定居、就业或从事商务等其他非公务活动,需要申办《中华人民共和国普通护照》,领取《中国公民因私出入国(境)申请表》。领表地点在户口所在地派出所、公安分(县)局出入境管理部门、北京市公安局出入境管理处和海淀、朝阳受理点领取。

    也可从网络下载表格,网址: www.bjgaj.gov.cn→网络便民服务→表格下载



3.填写申请表



    填写申请表须用黑色或蓝黑色墨水笔填写,要求字迹清楚、整洁,不准涂改。

    “身份证号码”以户口簿升位后18位填写(如没有升位仍可填写15位);

    “姓名”使用国家标准简化汉字,与户口簿、身份证一致?

    “拼音姓名”按普通话拼写;

    “出生日期”须与户口簿、身份证一致;

    “出生地”填写省、直辖市即可;

    “婚姻状况”按实际填写;

    “政治面貌”可填中共党员、共青团员、民主党派名称或群众;

    “文化程度”填写国家主管教育部门承认的最高学历;

    “户口所在地址”填写与户口簿一致的申请人户口所在地的详细地址;

    “家庭现住址、邮编”请依照家庭现居住地如实填写;

    “本人身份”须如实依项选择;工作单位填写全称,注明职务;档案与工作单位不一致的填写现在的单位,在备注栏注明档案存放地,退休人员档案在原单位填原单位;

    “单位地址”须写清单位的具体位地址门牌号码;

    “前往国家地区”按出境后第一个国家填写或中国台湾,不含过境国家;

    “属第几次申请因私出境”填写在公安机关申请出境的次数,未被批准的也合并计算,并备注栏说明未被批准情况;出境事由只选择一项;

    “申请证件种类类别”请按实际申请证件种类只可选择一种;

    “原护照号码”选择护照延期、换发、补发的请填写此栏;

    “家庭主要成员”填写配偶、子女、父母、公婆、岳父母、祖父母、外祖父母等,家庭成员在境外的,用中文填写境外单位、地址;

    “本人简历”从参加工作填起至今,起止日期要准确、衔接;

    “取证方式”请自愿选择;

    “以下由申请人所在位组织人事部门填写”是由单位负责人填写,签署意见并盖章签名。



4.哪些人员需要单位出具意见并盖公章



    1) 各级党政机关、人大、政协、人民法院、人民检察院、人民团体、事业单位在职的县(处)级以上的领导干部,离(退)休的厅(局)级以上干部;

    2) 金融机构,国有企业的法人代表,金融机构分支行(分支公司)以上领导成员及其相应职级的领导干部,国有大中型企业中层以上管理人员,国有控股企业中的国有股权代表;

    3) 各部门、行业中涉及国家安全及国有资产安全、行业机密人员;

    4) 其他在公安机关出入境管理部门登记备案的人员。



5.申请加急的条件



    如果您遇到紧急情况,符合下列条件并经公安机关审查批准后,可在提交申请时办理加急。申请加急的条件:

    1) 出国治病或探望危重病人,须提交境外医院开具的证明。

    2) 出国奔丧,须提交境外医院或警察局开具的死亡证明。

    3) 出国参加紧急商务活动,须提交境外邀请函。

    4) 出国留学、开学时间临近,须提交录取学校入学通知书。

    5) 前往国入境许可或签证有效期即将届满。

    6) 公安机关认为确属紧急的其他情形。

    办理加急业务申请,外文材料须到北京市公安局指定的翻译公司翻译成中文。



6.领取证件



    取证可由本人领取或通过邮政局速递,按照《取证回执单》上的日期领取证件。须本人携带居民身份证或户口簿,持《取证回执单》,交费后领取证件。因故不能本人领取的,须写委托书,受托人持本人和申请人的身份证原件和复印件,登记后领取。制作完毕的证件保管期为三个月,过期不领取的予以销毁。

     取证程序:

    1) 凭《取证回执》到20号台收费台交费;

    2) 凭交费收据到领证台领取证件;

    3) 领取证件时,请仔细核对护照内容,避免发生差错。

    为减少您的往返次数,一次办结护照申请,建议采用邮政速递业务。愿意速递的人员,请在办结申请手续后,持《取证回执单》到邮政局设在出入境管理处接待大厅的服务台办理邮政速递手续,护照邮寄费用直接交邮局柜台即可。



7.哪些出境事由需提交证明材料



    1) 公派留学,包括国家公派和单位公派,须提交填写完整的《公派留学人员申 请护照登记表》。

    2) 收养儿童出国定居,须提交常住户口所在地的省级民政部门出具的收养登记书、领养人的护照或其它身份证件。

    3) 由劳务公司办理的出国劳务人员,须提交有外派劳务经营权的劳务公司出具的劳务项目的说明。

    4) 由境外就业服务机构协助办理出国就业的,须提交有境外就业经营权的境外就业服务机构确认的申请人与境外雇主签定的就业合同。



8.外地在京人员申办护照



    根据公安部通知,不受理非北京户籍居民的护照申请。