#!/usr/bin/env python | |
""" | |
Change the color of the highlight annotations in PDF document(s). | |
The destination color is hardcoded in this script. | |
""" | |
# Adapted from: | |
# https://unix.stackexchange.com/a/118492/112647 | |
# PDF format reference: | |
# http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf | |
# pages 12 to 13 define the character sets |
wget https://downloads.sourceforge.net/project/sbml/libsbml/5.17.0/stable/libSBML-5.17.0-core-plus-packages-src.tar.gz | |
tar -xxvf libSBML-5.17.0-core-plus-packages-src.* | |
cd libSBML-5.17.0-Source | |
./configure --prefix=/usr/local/ \ | |
--enable-cpp-namespace \ | |
--enable-fbc \ | |
--enable-shared \ | |
--with-gnu-ld \ | |
--enable-layout \ | |
--enable-comp \ |
By: @saurabhshri
Many users when are given server access, do not have root (or sudo) privileges and can not simply do
sudo apt-get install python-pip
.
Here's an easy way you can install and use pip without root (or sudo) access in a local directory.
Note : This works without easy_install
too.
import requests | |
import re | |
response = requests.post( | |
'http://bigg.ucsd.edu/advanced_search_external_id_results', | |
data={'database_source': 'kegg.compound', 'query': 'C00234'} | |
) | |
try: | |
print re.search(r'/models/universal/metabolites/([^"]+)', response.text).group(1) |
Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:
- preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
- actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location
NB: Check out git subtree
/git submodule
and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.
Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.
Removing the last commit
To remove the last commit from git, you can simply run git reset --hard HEAD^
If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.
If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^
which will evict the commits from the branch and from the index, but leave the working tree around.
If you want to save the commits on a new branch name, then run git branch newbranchname
before doing the git reset.