Protected: 火车头采集器谷歌翻译插件(20230331自用修改版)
There is no excerpt because this is a protected post.
There is no excerpt because this is a protected post.
实现效果是每晚三点自动备份数据库和网站等数据并使用 Openssl 加密归档,保留最近一个月的数据,通过开源的 rclone 工具同步到 Google Drive 和 OneDrive 上,这样就万无一失了 1. Shell 脚本 脚本是自己使用,因此比较简单。 #!/bin/bash DATE=`date +%Y%m%d` BACKUP_TEMP_PATH=/backup/tmp # Database DB_NAME= DB_USR= DB_PW= DB_OUT_NAME="db_$DATE" # Website WEB_PATH= WEB_OUT_NAME="web_$DATE" # Archive ARCHIVE_PATH=/backup/archives ARCHIVE_LOG_FILE=/backup/log/backup.log # Backup mysql # mysqldump -u$DB_USR -p$DB_PW --databases $DB_NAME > $BACKUP_TEMP_PATH/$DB_OUT_NAME.sql mysqldump --login-path=$DB_USR --databases $DB_NAME > $BACKUP_TEMP_PATH/$DB_OUT_NAME.sql # Backup webdsite cd $WEB_PATH zip -rq $BACKUP_TEMP_PATH/$WEB_OUT_NAME.zip * # Archive files cd $BACKUP_TEMP_PATH # tar cf - * | openssl enc -e -aes-128-cbc -pbkdf2 -k [password] -out $ARCHIVE_PATH/$DATE.tar.aes tar cf - * | gpg -e -r [recipient] -o $ARCHIVE_PATH/$DATE.tar.gpg # Backup the latest 30 days rm $BACKUP_TEMP_PATH/* find $ARCHIVE_PATH -name "*.tar.gpg" -type f -mtime +30 -exec rm {} \; # Sync to Google Drive rclone sync $ARCHIVE_PATH gdrive:[sync path] # Sync to Microsoft OneDrive rclone sync $ARCHIVE_PATH onedrive:[sync path] # Output log file echo -e "\e[1;32m---------------------------------------------\e[0m" >> $ARCHIVE_LOG_FILE echo -e "Backup date: "$(date +%Y-%m-%d)"\t""Finish time: "$(date +%H:%M:%S) >> $ARCHIVE_LOG_FILE echo -e "\e[1;32m---------------------------------------------\e[0m\n" >> $ARCHIVE_LOG_FILE 这里说明一下,使用mysqldump备份的时候,如果通过账号密码导出会提示使用明文密码不安全的警告,虽然不影响使用,但看着就不爽,因此改用了 MySQL5.7 之后提供的新方式,通过 --login-path= 的方式登录数据库,首先保存一个加密验证信息: mysql_config_editor set --login-path=[name] --host=localhost --user=[usr] --password 查看所设置的信息: mysql_config_editor print --all 删除指定信息: mysql_config_editor remove --login-path=[usr] 值得一提的,我第一次设置的时候毫无疑问的失败了- -,一直无法登录,后来才知道所设置的用户密码中不能包括”#“符号,不然就会报错。 2. 配置 rclone 官方有一键安装脚本,适用于 Linux/macOS/BSD 系统: curl https://rclone.org/install.sh | sudo bash 之后需要在服务器上配置 Google Dirve 和 OneDrive 的连接,输入 rclone config 命令,根据提示的信息进行操作,下面演示的版本为 v1.57.0,不同版本可能会略有出入,但思路是一样的。 Google Drive - using defaults No remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n # 输入 n,新建远程连接 name> gdrive # 输入自定义名称,用于区分不同连接 Option Storage. Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value. 1 / 1Fichier \ "fichier" 2 / Alias for an existing remote \ "alias" 3 / Amazon Drive \ "amazon cloud drive" 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, SeaweedFS, and Tencent COS \ "s3" 5 / Backblaze B2 \ "b2" 6 / Better checksums for other remotes \ "hasher" 7 / Box \ "box" 8 / Cache a remote \ "cache" 9 / Citrix Sharefile \ "sharefile" 10 / Compress a remote \ "compress" 11 / Dropbox \ "dropbox" 12 / Encrypt/Decrypt a remote \ "crypt" 13 / Enterprise File Fabric \ "filefabric" 14 / FTP Connection \ "ftp" 15 / Google Cloud Storage (this is not Google Drive) \ "google cloud storage" 16 / Google Drive \ "drive" 17 / Google Photos \ "google photos" 18 / Hadoop distributed file system \ "hdfs" 19 / Hubic \ "hubic" 20 / In memory object storage system. \ "memory"...
function onloads(){ var url = location.search; /********************************************************************************************** * * 修改方法:如果销售页有10个产品,那么依次安装顺序填充location.href="淘宝客推广代码"; * 链接方式:如第一个:<?php bloginfo('template_directory'); ?>/sub.html?1 之后的以此类推! **********************************************************************************************/ if(url=="?home"){ location.href="http://s.click.taobao.com/"; } } //调用函数 onloads();
<script type="text/javascript"> (function(Switch){ var switch_pc = window.location.hash; var curURL = document.location.href; //当前URL var isMobile = curURL.indexOf("http://3g."); //判断当前URL是否是手机站 var isPc = curURL.indexOf("http://www."); //判断当前URL是否包含"http://www." if (isMobile < 0) { //不是手机站 if (isPc < 0) { //不包含"http://www." var thisURL = curURL.replace(/^http:\/\//,"http://3g."); } else { // 包含"http://www." var thisURL = curURL.replace(/^http:\/\/www\./,"http://3g."); } } if(switch_pc != "#pc"){ if(/iphone|ipod|ipad|ipad|Android|nokia|blackberry|webos|webos|webmate|bada|lg|ucweb|skyfire|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|wap|mobile/i.test(navigator.userAgent.toLowerCase())){ Switch.location.href = thisURL ; }[xss_clean]('<meta name="mobile-agent" content="format=html5;url='+thisURL+'" />'); } })(window); </script>
最近有国外项目需要使用AWS的EC2服务器;在创建服务器实例之后发现,没有root用户.跟着我.简单解决登录问题. 首先登录到服务器, 如果是亚马逊的ec2可以在后台直接选择登录服务器. 然后输入修改root用户密码命令 sudo passwd root 然后输入2次密码. 然后切换root权限. sudo -i 然后输入命令编辑系统文件.(在光标位置按”i”键进入编辑模式,按”ESC”退出编辑模式,输入”:wq”保存退出) # 将 PasswordAuthentication no 配置的 no 改为 yes,支持其他用户密码登录 # 如果需要 root 用户密码登录 # 将 PermitRootLogin 配置改为yes # 重启 sshd 可以用下面命令。也可以用 systemctl restart sshd.service ; sudo /sbin/service sshd restart 现在我们可以直接用root账号登录到服务器了. 成功截图
There is no excerpt because this is a protected post.
There is no excerpt because this is a protected post.
亲测好用 [\u4E00-\u9FFF]+
下面的操作在OneProvider的8欧独服上成功。 1、进入RESCUE MODE 2、使用上图提供的用户名和密码,连接SSH 3、SSH下,进入root模式 a、设置root密码 sudo passwd root b、进入root模式 sudo -s -H 4、DD Windows系统 wget -O- --no-check-certificate http://down.80host.com/iso/dd/Win2012R2ZW.gz |gunzip|dd of=/dev/sda Administrator Laiboke.com 其他系统选择:https://down.xieyang.org/Windows/ISO/ 5、启动模式改为常规模式 6、重启机器 #Debian/Ubuntu: apt-get install -y xz-utils openssl gawk file #RedHat/CentOS: yum install -y xz openssl gawk file 如果出现错误,请运行 #Debian/Ubuntu: apt-get update #RedHat/CentOS: yum update wget –no-check-certificate -qO InstallNET.sh ‘https://moeclub.org/attachment/LinuxShell/InstallNET.sh’ && bash InstallNET.sh -dd ‘[Windows dd包直连地址]’ 直链包:http://arv.asuhu.com/?dir=dd
<?php //This will get an array of all the gif, jpg and png images in a folder $img_array = glob("/path/to/images/*.{gif,jpg,png}",GLOB_BRACE); //Pick a random image from the array $img = array_rand($img_array); //Display the image on the page echo '<img alt="'.$img_array[$img].'" src="'.$img_array[$img].'" />'; ?>