Skip to content

Instantly share code, notes, and snippets.

{
"catalogues": {
"index": "#",
"name": "巡检项目",
"date": "时间",
"type": "巡检结果"
},
"items":[
{
"index": 1,
@melice
melice / shadowsocks.sh
Created September 20, 2019 07:06 — forked from Jacksgong/shadowsocks.sh
backpu teddysun ss installation script
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================================#
# System Required: CentOS 6+, Debian 7+, Ubuntu 12+ #
# Description: One click Install Shadowsocks-Python server #
# Author: Teddysun <[email protected]> #
# Thanks: @clowwindy <https://twitter.com/clowwindy> #
# Intro: https://teddysun.com/342.html #
#=================================================================#
centos下安装 jenkins
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
yum install jenkins
/usr/lib/jenkins/jenkins.war WAR包
@melice
melice / centos_java8.sh
Last active June 5, 2018 06:31
script for install java 8u171 for centos x64
# script for install java 8u171 for centos x64
# download
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.rpm"
# yum install
yum localinstall jdk-8u171-linux-x64.rpm
@melice
melice / cliboard.bat
Created November 2, 2017 09:00
cliboard.bat
#run this when RDP clipboard not working
taskkill -im rdpclip.exe -f
rdpclip.exe
@melice
melice / word2pdf.pas
Created October 16, 2017 14:04
office word docx save to pdf
program word2pdf;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
System.Variants,
System.Win.ComObj,
Word2000,
Vcl.OleServer;
const
@melice
melice / mobilepage.js
Last active November 23, 2016 08:38
mobile auto jump js
<script>
(function(a,b){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kw
@melice
melice / getQueryString.js
Last active October 29, 2016 08:50
getQueryString
function getQueryString(name) {
location.href.replace("#", "");
// 如果链接没有参数,或者链接中不存在我们要获取的参数,直接返回空
if (location.href.indexOf("?") == -1 || location.href.indexOf(name + '=') == -1) {
return '';
}
// 获取链接中参数部分
var queryString = location.href.substring(location.href.indexOf("?") + 1);
// 分离参数对 ?key=value&key2=value2
var parameters = queryString.split("&");
@melice
melice / youtube.php
Last active August 17, 2016 08:35
fetch youtube channel as RSS
<?php
// origin : https://gist.github.com/Skalman/801436d9693ff03bc4ce
if (!isset($_GET['url'])) {
?>
<!DOCTYPE html>
<meta charset="utf-8">
<title>Youtube RSS creator</title>
<form>
<p>Create an RSS feed for the videos on the following page:
@melice
melice / loadNprepare.php
Created August 12, 2016 07:50
php file_get_contents loadHTML 乱码
function loadNprepare($url,$encod='') {
$content = file_get_contents($url);
if (!empty($content)) {
if (empty($encod))
$encod = mb_detect_encoding($content);
$headpos = mb_strpos($content,'<head>');
if (FALSE=== $headpos)
$headpos= mb_strpos($content,'<HEAD>');
if (FALSE!== $headpos) {
$headpos+=6;