BuddyPress Theme Remove Sidebar

主体自带了buddypress插件,于是整体的就多了一个buddypress的成员页面,但是由于我的侧边栏比较长,那么这个页面看起来就非常的蛋疼,左侧的内容只有一点点,右边长的一p。于是就想改一下去掉侧边栏,大致搜了以下没有找到合适的插件,那就只能自己动手了。根据这篇文章的内容可以知道,影响页面的其实是page.php。那么直接对page.php动手,参考这篇文章的内容,可以创建一个子主题来实现相关功能,我没有安装插件也不想创建什么新的子主题了,直接在原始的文件上动手。解决问题的方案也比较简单,判断当前页面是不是buddypress相关的页面然后根据情况进行处理即可。
文章中提到了这么一个函数:bp_is_blog_page(),参考http://hookr.io/functions/bp_is_blog_page/的说明:

You can tell if a page is displaying BP content by whether the current_component has been defined.

Continue Reading

IDA Pro v7.3(Hex-Rays Decompilers v7.0): A Team IRA Release

How to install ida+decompilers:
1) Install the provided setup. Simply double click on the executable and use
the provided password.
2) Copy the plugins directory to the installed directory.
3) copy the cfg directory to the installed directory.
4) try the dsync plugin provided. Open the file you wish to decompile, press f5 to decompile. Press ctrl-shft-s to sync decompiler and disassembler views. Select a linein the decompiler and the corresponding disassembly lines will be highlighted. For more info on this plugin google dsync git.

Continue Reading

Porn Data Anaylize — TS伪娘 分类数据浅析

所谓“伪娘”,即通过女装、化妆等手法让外人认为是女性的男性,我们通常可以在各地的漫展上看到相当数量的“伪娘”,这也是二次元文化中的萌属性之一。
而“药娘”则不同,简单来说就是心理性别为女,生理性别为男的跨性别者,他们通常是依靠激素药物改变内分泌,从而让自己身体特征逐渐接近女性。这个群体的人数非常稀少且又特殊,直至去年(2016年?根据参考链接文章编辑时间推测。)才在网络上出现相关讨论,但目前并没有引起社会的广泛关注。

Continue Reading

BeautifulSoup抓取js变量

页面代码:

< div class="myplayer" >
< div class="m1938" >
< script type="text/javascript" >var player_data={"flag":"play","encrypt":0,"trysee":0,"points":0,"link":"\/index.php\/vod\/play\/id\/9221\/sid\/1\/nid\/1.html","link_next":"","link_pre":"","url":"https:\/\/lbbf9.com\/20200325\/WX8h2pjI\/index.m3u8","url_next":"","from":"lbm3u8","server":"no","note":""}< /script >        < script type="text/javascript" src="/static/js/playerconfig.js?t=20200913" >< /script >< script type="text/javascript" src="/static/js/player.js?t=20200913" >< /script >
< style >.MacPlayer{background: #000000;font-size:14px;color:#F6F6F6;margin:0px;padding:0px;position:relative;overflow:hidden;width:100%;height:100%;min-height:100px;}.MacPlayer table{width:100%;height:100%;}.MacPlayer #playleft{position:inherit;!important;width:100%;height:100%;}< /style >
< div class="MacPlayer" >< iframe id="buffer" src="" frameborder="0" scrolling="no" width="100%" height="100%" style="position: absolute; z-index: 99998; display: none;" >< /iframe >< iframe id="install" src="" frameborder="0" scrolling="no" width="100%" height="100%" style="position:absolute;z-index:99998;display:none;" >< /iframe >
< table border="0" cellpadding="0" cellspacing="0" >
< tbody >
< tr >
< td id="playleft" valign="top" style="" >< iframe width="100%" height="100%" src="/static/player/dplayer.html" frameborder="0" allowfullscreen="true" border="0" marginwidth="0" marginheight="0" scrolling="no" >< /iframe >< /td >
< /tr >
< /tbody >
< /table >
< /div >
< script src="/static/player/lbm3u8.js?v=0.5806522403562584" >< /script >< /div >
< /div >

Python代码:

from bs4 import BeautifulSoup as bs
import re
import json
import requests

def get_m3u8_link(url):
    # 直接正则匹配
    print('_' * 70)
    print('[A] 解析播放地址......')
    html_doc = get_url_source_code(url)
    bs = BeautifulSoup(html_doc, "html.parser")
    pattern = re.compile(r"var cms_player = {(.*?);$", re.MULTILINE | re.DOTALL)
    surls = bs.find('script', text=pattern)
    js_string = str(surls.text).replace('var cms_player = ', '').replace(';', '')
    json_data = json.loads(js_string)
    m3u8_link = json_data['url']
    title = bs.title.string
    print('[A] 标题:' + title)
    print('[A] 播放地址:' + m3u8_link)
    print('_' * 70)
    return m3u8_link, title
Continue Reading

更新Blog服务器配置

从14年开始使用这台vps服务器,最近发现jetpack出了问题。貌似是更新php版本之后,新的php-xml模块没有安装,尝试更新相关模块的时候首先要更新epel-release,问题是更新了epel-release之后yum命令就挂了,提示找不到xz!

于是问题就演化成了先有鸡还是先有蛋的问题,如果要解决这个问题那么:

  1. 删除epel-release 7,安装6,然后yum安装xz,xz安装成功之后更新epel-release
  2. 直接编译安装xz:
    wget https://sourceforge.net/projects/lzmautils/files/latest/download?source=typ_redirect  
    mv download\?source\=typ_redirect xz.gz tar -zxvf xz.gz  
    make &make install
    
Continue Reading

Porn Data Anaylize — AI换脸 分类数据浅析(github)

声明:本文中所有数据都是来源于第三方福利网站的数据,本文仅对数据中相关的信息进行解析。本人非常喜欢这些女明星,绝无抹黑之意。

from pyspark.sql.functions import col
import altair as alt
import pandas as pd
from matplotlib import pyplot as plt
%matplotlib inline
csv = spark.read.option("header",True).csv("hdfs://localhost:9000/data2/porn_data_movie.csv")
csv.printSchema()
root
 |-- id: string (nullable = true)
 |-- create: string (nullable = true)
 |-- update: string (nullable = true)
 |-- name: string (nullable = true)
 |-- describe: string (nullable = true)
 |-- source_id: string (nullable = true)
 |-- publish_time: string (nullable = true)
 |-- play_count: string (nullable = true)
 |-- good_count: string (nullable = true)
 |-- bad_count: string (nullable = true)
 |-- link_count: string (nullable = true)
 |-- comment_count: string (nullable = true)
 |-- designation: string (nullable = true)
 |-- category_id: string (nullable = true)
 |-- porn_site_id: string (nullable = true)
 |-- uploader_id: string (nullable = true)
 |-- producer: string (nullable = true)
Continue Reading

Porn Data Anaylize — 上传者 分类信息分析(github)

'''
视频作者 视频分类信息分析
http://www.h4ck.org.cn
by obaby
obaby@mars
email:root@obaby.org.cn
date: 2020.09.04
'''
from pyspark.sql.functions import col
import altair as alt
import pandas as pd
from matplotlib import pyplot as plt
%matplotlib inline
csv = spark.read.option("header",True).csv("hdfs://localhost:9000/data2/porn_data_movie.csv")
csv.printSchema()
root
 |-- id: string (nullable = true)
 |-- create: string (nullable = true)
 |-- update: string (nullable = true)
 |-- name: string (nullable = true)
 |-- describe: string (nullable = true)
 |-- source_id: string (nullable = true)
 |-- publish_time: string (nullable = true)
 |-- play_count: string (nullable = true)
 |-- good_count: string (nullable = true)
 |-- bad_count: string (nullable = true)
 |-- link_count: string (nullable = true)
 |-- comment_count: string (nullable = true)
 |-- designation: string (nullable = true)
 |-- category_id: string (nullable = true)
 |-- porn_site_id: string (nullable = true)
 |-- uploader_id: string (nullable = true)
 |-- producer: string (nullable = true)
csv.select('name', 'describe', 'uploader_id').show()
Continue Reading