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 static string FormatWith(this string format, object source) | |
{ | |
return FormatWith(format, null, source); | |
} | |
public static string FormatWith(this string format, IFormatProvider provider, object source) | |
{ | |
if (format == null) | |
throw new ArgumentNullException("format"); |
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 class HotelSearch | |
{ | |
public static String IndexFolder => Sitecore.Configuration.Settings.DataFolder.EndsWith("\\") | |
? Sitecore.Configuration.Settings.DataFolder + "indexes\\hotel_index" | |
: Sitecore.Configuration.Settings.DataFolder + "\\indexes\\hotel_index"; | |
public void BuildIndex(HotelProperty[] datas) | |
{ | |
var dataFolder = IndexFolder; | |
if (!Directory.Exists(dataFolder)) |
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 python3 | |
#-*- coding=utf-8 -*- | |
import logging | |
import requests | |
import requests.utils | |
import sys | |
import re | |
import os.path | |
import json |
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/sh | |
SCANIP=`grep "Failed" /var/log/secure | awk '{print $(NF-3)}' | sort | uniq -c | awk '{print $1"="$2;}'` | |
for i in $SCANIP | |
do | |
NUMBER=`echo $i | awk -F= '{print $1}'` | |
SCANIP=`echo $i | awk -F= '{print $2}'` | |
echo "$SCANIP:$NUMBER" | |
if [ $NUMBER -gt 10 ] | |
then | |
grep $SCANIP /etc/hosts.deny >/dev/null 2>&1 || echo "sshd:$SCANIP" >> /etc/hosts.deny |
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 bash | |
type='n' | |
pt='3.1' | |
channel=1 | |
pb='320' | |
from='mainsite' | |
kbps='320' | |
app_name='radio_website' | |
client='s:mainsite|y:3.0' |
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 | |
#this file is check "voice.sh" script whether is running | |
#if "voice.sh" script is running , nothing to do | |
#else run "voice.sh" script | |
result=`ps aux | grep -i "voice.sh" | grep -v "grep" | wc -l` | |
echo $result | |
if [ $result -ge 1 ] | |
then | |
echo "voice.sh is running..." |
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
num=$(date "+%H") | |
t=$(date "+%F %T") | |
echo $num | |
if [ $num -le 5 ];then | |
amixer set PCM,0 80% | |
echo "$t ---> 60" >> /tmp/1.log | |
elif [ $num -gt 5 ]&&[ $num -lt 9 ];then | |
amixer set PCM,0 86% | |
echo "$t ---> 70" >> /tmp/1.log | |
elif [ $num -ge 9 ]&&[ $num -lt 13 ];then |
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/sh | |
LOGTIME=$(date "+%F %T") | |
PRO_NAME=frpc | |
NUM=$(ps | grep $PRO_NAME | grep -v grep |wc -l) | |
#echo $NUM >> /tmp/frp.log | |
if [ "${NUM}" -lt "1" ];then | |
echo $LOGTIME $PRO_NAME is stop, restarting.... >> /tmp/frp.log | |
/home/pi/frp/frpc -c /home/pi/frp/frpc.ini -L /home/pi/frp/frpc.log & |
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 | |
filePath=/home/pi/timeaudio | |
#time=`date | awk -F \ {'print $4'} | awk -F : {'print $1'}` | |
time=`date +%H%M` | |
audioFile="$filePath/$time.mp3" | |
echo $audioFile | |
player=/usr/bin/mplayer | |
$player $audioFile |
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
%ConEmuDrive%\msys64\usr\bin\bash.exe --login -i -new_console:C:"%ConEmuDrive%\msys64\msys2.ico" |
OlderNewer