Skip to content

Instantly share code, notes, and snippets.

View Shellbye's full-sized avatar
🎯
Focusing

shellbye Shellbye

🎯
Focusing
  • Momenta
  • Beijing, China
  • 09:06 (UTC -12:00)
View GitHub Profile
@Shellbye
Shellbye / set_up_http_proxy
Last active August 29, 2015 14:14
set up http proxy
#!/bin/sh
sudo apt-get update
sudo apt-get install -y squid3
sudo cp /etc/squid3/squid.conf /etc/squid3/squid.conf.original
sudo chmod a-w /etc/squid3/squid.conf.original
echo "use vim /etc/squid3/squid.conf to change port(default 3128) and http_access allow"
# change port: http_port 8888
# allow access: http_access allow all <==this should at top of all http_access
# ref: https://help.ubuntu.com/lts/serverguide/squid.html
@Shellbye
Shellbye / CentOS_version_check.sh
Created April 26, 2016 06:18
Some command to check CentOS version
# https://forum.directadmin.com/showthread.php?t=15878
cat /etc/*release*
cat /etc/centos-release # http://www.liquidweb.com/kb/how-to-check-your-centos-version/
cat /etc/redhat-release
# https://linuxconfig.org/how-to-check-centos-version
# the later two may need some package to install
rpm --query centos-release
@Shellbye
Shellbye / install_twisted_16_1_1
Created April 26, 2016 08:13
Install Twisted-16.1.1
wget https://pypi.python.org/packages/source/T/Twisted/Twisted-16.1.1.tar.bz2
tar -jvxf Twisted-16.1.1.tar.bz2
cd Twisted-16.1.1
python setup.py install
@Shellbye
Shellbye / install_pip_on_CentOS7.2
Created April 29, 2016 01:45
Install pip on CentOS7.2
# http://www.liquidweb.com/kb/how-to-install-pip-on-centos-7/
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
sudo python get-pip.py
@Shellbye
Shellbye / setup.sh
Created June 1, 2016 10:04
setup_django_in_ubuntu_1404.sh
#!/usr/bin/env bash
apt-get update
apt-get install -y python-pip
pip install django==1.8.6 # or use install_django_without_pip.sh
@Shellbye
Shellbye / install_django_without_pip.sh
Created June 1, 2016 10:06
install_django_without_pip
#!/usr/bin/env bash
wget https://www.djangoproject.com/m/releases/1.8/Django-1.8.6.tar.gz
tar -xvzf Django-1.8.6.tar.gz
cd Django-1.8.6
python setup.py install
@Shellbye
Shellbye / install_pillow_in_ubuntu_1404.sh
Created June 2, 2016 02:02
install_pillow_in_ubuntu_1404
#!/usr/bin/env bash
wget https://pypi.python.org/packages/e2/af/0a3981fffc5cd43078eb8b1057702e0dd2d5771e5aaa36cbd140e32f8473/Pillow-3.2.0.tar.gz#md5=7cfd093c11205d9e2ebe3c51dfcad510
tar -xzvf Pillow-3.2.0.tar.gz
cd Pillow-3.2.0
apt-get update
apt-get install -y libjpeg-dev # ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting
apt-get install -y zlib1g-dev # ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
apt-get install -y python-dev # error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
@Shellbye
Shellbye / install_django-simple-captcha_in_ubuntu_1404.sh
Created June 2, 2016 03:22
fix ImportError: The _imagingft C module is not installed when install & use django-simple-captcha in ubuntu 1404
#!/usr/bin/env bash
# ImportError: The _imagingft C module is not installed
apt-get install -y libfreetype6-dev
apt-get install -y python-imaging
pip install pillow
pip install django-simple-captcha
@Shellbye
Shellbye / ubuntu_install_PIL
Created July 8, 2016 09:16
Ubuntu install PIL
wget http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz
cd Imaging-1.1.7/
sudo python setup.py install
@Shellbye
Shellbye / setup_fragment_env.sh
Last active July 15, 2016 03:05
setup the env for fragment_extract in ubuntu 16 04
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get install -y python
sudo apt-get install -y git
sudo apt-get install -y nginx
# for Pillow
sudo apt-get install -y libjpeg-dev # ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting
sudo apt-get install -y zlib1g-dev # ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting