甲骨文(非ARM)dd出现Error, Not found interfaces config

甲骨文dd用的傻瓜式一键dd脚本:

或者也可以直接用:https://www.cxthhhhh.com/network-reinstall-system-modify

但是都出现了错误:Error, Not found interfaces config

网上找到的解决方案,运行如下两条命令:

mkdir /etc/network/interfaces.d
echo "# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens3
iface ens3 inet dhcp

" > /etc/network/interfaces

重装后SSH登录,用户名root,密码:cxthhhhh.com

别忘记修改root密码:

root@baidu:~# passwd
Enter new UNIX password:
继续阅读

WordPress Builder编辑器统计

WordPress常见的所见即所得(拖动)编辑器统计:

  • Elementor

Elementor用户量最大,功能最多,但是也略臃肿。

  • WPBakery

WPBakery应该是好评最多的编辑器。

  • Oxygen Builder

引用别人的一句话是:Oxygen is NOT a page builder is a THEME BUILDER…Big difference. 不仅仅是编辑器,还可以自己制作主题。

  • Divi Builder

貌似是后出来的?好评不少。

国家代码COUNTRY CODES ALPHA-2 & ALPHA-3

有时经常要用到,转过来。

This is a complete list of all country ISO codes as described in the ISO 3166 international standard.
These codes are used throughout the IT industry by computer systems and software to ease the identification of country names.
We have compiled them in the quick reference table below in order to help our clients do quick conversions from the numeric or 2 letter code to any country name.

继续阅读

宝塔反代+CDN后Nginx日志获取不到真实IP

将源站反代,同时套上了cloudflare后,发现源站Nginx网站日志,获取不到用户的真实IP,日志中记录到的都是反代服务器IP,或者是cloudflare的IP。

查看反代服务器Nginx日志,发现记录的也都是cloudflare的IP。

在源服务器和反代服务器Nginx配置http{ 段中,添加以下3行代码,问题顺利解决:

set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
  • set_real_ip_from:定义接受从哪个信任前代理处获得真实用户ip,可以定义多行,可定义为ip,ip段,支持ipv4和ipv6
  • real_ip_header:定义从接收到报文的哪个http头部去获取前代理传送的用户ip,默认为X-Real-IP
  • real_ip_recursive:递归搜索,默认为off

以下为引用:

继续阅读

傻瓜式一键dd多合一脚本

安装重装系统的前提组件:
Debian/Ubuntu:

apt-get install -y xz-utils openssl gawk file wget screen && screen -S os

RedHat/CentOS:

yum install -y xz openssl gawk file glibc-common wget screen && screen -S os

如果出现异常,请刷新Mirrors缓存或更换镜像源。
RedHat/CentOS:

yum makecache && yum update -y

Debian/Ubuntu:

apt update -y && apt dist-upgrade -y

使用:

wget --no-check-certificate -O AutoReinstall.sh https://git.io/betags && chmod a+x AutoReinstall.sh && bash AutoReinstall.sh

如为CN主机,可能出现报错或不能下载脚本的问题,可执行以下命令开始安装.

wget --no-check-certificate -O AutoReinstall.sh https://cdn.jsdelivr.net/gh/fcurrk/reinstall@master/AutoReinstall.sh && chmod a+x AutoReinstall.sh && bash AutoReinstall.sh

25合一系统密码:
1、CentOS 7.7 (已关闭防火墙及SELinux,默认密码Pwd@CentOS)
2、CentOS 7 (默认密码cxthhhhh.com)
3、CentOS 8 (默认密码cxthhhhh.com)
4、CentOS 6 (默认密码Minijer.com)
5、Debian 11 (默认密码Minijer.com)
6、Debian 10 (默认密码Minijer.com)
7、Debian 9 (默认密码Minijer.com)
8、Debian 8 (默认密码Minijer.com)
9、Ubuntu 20.04 (默认密码Minijer.com)
10、Ubuntu 18.04 (默认密码Minijer.com)
11、Ubuntu 16.04 (默认密码Minijer.com)
12、Windows Server 2019 (默认密码cxthhhhh.com)
13、Windows Server 2016 (默认密码cxthhhhh.com)
14、Windows Server 2012 (默认密码cxthhhhh.com)
15、Windows Server 2012 Lite (默认密码nat.ee)
16、Windows Server 2008 (默认密码cxthhhhh.com)
17、Windows Server 2008 Lite (默认密码nat.ee)
18、Windows Server 2003 (默认密码cxthhhhh.com)
19、Windows Server 2003 Lite (默认密码WinSrv2003x86-Chinese)
20、Windows 10 LTSC Lite (默认密码www.nat.ee)
21、Windows 7 x86 Lite (默认密码Windows7x86-Chinese)
22、Windows 7 Ent Lite (默认密码nat.ee)
23、Windows 7 Ent Lite (UEFI支持甲骨文)(默认密码nat.ee)
24、Windows Server 2008 Lite (UEFI支持甲骨文)(默认密码nat.ee)
25、Windows Server 2012 Lite (UEFI支持甲骨文)(默认密码nat.ee)
99、自定义镜像

记得装完修改密码,Linux:

sudo passwd root

或者直接用root运行:

passwd
继续阅读

国外stream site种子站整理

最近在研究stream site,整理一些国外电影下载站stream site种子站,流量非常大,基本上都是top级别的。

https://rarbg.to/       更新最快
https://www.1377x.to/     数一数二
https://yts.mx/
https://eztv.re/
https://thepiratebay.org/  海盗湾
https://unblockninja.com/  这个网站是反代了市面上所有流行的stream site,牛
https://torrentbay.to/     也是反代网站,跟上面一样,流量都做到非常大。

更多整理中。。。

wordpress数据表及火车采集数据库发布

  • wordpress特色图片featured image写入数据库,先发布文章post,然后需要将图片作为post发布,再添加 _thumbnail_id 和 _wp_attached_file ,缺一不可:
INSERT INTO wp_posts (post_title,post_content,post_author,post_date,post_excerpt,to_ping,pinged,post_content_filtered,guid,post_type,post_status,post_mime_type) VALUES ('[标签:标题]','','[标签:authorid]','[系统时间转化:yyyy-MM-dd HH:mm:ss]','','','','','[标签:img-url]','attachment','inherit','image/[标签:image-type]');

INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES ([文章编号:wp_posts]-1,'_thumbnail_id',[文章编号:wp_posts]);

INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES ([文章编号:wp_posts],'_wp_attached_file','[标签:img-url-2]');
  • 同一张数据表如果要插入多组数据,可以:
INSERT INTO

wp_term_relationships (object_id,term_taxonomy_id)

VALUES

 ('[文章编号:wp_posts]','[标签:catid]'),
 ('[文章编号:wp_posts]','[标签:catid2]'),
 ('[文章编号:wp_posts]','[标签:catid3]');

但是火车采集不支持这种SQL写法,会报错,只能每次插入一行,分开写。

  • 如果要获取上一篇post的自增id,即post_id,可以用set变量:
set @var=[文章编号:wp_posts];
INSERT INTO wp_postmeta ( post_id,meta_key,meta_value)
VALUES
(@var-1,'_wp_attached_file','shows/[标签:img]'),
(@var-1,'_movie_poster',@var);

但是,火车采集同样不支持set变量。不过可以直接用减法运算:

INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES ([文章编号:wp_posts]-1,'_movie_poster',[文章编号:wp_posts]);
  • 前面关于wordpress火车采集数据库发布的文章:

有时需要更新wp_posts补全其他字段,否则会报错:

INSERT INTO wp_posts (post_title,post_content,post_author,post_name,post_date,post_excerpt,to_ping,pinged,post_content_filtered) VALUES ('[标签:标题]','[标签:内容]','[标签:authorid]','[标签:slug]','[系统时间转化:yyyy-MM-dd HH:mm:ss]','','','','');
  • 关于wordpress几张数据表的对应关系,前面也有:

用的比较多的时posts和category、tag之间的对应关系,经常容易搞错,我做了个说明图,一目了然。

  • 数据表的自增id是根据上一个(最后一个)id递增的,如果需要重置,或者设定从某id增加,执行下面代码
//设置sysuser_account表从88开始自增

alter table sysuser_account auto_increment=88;

wordpress自动设置文章第一张图为特色图

下面这段代码会将文章中第一张WordPress附件图片设置为特色图像,附件图片是指上传到WordPress的图片,不需要和当前的文章有关联。

function sola_auto_featured_image() {
  global $post;

  if( has_post_thumbnail() ){
    return;
  }

  preg_match('/<img\s[^>]*?class\s*=\s*[\'\"]([^\'\"]*?)[\'\"][^>]*?>/', $post->post_content, $matches);
  $img_class = $matches[1] ?? false;

  if( $img_class ){
    preg_match('/wp-image-([\d]+)/', $img_class, $matchId);
    $attachment_id = $matchId[1] ?? false;

    if( $attachment_id ){
        set_post_thumbnail($post->ID, absint($attachment_id) );
    }
  }
}

add_action('the_post', 'sola_auto_featured_image');
add_action('save_post_post', 'sola_auto_featured_image');

注意:add_action(‘the_post’, ‘sola_auto_featured_image’)会使这段代码在任何文章被加载时运行,比如archive页面,single post页面等等。好处是被人访问一段时间,你的所有文章就自动获得了特色图像,坏处就是对性能有影响。当你的特色图像设置的差不多时,应该将这一句注释掉。

继续阅读