2016年每日计划任务
- Caddy,一个用Go实现的Web Server
- 50 Shades of Go: Traps, Gotchas, and Common Mistakes for New Golang Devs 中译版上 中译版下 🍀
2017年每日计划 fuck get me a message
2016年每日计划任务
2016年每日计划任务
2017年每日计划 fuck get me a message
[mysqld]
lower_case_table_names=1
其中0
:区分大小写,1
:不区分大小写
Martini
框架学习 ✅✅ 交付成果
😟
安装net-tools
即可
yum install net-tools
Harbor项目是帮助用户迅速搭建一个企业级的registry 服务,由VMWare**团队打造,支持中文。项目官方地址是https://github.com/vmware/harbor
环境
OS | IP | Docker |
---|---|---|
CentOS Linux release 7.2.1511 (Core) | 10.10.10.10 | 1.11.0 |
下载解压即可,也可以git clone
git clone https://github.com/vmware/harbor.git
进入Deploy
目录,编辑
cd harbor/Deploy/
vim harbor.cfg
## Configuration file of Harbor
#The IP address or hostname to access admin UI and registry service.
#DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname = reg.mydomain.com
#The protocol for accessing the UI and token/notification service, by default it is http.
#It can be set to https if ssl is enabled on nginx.
ui_url_protocol = http
#Email account settings for sending out password resetting emails.
email_server = smtp.qq.com
email_server_port = 25
email_username = [email protected]
email_password = XXX
email_from = admin <[email protected]>
##The password of Harbor admin, change this before any production use.
harbor_admin_password= 123456
##By default the auth mode is db_auth, i.e. the credentials are stored in a local database.
#Set it to ldap_auth if you want to verify a user's credentials against an LDAP server.
auth_mode = db_auth
执行配置
# ./prepare
Generated configuration file: ./config/ui/env
Generated configuration file: ./config/ui/app.conf
Generated configuration file: ./config/registry/config.yml
Generated configuration file: ./config/db/env
The configuration files are ready, please use docker-compose to start the service.
# curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose
启动docker-compose
#docker-compose up -d
查看状态
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1e472cafff59 library/nginx:1.9 "nginx -g 'daemon off" 5 hours ago Up 44 minutes 0.0.0.0:80->80/tcp, 443/tcp deploy_proxy_1
6f1e7bd3ca11 deploy_mysql "docker-entrypoint.sh" 5 hours ago Up 44 minutes 3306/tcp deploy_mysql_1
94a9ce99b98e deploy_ui "/go/bin/harbor_ui" 5 hours ago Up 44 minutes 80/tcp deploy_ui_1
62b86a3eed2d library/registry:2.3.0 "/bin/registry /etc/r" 5 hours ago Up 44 minutes 5000/tcp, 0.0.0.0:5001->5001/tcp deploy_registry_1
14b3c9631fb8 deploy_log "/bin/sh -c 'cron && " 5 hours ago Up 44 minutes 0.0.0.0:1514->514/tcp deploy_log_1
# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1043/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1712/master
tcp6 0 0 :::5001 :::* LISTEN 15121/docker-proxy
tcp6 0 0 :::1514 :::* LISTEN 15041/docker-proxy
tcp6 0 0 :::80 :::* LISTEN 15252/docker-proxy
tcp6 0 0 :::22 :::* LISTEN 1043/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1712/master
#cd harbor/Deploy/config/registry/
#mkdir -p /etc/docker/certs.d/reg.mydomain.com/
#cp root.crt /etc/docker/certs.d/reg.mydomain.com/
#vim /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/docker daemon -H fd:// --insecure-registry reg.mydomain.com
重启服务
#systemctl daemon-reload
#systemctl restart docker
登录
# docker login reg.mydomain.com
Username: admin
Password:
Login Succeeded
# docker tag registry:2.3.0 reg.mydomain.com/demo/registry:2.3.0
# docker push reg.mydomain.com/demo/registry:2.3.0
The push refers to a repository [reg.mydomain.com/demo/registry]
5f70bf18a086: Pushed
386863388803: Pushed
855a4bc04ce4: Pushed
e6107e74315e: Pushed
917c0fc99b35: Pushed
2.3.0: digest: sha256:388dabaa61d598b544fe2b7b973d8551ecd30cb4f915c0159ff4a41004354877 size: 2166
登录Harbor,可以看到pull的image
大功告成!
sudo yum remove git
sudo wget -c "https://www.kernel.org/pub/software/scm/git/git-2.10.1.tar.gz"
sudo tar zxf git-2.10.1.tar.gz
sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
sudo gcc perl-ExtUtils-MakeMaker
cd git-2.10.1
sudo make prefix=/usr/local/git all
sudo make prefix=/usr/local/git install
编辑/etc/profile
,加入如下内容:
export PATH=$PATH:/usr/local/git/bin
问题的原因: 在编译sudo包的时候默认开启了- -with-secure-path选项。
必须用绝对路径命令才有效
解决办法
在~/.bashrc
加入下面的配置
alias sudo='sudo env PATH=$PATH'
sudo passwd root
su root
vim /etc/ssh/sshd_config
sudo /sbin/service sshd restart
su root
passwd ec2-user
中级解决办法,修改grub,使其在启动时不加载ipv6。在GRUB_CMDLINE_LINUX
中加入ipv6.disable=1
vim /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="ipv6.disable=1 crashkernel=auto rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
useradd -u 700 -g root kuuyee
-g 指定有效用户组
-G 还可以加入的用户组
-M 强制!不要创建用户主目录
-m 强制!要创建用户目录
-c /etc/passed这个第五列的说明内容
-d 指定用户目录的位置
-r 创建一个系统账号,uid一般在500以内
-s 指定用户使用的shell,默认/bin/bash
-e 指定一个日期,格式为"YYYY-MM-DD" 写入shadow第八列
-f 指定密码是否失效,0为立刻失效 l为用不失效
useradd agetest
echo "agetest" | passwd --stdin agetest
chage -d 0 agetest
grep kuuyee /etc/passwd /etc/shadow /etc/group
usermod -c "更改说明" kuuyee
userdel kuuyee
su kuuyee
与su - kuuyee
切换是有区别的,带-
表示切换用户并启用用户的变量,不带-
表示变量设置方式为non-lgin shell
,这种情况下很多原有的变量不会改变。
useradd k
echo "kuuyee ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/kuuyee
chmod 0440 /etc/sudoers.d/kuuyee
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
Martini
框架学习:white_check_mark:✅ 交付成果
😟
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.