Tech jibber-jabbers

Just so you know, I play Xbox/3DS/PSV too...╮(╯▽╰)╭

Project Yet Name Unknown

Some initial ideas about this project.

By the end of year 2015, I start to get my hands on some DevOps works by chance. It turns out pretty interesting. I am surprised, shamed that how little that I know of this area, and amazed by how fast the technology evolves. Puppet, Chef, MCollective, Docker…all these fancy terms make me so eager to put them on my LinkedIn profile, which ends with this open source idea. Well…I am not even sure about the term “Open Source” is legit in my case. I will probably just put all my codes and documentations somewhere on the Internet publicly and that’s all.

Okay, back to the topic. I am thinking of building a dev to release style of pipeline to reduce the unnecessary distraction from non dev works by providing a sort of user friendly interface to inspect a vm’s states. At least for the demo and testing purpose. I don’t really see too much of actual enterprise level benefits from this project. More of self education purpose.

After couple hours of research, I come out this premature technology candidates:

  1. Container will be hosted by AWS Docker enabled environment.
  2. Jenkins CI(Continuous Integration) Jobs will be triggered by github post commit actions.
  3. Chef runs will be kicked by Jenkins job.
  4. Possibly integrates with kitchen for Chef testing.

Roughly saying, I want to give it like a 6 months plan. After first three months named stage one, I would want to be able show it to my team as my side project. So it may focus on a certain set of use cases. The last three months named stage two, I would want to focus on optimizing its scalability. And if goes well I can learn more feedback from the community if this project really worth taking a look at.

Stage one will do a one week sprint planning. I will divide epics based on technology key word:

  1. AWS + Docker
  2. Jenkins CI
  3. Chef Kitchen testing

Sprint 02-17 ~ 02-24:

  1. Learning 101 on AWS + Docker. Deliverable: re-open my aws account, set up a running instance, install docker.

  2. Learning 101 on Jenkins. Deliverable: Install Jenkins on the docker image.

Git repo: https://github.com/YusiZhang/Project0

Shell Usage Tip

Source env setting

When I tried to write a shell script to set some environment variables that will stay in that shell session, I found the changes I made was lost after that shell process terminated.

For example, my proxyon.sh is like this:

1
2
3
4
5
#!/bin/sh
export http_proxy="http://myproxy.com:80"
export https_proxy=$http_proxy
export HTTP_PROXY=$http_proxy 
echo $http_proxy

Then in the shell terminal, instead of running sh proxyon.sh, I can use source proxyon.sh to make sure all the env changes stays during the current shell session.

Check running process

1
ps -ef

For example, if I want to know if weblogic server is running or not, do this.

1
ps -ef | grep java | grep wls

List hidden files

1
ls -a

or if you install tree

1
tree -a

Find a file

Find by file name under the current folder.

1
find . -name "keyword"

MD5 check sum

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[ec2-user@ip-172-31-23-84 ~]$ mkdir md5test
[ec2-user@ip-172-31-23-84 ~]$ cd md5test/
[ec2-user@ip-172-31-23-84 md5test]$ ls
[ec2-user@ip-172-31-23-84 md5test]$ touch file1.txt file2.txt
[ec2-user@ip-172-31-23-84 md5test]$ ls
file1.txt  file2.txt
[ec2-user@ip-172-31-23-84 md5test]$ md5sum *.txt > md5sumtest.md5
[ec2-user@ip-172-31-23-84 md5test]$ cat md5sumtest.md5 
d41d8cd98f00b204e9800998ecf8427e  file1.txt
d41d8cd98f00b204e9800998ecf8427e  file2.txt
[ec2-user@ip-172-31-23-84 md5test]$ echo "xxxx" > file1.txt 
[ec2-user@ip-172-31-23-84 md5test]$ md5sum -c md5sumtest.md5 
file1.txt: FAILED
file2.txt: OK
md5sum: WARNING: 1 computed checksum did NOT match
[ec2-user@ip-172-31-23-84 md5test]$ cat file1.txt 
xxxx
[ec2-user@ip-172-31-23-84 md5test]$ cat /dev/null > file1.txt 
[ec2-user@ip-172-31-23-84 md5test]$ md5sum -c md5sumtest.md5 
file1.txt: OK
file2.txt: OK

Clojure Cheatsheet

Define Function

Write a function which returns a personalized greeting. (= (__ “Dave”) “Hello, Dave!”)

Hello World

1
(fn [name] (str "Hello, ", name, "!"))

or

“#(str "Hello, ” % “!”)"

Mark Down Cheatsheet

Headings

1
2
3
# The largest heading (an <h1> tag)
## The second largest heading (an <h2> tag)
###### The 6th largest heading (an <h6> tag)