7年前的笔记本越来越感受到压力,于是想升级下内存。
阿里云 EC2 CentOS 6.0 系统分区扩容
阿里云的虚拟主机磁盘空间满了,这个主要是用来放blog的,所以并没有其他的数据盘。所有的数据都是直接放到/dev/vda1磁盘下的,数据库也是在这个盘下。从阿里云的后台扩容了磁盘发现还需要登陆进行扩容,于是开始按照教程操作,事实证明给出的文档(https://help.aliyun.com/document_detail/25452.html?spm=a2c4g.11186623.6.788.666a3f87QwRXFB)里面方法比较蛋疼,对于扩展系统分区不大适用。
后来发现貌似看的文档有问题,如果要扩展系统盘应该看这个https://help.aliyun.com/document_detail/111738.html?spm=5176.2020520101.0.0.44d34df5aZCEKE。 这个就尴尬了 ,没看好文档。
安装growpart
yum install cloud-utils-growpart
然后对系统分区进行扩容:
growpart /dev/vda 1
阿里云 安卓push无法收到消息
官方给的demo代码如下:
request = PushMessageToAndroidRequest.PushMessageToAndroidRequest()
request.set_AppKey(appKey)
request.set_Target('ALL')
request.set_TargetValue('ALL')
request.set_Title("PushMessageToAndroid title")
request.set_Body("Message from ali push Open Api2.0 : PushMessageToAndroid")
request.add_query_param('AndroidNotificationChannel', '1')
result = clt.do_action(request)
print result
这个代码有两个问题,如果和另外一份demo代码中的:
clt = client.AcsClient(properties.accessKeyId,properties.accessKeySecret,properties.regionId)
request = PushMessageToAndroidRequest.PushMessageToAndroidRequest()
request.set_AppKey(properties.appKey)
request.set_Target('ALL')
request.set_TargetValue('ALL')
request.set_Title("PushMessageToAndroid title")
request.set_Body("Message from ali push Open Api2.0 : PushMessageToAndroid")
result = clt.do_action(request)
很可能会出现下面的错误信息:
EABF26DA-89EA-44BA-B16E-117FE03D29C7
cloudpush.aliyuncs.com
Throttling.User
Request was denied due to user flow control.
这个错误信息按照官方的解释是限流了,但是实际并不是,可以尝试分开调用,不要连续进行push message和push notice。
另外一个问题是: 这份代码在对于最新的安卓8.0以上系统的消息无法正常弹出,按照文档解释需要设置NotificationChannel(文档链接:https://help.aliyun.com/knowledge_detail/67398.html)。
jupyter notebook 调整字体 以及matplotlib显示中文
原生的jupyter theme看起来比较蛋疼,尤其是字体和字号。为了修改这个配置可以安装 jupyter theme。
项目链接: https://github.com/dunovank/jupyter-themes 如果不喜欢英文可以参考这个链接:https://www.jianshu.com/p/6de5f6cce06d
上面的样式对应的配置命令:
jt -f fira -fs 11 -cellw 90% -ofs 11 -dfs 11 -T -t solarizedl
除此之外matplotlib 默认不支持中文显示,主要是字体问题,可以通过下面的代码配置来让matplotlib 支持中文
from matplotlib import pyplot as plt
%matplotlib inline
font = {'family' : 'MicroSoft YaHei',
'weight' : 'bold',
'size' : 10}
plt.rc("font", **font)
实际效果,另外还可以使用altair ,altair 默认支持中文显示 https://altair-viz.github.io
基于RandomForestClassifier的titanic生存概率分析
The Challenge
The sinking of the Titanic is one of the most infamous shipwrecks in history.
On April 15, 1912, during her maiden voyage, the widely considered “unsinkable” RMS Titanic sank after colliding with an iceberg. Unfortunately, there weren’t enough lifeboats for everyone onboard, resulting in the death of 1502 out of 2224 passengers and crew.
While there was some element of luck involved in surviving, it seems some groups of people were more likely to survive than others.
In this challenge, we ask you to build a predictive model that answers the question: “what sorts of people were more likely to survive?” using passenger data (ie name, age, gender, socio-economic class, etc).
这个是kaggle上的一个基础项目,目的是探测泰坦尼克号上的人员的生存概率,项目地址:https://www.kaggle.com/c/titanic
网上基于这个项目其实可以找到各种各样的解决方案,我也尝试了不同的做法。但是实际的效果并不是十分好,个人尝试最好的成绩是0.78468,一次是基于深度神经网络,另外一次就是基于当前的随机森林的模型。
另外还可以看到一系列score为1的提交,这些不知道是怎么做到的,真是太tm牛了~~
青岛移动劫持了*.gravatar.com (:rofl:)
刚发现除了自己的头像,别人的都没显示。这个挺奇怪的,于是向看下原因,结果发现那啥了,直接被劫持了~~还到了一个不可描述的网站,这移动的胆子也忒大了吧?
查看图片地址可以看到头像地址为:http://1.gravatar.com/avatar/ae5dda06e91e95afda4be9dbb02a818f?s=24&d=identicon&r=g
MSBuildToolsPath is not specified for the ToolsVersion “14.0”
磁盘空间红了,于是卸载了一些没用的东西,其中之一就是Vs 2015,结果卸载了之后悲剧了,Delphi无法进行编译了,提示上面的错误:MSBuildToolsPath is not specified for the ToolsVersion “14.0” defined at “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\TOolsVersions\14.0 .
git 统计一段时间内提交的代码行数
代码:
git log --author="obaby" --after="2019-08-04 00:00:01" --before="2019-08-10 12:00:00"
--pretty=tformat: --numstat | grep -v 'static' |
gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "增加行数:%s 删除行数:%s 变化总行数:%s\n",add,subs,loc }'
参数说明:
--author 作者 提交者
--after 开始时间
--before 结束时间
--pretty 格式
上面的代码依赖于linux windows下运行可以使用cgywin 或者mobaxterm,https://mobaxterm.mobatek.net
MobaXterm is your ultimate toolbox for remote computing. In a single Windows application, it provides loads of functions that are tailored for programmers, webmasters, IT administrators and pretty much all users who need to handle their remote jobs in a more simple fashion.
MobaXterm provides all the important remote network tools (SSH, X11, RDP, VNC, FTP, MOSH, …) and Unix commands (bash, ls, cat, sed, grep, awk, rsync, …) to Windows desktop, in a single portable exe file which works out of the box.
There are many advantages of having an All-In-One network application for your remote tasks, e.g. when you use SSH to connect to a remote server, a graphical SFTP browser will automatically pop up in order to directly edit your remote files. Your remote applications will also display seamlessly on your Windows desktop using the embedded X server