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
(defun shr-table-to-list (str) | |
"Turns a chunk of text with 'shr-indentation properties (from the | |
simple html renderer of tables) into a list of the table data cells" | |
(let ((pos 0) | |
(nextpos 0) | |
(results '()) | |
(strlen (length str))) | |
(while (and nextpos (< pos strlen)) | |
(setq nextpos (next-single-property-change (1+ pos) 'shr-indentation str)) | |
(if nextpos |
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
$ docker pull centos:centos7 | |
Pulling repository centos | |
a5fd0258f31c: Pulling fs layer | |
511136ea3c5a: Download complete | |
0b2c58b208cf: Download complete | |
2014/09/30 16:03:13 unexpected EOF |
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
The code snippet: | |
Bootstrap b2 = new Bootstrap(); | |
b2.group(childGroup) | |
.option(ChannelOption.TCP_NODELAY, true) | |
.channel(NioSocketChannel.class) | |
.handler(new ChannelInitializer<SocketChannel>() { | |
@Override | |
protected void initChannel(SocketChannel ch) throws Exception { | |
ch.pipeline().addLast("stringEncoder", new StringEncoder(BufType.BYTE, CharsetUtil.UTF_8)); |
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
With languages like Java, or especially C++,” Bornstein says, “abstractions can be convenient, but there | |
are a lot of implicit operations that happen, such as when copy constructors are invoked, or destructors | |
or assignment operators, or if you have any sort of operator overloading. Those implicit sort of function | |
calls, unless you’re an absolute expert in the code base and know exactly how everything was designed, | |
can actually create real problems when reasoning about a piece of code. | |
http://dl.acm.org/citation.cfm?doid=2366316.2366321 |
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 | |
if [ -x `which update-rc.d` ] ; then | |
update-rc.d carbon-cache defaults | |
else | |
chkconfig --add carbon-cache | |
fi | |
rm /etc/apache2/sites-enables/000-default | |
ln -sf /opt/graphite/examples/example-graphite-vhost.conf /etc/apache2/sites-enabled/graphite-vhost.conf |
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 | |
VER=0.9.10 | |
HERE=`pwd` | |
apt-get install python-setuptools python-django-tagging python-pysqlite2 python-memcache python-ldap python-django python-cairo-dev | |
wget https://launchpad.net/graphite/0.9/${VER}/+download/graphite-web-${VER}.tar.gz | |
wget https://launchpad.net/graphite/0.9/${VER}/+download/carbon-${VER}.tar.gz |
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 | |
VERS=$1 | |
cat > java-remove.sh <<EOF | |
#!/bin/sh | |
set -e | |
for i in java javac jps jstack jmap ; do | |
update-alternatives --remove \$i /usr/lib/jvm/$VERS/bin/\$i |
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 | |
VERS=$1 | |
cat > java-post.sh <<EOF | |
#!/bin/sh | |
set -e | |
for i in java javac jps jstack jmap ; do | |
update-alternatives --install /usr/bin/\$i \$i /usr/lib/jvm/$VERS/bin/\$i 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
#!/bin/bash | |
JAVAPATH=$1 | |
BN=`basename $JAVAPATH` | |
if [ ${BN:0:3} != 'jdk' ] ; then | |
echo "Error, path $JAVAPATH doesnt seem to be a JDK path, which normally starts with 'jdk'" | |
exit 1 | |
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
#!/bin/sh | |
HOSTS="a b c d e" | |
echo `hostname` | |
for i in $HOSTS ; do | |
host $i | |
done |
NewerOlder