问题描述
前几日个人网站无法打开,自搭科学上网工具也无法使用。原本以为是服务器ip被封,后来查看服务器能正常登陆,cpu和内存等负载正常范围,但按tab键命令提示和创建文件时候,提示No space left on device
。
Jupyter Notebook 是科学计算必备工具之一,它是一个开源的web应用程序,允许你创建和共享实时代码,可以用来进行数据清理和转换、统计建模、数据可视化、机器学习等等工作。
下面是使用supervisour和nginx来部署公开jupyter notebook服务过程。
推荐python3环境下安装jupyter。我系统是Ubuntu 18.04
里面内置了python3,所以直接安装jupyter,如果系统python版本是python2.7,可以使用virtualenvwrapper
进行多版本python管理。
下面使用pip来安装jupyter notebook
1 | sudo apt-get install python3-pip // 安装pip3 |
9月份时候由于工作中涉及到大数据统计分析内容,研究了spark使用,10月份时候把研究内容在小组内简单做了一次分享。现在把分享的PPT贴出,分享过程中也涉及到真实项目使用spark演示,这部分为未贴出。
最近看了《Better PHP Development》一书,里面第6章专门讲了crontab
使用指南,事无巨细,几乎涉及到crontab
用法的方方面面。一直以为以为自己对crontab
用法非常熟悉了,看完之后才发现有些地方之前确实不知道。现把书中重要内容记录到博客中,以便后续查阅。
cron
是类Unix操作系统中基于时间的作业调度器,它会在未来某个时刻触发某些任务。这个名字源于希腊语“χρόνος”( chronos ),意思是时间。由于crontab
命令是使用cron
时候最常用的命令,所以我们通常会说crontab
,其实也就是cron
。
如果我们查看/etc
目录,我们可以看到cron.hourly
, cron.daily
, cron.weekly
和cron.monthly
这样的目录,每个目录都对应于特定的执行频率。比如cron.hourly
目录下面的脚本会按照每小时来执行。安排任务的一种方式是将脚本放在相对应的目录中。例如,为了每天运行db_backup.php
,我们将它放在cron.daily
中。若没有这个目录,我们需要手动创建cron.daily
。
原文地址:Comprehensive Introduction to Apache Spark, RDDs & Dataframes (using PySpark)
Industry estimates that we are creating more than 2.5 Quintillion bytes of data every year.
Think of it for a moment – 1 Qunitillion = 1 Million Billion! Can you imagine how many drives / CDs / Blue-ray DVDs would be required to store them? It is difficult to imagine this scale of data generation even as a data science professional. While this pace of data generation is very exciting, it has created entirely new set of challenges and has forced us to find new ways to handle Big Huge data effectively.
原文地址:Using PySpark to perform Transformations and Actions on RDD
In my previous article, I introduced you to the basics of Apache Spark, different data representations (RDD / DataFrame / Dataset) and basics of operations (Transformation and Action). We even solved a machine learning problem from one of our past hackathons. In this article, I will continue from the place I left in my previous article. I will focus on manipulating RDD in PySpark by applying operations (Transformation and Actions).
As you would remember, a RDD (Resilient Distributed Database) is a collection of elements, that can be divided across multiple nodes in a cluster to run parallel processing. It is also a fault tolerant collection of elements, which means it can automatically recover from failures. RDD is immutable, i.e. once created, we can not change a RDD. So, then how do I apply operations on a RDD? Well, we apply an operation and store results in another RDD
For this article, one must have some understanding about Apache Spark and hands on experience in python programming.
Pandas作为python的库,包含易于使用的数据结构,是一个强大数据分析的工具
Pandas的主要数据结构有Series和DataFrame。Series是一种类似于一维数组的对象,它由一组数据以及一组与之相关的一组标签组成。DataFrame是一个表格型数据结构,它含有一组有序的列,每列可以是不同的值类型。
1 | import pandas as pd |
在PHP开发中,由于编码bug或者配置不正确,如果被恶意利用往往会导致严重安全问题。根据OWASP Top 10 2017里面的10大安全风险,现归纳总结了PHP项目中几种常见安全风险,攻击场景和防范措施。
例1. 用户输入的数据直接用于SQL查询语句中
1 | $sql = 'select * from news where id="' . $_GET['id'] . '"' |
攻击方式:
1 | http://example.com/news?id=" or 1='1 |