Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
version='stable' | |
#version='latest' | |
mkdir -p /var/backups/rancher | |
cd /var/backups/rancher | |
container_id=$(docker ps|grep rancher:${version}|awk '{ print $1 }') | |
echo $container_id | |
docker stop $container_id | |
today=$(date +%Y%m%d) | |
docker create --volumes-from $container_id --name rancher-data-$today rancher/rancher:${version} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name copy 500px images | |
// @namespace http://www.oldcai.com/ | |
// @version 0.1 | |
// @description copy 500px images | |
// @author You | |
// @match https://500px.com/photo/* | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
from gevent import monkey | |
from psycogreen.gevent import patch_psycopg | |
# The threading module raises a KeyError if already loaded | |
# when monkey patching it. | |
if "threading" in sys.modules: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
/jffs/scripts/xunlei stop | |
/jffs/scripts/swap stop | |
/jffs/scripts/remount start | |
/jffs/scripts/swap start | |
/jffs/scripts/xunlei start |
Debian
cd /tmp
# 下载源码
git clone https://github.com/madeye/shadowsocks-libev.git
# 开始编译
cd shadowsocks-libev
./autogen.sh
./configure --prefix=/usr && make
make install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Great Shadowsocks Server | |
Wants=network-online.target | |
After=network.target | |
[Service] | |
Type=simple | |
PIDFile=/run/shadowsocks.pid | |
ExecStart=/usr/local/bin/ss-server -c /etc/sysconfig/shadowsocks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Change KeyPad 0 to Num 0</name> | |
<identifier>private.change_keypad0_to_num0</identifier> | |
<autogen>__KeyToKey__ KeyCode::KEYPAD_0, KeyCode::KEY_0</autogen> | |
</item> | |
<item> | |
<name>Change KeyPad 1 to Num 1</name> | |
<identifier>private.change_keypad1_to_num1</identifier> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install -y libsqlite3-dev libbz2-dev zsh git-core curl libtiff4-dev libjpeg8-dev zlib1g-dev \ | |
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk | |
curl -L http://install.ohmyz.sh | sh | |
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash | |
pyenv update | |
pyenv install 2.7.9 | |
pyenv global 2.7.9 | |
cat >> ~/.zshrc <<END | |
export PATH="$HOME/.pyenv/bin:$PATH" |
NewerOlder