页面“Mediawiki修改左侧导航条”与“多个git账号之间的切换 多个git账号指定不同的key”之间的差异

来自linux中国网wiki
(页面间的差异)
跳到导航 跳到搜索
docker>Evan
 
docker>Evan
(导入1个版本)
 
第1行: 第1行:
=修改左侧导航栏字体大小,行距=
 
<pre> #这里是增大,原来的感觉太小了
 
vim ./skins/Vector/components/navigation.less
 
  
注释掉并修改:
+
多个git账号之间的切换 多个git账号指定不同的key
  
111                                li {   
+
ssh可以通过-i使用指定的私钥文件,如:
112                                        /*line-height: 1.125em;*/
 
113                                        line-height: 1.2em;
 
114                                        padding: 0;
 
115                                        padding-bottom: 0.5em;
 
116                                        margin: 0;
 
117                                        /*font-size: @menu-main-body-font-size;*/
 
118                                        font-size: 0.875em;
 
                                        word-wrap: break-word;</pre>
 
  
=修改后的左侧=
+
ssh -i ~/mykey_rsa username@host
<pre>
 
* navigation
 
** mainpage|mainpage
 
*我的导航
 
  
** http://wiki.linuxchina.net/index.php?title=%E5%88%86%E7%B1%BB:Shell |shell
+
但是走ssh协议的git却没有类似的参数可以指定,只能是使用用户默认的ssh私钥。
**http://wiki.linuxchina.net/index.php?title=%E5%88%86%E7%B1%BB:Python |python
+
 
**http://wiki.linuxchina.net/index.php?title=%E5%88%86%E7%B1%BB:Ops |ops
+
而git 一般也是用key认证的,如果你来我一样的情形 ,怎么办 ? 先假设我有两个账号,一个是github上的,一个是公司gitlab上面的。先为不同的账号生成不同的ssh-key
** http://www.linuxchina.net|linuxchina.net
+
 
** http://blog.linuxchina.net|blog.linuxchina.net
+
ssh-keygen  -t rsa -f ~/.ssh/id_rsa_work -C evan886@gmail.com
**
+
 
** recentchanges-url|recentchanges
+
然后根据提示连续回车即可在~/.ssh目录下得到id_rsa_work和id_rsa_work.pub两个文件,id_rsa_work.pub文件里存放的就是我们要使用的key
** randompage-url|randompage
+
 
** helppage|help
+
ssh-keygen -t rsa -f ~/.ssh/id_rsa_github -C [email protected]
</pre>
 
  
 +
然后根据提示连续回车即可在~/.ssh目录下得到id_rsa_github和id_rsa_github.pub两个文件,id_rsa_gthub.pub文件里存放的就是我们要使用的key
  
 +
编辑 ~/.ssh/config,设定不同的git 服务器对应不同的key
  
<br/> mediawiki修改左侧导航条
+
在本机添加
 +
<pre>cat ~/.ssh/config
  
搜索栏中输入“mediawiki:sidebar”,然后进行编辑
+
Host github.com
 +
  hostname github.com
 +
  User git
 +
  #port 22
 +
  IdentityFile /home/evan/.ssh/id_rsa_github
 +
  IdentitiesOnly yes
 +
 
 +
</pre>
  
mediawiki:sidebar的原始信息如下:
+
#建一个gitlab别名,新建的帐号使用这个别名做克隆和更新
 +
<pre>Host 192.168.11.11
 +
  HostName 192.168.11.11
 +
  User work
 +
  IdentityFile ~/.ssh/id_rsa_work
  
&nbsp;* navigation<br/> &nbsp;** mainpage|mainpage<br/> &nbsp;** portal-url|portal<br/> &nbsp;** currentevents-url|currentevents<br/> &nbsp;** recentchanges-url|recentchanges<br/> &nbsp;** randompage-url|randompage<br/> &nbsp;** helppage|help<br/> &nbsp;** sitesupport-url|sitesupport
+
</pre>
  
<br/> 第一行(一个前导*)表示导航栏的名称,其提示文本在“mediawiki:navigation”页面中修改,也可以直接输入文字信息(文字不能与内部mediawiki参数页面重名)。
+
打开 [https://github.com/settings/ssh https://github.com/settings/ssh] 把pub key (id_rsa_github.pub) 添加一下
  
后续行(两个前导*)表示实际导航栏的内容,其格式为“链接网址|显示文本”。其中,链接网址有三种类型:
+
  
直接输入http网址,例如直接输入“[http://www.allwiki.com/bbs” http://www.allwiki.com/bbs”]<br/> 文章页面标题,例如输入“天下维客”代表站内文章“[[天下维客|天下维客]]”的网址<br/> mediawiki名字空间的参数页,例如输入“mainpage”代表文字信息参数页面“[[MediaWiki:Mainpage]]”的网址。此类字串还有helppage、portal-url等,请到special:allmessages里面查看更多的此类字串。<br/> 显示文本的设定与导航栏名称设定类似,可以:
+
看到 You’ve successfully 就表示OK了
  
直接输入文字信息<br/> 使用mediawiki名字空间参数页的标题缩写,例如上文默认文本中的“randompage”、“sitesupoort”分别代表“[[MediaWiki:Randompage]]”和“[[MediaWiki:Sitesupport]]”。<br/> 用户可根据需求删除/增加mediawiki:sidebar页面中的项目,修改后左侧导航栏就会发生相应改变。(本方法适用于mediawiki默认的monobook皮肤风格)
+
多个git账号之间的切换 也可以多个github 帐号 [http://memoryboxes.github.io/blog/2014/12/07/duo-ge-gitzhang-hao-zhi-jian-de-qie-huan/ http://memoryboxes.github.io/blog/2014/12/07/duo-ge-gitzhang-hao-zhi-jian-de-qie-huan/]
  
&nbsp; ** http://www.evanlinux.com | 显示文本
+
命令行下的git配置问题: 多个sshkey, 多个用户身份, git alias [http://www.liaohuqiu.net/cn/posts/git-setup-and-setting/ http://www.liaohuqiu.net/cn/posts/git-setup-and-setting/]
  
举例&nbsp;
+
Git Config 命令查看配置文件 [https://cnbin.github.io/blog/2015/06/19/git-config-ming-ling-cha-kan-pei-zhi-wen-jian/ https://cnbin.github.io/blog/2015/06/19/git-config-ming-ling-cha-kan-pei-zhi-wen-jian/]
  
<br/> &nbsp;*我的导航&nbsp;<br/> &nbsp;**文章标题项&nbsp;<br/> &nbsp;**[http://www.linuxchina.net http://www.linuxchina.net] &nbsp;|linuxchina.net &nbsp;&nbsp;<br/> &nbsp;**[http://wiki.linuxchina.net/index.php?title=分类:Python http://wiki.linuxchina.net/index.php?title=%E5%88%86%E7%B1%BB:Python] |python
+
ssh-keygen -t rsa -f ~/.ssh/id_rsa_evan -C evan886@gmail.com
  
<br/> Mediawiki修改左侧导航条<br/> [http://codex.wordpress.org.cn/Mediawiki修改左侧导航条 http://codex.wordpress.org.cn/Mediawiki%E4%BF%AE%E6%94%B9%E5%B7%A6%E4%BE%A7%E5%AF%BC%E8%88%AA%E6%9D%A1]<br/> [http://mi-shang.org/修改MediaWiki左侧导航条 http://mi-shang.org/%E4%BF%AE%E6%94%B9MediaWiki%E5%B7%A6%E4%BE%A7%E5%AF%BC%E8%88%AA%E6%9D%A1]<br/> [http://www.xiuyuanxi.com/index.php?title=MediaWiki左侧导航修改 http://www.xiuyuanxi.com/index.php?title=MediaWiki%E5%B7%A6%E4%BE%A7%E5%AF%BC%E8%88%AA%E4%BF%AE%E6%94%B9]
+
[https://www.linuxchina.net/?p=3393 https://www.linuxchina.net/?p=3393]
  
 
&nbsp;
 
&nbsp;
  
=see also=
+
&nbsp;
[https://blog.mimvp.com/article/7180.html mediawiki 常用参数设置]
 
  
[[Category:wiki]]
+
[[Category:git]]

2017年1月23日 (一) 09:56的版本

多个git账号之间的切换 多个git账号指定不同的key

ssh可以通过-i使用指定的私钥文件,如:

ssh -i ~/mykey_rsa username@host

但是走ssh协议的git却没有类似的参数可以指定,只能是使用用户默认的ssh私钥。

而git 一般也是用key认证的,如果你来我一样的情形 ,怎么办 ? 先假设我有两个账号,一个是github上的,一个是公司gitlab上面的。先为不同的账号生成不同的ssh-key

ssh-keygen  -t rsa -f ~/.ssh/id_rsa_work -C [email protected]

然后根据提示连续回车即可在~/.ssh目录下得到id_rsa_work和id_rsa_work.pub两个文件,id_rsa_work.pub文件里存放的就是我们要使用的key

ssh-keygen -t rsa -f ~/.ssh/id_rsa_github -C [email protected]

然后根据提示连续回车即可在~/.ssh目录下得到id_rsa_github和id_rsa_github.pub两个文件,id_rsa_gthub.pub文件里存放的就是我们要使用的key

编辑 ~/.ssh/config,设定不同的git 服务器对应不同的key

在本机添加

cat ~/.ssh/config

Host github.com
  hostname github.com
  User git
  #port 22
  IdentityFile /home/evan/.ssh/id_rsa_github
  IdentitiesOnly yes
  
  1. 建一个gitlab别名,新建的帐号使用这个别名做克隆和更新
Host 192.168.11.11
  HostName 192.168.11.11
  User work
  IdentityFile ~/.ssh/id_rsa_work

打开 https://github.com/settings/ssh 把pub key (id_rsa_github.pub) 添加一下

ssh -vT [email protected]

看到 You’ve successfully 就表示OK了

多个git账号之间的切换 也可以多个github 帐号 http://memoryboxes.github.io/blog/2014/12/07/duo-ge-gitzhang-hao-zhi-jian-de-qie-huan/

命令行下的git配置问题: 多个sshkey, 多个用户身份, git alias http://www.liaohuqiu.net/cn/posts/git-setup-and-setting/

Git Config 命令查看配置文件 https://cnbin.github.io/blog/2015/06/19/git-config-ming-ling-cha-kan-pei-zhi-wen-jian/

ssh-keygen -t rsa -f ~/.ssh/id_rsa_evan -C [email protected]

https://www.linuxchina.net/?p=3393