This file contains 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 | |
URL="https://www.zq12369.com/" | |
DATA=`curl --noproxy "*" -s $URL` | |
FORECAST_DATA=`echo $DATA | pup 'div[class="forecast"] json{}'` | |
AQI_DATA=`echo $DATA | pup 'div[class="aqidetail"] json{}' | jq '.[0].children'` | |
curl -s 'https://www.zq12369.com/' | pup 'div[class="aqibg aqibanner1"]' | pup 'div[class="aqi"] json{}' | jq -cMr '.[0].text' |
This file contains 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 | |
#set -x | |
VERSION="1.6.1" | |
JQ_BIN=jq | |
LAST_TIME_FILE='/tmp/wea_last_time' | |
LAST_WEATHER='/tmp/wea_last_weather' |
This file contains 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 | |
JQ_BIN=/usr/local/bin/jq | |
#MENUFONT="size=13 font=UbuntuMono-Bold" | |
MENUFONT="size=15" | |
COLORS=("#0ed812" "#ffde33" "#ff9933" "#cc0033" "#660099" "#7e0023") | |
CURRENT_WEA_URL="https://tianqiapi.com/api/?version=v6&appid=76961778&appsecret=K1Evb4rc" | |
DATA=`curl --noproxy "*" -s "${CURRENT_WEA_URL}"` |
This file contains 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 | |
# <bitbar.title>Homebrew Updates</bitbar.title> | |
# <bitbar.author>killercup</bitbar.author> | |
# <bitbar.author.github>killercup</bitbar.author.github> | |
# <bitbar.desc>List available updates from Homebrew (OS X)</bitbar.desc> | |
exit_with_error() { | |
echo "err | color=red"; | |
exit 1; | |
} |
This file contains 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 | |
echo -e "\033[34m[umount] /home/hcy/mycloud/data... \033[0m" | |
umount /home/hcy/mycloud/data > /dev/null 2>&1 | |
echo -e "\033[34m[umount] /home/hcy/mycloud/public... \033[0m" | |
umount /home/hcy/mycloud/public > /dev/null 2>&1 | |
echo -e "\033[34m[umount] /home/hcy/mycloud/tddownloads... \033[0m" | |
umount /home/hcy/mycloud/tddownloads > /dev/null 2>&1 | |
echo -e "\033[34m[mount] /nfs/Data to /home/hcy/mycloud/data... \033[0m" |
This file contains 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
class Linux_0_01 | |
{ | |
int restart_syscall(); //0 | |
int exit(); //1 | |
int fork(); //2 | |
int read(); //3 | |
int write(); //4 | |
int open(); //5 | |
int close(); //6 | |
int waitpid(); //7 |
This file contains 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
/** | |
* \file include/stx/btree.h | |
* Contains the main B+ tree implementation template class btree. | |
*/ | |
/* | |
* STX B+ Tree Template Classes v0.9 | |
* Copyright (C) 2008-2013 Timo Bingmann <tb@panthema.net> | |
* | |
* Boost Software License - Version 1.0 - August 17th, 2003 |
This file contains 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
public boolean isIntentExisting(Context context, String action) { | |
final PackageManager packageManager = context.getPackageManager(); | |
final Intent intent = new Intent(action); | |
List<ResolveInfo> resolveInfo = | |
packageManager.queryIntentActivities(intent, | |
PackageManager.MATCH_DEFAULT_ONLY); | |
if (resolveInfo.size() > 0) { | |
return true; | |
} | |
return false; |
This file contains 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 | |
# | |
# 多个进行并行执行任务 | |
# | |
SEND_THREAD_NUM=8 | |
tmp_fifofile="/tmp/$$.fifo" # 脚本运行的当前进程ID号作为文件名 | |
mkfifo "$tmp_fifofile" # 新建一个随机fifo管道文件 | |
exec 6<>"$tmp_fifofile" # 定义文件描述符6指向这个fifo管道文件 | |
rm $tmp_fifofile |
This file contains 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
Intent intent = new Intent("com.android.camera.action.CROP"); | |
intent.setDataAndType(Uri.fromFile(capturePicFile), "image/*"); | |
//如何选择 | |
intent.putExtra("aspectX", 1); | |
intent.putExtra("aspectY", 1); | |
//输出大小 | |
intent.putExtra("outputX", 96); |
NewerOlder