while read line; do echo -n "$line" | wc -c; done< f1
This file contains 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 | |
OPENSSL_VERSION="1.0.1g" | |
curl -O http://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz | |
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz | |
mv openssl-$OPENSSL_VERSION openssl_i386 | |
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz | |
mv openssl-$OPENSSL_VERSION openssl_x86_64 | |
cd openssl_i386 |
This file contains 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
!macro ProcessEnvPrependPath UN | |
;; ref: http://stackoverflow.com/a/32384667/1292238 | |
!ifndef ERROR_ENVVAR_NOT_FOUND | |
!define ERROR_ENVVAR_NOT_FOUND 203 | |
!endif | |
!if "${NSIS_PTR_SIZE}" <= 4 | |
!include LogicLib.nsh | |
Function ${UN}ProcessEnvPrependPath ; IN:Path OUT:N/A | |
System::Store S | |
Pop $1 |
This file contains 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
!macro ProcessEnvPrependPath UN | |
;; ref: http://stackoverflow.com/a/32384667/1292238 | |
!ifndef ERROR_ENVVAR_NOT_FOUND | |
!define ERROR_ENVVAR_NOT_FOUND 203 | |
!endif | |
!if "${NSIS_PTR_SIZE}" <= 4 | |
!include LogicLib.nsh | |
Function ${UN}ProcessEnvPrependPath ; IN:Path OUT:N/A | |
System::Store S | |
Pop $1 |
This file contains 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
;; Requisites: Emacs >= 24 | |
;; INSTALL PACKAGES | |
;; -------------------------------------- | |
(prefer-coding-system 'utf-8) | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.org/packages/") t) | |
(package-initialize) |
This file contains 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
# Say I have such classes A, B, C, ..., Y, and Z that do different things, | |
# and classes AComment, BComment, CComment, ..., YComment and ZComment | |
# that record comments on instances of class A, B, ..., Y and Z respectively. | |
# All XComment classes share the same attributes except one property | |
# that is is dependent on the class the comment is for. | |
# e.g. AComment has a property 'a' and BComment has a property 'b'. | |
class A(): | |
def __init__(self): | |
print 'init an instance of class A' |
This file contains 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 | |
# Replace more than one consecutive spaces with tab in files on both Linux and Mac OS X. | |
# You need to install gnu-sed on Mac OS X for this to work. | |
# Usage: spaces2tab.sh [file ...] | |
# See also: http://azaleasays.com/2014/03/07/os-x-sed-does-not-recognize-tab-character/ | |
if [ "$(uname -s)" == "Darwin" ] # If the system is Mac OS X | |
then |
This file contains 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 | |
oldext=".md" | |
newext=".markdown" | |
for file in $(git ls-files | grep ${oldext}\$); do | |
echo processing $file... | |
filename="${file%.*}" | |
git mv $file ${filename}$newext | |
done |
This file contains 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
# only ask for my SSH key passphrase once! | |
# use existing ssh-agent if possible | |
if [ -f ${HOME}/.ssh-agent ]; then | |
. ${HOME}/.ssh-agent > /dev/null | |
fi | |
if [ -z "$SSH_AGENT_PID" -o -z "`/usr/bin/ps -a|/usr/bin/egrep \"^[ ]+$SSH_AGENT_PID\"`" ]; then | |
/usr/bin/ssh-agent > ${HOME}/.ssh-agent | |
. ${HOME}/.ssh-agent > /dev/null | |
fi |
This file contains 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
'''This code tried to do things the hard way to solve: http://www.biostars.org/p/92205/ by | |
first, the function split_fasta() splits the original fasta file into files containing individual sequence records; | |
second, blast_seq_the_hard_way() iterates over these individual files and feeds their filenames to BLAST. | |
Please note that BLAST can handle multiple sequences in -query and -subject at the same time, so there is no need | |
to split the files. This code is just for demonstration purposes. | |
''' | |
import os | |
import re | |
from Bio.Blast.Applications import NcbiblastpCommandline |
NewerOlder