wireguard隧道安装留存记录

Centos下安装一直没折腾好,暂时搁置做留存记录。


https://www.wireguard.io/install/#kernel-requirements

Linux创建gre隧道

ubuntu
写入网卡/etc/network/interfaces

ubuntu通用

auto tun0
iface tun0 inet static
address <local tunnel IP>
netmask <tunnel subnet mask>
pre-up iptunnel add tun1 mode gre local <local IP> remote <remote IP> ttl 255
up ifconfig tun1 multicast
pointopoint <remote tunnel IP>
post-down iptunnel del tun1

Centos类方法
约定:
hostA IP:公网 100.xx.xx.101 内网10.0.0.1
hostB IP:公网192.xx.xx.101 内网10.0.0.2

阅读剩余部分...

PHP7 Web环境安装临时存放shell

cat>/etc/yum.repos.d/MariaDB.repo<<EOF
  [mariadb]
  name = MariaDB
  baseurl = http://yum.mariadb.org/10.1/centos6-amd64
  gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  gpgcheck=1
  EOF
  yum -y install git wget gcc gcc-c++ gmake autoconf
  yum -y install lua-devel
  yum -y install libmcrypt-devel libjpeg-devel libpng-devel freetype-devel libxml2-devel libcurl-devel openssl-devel libc-client-devel net-snmp-devel

阅读剩余部分...

多线程下载工具axel编译安装

多线程下载非常好用,但是感觉这货已经是被遗弃了,经常在debian的下载点上无法下载。

离线包下载安装

wget http://dl.kvm.la/softsource/axel-2.4.tar.gz  -O - | tar zxf -
cd axel-2.4
sh install.rhel.sh

install.rhel.sh是方便自己用而添加的,有迫害妄想症担心篡改过代码的勿用。

阅读剩余部分...

junper交换机升级JUNOS

以下为个人操作的备用记录,并不适用于生产环境操作,且本人实际其中的操作过程中有翻车。

升级分2部分,分别是jloader和jinstall。

插上串行线,用putty之类的客户端,链接COM3端口。

进入系统后cli模式运行命令

先查看版本和固件并记录下来。  

阅读剩余部分...

LVM卷删除恢复

该文章内容提及的第二步有一定几率会出现事故的风险(恢复删除lv卷会覆盖新建的lv卷, 导致丢数据)。

LVM删除一些分区后数据仍然保留在磁盘内,只要没有被完全覆盖是可以恢复的。
大致上3个步骤完成:第一步查找出日志位置,第二步恢复分区,第三步激活分区。

以下内容的约定:

卷组名为vg0,DF*_img为卷。
恢复卷的对象是DF101425_img

第一步查找日志

vgcfgbackup -f /etc/lvm/backup/Manual-backup-vg0 vg0 #备份当前VG
vgcfgrestore -l /dev/vg0|grep -B2 -A1 lvremove

执行后可以看到类似以下的日志内容。
在日志内找到了DF101425_img卷然后对应的File是/etc/lvm/archive/vg0_03279-1491291498.vg

File:         /etc/lvm/archive/vg0_03275-1349445321.vg
 VG name:      vg0
 Description:  Created *before* executing 'lvcreate -L5G -s -n /dev/vg0/DF102118_snapshot /dev/vg0/DF102118_img'
 Backup Time:  Wed Oct 26 19:23:47 2016

 File:         /etc/lvm/archive/vg0_03276-1170939834.vg
 VG name:      vg0
 Description:  Created *before* executing 'lvremove -f /dev/vg0/DF102118_snapshot'
 Backup Time:  Wed Oct 26 23:34:08 2016

 File:         /etc/lvm/archive/vg0_03279-1491291498.vg
 VG name:      vg0
 Description:  Created *before* executing 'lvremove -f /dev/vg0/DF101425_img'
 Backup Time:  Sun Oct 30 14:05:33 2016

阅读剩余部分...

[转载]JUNOS学习笔记,基本命令及中文解

root@host% 根用户的shell提示符
user@host> 运行模式CLI提示符
user@host# 配置模式提示符

configure进入配置模式
cli 进入CLI
补全 空格
? 查询命令
show interface terse 查看接口
show interface terse | except fe- 查看除fe-的接口
show interface terse | match se-3 只查看se-3接口
show interface | last 显示上一屏数据
show interfaces terse | count 显示输出行数
show interfaces lo0 | display set 结果通道
edit system
set host-name host
set domain-name example.com
set root-authentication plain-text-password

阅读剩余部分...

[转载]JUNOS升级步骤

原文地址:JUNOS升级步骤

注意:升级时配置和一些其它附属文件会被自动保存,但存放在RE上的本地日志等文件可能会被删除。所以如果需要保存这些日志等文件也应该在升级前使用FTP备份这些文件到服务器上。

1、备份

xiaocisco@test-j2320> request system snapshot

xiaocisco@test-j2320# save /var/home/xiaocisco/config.junos.txt

xiaocisco@test-j2320# run file copy config.junos.txt ftp://username:[email protected]/config.junos.txt

2、将新的JUNOS使用ftp上传至Juniper设备

xiaocisco@test-j2320#run file copy ftp://username:[email protected] /var/tmp/junos-jsr-9.5R1.8-domestic.tgz

3、JUNOS安装

阅读剩余部分...

清除Linux挖矿木马联启动

问题主要是root弱口令以及glibc版本漏洞导致。

chattr  -ASacdijstu /etc/cron.hourly/gcc.sh /lib/libudev.so /lib/libudev.so.6
rm -f /etc/cron.hourly/gcc.sh /lib/libudev.so /lib/libudev.so.6
touch /etc/cron.hourly/gcc.sh /lib/libudev.so /lib/libudev.so.6
chattr  +ASacdijstu /etc/cron.hourly/gcc.sh /lib/libudev.so /lib/libudev.so.6

清理完固定路径木马后需要检查/etc/init.d下的随机启动脚本,并禁用。

ubuntu16将网卡名ens3改回eth0

 sed  -i 's#GRUB_CMDLINE_LINUX=""#GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"#g' /etc/default/grub  
sed -i 's/#GRUB_DISABLE_LINUX_UUID=true/GRUB_DISABLE_LINUX_UUID=true/g' /etc/default/grub
 echo 'GRUB_DISABLE_LINUX_UUID=true' >>/etc/default/grub
 sudo grub-mkconfig -o /boot/grub/grub.cfg  

更新网卡配置/etc/network/interfaces

然后重启生效.

超微主板BIOS和IPMI固件下载地址

http://www.supermicro.com/support/bios/firmware0.aspx
 http://www.supermicro.com/ResourceApps/BIOS_IPMI.aspx?MoboType=1

LSI常用芯片备忘录

SAS3316 12Gb/s SAS RAID-on-Chip (ROC)

SAS3324 12Gb/s SAS RAID-on-Chip (ROC)
SAS2108 6Gb/s SAS RAID-on-Chip (ROC)
SAS3108 12Gb/s SAS RAID-on-Chip (ROC)


[Abuse Report]滥用投诉处理FAQ

由于情况比较多分为两个方向解决问题:恶性情况直接按欺诈和请退处理,普通情况只要求及时积极解决问题。

对投诉和滥用报告视而不见,推诿责任(以各种不是自己问题或者是不知道做为理由),均暂停订单或者请退处理。

滥用:主要指恶意使用和长时间占用资源等行为,具体参考TOS服务条款。

投诉:主要来自第三方的报告邮件,例如SBL DMCA 数据中心 安全漏洞监控组织 版权方。

阅读剩余部分...

备忘录-Populating /dev

6.8.1. Creating Initial Device Nodes

When the kernel boots the system, it requires the presence of a few device nodes, in particular the console and null devices. The device nodes will be created on the hard disk so that they are available before udev has been started, and additionally when Linux is started in single user mode (hence the restrictive permissions onconsole). Create the devices by running the following commands:

mknod -m 600 /dev/console c 5 1
mknod -m 666 /dev/null c 1 3

阅读剩余部分...

IPMITOOLS常用备忘

yum install ipmitool -y
modprobe ipmi_watchdog
modprobe ipmi_poweroff
modprobe ipmi_devintf
modprobe ipmi_si

Cheat sheet

阅读剩余部分...