作者:matrix
发布时间:2019年5月31日
分类:零零星星
对于胶片感兴趣想尝试主要源于腹肌蓝波湾的XT20
,虽然XT20之前没有摄影的经历 不过还是能感受到一丁点的胶片模拟复古静谧的感觉。
相机用的VILIA Soviet
,两个月前ebay海淘的前苏联造物。这个相机需要全部手动操作,估焦、测光这些我都对比手上的xt20进行拍摄,最终效果还算不错,个别照片有点糊和低曝。总体来说很满意啦,毕竟第一次用这玩意拍。不错 不错 以后还得缴学费。
胶卷是淘宝买的iso200柯达彩色135,选的最便宜的一个18块一卷的。起初会担心过安检的X光会让胶片曝光,实际上测试完全没问题,或许iso高的胶卷会有影响。
把胶卷冲洗为电子档的照相馆还真不好找,在成都听朋友说环球中心大概25可以弄。在昆明问了好多家照相馆都不可以,最后找到的是云南师大西南联大校区正门口的大红门照相馆
可以冲洗,30块钱搞定等了2周。
总体效果非常满意,浓重的复古感。毕竟手动估焦还不是很熟悉,曝光也是。 🙈
第一卷胶片
作者:matrix
发布时间:2019年5月26日
分类:零零星星
SQLite Manager是以前@小飞推荐的sqlite管理的插件,当初觉得这个好精简,竟然可以以火狐插件的形式对数据库进行管理,堪称高级货!去年发现因为firefox版本更新不能使用了,现在捡起来是因为临时想对sqlite文件进行查看编辑操作,想起了这个非常轻量级的插件,完全能胜任我的需求,并且我还不想用其他不熟悉的DB管理软件。看到插件被下架、版本不支持,那这次偏要下载使用旧版本的火狐浏览器来解决这个问题。
https://addons.mozilla.org/zh-CN/firefox/addon/sqlite-manager/
这个插件已经被mozilla下架了,lazierthanthou作者有github项目地址。
GitHub:https://github.com/lazierthanthou/sqlite-manager
插件下载
不过可以通过其他方式找到:
下载页面:https://addons.thunderbird.net/en-us/seamonkey/addon/sqlite-manager/
>> cache download SQLite Manager 0.8.3.1
firefox版本问题
youtube上有人说可以用ESR版本来解决插件不能使用的问题,然而进过测试无法使用。最新版本的ESR是基于火狐60.7,对于SQLite Manager插件已经无能为力。
有说firefox57以上版本已经把sqlite引擎去除,所以如果硬是要用那就必须降到支持的版本,理论上小于57应该是可以的。
Firefox 历史版本:
https://ftp.mozilla.org/pub/firefox/releases/
我这里测试使用52.9.0esr
版本,完美运行。
PEACE~
作者:matrix
发布时间:2019年5月16日
分类:Python 零零星星
Django默认模板中如果想要调用变量的属性值只能点.
字符,也就是value.arg
,等同于value["arg"]
的调用,不能使用方括号的语法操作,这样的就会导致无法取value[arg]
这种变量属性值。
解决办法
1.更换模版引擎。
2.使用自定义template filters模版过滤器
使用模版过滤器setup
1.创建templatetags目录
在项目的模块目录下创建templatetags文件夹(和路由配置urls.py同级)
目录下需要创建__init__.py
空白文件
2.创建过滤器py文件
自定义过滤器:dict_value
val.py
from django import template
register = template.Library()
@register.filter(name='dict_value')
def dict_value(value, arg):
"""
模版变量过滤器 用于调用变量属性的值
如:$value[$arg]
:param value:
:param arg:
:return:
"""
return value[arg]
3.模版中使用
模版中需要load
操作:
{% load val %} #载入过滤器文件val.py
{{ params_data|dict_value:item|dict_value:'title' }}#使用过滤器
如上调用形式等同于:
params_data[item]['title']
参考:
https://www.v2ex.com/t/66772
https://docs.Djangoproject.com/en/dev/howto/custom-template-tags/
https://blog.csdn.net/lagelangzhi/article/details/54620061
PEACE~
作者:matrix
发布时间:2019年3月22日
分类:零零星星
有时候使用终端clone操作或者其他install访问外网的时候会造成超级延迟,以至于无法使用,网络需要符合国情,毕竟有个大号防火墙。使用Proxifier
可以间接实现全局的外网访问。
windows端可以使用SSTap
测试环境:macOS + ss + Proxifier
方案1.使用Proxifier
Proxifier下载:http://www.proxifier.com/download/
注册软件:
用户名称随意:Anything
注册码:P427L-9Y552-5433E-8DSR3-58Z68
程序添加完成之后,下方的Action
选择刚刚添加的Proxies,点击ok
之后控制台界面就能看到程序访问外网的情况
终端测试:
$ curl https://ip.cn
方案2.设置全局export变量
$ `vi ~/.bash_profile` #编辑环境变量配置
#添加如下内容
# proxy list
alias proxy='export all_proxy=socks5://127.0.0.1:1086' #需要开启ss
alias unproxy='unset all_proxy'
应用
$ source ~/.bash_profile
之后命令行中使用proxy
和unproxy
来手动开启和关闭代理
参考:
https://www.v2ex.com/t/269997
终端使用 Shadowsocks 的代理方案:Proxifier
https://www.ljjjustin.xyz/2018/03/21/macos-system-proxies/
Proxifier 2.14.1 – Access Internet apps via a firewalled/proxied network
http://yangzq007.com/2017/03/29/%E7%BB%88%E7%AB%AF%E7%BF%BB%E5%A2%99/
作者:matrix
发布时间:2019年3月22日
分类:零零星星
新浪微博ios app的scheme 测试可用
#打开首页
sinaweibo://gotohome
#新发微博
sinaweibo://share?content=[微博内容 URL Encode]
#消息页面
sinaweibo://discover
#指定搜索
sinaweibo://searchall?q=[URL Encode]
#微博扫一扫
sinaweibo://qrcode
#微博详情页
如https://weibo.com/1613133581/HlVM69RR9中mblogid为HlVM69RR9
sinaweibo://detail?mblogid=[mblogid]
#指定用户的全部微博
containerid可以根据https://m.weibo.cn/u/1613133581中查找
sinaweibo://cardlist?containerid=[containerid]
#和指定用户聊天
sinaweibo://messagelist?uid=[uid]
#指定用户资料页
sinaweibo://userinfo?uid=[uid]
参考:
https://www.ryannn.com/archives/url-schemes-share
https://www.v2ex.com/t/163755
https://www.jianshu.com/p/d64b9be5ad64
个人微博插件页面:
http://service.weibo.com/widget/widget_blog.php?uid=1613133581&height=1700&skin=wd_01&showpic=1
作者:matrix
发布时间:2019年3月14日
分类:零零星星
使用vagrant做开发可以将环境全部运行于虚拟机中,避免本机安装各种环境模块造成问题也是为了完全和宿主机分离。
测试:macOS + pycharm + Django项目
配置vagrant的初始化文件
pycharm设置中搜索Vagrant
配置Vagrant的基本运行程序
Vagrant executable
为Vagrant程序路径
Instance folder
表示Vagrant box配置的初始化目录。我这里也就直接将就以前init的目录。默认位置为当前项目路径
设置好就可以启动虚拟机环境:tools->Vagrant->up
打开虚拟机ssh:tools->Start SSH Session
配置python解释器
点击右上角绿色▶️箭头或者Control
+R
按键运行,提示失败是由于使用vagrant项目代码是在本机修改编写在虚拟机中运行,默认的项目启动会调用本机的python环境来运行,项目中的所有module亦同 所以修改下运行的python环境。
pycharm设置中搜索Project Interpreter
进行配置修改
点击右侧设置图标add
新加一个vagrant
环境的Interpreter
添加完成后重新选择新加的虚拟机中的python解释器
之后列表中的可用包名就都是虚拟机中已经安装了的。重新run
也就会成功执行。
配置run
如果运行Django项目还需要给简单编辑一下运行选项Edit Configurations...
打开之后选择新添加的Pyhton Interpreter
,设置Parameters
为Django项目的运行参数runserver
为runserver 0.0.0.0:8080
然后▶️运行项目就OK了。
ssh://vagrant@127.0.0.1:2222/usr/bin/python3.6 -u /pythonWork/okex/okex/manage.py runserver 0.0.0.0:8080
Performing system checks...
...
March 14, 2019 - 07:56:04
Django version 2.1.7, using settings 'okex.settings'
Starting development server at http://0.0.0.0:8080/
Quit the server with CONTROL-C.
解决Unresolved reference错误
编辑器很多提示导包的Unresolved reference 'XXX' more....
错误 在于py文件目录定位错误导致的 需要手动修改下
重新选择import
倒包的包名py文件的目录即可
设置项目的Project Structure
,先选中
报错 提示的python文件的目录,再点击上面的Sources
,之后右侧的Source Folders
就会出现刚刚选中的目录,保存应用即可。
若没有马上生效需要清空缓存且重启File->Invalidate Caches / Restart...
,之后编辑器也就不会提示导包的错误提示Unresolved reference
参考:
https://blog.csdn.net/u013088062/article/details/50346181
https://blog.csdn.net/u013088062/article/details/50346719
https://blog.csdn.net/wqwqwqwq403/article/details/78861255
https://www.cnblogs.com/xiaohuamao/p/6903030.html
PEACE~
作者:matrix
发布时间:2019年3月7日
分类:Wordpress 零零星星
本来几乎少有在blog上放置音乐,但是看到之前的帖子的哪个音频播放UI简直难受的很,已经记不起WP是从多少版本开始有这种协调默认的媒体播放界面。刚开始应该是使用html5的默认audio播放界面,后面就使用MediaElement.js的播放器且覆盖了样式,默认都是黑色调的蓝/白色进度条的那种。
音频播放界面如上图样子,早就该改了的 实在难受 😱 😱
下面的代码来自@Vassilis Mastorostergios
,style很好看 也就照教程搬过来用了。
修改后的样式:
添加样式文件
主题css
目录下新建文件my-theme-player.css
/* Media Element Player styles */
/* Player background */
.mytheme-mejs-container.mejs-container,
.mytheme-mejs-container .mejs-controls,
.mytheme-mejs-container .mejs-embed,
.mytheme-mejs-container .mejs-embed body {
background-color: #efefef;
}
/* Playmejs-time-floater controls */
.mytheme-mejs-container .mejs-button > button {
background-image: url(images/mejs-controls-dark.svg);
}
.mytheme-mejs-container .mejs-time {
color: #888888;
}
/* Progress and audio bars */
/* Progress and audio bar background */
.mytheme-mejs-container .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total,
.mytheme-mejs-container .mejs-controls .mejs-time-rail .mejs-time-total {
background-color: #fff;
}
/* Track progress bar background (amount of track fully loaded)
We prefer to style these with the main accent color of our theme */
.mytheme-mejs-container .mejs-controls .mejs-time-rail .mejs-time-loaded {
background-color: rgba(219, 78, 136, 0.075);
}
/* Current track progress and active audio volume level bar */
.mytheme-mejs-container .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current,
.mytheme-mejs-container .mejs-controls .mejs-time-rail .mejs-time-current {
background: #db4e88;
}
/* Reduce height of the progress and audio bars */
.mytheme-mejs-container .mejs-time-buffering,
.mytheme-mejs-container .mejs-time-current,
.mytheme-mejs-container .mejs-time-float,
.mytheme-mejs-container .mejs-time-float-corner,
.mytheme-mejs-container .mejs-time-float-current,
.mytheme-mejs-container .mejs-time-hovered,
.mytheme-mejs-container .mejs-time-loaded,
.mytheme-mejs-container .mejs-time-marker,
.mytheme-mejs-container .mejs-time-total,
.mytheme-mejs-container .mejs-horizontal-volume-total,
.mytheme-mejs-container .mejs-time-handle-content {
height: 3px;
}
.mytheme-mejs-container .mejs-time-handle-content {
top: -6px;
}
.mytheme-mejs-container .mejs-time-total {
margin-top: 8px;
}
.mytheme-mejs-container .mejs-horizontal-volume-total {
top: 19px;
}
/* WordPress audio playlist styles */
.wp-playlist-light {
box-shadow: 3px 3px 0 #e2e2e2;
}
/* Captions - Track titles / subtitles, time */
.wp-playlist-light .wp-playlist-caption,
.wp-playlist-light .wp-playlist-item-length {
color: #787878;
}
/* Captions - Current track */
.wp-playlist-light .wp-playlist-current-item .wp-playlist-item-title {
font-size: 16px;
}
.wp-playlist-light .wp-playlist-item-album {
font-style: normal;
}
.wp-playlist-light .wp-playlist-item-artist {
text-transform: none;
opacity: .8;
}
/* Playlist items */
.wp-playlist-light .wp-playlist-item {
padding: 10px 0;
border-bottom-color: #efefef;
}
.wp-playlist-light .wp-playlist-item:last-child {
padding-bottom: 0;
}
.wp-playlist-light .wp-playlist-playing {
font-weight: normal;
border-bottom-color: #db4e88;
}
.wp-playlist-light .wp-playlist-item-length {
top: 10px;
}
/*调整优化*/
.mejs-time-float,.mejs-time-float-current,.mejs-time-float-corner{
border:none ;
color: #888888; /*设置文字颜色*/
}
.wp-audio-shortcode a,.wp-playlist a{
border-bottom:none; /*去除主题的a标签全局下划线*/
}
说明:
调整优化部分是我自行添加的,主要是避免和本主题的样式冲突
添加svg播放图标
mejs-controls-dark.svg放置在主题css/images目录下css/images/mejs-controls-dark.svg
下载:
https://d.pr/f/Y83MD
https://pan.baidu.com/s/14P4TOe1StJQfoRHgAmMrkg#提取码: 4pjf
挂载脚本
functions.php适当位置添加css和js加载的钩子
//加载之前新建的my-theme-player.css文件
//判断启用wp-mediaelement才会加载 避免多余的资源请求
add_action( 'wp_footer', 'ci_theme_footer_scripts' );
function ci_theme_footer_scripts() {
if ( wp_style_is( 'wp-mediaelement', 'enqueued' ) ) {
wp_enqueue_style( 'my-theme-player', get_template_directory_uri() . '/css/my-theme-player.css', array(
'wp-mediaelement',
), '1.0' );
}
}
//给MediaElementJs播放器添加自定义样式mytheme-mejs-container 用于重写系统自带css
/**
* Add an HTML class to MediaElement.js container elements to aid styling.
*
* Extends the core _wpmejsSettings object to add a new feature via the
* MediaElement.js plugin API.
*/
add_action( 'wp_print_footer_scripts', 'mytheme_mejs_add_container_class' );
function mytheme_mejs_add_container_class() {
if ( ! wp_script_is( 'mediaelement', 'done' ) ) {
return;
}
?>
<script>
(function() {
var settings = window._wpmejsSettings || {};
settings.features = settings.features || mejs.MepDefaults.features;
settings.features.push( 'exampleclass' );
MediaElementPlayer.prototype.buildexampleclass = function( player ) {
player.container.addClass( 'mytheme-mejs-container' );
};
})();
</script>
<?php
}
PEACE~
参考:
https://www.cssigniter.com/css-style-guide-for-the-default-WordPress-media-player/
https://codex.WordPress.org/Playlist_Shortcode
作者:matrix
发布时间:2019年2月27日
分类:零零星星
TeamViewer使用频繁或者被检测到某些ip段中会被标记为商业行为的使用,也就会要求付费。对应的TeamViewer ID也就会被要求进行商业授权许可。
本来之前使用都是正常,今天给朋友远程执行脚本命令,我连接控制了半分钟就提示断开连接「超时后连接被阻断」,然后等待时间过后就提示了监测到「商业行为」。网上说TeamViewer修改了商业行为的判定导致客户大量流失,TeamViewer目前报价对于单用户单连接/年需要¥2500,有点贵啊。期间尝试过mac端的向日葵远程控制端和系统自带的屏幕共享
,前者只能查看不能操作,后者完全连接不上亦或使用内网VNC地址成功,使用apple id就连接失败,mac端qq就根本没这个功能。
方法0
使用其他工具:
https://anydesk.com/zhs
https://sunlogin.oray.com/zh_CN/download
http://www.xt800.cn/download
参考:https://www.appinn.com/alternative-teamviewer/
有人建议使用俄罗斯版本:https://www.teamviewer.com/ru/
方法1
申述TeamViewerID为个人用户使用,最快7天内解决申请。
https://www.teamviewer.com/en/support/commercial-use-suspected/
2019年3月11日 22:36收到邮件“Your TeamViewer ID has been reset to free”
方法2
TeamViewer会把ID进行标记,所以换一个新的ID就可以使用了。
使用虚拟机VirtualBox
来使用TeamViewer,如果被检测有商业行为就给虚拟机重新初始化MAC地址。这样就可以切换新ID
方法3
使用脚本修改,切换TeamViewer新ID
感谢@zhovner的一键切换脚本TeamViewer ID Changer for MAC OS解决帮了大忙:
测试版本:TeamViewer for macOs V14.0.13880版本
python 2.7.10测试运行
#!/usr/bin/env python
#coding:utf-8
import sys
import os
import glob
import platform
import re
import random
import string
print('''
--------------------------------
TeamViewer ID Changer for MAC OS
--------------------------------
''')
if platform.system() != 'Darwin':
print('This script can be run only on MAC OS.')
sys.exit();
if os.geteuid() != 0:
print('This script must be run form root.')
sys.exit();
if os.environ.has_key('SUDO_USER'):
USERNAME = os.environ['SUDO_USER']
if USERNAME == 'root':
print('Can not find user name. Run this script via sudo from regular user')
sys.exit();
else:
print('Can not find user name. Run this script via sudo from regular user')
sys.exit();
HOMEDIRLIB = '/Users/' + USERNAME + '/library/preferences/'
GLOBALLIB = '/library/preferences/'
CONFIGS = []
# Find config files
def listdir_fullpath(d):
return [os.path.join(d, f) for f in os.listdir(d)]
for file in listdir_fullpath(HOMEDIRLIB):
if 'teamviewer'.lower() in file.lower():
CONFIGS.append(file)
if not CONFIGS:
print ('''
There is no TemViewer configs found.
Maybe you have deleted it manualy or never run TeamViewer after installation.
Nothing to delete.
''')
# Delete config files
else:
print("Configs found:\n")
for file in CONFIGS:
print file
print('''
This files will be DELETED permanently.
All TeamViewer settings will be lost
''')
raw_input("Press Enter to continue or CTR+C to abort...")
for file in CONFIGS:
try:
os.remove(file)
except:
print("Cannot delete config files. Permission denied?")
sys.exit();
print("Done.")
# Find binaryes
TMBINARYES = [
'/Applications/TeamViewer.app/Contents/MacOS/TeamViewer',
'/Applications/TeamViewer.app/Contents/MacOS/TeamViewer_Service',
'/Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Desktop',
]
for file in TMBINARYES:
if os.path.exists(file):
pass
else:
print("File not found: " + file)
print ("Install TeamViewer correctly")
sys.exit();
# Patch files
def idpatch(fpath,platf,serial):
file = open(fpath, 'r+b')
binary = file.read()
PlatformPattern = "IOPlatformExpert.{6}"
SerialPattern = "IOPlatformSerialNumber%s%s%sUUID"
binary = re.sub(PlatformPattern, platf, binary)
binary = re.sub(SerialPattern % (chr(0), "[0-9a-zA-Z]{8,8}", chr(0)), SerialPattern%(chr(0), serial, chr(0)), binary)
file = open(fpath,'wb').write(binary)
return True
def random_generator(size=8, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
RANDOMSERIAL = random_generator()
RANDOMPLATFORM = "IOPlatformExpert" + random_generator(6)
for file in TMBINARYES:
try:
idpatch(file,RANDOMPLATFORM,RANDOMSERIAL)
except:
print "Error: can not patch file " + file
print "Wrong version?"
sys.exit();
print "PlatformDevice: " + RANDOMPLATFORM
print "PlatformSerial: " + RANDOMSERIAL
print('''
ID changed sucessfully.
!!! Logout User Or Restart computer before using TeamViewer !!!!
''')
脚本执行成功会显示ID changed sucessfully.
之后重启电脑或者注销用户启用就好了。之后打开teamViewer会发现是新的ID。
主要兼容11,12,和14.0版本
14.0.13880 mac版本:https://www.malavida.com/en/soft/teamviewer/mac/
14.0.13488 windows:https://www.filepuma.com/download/teamviewer_14.0.13488-20699/
12.0.72647 mac版本:https://teamviewer.en.uptodown.com/mac/download/1510547
P.S. 4月份发现脚本无法切换ID
,软件会提示商业使用,但是使用上依然没问题
PEACE~
参考:
https://gist.github.com/zhovner/b1d72f3465c46e7b58a4ea42d625c3e8
https://community.spiceworks.com/topic/1151930-teamviewer-5-minute-timelimit
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
... - 23