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 | |
if [ $# -ne 1 ] | |
then | |
echo "Usage: getmobileuuid the-mobileprovision-file-path" | |
exit 1 | |
fi | |
# mobileprovision_uuid=`grep UUID -A1 -a $1 | grep -o "[-A-Z0-9]\{36\}"` | |
mobileprovision_uuid=`/usr/libexec/PlistBuddy -c "Print UUID" /dev/stdin <<< $(/usr/bin/security cms -D -i $1)` | |
echo "UUID is:" | |
echo ${mobileprovision_uuid} |
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
sed 's/\x1b\[[0-9;]*m//g' |
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
typedef NS_ENUM(NSInteger, JHAlcoholCategory) { | |
JHAlcoholCategoryWhiteSpirit = 1, | |
JHAlcoholCategoryChampagne = 11, | |
JHAlcoholCategoryWine = 12, | |
JHAlcoholCategoryLiquer = 16, | |
JHAlcoholCategoryBeer = 17, | |
JHAlcoholCategoryWineset = 19, | |
JHAlcoholCategoryGift = 18, | |
JHAlcoholCategorySet = 20, | |
JHAlcoholCategoryOneKey = 21, |
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
const Mocha = require("mocha"); | |
var constants = Mocha.Runner.constants; | |
var EVENT_RUN_END = constants.EVENT_RUN_END; | |
var EVENT_SUITE_BEGIN = constants.EVENT_SUITE_BEGIN; | |
var EVENT_SUITE_END = constants.EVENT_SUITE_END; | |
var EVENT_TEST_PASS = constants.EVENT_TEST_PASS; | |
const t = new Mocha(); | |
t.addFile("./all.spec.js"); |
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
const path = require('path'); | |
const express = require('express') | |
const app = express() | |
const archiver = require('archiver') | |
app.get('/', function(req, res) { | |
const archive = archiver('zip'); | |
archive.on('error', function(err) { |
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
/* 百度拼音输入法BCD词库文件解析 | |
* Copyright (c) 2010 Xiaoyun Zhu | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* |
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 | |
baseDir="/data/backup/mysql"; | |
userName="root" | |
password="123456" | |
host="127.0.0.1" | |
backup() { | |
echo "开始备份数据库: $1" | |
mysqldump -h$host -u$userName -p$password --default-character-set=utf8 $1 | gzip > $baseDir/$1_dump_$(date +%Y%m%d_%H%M%S).sql.tar.gz | |
echo "备份数据完成"; |
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 python | |
#-*- coding:utf-8 -*- | |
import urllib2 | |
import urllib | |
import json | |
import time | |
import socket | |
public_dic={} | |
public_dic["login_email"]="" #replace your email |
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
// https://github.com/qbright/fmp-timing/blob/master/src/fmp-timing.js | |
const START_TIME = performance && performance.timing.responseEnd; | |
const IGNORE_TAG_SET = ["SCRIPT", "STYLE", "META", "HEAD", "LINK"]; | |
const TAG_WEIGHT_MAP = { | |
SVG: 2, | |
IMG: 2, | |
CANVAS: 4, |
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 | |
# https://ruby-china.org/topics/31942 | |
# Install | |
yum install -y epel-release | |
yum install -y certbot | |
# 使用方法:certbot certonly --webroot -w [Web站点目录] -d [站点域名] -m [联系人email地址] --agree-tos | |
certbot certonly --webroot -w /opt/www/demo.mydomain.com -d demo.mydomain.com -m myname@gmail.com --agree-tos |
NewerOlder