This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Ubuntu 16.04, user root | |
add-apt-repository ppa:zhaofeng-shu33/gtest | |
apt update | |
apt install libgtest-dev | |
cat <<EOF >> gtest_example.cpp | |
#include <gtest/gtest.h> | |
TEST(MATH, ADD){ | |
EXPECT_EQ(1 + 3, 4); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# get the top 5 processes | |
result=1490.0 | |
mapfile -t proc_list < <(ps --no-headers --sort=-pcpu -Ao pid,pcpu | head -n 5) | |
for i in "${proc_list[@]}"; do | |
process_cpu_list=($i) | |
process_id=${process_cpu_list[0]} | |
cpu_usage_percentage=${process_cpu_list[1]} | |
compare_result=$(awk 'BEGIN{ print '$cpu_usage_percentage'<'$result' }') | |
if [ ! "$compare_result" -eq 1 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function exitJson($err, $msg , $result='') | |
{ | |
echo json_encode(array('err'=>$err, 'msg'=>$msg , 'result'=>$result)); | |
exit(); | |
} | |
$postdata = file_get_contents("php://input"); | |
$jsondata = json_decode($postdata); | |
if($jsondata->ref == 'refs/heads/master'){ // only deploy on master branch | |
$return_val; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"configurations": [ | |
{ | |
"inheritEnvironments": [ | |
"cygwin_64" | |
], | |
"name": "x64-Debug", | |
"includePath": [ | |
"${env.INCLUDE}", | |
"${workspaceRoot}\\**" |
NewerOlder