$ mkdir example
$ cd example
$ git init
Initialized empty Git repository in /home/gerjan/example/.git/
This file contains hidden or 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
Find: (^\w*\.\w*)=.*$ | |
Replace with: $1=\$\{$1\} |
This file contains hidden or 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
mkfifo foo | |
nc -lk 2600 0<foo | /bin/bash 1>foo 2>&1 | |
(REMOTE: nc myip 2600) | |
mkdir -p foo/bar/baz/quux | |
cd foo/bar/baz/quux/ | |
for i in `seq 1 1000`; do echo -n $i" " >> foobar.txt ; done | |
zip -f foo.zip foo/ | |
hexedit foo.zip |
This file contains hidden or 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
Cloud foundry Grails app from scratch | |
===================================== | |
* Pre: Ubuntu 12.10 desktop system | |
* Log in (guest account) | |
* Alt+F2 firefox | |
* http://www.springsource.org/downloads/sts-ggts | |
* http://download.springsource.com/release/STS/3.1.0/dist/e3.8/groovy-grails-tool-suite-3.1.0.RELEASE-e3.8-linux-gtk.tar.gz | |
* Alt+F2 gnome-terminal | |
* cd Downloads/ |
This file contains hidden or 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
<HTML> | |
<BODY> | |
<% | |
out.println("<DL>"); | |
java.util.Properties props = System.getProperties(); | |
java.util.Enumeration e = props.propertyNames(); | |
while (e.hasMoreElements()) | |
{ | |
String key = (String) e.nextElement(); | |
String value = props.getProperty (key); |
This file contains hidden or 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
<HTML> | |
<BODY> | |
<% | |
out.println("<DL>"); | |
java.util.Enumeration attrs = pageContext.getRequest().getAttributeNames(); | |
while (attrs.hasMoreElements()) { | |
String attr = (String) attrs.nextElement(); | |
Object val = pageContext.getRequest().getAttribute(attr); | |
out.println("<DT>"+attr+"</DT><DD>"+val.toString()+"<DD/>"); | |
} |
This file contains hidden or 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
@Grab(group='net.sourceforge.nekohtml', module='nekohtml', version='1.9.18') | |
import org.cyberneko.html.parsers.SAXParser | |
def download(address) | |
{ | |
def file = new FileOutputStream(address.tokenize("/")[-1]) | |
def out = new BufferedOutputStream(file) | |
out << new URL(address).openStream() | |
out.close() | |
} |
This file contains hidden or 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
ssh user@host tail -F /usr/share/tomcat/logs/catalina.out >> /tmp/host-catalina.out | |
vi ~/.swatchrc: | |
watchfor /"from"/ | |
pipe 'cut -f5- -d" "|python -mjson.tool' | |
swatch -c ~/.swatchrc -t /tmp/host-catalina.out |
This file contains hidden or 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
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or 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
# http://stackoverflow.com/questions/2709458/bash-script-to-replace-spaces-in-file-names | |
find ./tmp/ -depth -name "* *" -execdir rename 's/ /_/g' "{}" \; |