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
$ gzip hej | |
... | |
open("hej", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW) = 3 | |
fstat(3, {st_mode=S_IFREG|0664, st_size=27, ...}) = 0 | |
rt_sigprocmask(SIG_BLOCK, [HUP INT PIPE TERM XCPU XFSZ], [], 8) = 0 | |
open("hej.gz", O_WRONLY|O_CREAT|O_EXCL, 0600) = 4 | |
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 | |
read(3, "dsfkjfh'\nsdf\nsdf\nf\ndsf\nsdf\n", 65536) = 27 | |
read(3, "", 65509) = 0 | |
write(4, "\37\213\10\10f\215sX\0\3hej\0K)N\313\316J\313P\347*NI\3\3434\256\224b"..., 43) = 43 |
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
description "Elastic Search" | |
pre-stop script | |
triesleft=3600 | |
while true | |
do | |
curl -s localhost:9200/_cluster/health?pretty | grep status | grep green > /dev/null | |
exitcode=$? | |
#echo $exitcode | |
if [ $exitcode -ne 0 ] |
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
APT ""; | |
APT::Architecture "amd64"; | |
APT::Build-Essential ""; | |
APT::Build-Essential:: "build-essential"; | |
APT::Install-Recommends "1"; | |
APT::Install-Suggests "0"; | |
APT::NeverAutoRemove ""; | |
APT::NeverAutoRemove:: "^firmware-linux.*"; | |
APT::NeverAutoRemove:: "^linux-firmware$"; | |
APT::NeverAutoRemove:: "^kfreebsd-image.*"; |
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 | |
USAGE="Usage: $0 SERVICENAME CMD [CMDARGS1 ... CMDARGN]" | |
if [ "$#" == "0" ]; then | |
echo "$USAGE" | |
exit 1 | |
fi | |
SERVICENAME=$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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/exec" | |
"time" |
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
class UserLister { | |
... | |
public Observable<User> streamAll(int batchSize) { | |
final int prefixLength = estimatePrefixLength(batchSize); | |
Preconditions.checkState(prefixLength > 0); | |
log.debug("Estimated prefix length: " + prefixLength); | |
return Observable.from(RepositoryUtils.hexPrefixes(prefixLength)).flatMapIterable(new Function1<String, List<User>>() { | |
public List<User> call(String prefix) { | |
repository.listByIdPrefix(useridPrefix); |
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
package my.application; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.TimeUnit; | |
import rx.Observable.Operator; | |
import rx.Subscriber; | |
import my.application.ExecutorServiceUtils; | |
import my.application.User; | |
public class ExecutorOperator implements Operator<User, User> { |
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
$ git clone git@localhost:JensRantil/jensrantil.github.io . | |
/opt/local/gnocci/vendor/cache/mixlib-shellout-e30a3b6a9e49/lib/mixlib/shellout/unix.rb:277: warning: Insecure world writable dir /opt/local/rbenv/shims in PATH, mode 040777 | |
Cloning into '.'... | |
Warning: Permanently added 'localhost' (RSA) to the list of known hosts. | |
Command git clone git@localhost:JensRantil/jensrantil.github.io . exited successfully with status 0. Took 0.87956 seconds.$ git checkout develop | |
/opt/local/gnocci/vendor/cache/mixlib-shellout-e30a3b6a9e49/lib/mixlib/shellout/unix.rb:277: warning: Insecure world writable dir /opt/local/rbenv/shims in PATH, mode 040777 | |
Already on 'develop' | |
Your branch is up-to-date with 'origin/develop'. | |
Command git checkout develop exited successfully with status 0. Took 0.02847 seconds.$ git reset --hard 734e9670a4e0be86b38ebbe391bb54e8b52dbbbd | |
/opt/local/gnocci/vendor/cache/mixlib-shellout-e30a3b6a9e49/lib/mixlib/shellout/unix.rb:277: warning: Insecure world writable dir /opt/local/rbenv/shims in PATH, m |
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
public class MainContainer { | |
public static void main(String[] args) { | |
// Frameworks and drivers | |
DatabaseDriver jdbcDatabaseDriver = new MysqlDatabaseDriver(); | |
// Interface adapters | |
UserRepository userRepository = new UserMySQLRepository(jdbcDatabaseDriver); | |
// Use cases. | |
UserBusinessUseCases userBusinessCases = new UserBusinessCases(userRepository); |
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 | |
# Install using: | |
# curl https://gist.github.com/JensRantil/ba21c50e7720bfc62050/raw/c34825afc94940388b1b1dca2abe4c813211ecd0/install.sh | bash -e | |
# ...but PLEASE have a look at the URL to make sure its sane first! | |
# | |
# An alternative is obviously to download the script and executing it. | |
# Fail early. | |
set -e |