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 | |
sudo apt update | |
sudo apt install -y vim zsh git goaccess | |
sudo apt install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2 | |
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list | |
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add | |
sudo apt update | |
sudo apt install -y php-fpm mariadb-server php-mysql php-curl php-xml php-imagick php-mbstring php-zip php-intl mycli | |
sudo a2enmod proxy_fcgi setenvif rewrite |
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 | |
# Based on: https://gist.github.com/XVilka/8346728 | |
awk -v term_cols="${width:-$(tput cols || echo 80)}" 'BEGIN{ | |
s="/\\"; | |
for (colnum = 0; colnum<term_cols; colnum++) { | |
r = 255-(colnum*255/term_cols); | |
g = (colnum*510/term_cols); | |
b = (colnum*255/term_cols); | |
if (g>255) g = 510-g; |
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 | |
m3u="/www/1.m3u" | |
dvrpath="/mnt/media/" | |
echo -n "频道名:" | |
read chan | |
while [ -z $(cat /www/1.m3u | grep ${chan} -A 1 | head -2 | tail -1) ]; do | |
echo -n "无此频道,请重新输入:" | |
read chan | |
done |
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
[Definition] | |
failregex = ^<HOST> - - \[\] ".*" 30[12] \d+ ".*" "[^-].*".*$ | |
ignoreregex = | |
datepattern = ^[^\[]*\[({DATE}) | |
{^LN-BEG} |
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 | |
scp aadps.net:/tmp/db.zip /home/cathiabi/dbback/$(date +%y%m%d).zip | |
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/sh | |
touch /run/tmp | |
vcgencmd measure_temp | cut -d"=" -f2 > /run/temp |
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
with open("/mnt/dev/lexicon.txt", "r") as file1, open("/mnt/dev/l.txt", "w") as file2: | |
for line in file1: | |
items = line.split("\t") | |
if items[3].startswith("nn"): | |
items[3] = "1" | |
elif items[3].startswith("vv"): | |
items[3] = "2" | |
elif items[3].startswith("jj"): | |
items[3] = "3" | |
elif items[3].startswith("rr"): |
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
#!/usr/bin/env python | |
import RPi.GPIO as GPIO | |
import time | |
import requests | |
import os | |
RED=22 | |
YELLOW=27 | |
GREEN=17 |
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
#!/usr/bin/python | |
import sys | |
import Adafruit_DHT | |
import json | |
import time | |
from datetime import datetime | |
def update(hum, temp, t): | |
with open('/var/www/html/data.json', 'r+') as f: | |
data = json.load(f) |
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
#!/usr/bin/env python3 | |
import lilcom | |
import numpy as np | |
a = np.empty((0)) | |
b = lilcom.compress(a) | |
assert b[0] == 76 |
NewerOlder