Quantcast
Channel: 钻戒 and 仁豆米
Viewing all 290 articles
Browse latest View live

一家虚拟主机商


nss error -12190 报错的解决

$
0
0

系统是CentOS 6.6的,curl访问https报错。

nss error -12190 这个错误说明系统预埋的CA需要更新了。

一句话解决:

yum update -y nss curl libcurl  

鬼畜的是,yum的CentOS-Base.repo被改成了本地,根本没有可以升级的东西,shit,增加一段网易的mirror吧

[base]
name=CentOS-6 - Base - 163.com  
baseurl=http://mirrors.163.com/centos/6/os/$basearch/  
gpgcheck=1  
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

[updates]
name=CentOS-6 - Updates - 163.com  
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/  
gpgcheck=1  
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

[extras]
name=CentOS-6 - Extras - 163.com  
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/  
gpgcheck=1  
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

[centosplus]
name=CentOS-6 - Plus - 163.com  
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/  
gpgcheck=1  
enabled=1  
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

[contrib]
name=CentOS-6 - Contrib - 163.com  
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/  
gpgcheck=1  
enabled=1  
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6  

再执行,就搞定

安装OLAINDEX

$
0
0
安装OLAINDEX

买了一个世纪互联的Onedrive,说是有一个web网盘界面,就想折腾一下。

想在Hostgator vps上安装,真是个大麻烦

最大的问题是无法使用composer,于是找了一台独立vps

安装文档如下:

git clone https://gitee.com/LXY1226/OLAINDEX.git  
cd OLAINDEX  
#配置站点
mv tmp/.git .  
rm -rf tmp  
git reset --hard  
cp database/database.sample.sqlite database/database.sqlite  
composer install -vvv  
chmod -R 755 storage/  
chown -R www:www *  
php artisan od:install  

上面有个问题,composer install时会报错:

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1 PackageManifest.php: Undefined index: name

查了半天,得改:

vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php文件中做如下修改:

//$packages = json_decode($this->files->get($path), true);
$installed = json_decode($this->files->get($path), true);
$packages = $installed['packages'] ?? $installed;

然后再跑composer install -vvv就能成功了

安装完之后,把整个OLAINDEX打包传到Hostgator vps就行了

注意:要手动修改Cache下的config.php,匹配真实路径。

话说回来,这个网盘装好了,不知道有什么用。

Traefik的单独安装使用

$
0
0

traefik在k8s里安装的话,直接用helm就可以了。

但是,只想用它的功能,替代haproxy和nginx做代理的话,就需要把它单独拎出来安装,还真的比较麻烦。

记录一下过程。

这个时间点,traefik 已经是2.0的时代了,所以下载新版的:

wget https://github.com/traefik/traefik/releases/download/v2.4.8/traefik_v2.4.8_linux_amd64.tar.gz

解压,得到traefik的可执行文件。

然后在同级目录下生成两个文件,启动的时候,主程序会自动寻找traefik.yml或者traefik.toml配置文件

首先是traefik.yml

log:  level: DEBUGapi:  dashboard: true  insecure: trueentryPoints:  web:    address: ":80"providers:  file:    filename: routes.yml    watch: true

然后是动态配置文件routes.yml,定义了一些转发规则

http:  routers:    router1-http:      rule: "Host(`172.18.31.33`)"       entryPoints:        - web      service: site_name_example.com  services:    site_name_example.com:      loadBalancer:        servers:          - url: "http://172.16.8.1:80"

然后运行traefik就可以了。

打开网址 http://xxx.xxx.xxx.xxx:8080/dashboard/

折腾了很久,真的是烦躁。

Let's encrypt证书申请工具-lego

$
0
0

amce申请证书实在是太烦了,对于一台只有1cpu 512m的vps来说,装这个东西简直就是费时费劲。

好在有人干脆开发了一个go语言的工具lego

https://github.com/go-acme/lego/

只有一个执行文件,极简主义:

申请证书一句话:

lego --email="foo@bar.com" --domains="example.com" --http run

回答一下Yes

然后生成的证书都放在.lego/certificates/目录下

续费也是一句话

lego --email="foo@bar.com" --domains="example.com" --http renew

及其简单,也方便搬迁。生成的证书crt是带证书链条的

申请好就可以装trojan了。实在是方便

Aria2组合工具拳

$
0
0

南瓜视频彻底完蛋了,一时陷入片荒。家里的电视机好不容易禁止升级,能用ES浏览器,挂上百度网盘,看存在里面的电影。但是,百度网盘现在基本是磁力和BT都失效了,没办法,只能想个办法看怎么下载并上传到百度网盘了。

首先是Aria2,这个非常简单,就一个执行文件和一堆配置文件就行了。

wget https://github.com/P3TERX/Aria2-Pro-Core/releases/download/1.35.0_2021.02.19/aria2-1.35.0-static-linux-amd64.tar.gztar zxvf aria2-1.35.0-static-linux-amd64.tar.gzmkdir /root/.aria2cd /root/.aria2wget https://p3terx.github.io/aria2.conf/aria2.confwget https://p3terx.github.io/aria2.conf/clean.shwget https://p3terx.github.io/aria2.conf/corewget https://p3terx.github.io/aria2.conf/script.confwget https://p3terx.github.io/aria2.conf/rclone.envwget https://p3terx.github.io/aria2.conf/upload.shwget https://p3terx.github.io/aria2.conf/delete.shwget https://p3terx.github.io/aria2.conf/dht.datwget https://p3terx.github.io/aria2.conf/dht6.datwget https://p3terx.github.io/aria2.conf/move.shwget https://p3terx.github.io/aria2.conf/LICENSEtouch aria2.session

注意这里是root用户运行,如果要用其他用户,修改/root/.aria2/aria2.conf里面的/root就行。

然后再造个systemctl的控制文件,

cat <<EOF>>/etc/systemd/system/aria2.service [Unit]Description=aria2 ServiceAfter=network.targetWants=network.target[Service]Type=simpleExecStart=/root/aria2c --conf-path=/root/.aria2/aria2.confRestart=on-failure# Don't restart in the case of configuration errorRestartPreventExitStatus=23[Install]WantedBy=multi-user.targetEOFsystemctl daemon-reloadsystemctl start aria2 

注意,如果有防火墙,注意打开以下三个端口。

tcp 6800tcp 51413udp 51413

然后就好了,但是,没有界面啊

我们弄个界面,AriaNG,其实就一个文件,index.html

wget https://github.com/mayswind/AriaNg/releases/download/1.2.1/AriaNg-1.2.1-AllInOne.zip

随便放到个服务器上,然后打开配置一下

然后就能随便去下载磁力链和BT了。

然后呢,怎么传到百度云盘去呢?

继续,用BaiduPCS-Go

wget https://github.com/qjfoidnh/BaiduPCS-Go/releases/download/v3.7.9/BaiduPCS-Go-v3.7.9-linux-amd64.zip

然后用浏览器打开pan.baidu.com,F12调试,拿到BDUSS的Cookie

先登录

./BaiduPCS-Go login -bduss=xxxx

然后就可以上传了

./BaiduPCS-Go u 爱,死亡和机器人.Love.Death.and.Robots.S02/ movie/爱,死亡和机器人

阿里云ACK集群创建时候选择了节点ip数量错误的情形

$
0
0

大坑啊,阿里云建立ACK时,选择节点ip数量是16

官方文档中默认是64

结果建完就傻眼了,每个worker的kube-system缺省会跑到11-14个pod

16个就什么也pod也部署不了

开了工单,问了阿里客服,得到的回复是无法修改

没办法,只能毁掉集群重建,麻烦的是arm的log也必须毁掉,否则重建的时候日志服务会不行。

那么,到底有没有方法不用毁掉集群重建呢?

有的

登录到每个worker node上,修改/etc/kubernetes/initialize/config.cfg,看到那个256的字样了吧

改掉,然后重启节点就行了。

Git的一些必用技巧

$
0
0

一、每次输入用户名和密码特别烦人,保存下来

git config --global credential.helper storegit pull

然后输入,用户名和密码就会存在 ~/.git-credentials文件中了

二、rebase的时候编辑器居然是nano,没法用,改成vi

git config core.editor vi

Cisco接入交换机的配置

$
0
0

Cisco接入交换机配置指南

Clean session

#Show current login usersshow users# terminal a userclear line vty 0

Set Session timeout

exec timeout command is sused to specify the timeout for exec sessions[telnet/ssh] whereas session timeout command specifies the idle timeout period for all the sessions.

config tline vty 0 15exec-timeout 10session-timeout 10#Check configuresh run | be line vty

How to fix %Error opening tftp://255.255.255.255/network-confg (Timed out)

no service config

Set ip address and default gateway

ip default-gateway 192.168.0.1interface vlan 1ip address 192.168.0.2 255.255.255.0

Set hostname and domain-name

config thostname myswitchip domain-name mydomain.com

Enable ssh login

Generate the RSA keys

myswitch(config)# crypto key generate rsa The name for the keys will be: myswitch.thegeekstuff.com Choose the size of the key modulus in the range of 360 to 2048 for your   General Purpose Keys. Choosing a key modulus greater than 512 may take   a few minutes.How many bits in the modulus [512]: 1024 % Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

Setup the line vty configurations

line vty 0 4session-timeout 10transport input sshlogin localpassword 7exit

Set the console line

line console 0logging synchronuslogin local

Create the username password

config tusername $USERNAME password $MYPASSWORDenable secret $MYENABLEPASSWORD

enable service password-encryption

service password-encryption

Verify SSH access

show ip ssh

Configureport-channel

interface Port-channel1 description testing switchport trunk allowed vlan 4-12 switchport trunk encapsulation dot1q switchport mode trunk# network port settingsinterface GigabitEthernet1/0/27 description lacp-wifi-network switchport trunk encapsulation dot1q switchport mode trunk channel-protocol lacp channel-group 3 mode active!interface GigabitEthernet1/0/28 description lacp-wifi-network switchport trunk encapsulation dot1q switchport mode trunk channel-protocol lacp channel-group 3 mode active! 

Access mode

interface GigabitEthernet1/0/29 switchport access vlan 60 switchport mode access

SNMP

snmp-server community public RO

NTP

ntp source vlan 20ntp server 10.32.0.2 source vlan 20

博客搬迁了

Viewing all 290 articles
Browse latest View live