Skip to content

Instantly share code, notes, and snippets.

Avatar

eonezhang eonezhang

  • hnair.com
  • ChengDu
View GitHub Profile
@eonezhang
eonezhang / yaml
Created Mar 27, 2021
ansible获取操作系统版本
View yaml
# https://www.ipcpu.com/2016/01/ansible-setup-when/
# 通过使用 ansible 的 setup 模块,可以将操作系统的版本变量获取并存储在 ansible 内置的变量中, 可以在脚本中直接引用.
- hosts: webserver
vars:
logserver: 10.127.2.170
gather_facts: True
tasks:
- name: add conf to config files to CentOS6
lineinfile: dest=/etc/rsyslog.conf line="*.* @{{ logserver }}"
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == "6"
@eonezhang
eonezhang / Cargo.toml
Created Oct 20, 2018 — forked from nicolov/Cargo.toml
Rust API with Mysql
View Cargo.toml
[package]
name = "api_example"
version = "0.1.0"
authors = ["nicolov"]
[dependencies]
iron = "*"
router = "*"
mysql = "*"
r2d2 = "*"
@eonezhang
eonezhang / idea
Created May 2, 2018 — forked from chrisdarroch/idea
Open a project in IntelliJ IDEA from your command line!
View idea
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`
@eonezhang
eonezhang / build.xml
Created Sep 10, 2016 — forked from millermedeiros/build.xml
RequireJS optimizer Ant task
View build.xml
<?xml version="1.0" encoding="utf-8"?>
<project name="sample-require-js" default="" basedir=".">
<!-- properties -->
<property name="r.js" value="_build/rjs/r.js" />
<property name="closure.jar" value="_build/closure/compiler.jar" />
<property name="rhino.jar" value="_build/rhino/js.jar" />
<property name="js.build" value="_build/js.build.js" />
<property name="css.build" value="_build/css.build.js" />