Skip to content

Instantly share code, notes, and snippets.

@forthxu
forthxu / mysql
Created August 28, 2012 08:23
class mysql
<?php
defined('IN_FORTH') or die('Access Denied.');
class MySql {
public $queryCount = 0;
public $conn;
public $result;
//构造函数
@forthxu
forthxu / test google ips
Last active August 29, 2015 14:02
google g-f-w pings
#!/usr/bin/python
#-*- coding:utf8 -*-
'''
Created on 2014-06-02
# QQ:263967133
# pings运行一般运行一次就够了,自己选一个ip段
# google ip地址段
# 64.233.160.0 - 64.233.191.255
# 66.102.0.0 - 66.102.15.255
@forthxu
forthxu / apkinfo.sh
Last active June 6, 2022 07:19
获取apk的name,icon,version,permissions,RSA等信息
#!/bin/bash
#@author forthxu.com
#说明
#找到获取apk信息有两种方式
#一种解压后读取AndroidManifest.xml,解压最好不要通过unzip因为获取的是压缩过的内容,读取不准确,可用apktool反编译解压
#另外一种可通过aapt也就是官方sdk中提供的工具读取信息
#aapt和apktoool工具 https://code.google.com/p/android-apktool
#可能存在的问题 http://www.qiansw.com/centos-apk-apktool.html
#扩展阅读,汉化apk http://bbs.dospy.com/thread-9991523-1-354-1.html
@forthxu
forthxu / zaoan.sh
Created January 7, 2015 15:57
播放一首音乐然后 叫你起床 连续三遍 都是随机的
#!/bin/bash
#叫床声可以去www.nsjnqc.com找或百度
files_dir='/workspace/work/other/zaoan/';
musics_dir='/workspace/work/other/mp3/';
i=0;
j=0;
files=();
musics=();
for file in $(ls ${files_dir});do
@forthxu
forthxu / wanan.sh
Created January 7, 2015 15:59
晚安版
#!/bin/bash
musics_dir='/workspace/work/other/mp3/';
j=0;
musics=();
for file in $(ls ${musics_dir});do
musics[$j]=$file;
let "j+=1";
done
@forthxu
forthxu / redis-server
Last active August 29, 2015 14:14 — forked from tessro/redis-server
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
@forthxu
forthxu / STD3Des.java
Last active September 21, 2018 12:58
3des加密java版和php版
// javac test3.java
// java test3
import java.security.Key;
import javax.crypto.Cipher;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;
import javax.crypto.spec.IvParameterSpec;
@forthxu
forthxu / app_tag.py
Created January 31, 2015 08:23
豌豆荚采集
#!/usr/bin/env python
#coding:utf-8
# import sys
# reload(sys)
# sys.setdefaultencoding('utf-8')
import types
import urllib2
import json
import MySQLdb
import time
@forthxu
forthxu / Pagination.php
Created February 13, 2015 09:30
php独立分页类
<?php
/**
* @Date : 13-12-5 下午12:46
* @File : Pagination.php
* @Desc :
*  *  独立分页类
*  *  调用方式:
*  *  $pagenation = new Pagination( 4, 10, 200 ); // 4(第一个参数) = currentPage, 10(第二个参数) = pageSize, 200(第三个参数) = 总数
*  *  $pagenation->set_link( 'http://www.exmple.com' );
*  *  echo $pagenation->create();
@forthxu
forthxu / medoo.php
Created February 13, 2015 09:31
The lightest PHP database framework to accelerate development
<?php
/*!
* Medoo database framework
* http://medoo.in
* Version 0.9.6
*
* Copyright 2014, Angel Lai
* Released under the MIT license
*/
class medoo