Skip to content

Instantly share code, notes, and snippets.

@bzdk
bzdk / community_to_shell.py
Created December 23, 2019 02:21 — forked from biwin/community_to_shell.py
Change PyCharm Community Python Console to PyCharm Professional Django Console (Django Shell)
# Change the run script on `settings> Build Execution and Deployment > Console > Python Console` to
# hoping you have your settings at project/project/settings.py (if not, change accordingly;)
import os,sys,django;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])
os.environ['DJANGO_SETTINGS_MODULE'] = WORKING_DIR_AND_PYTHON_PATHS.split('/')[-1]+'.settings'
print('Python {0} on {1} using {2} as settings'.format(sys.version, sys.platform, os.environ['DJANGO_SETTINGS_MODULE']))
django.setup()
@bzdk
bzdk / install-libsodium.sh
Created August 6, 2017 11:31 — forked from jonathanpmartins/install-libsodium.sh
Install Libsodium on Ubuntu 14.04.3 LTS Trusty
#!/bin/bash
sudo add-apt-repository ppa:chris-lea/libsodium;
sudo echo "deb http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list;
sudo echo "deb-src http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list;
sudo apt-get update && sudo apt-get install libsodium-dev;
@bzdk
bzdk / _stoploss.py
Last active December 18, 2015 06:08 — forked from dkgeorge/sgdbot.py
A stop-loss/start-gain bot working with goxtool for MtGox BTC exchange. information: https://bitcointalk.org/index.php?topic=183430.0 Changes: Added pushover notification when order filled
"""
a simple stop loss/start gain bot
adjust STOP_PRICE/START_PRICE and STOP_VOLUME/START_VOLUME to your needs.
to reset orders during runtime, press (s) for a new stop order and (g) for a new start gain
The file can be reloaded after editing without restarting goxtool by simply pressing the (l) key.
"""
# Using the global statement
# pylint: disable=W0603
# No exception type(s) specified
# pylint: disable=W0702
Shadowsocks 启动脚本
# insserv -v -d /etc/init.d/shadowsocks
=====================
#!/bin/sh
### BEGIN INIT INFO
# Provides: shadowsocks
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog