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 | |
mount_disk() | |
{ | |
sudo umount $disk | |
mkdir ~/Desktop/$diskname | |
sudo mount_ntfs -o rw,auto,nodev,nobrowse,noowners,noatime $disk ~/Desktop/$diskname | |
echo "Mount $disk to ~/Desktop/$diskname" | |
open ~/Desktop/$diskname | |
} |
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 | |
avail=$(df / | tail -n 1 | awk '{print $4}') | |
threshold="" | |
message="硬盘要满啦" | |
token="" | |
if [[ ${avail:?} -lt ${threshold:?} ]]; then | |
curl "https://sc.ftqq.com/${token:?}.send?text=${message:?}" | |
fi |
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 | |
hwmon_sysfs="/sys/class/hwmon" | |
list=$(find "$hwmon_sysfs"/*) | |
for i in $list; do | |
if [ -e "$i/name" ]; then | |
sensor="$i" | |
else |
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 | |
# Configure by yourself | |
procname="cagent" | |
duration=10 | |
usage() | |
{ | |
echo "$0 {process name} {duration}" | |
echo "By default:" |
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 | |
MOUNTPOINT="$HOME/Nutstore" | |
sudo mount -t davfs https://dav.jianguoyun.com/dav/ "$MOUNTPOINT" |
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
#!/usr/bin/env expect | |
set timeout 6 | |
set send_slow {1 .1} | |
spawn ./lanconf32 textmode | |
expect { | |
"Press any key to continue." {send -s " ";} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
void sig_handler(int signo) | |
{ | |
printf("Signal %d", signo); | |
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 - | |
############################################################################### | |
# FILENAME: | |
# auto_sys_inst.sh | |
# | |
# DESCRIPTION: | |
# Build a live usb disk from rootfs.tgz | |
# | |
# REVISION(MM/DD/YYYY): | |
# 11/22/2011 jia.sui(jia.sui@advantech.com.cn) |
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 | |
# ----------------------------------------------- | |
# | |
# rpm_file.sh | |
# | |
# Description: Get type and RPM owner of files under a given path. | |
# | |
# usage: | |
# ./rpm_file.sh [PATH] | |
# param: |
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 | |
[ -z $1 ] && echo "Missging git src path" && exit 1 | |
git_src=$1 | |
cd $git_src | |
make prefix=/usr | |
sudo make prefix=/usr install |