
今天分享一下 VPS 上怎么 dd 一个 Windows 的操作系统,本站使用的是 lolico.moe 制作的 Windows Server 2016 版,亲测在VPS 上完美安装并运行,其他版本的 Windows 暂时没有试过,不过问题都应该不大。搬瓦工的 VPS 目前已经全部基于 KVM 架构,所以默认你的 VPS 也是采用 KVM 架构。注意,只有基于 KVM 架构的可以这样操作,基于 OpenVZ 的无法进行 dd 安装 Windows。 本站教程均为自己整理测试,亲测可用,如有问题或已失效,请在下方留言,本站会及时更新。 在上述方案中均测试成功,完美运行,没有出现 CPU 超标的情况。 、dd Windows 重装之后,通过 SSH 登陆到你的搬瓦工 VPS,登陆之后,输入下面的命令 wget -qO DebianNET.sh qiu.sh/dd && bash DebianNET.sh -dd "https://files.lolico.moe/show/dd/win2016-standard-vultr-bare-metal.gz" 完成之后,我们就可以使用远程桌面软件登陆了,比如 Microsoft Remote Desktop,macOS 上有 Parallels Client 可以用,是免费的。输入我们的搬瓦工 VPS 的 IP 地址,进行登陆。默认的账户密码为: 账户:Administrator 密码:lolico.moe123 建议登陆之后及时修改密码。登陆之后的操作就和 Windows 的操作一样了,就不用多赘述了。 以上命令安装的是 Windows Server 2016,并且未激活。如果想安装其他系统,只需替换 dd 包即可,更多的 dd 包可以参考: wget –no-check-certificate -qO InstallNET.sh ‘https://moeclub.org/attachment/LinuxShell/InstallNET.sh’ && bash InstallNET.sh -dd ‘Windows的软件包’ https://image.moeclub.org/GoogleDrive/1OVA3t-ZI2arkM4E4gKvofcBN9aoVdneh 默认用户名:Administrator 默认密码:Vicer wget -qO DebianNET.sh qiu.sh/dd && bash DebianNET.sh -dd “https://files.lolico.moe/show/dd/win2016-standard-vultr-bare-metal.gz” 账户:Administrator 密码:lolico.moe123键DD脚本为VPS服务器更换/重装纯净版CentOS/Debian/Ubuntu 但是需要注意的是,最好不要安装最新的,否则可能会导致 CPU 超标而被暂停。 3、注意事项 A、登陆之后,会发现磁盘只有 10GB 可用,我们需要进入控制面板的磁盘格式化选项里面,把 C盘扩展一下,这个操作应该是基本操作,如果不会的话自己搜索一下就行。 B、如果觉得网速比较慢,原因是因为 Windows 默认的拥塞控制机制不好,解决方法很简单,先进入设置里面,更新系统,把所有系统更新都装上。装好更新之后,打开 Powershell,输入下面的命令: Set-NetTCPSetting -SettingName InternetCustom -CongestionProvider LEDBAT 然后回车,重启即可。 建议购买至少能跑满 0.5 核的方案,最好的是能跑满 1 核,想用的爽,就买能跑满 2 核或更多的方案。目前来看,CN2 GIA 系列方案的 CPU 给的最充足,所以也最为推荐。参考上面的 CPU 限制,建议购买 40G 或者以上的方案。
<?php $token='http://data.zz.baidu.com/urls?site=www.xxxxx.com&token=6lvko54336DCLR6e';//去百度获取 $xml_string = file_get_contents("https://www.1004619.com/sitemap.xml");//网站地图 $xml_string = trim($xml_string); $xml_object = simplexml_load_string($xml_string); $array=[]; $i=0; foreach ($xml_object->url as $key=>$value){ //$i=500 代表从地图获取500条连接 默认是从第一条开始 if($i===88){ break; } $array['aa']= get_object_vars($value); $url.=$array['aa']['loc']."\n"; $i++; } $urls=explode("\n",$url); $ch = curl_init(); $options = array( CURLOPT_URL => $token, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => implode("\n", $urls), CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), ); curl_setopt_array($ch, $options); $result = curl_exec($ch); echo $result; ?>
介绍 本篇文章讲的是制作简单的图片/视频API的一个方法,做属于自己的API, 适合新手,适合懒人(大神绕道) 本地图片API 制作方法 新建一个PHP文件(名字可以自己取),在创建一个img文件夹,把图片放进去 把php文件和img文件夹上传到服务器然后访问域名/PHP文件名就可以啦 php代码如下: <?php $img_array = glob("img/*.{gif,jpg,png}",GLOB_BRACE); $img = array_rand($img_array); $dz = $img_array[$img]; header("Location:".$dz); ?> 外链图片API 制作方法 新建一个PHP文件(名字可以自己取), images.txt文档文件,把外链图片地址放进去 把php文件和txt文档上传到服务器里就可以啦 PHP代码如下: <?php $arr=file("images.txt"); $n=count($arr)-1; for ($i=1;$i<=1;$i++){ $x=rand(0,$n); header("Location:".$arr[$x],"\n"); } ?> 本地视频API 创建一个video的文件夹,视频放进去,和本地图片API差不多 php代码如下: <?php $video_array = glob("video/*.{mp4}",GLOB_BRACE); $video = array_rand($video_array); $dz = $video_array[$video]; header("Location:".$dz); ?>
There is no excerpt because this is a protected post.
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账号登录到服务器了. 成功截图