代码管理

git 每个仓库设置Git用户名 git config --global user.name "username" git config --global user.email "email address" 一个仓库设置Git用户名 git config user.name "username" git config user.email "email address" https://docs.github.com/cn/get-started/getting-started-with-git/setting-your-username-in-git # 生成ssh-key ssh-keygen -t rsa -C "email address" # 测试链接GitHub ssh -T git@github.com GitHub https://cli.github.com/

October 20, 2022 · 1 min · zhangxiaofeng05

Nextcloud云盘

维基百科 Nextcloud Nextcloud是一套用于创建网络硬盘的客户端-服务器软件。其功能与Dropbox相近,但Nextcloud是自由及开放源代码软件,每个人都可以在私人服务器上安装并运行它。 与Dropbox等专有服务相比,Nextcloud的开放架构让用户可以利用应用程序的方式在服务器上新增额外的功能,并让用户可以完全掌控自己的数据。 ownCloud原先的开发者弗兰克·卡利切创建了ownCloud的分支——Nextcloud,继而让卡利切与其他原先的ownCloud团队成员持续积极地开发。 特性 Nextcloud的文件存储在一般的目录结构中,并可透过WebDAV访问。用户的文件会在传输时加密。Nextcloud可与在Windows(Windows XP、Vista、7与8)、macOS(10.6或更新版本)或是多种Linux散布版上运行的客户端同步。 Nextcloud用户可以管理日历(使用CalDAV)、联系人(CardDAV)、计划工作与流媒体(Ampache)。 从管理的角度来看,Nextcloud允许用户与组群管理(透过OpenID或LDAP)。透过用户间与/或组群间的读/写权限调整达到分享文件的目的。另外,Nextcloud的用户可以创建公开的URL来分享文件。也可以记录与文件相关的动作,以及利用文件访问规则来禁止对特定文件的访问。 此外,用户也可以透过浏览器使用Nextcloud的文本编辑器、书签服务、缩略网址服务、相册、RSS阅读器与文件查看器。因为有良好的扩展性,Nextcloud可以透过鼠标点一下即可完成安装的应用程序强化其功能,并可连线至Dropbox、Google云端硬盘与Amazon S3。 架构 为了让个人电脑与Nextcloud服务器同步,Windows、macOS、FreeBSD或Linux上都有客户端可以使用。行动客户端则在iOS与Android设备上提供。也可以使用浏览器访问、管理与上传任何文件与数据。任何在设置好同步的文件系统上的变更都会推送到所有链接到该用户账号的电脑与移动设备上。 Nextcloud服务器是以PHP与JavaScript脚本语言撰写。对于远程访问,它采用的是SabreDAV,其为一开放源代码的WebDAV服务器。Nextcloud可与多种数据库管理系统一同运作,包含了SQLite、MariaDB、MySQL、Oracle数据库与PostgreSQL。 centos7安装 官方安装指南: https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html 环境 LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.7.1908 (Core) Release: 7.7.1908 Codename: Core PHP 7.2.27 (cli) (built: Jan 26 2020 15:49:49) ( NTS ) Server version: 5.5.64-MariaDB MariaDB Server Nextcloud 17.0.5 Nextcloud官网: https://nextcloud.com/ 安装httpd(apache),php,php-fpm,MariaDB 自行百度,谷歌.如果服务器上还有nginx,建议apache更改默认端口 /etc/httpd/conf/httpd.conf(我的改为7000) php-fpm默认端口9000 ps:安装php-fpm需要注意版本是否支持要安装nextcloud版本 下载nextcloud https://nextcloud.com/changelog/ 下载nextcloud-17.0.5.zip,解压至/var/www /var/www/nextcloud是根目录,有index.php,在此目录下新建目录data cd /var/www/nextcloud/ mkdir data cd /var/www chmod -R 755 nextcloud/ chown -R apache:apache nextcloud/ 配置httpd vim /etc/httpd/conf.d/nextcloud.conf ...

April 4, 2020 · 1 min · zhangxiaofeng05

SimpleHTTPServerWithUpload

简介 SimpleHTTPServerWithUpload.py是简单的上传下载的脚本 python2 github地址 https://gist.github.com/UniIsland/3346170 使用方法 方法一 python SimpleHTTPServerWithUpload.py 8050 8050为端口号,不写端口默认为8000 方法二 python -m SimpleHTTPServerWithUpload 8050 8050为端口号,不写端口默认为8000 访问:http://127.0.0.1:8050/ python3 github地址 https://gist.github.com/touilleMan/eb02ea40b93e52604938 使用方法 python SimpleHTTPServerWithUpload.py 端口为8000

January 4, 2020 · 1 min · zhangxiaofeng05

linux安装mariadb并配置phpmyadmin

mariadb 维基百科 MariaDB是MySQL关系数据库管理系统的一个复刻,由社区开发,有商业支持,旨在继续保持在GNU GPL下开源。MariaDB的开发是由MySQL的一些原始开发者领导的,他们担心甲骨文公司收购MySQL后会有一些隐患。 linux现在默认的MySQL是mariadb。 安装mariadb $ sudo apt-get install mariadb-server mariadb-client 新建用户授权 以root身份输入mariadb,进入mariadb # mariadb > use mysql; # 进入mysql数据库 mysql> CREATE USER 'zhang'@'localhost' IDENTIFIED BY '123456'; # zhang是用户名,123456是密码 mysql> GRANT ALL PRIVILEGES ON *.* TO 'zhang'@'localhost' WITH GRANT OPTION; # 授权 mysql> FLUSH PRIVILEGES; 或者(推荐下边的,可以登录,上边只能本地登录) mysql> CREATE USER 'zhang'@'%' IDENTIFIED BY '123456'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'zhang'@'%' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES; 查看user信息 > select user,host,password from user; 至此,可以用新建的用户登录了。 ...

December 29, 2019 · 6 min · zhangxiaofeng05

ftp服务器

linux环境 LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.3.1611 (Core) Release: 7.3.1611 Codename: Core 安装 yum install vsftpd systemctl restart vsftpd.service # 重启vsftpd systemctl stop vsftpd.service # 停止vsftpd systemctl start vsftpd.service # 启动vsftpd systemctl status vsftpd.service # 查看vsftpd的状态 匿名配置 服务器配置文件 位置:/etc/vsftpd/vsftpd.conf 坑:从网上购买的服务器(阿里云)要从控制台开放ftp的端口,建议放开全部端口,如果有需要限制,再限制,否则会出现登录失败的问题 防火墙:开放所需端口 匿名设置:配置文件内容 anonymous_enable=YES #允许匿名登录 local_enable=YES write_enable=YES local_umask=022 #匿名上传的默认权限,匿名不能修改生效,只能上传删除 anon_upload_enable=YES #允许匿名上传 anon_mkdir_write_enable=YES anon_other_write_enable=YES dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_file=/var/log/xferlog xferlog_std_format=YES listen=YES listen_ipv6=NO pam_service_name=vsftpd userlist_enable=YES tcp_wrappers=YES 匿名用户的默认根目录:/var/ftp/pub 需要更改权限:chmod -R 755 /var/ftp/pub 客户端(deepin) 安装: ...

December 1, 2019 · 1 min · zhangxiaofeng05

hugo搭建博客,部署到GitHub

hugo站点 hugo官网:https://gohugo.io/ 安装和使用,先参考官网 安装:使用命令或者从GitHub下载 https://github.com/gohugoio/hugo 检查安装:$ hugo version 生成站点 $ hugo new site blogHugo 进入站点 $ cd blogHugo 使用主题(https://github.com/olOwOlo/hugo-theme-even) $ git clone https://github.com/olOwOlo/hugo-theme-even themes/even 安装主题上的说明进行配置,注意此主题生成新文件为$ hugo new post/some-content.md 本地运行预览博客 $ hugo server -D 浏览器 $ http://localhost:1313/ 部署到GitHub 在GitHub新建仓库 username.github.io 渲染md文件 $ hugo --theme=even --baseUrl="https://username.github.io" --buildDrafts 此时生成了public目录 执行命令 cd public git init git commit -m "first commit" git remote add origin git@github.com:username/blogHugo.git git push origin master 以后再提交,在站点执行此脚本 $ sh gitHub.sh gitHub.sh hugo --theme=even --baseUrl="https://username.github.io" --buildDrafts cd public git add . git commit -m "update" git push origin master cd .. 原文件放入私有仓库 第一次使用,在站点目录下 ...

October 21, 2019 · 1 min · zhangxiaofeng05