nvm 使用淘宝镜像

由于网络原因 nvm 在安装的时候速度很慢,这个问题可以通过翻墙等方式去解决,也可使用国内镜像来加速安装,本文介绍的是通过淘宝镜像使用 nvm 安装 Node.js
指定 nvm 的镜像需要在环境配置中增加 NVM_NODEJS_ORG_MIRROR ,我这里的 terminal shell 是 oh-my-zsh 所以编辑环境文件:
Shell

vim ~/.zshrc

在最后增加:

export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node

然后使环境生效:
Shell

source ~/.zshrc

如果怀疑环境配置文件是否生效可以将改配置打印出来
Shell

echo $NVM_NODEJS_ORG_MIRROR

能看到输出“http://npm.taobao.org/mirrors/node”即表示环境已经生效。

让Special-K系列破解工具运行在macOS sierra 10.12上

  • 最新补充:

国外大神已发布Special K for Sierra Utility工具,可以不用下面的手工操作,工具和操作方法请移步到:
http://bbs.feng.com/read-htm-tid-10814293.html

CORE Keygen系列注册机在macOS sierra 10.12(16A323)上运行方法请看这里
http://bbs.feng.com/read-htm-tid-10808347.html



大家都知道目前在macOS sierra 10.12里运行不了注册机,据说是因为签名问题,等那些大神们更新不知等到猴年马月,还是自己动手吧


需要准备的工作:
你的mac上要有Xcode,没有的话去App store里搜索下载,文件比较大,4G多



操作环境:macOS sierra 10.12(16A323)

这里先拿Path Finder 7.X  Special-K系列的注册机举例子

1,把需要注册Path Finder.app拖入/Applications

2,在Path Finder 7.X  [SP].app上点击右键——显示包含内容——Contents——MacOS
你会看到这两个文件  eyePatch,patcher

              

3,打开终端,按照下面的次序拖入文件(拖入次序十分关键)

patcher
Path Finder.app
eyePatch

Path Finder.app
回车
得到回复(没有这个回复说明没有注册成功)
code_alloc_xc_ios: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
如图


如果没有装Xcode,回车,结果是这样的,Path Finder.app注册失败。Xcode的作用就是提供提供程序运行的框架,让patcher和eyePatch可以像Path Finder 7.X  [SP].app那样运行在操作系统中


4,打开Path Finder.app,显示已注册

●要点,
Xcode很关键,整个过程没有运行
Path Finder 7.X  [SP].app,只是用了里面的两个关键文件,Xcode起到了自动填写注册码和破解的动作。App Store里下载完成以后,一定要先点击Xcode,运行安装。(Xcode尽量通过苹果官方渠道下载,以前XcodeGhost病毒就是一些开发者从非官方渠道下载Xcode感染的

Special-K注册机存放位置,一般在任何地方都可以,如果按照上面的方法不成功,请把Special-K注册机放到应用程序里,和需被注册程序同在/Applications

eyePatch,patcher和被破解程序拖入终端的次序很重要,一定要按照次序

Yum 安装 PhpMyAdmin 最新版

原文链接:https://tecadmin.net/how-to-install-phpmyadmin-on-centos-using-yum/

 

PhpMyAdmin is a well most popular web-based client for managing MySQL server. PHPMyAdmin is written in PHP programming language. It provides a user-friendly web interface to access and manage your databases. To ease usage to a wide range of people, phpMyAdmin is being translated into 72 languages and supports both LTR and RTL languages. This article will help you to install phpMyAdmin on CentOS/RedHat System.

Prerequsities

In order to use PHPMyAdmin, you must have PHP, MySQL and Apache installed on your system. Also, you need PHP-MySQL or PHP-MySQLi module enabled in PHP configuration. For the current version of PHPMyAdmin 4.7.2, the requirements are as follows.

  • Apache >= 2.2
  • PHP >= 5.5
  • MySQL/MariaDB >= 5.5

Use the tutorial: Installing Apache MySQL PHP on CentOS and RedHat

Enable Remi Repository

phpMyAdmin most updated package is available under Remi repository. Install it in your system using following commands.

CentOS/RHEL 7:
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

CentOS/RHEL 6:
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Fedora 26:
# rpm -Uvh http://rpms.famillecollet.com/remi-release-26.rpm

Fedora 25:
# rpm -Uvh http://rpms.famillecollet.com/remi-release-25.rpm

Fedora 24:
# rpm -Uvh http://rpms.famillecollet.com/remi-release-24.rpm

Install PhpMyAdmin

After enabling Remi repository on your system, let’s start the with the installation of phpMyAdmin using yum package manager. All the dependencies will automatically be installed.

# yum --enablerepo=remi,remi-test  install phpMyAdmin

Configure PhpMyAdmin

phpMyAdmin by default allowed to access from localhost only. If you want to make it accessible from remote computers edit /etc/httpd/conf.d/phpMyAdmin.conf and update all 127.0.0.1 with your network like below or enable phpMyAdmin access for everyone.

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

## Comment below section to allow everyone
<Directory /usr/share/phpMyAdmin/>
    <IfModule !mod_authz_core.c>
     Order Deny,Allow
     Deny from All
     Allow from 192.168.1.0/24
     Allow from ::1
   </IfModule>
</Directory>

<Directory /usr/share/phpMyAdmin/libraries/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

After updating phpMyAdmin Apache configuration file, restart Apache service to reload new settings.

# service httpd restart

Access phpMyAdmin in Browser

Now you can access phpMyAdmin in a browser using the following URL. Change svr1.tecadmin.net with your server IP/FQDN.

http://svr1.tecadmin.net/phpMyAdmin/

Login Details: Use MySQL username and password.

phpMyAdmin-Login-Screen

Congratulation’s You have successfully installed phpMyAdmin. Using single phpMyAdmin we can manage multiple MySQL servers by adding multiple remote MySQL server. Use this article to add multiple MySQL hosts in phpMyAdmin.

angular 安装运行没有权限的问题

问题症状

g new my-project
/usr/local/lib/node_modules/angular-cli/node_modules/configstore/index.js:54
                throw err;
                ^

Error: EACCES: permission denied, open '/Users/xuys/.config/configstore/ember-cli.json'
You don't have access to this file.

    at Error (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.fs.readFileSync (fs.js:397:15)

解决方法:

修改ng目录的权限为当前用户的权限。

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

 

Ubuntu 链接提示令牌验证出错 ARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

➜  ~ ssh  root@218.241.xxx 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:dg94ZKYfRhqsmEW2P5uofC1AtrlbevWQ6eX3ylI2Z8Q.
Please contact your system administrator.
Add correct host key in /Users/xuys/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/xuys/.ssh/known_hosts:31
RSA host key for 218.241.xxx has changed and you have requested strict checking.
Host key verification failed.

 

解决办法

ssh-keygen -R 218.241.xxx.xxx

刷新令牌

重新链接即可!

docker 安装jenkins 日志

前提:阿里云容器服务加自有Ubuntu服务器

1、从阿里云容器服务里创建应用,选择从镜像安装、搜索jenkins获取官方镜像安装。

2、配置docker配置,可以用http访问、简单路由。

3、访问链接访问镜像服务。

4、填写jenkins生成的秘钥,在服务器上运行 docker logs 容器id  ,复制密码,输入jenkins的验证中。继续完成安装。

5、新建项目,添加git项目。

登录容器 运行ssh-keygen -t rsa -C “xuyscn@163.com” 生成ssh私钥和公钥。

路径为/var/jenkins_home/.ssh/id_rsa 和/var/jenkins_home/.ssh/id_rsa.pub (命令行中有提示)。

注:如果是docker容器,必须是登录容器里生成的公钥私钥,即是jenkins所在服务器的ssh私钥公钥。

6、将这个私钥加到jenkins控制台的Credentials 里。

7、将公钥复制到git仓库的公钥里。

 

WordPress 自定义文章类型增加taxonomy 下载过滤器

1、打开文件  /wp-admin/includes/class-wp-posts-list-table.php,在452行处添加代码。

do_action( 'custome_dropdown_taxonomy', $post_type );

 

Snip20170214_93

2、在主题functiuon 文件里加下面的函数即可实现。

custome_catalog 换成自己新建的文章taxonomy
function orhoncms_custom_taxonomy_dropdown($post_type){

	if ( is_object_in_taxonomy( $post_type, 'custome_catalog' ) ) {
		$dropdown_options = array(
			'show_option_all' => get_taxonomy( 'custome_catalog' )->labels->all_items,
			'hide_empty' => 0,
			'hierarchical' => 1,
			'show_count' => 0,
			'orderby' => 'name',
			'taxonomy'          => 'custome_catalog',
			'show_count'        => 1,
		);

		echo '<label class="screen-reader-text" for="cat">' . __( 'Filter by category' ) . '</label>';
		wp_dropdown_categories( $dropdown_options );
	}
}
add_action( 'custome_dropdown_taxonomy', 'orhoncms_custom_taxonomy_dropdown' );

注释: 当前版本 4.6.1

WordPress 获取文章的缩略图代码

当设置的“特色图”的时候调用特色图,如果没有则调用文章的第一个图片,如果还没有就调用主题默认图片。

<a href="<?php the_permalink(); ?>">
    <?php 
      if (has_post_thumbnail()) { 
        the_post_thumbnail( 'thumbnail'); 
      }else{ 
        $args=array( 'post_type'=>'attachment','numberposts' => 1,'post_status' => null,'post_parent' => $post->ID); 
        $attachments = get_posts( $args ); 
        if($attachments){ 
          foreach($attachments as $attachment){ 
            $src = (array) wp_get_attachment_image_src( $attachment->ID, 'thumbnail');
            if($src){ ?>
              <img src="<?php echo $src[0]; ?>" height="280" width="300" />
            <?php 
            } 
          } 
        }else{ ?>
          <img src="<?php echo get_template_directory_uri(); ?>/images/default_thumbnail.png" height="280" width="300" />
          <?php 
        } 
      } 
    ?>
</a>