Skip to content

Instantly share code, notes, and snippets.

Our Lab bought a new server to build a web paltform (LAMP maybe, I am not involved in that) whose system is Centos 6.5. Centos maybe a great system yet not for our school's network.

In the campus, we connect to the Internet through l2tp VPN and xl2tpd is usually used. We have customized deb package for xl2tpd containing specific options for the school network on the school forum. Unfortunately, no rpm package is provided.

I found a github project provide a solution for rpm package. But the problem is the package version is too new for Centos 6.5, or rather too new for glibc. So the solution for Centos 6.5 is to use the xl2tp-1.2.8-1 package (or lower, I haven't test lower versions). On pkgs.org/, we can find other xl2tpd versions.

@hxhc
hxhc / Compiling Vim with Anaconda.md
Last active January 30, 2020 21:03
Compiling Vim with Anaconda

Compiling Vim with Anaconda

Vim is a powerful editor with no doubt, and the jedi-vim plugin is powerful for pythoners. However, jedi-vim can't work with Anaconda. This is because

  • Ubuntu's (14.04) python is located at /usr/bin
  • Anaconda' python is at ~/Anaconda3/bin

There is a tricky but dangerous way to overcome it. Adding the line below to ~/.zshrc or ~/.bashrc.

@hxhc
hxhc / merge.py
Last active July 13, 2017 08:32
merge some data files into one
import pandas as pd
import os
import glob
import numpy as np
# This script is used to calculate the mean of spectra of every 3 jdx files, thus combining 3 data files into one.
# get all filenames
path = os.getcwd()
all_files = glob.glob(os.path.join(path, "*.txt"))