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
#! /usr/bin/env jruby | |
=begin | |
$ ./interrupt.rb | |
Current time: Monday March 4 03/04/2013 21:40:06.304 | |
Scheduled event for 10 seconds from now | |
f1: Current time: Monday March 4 03/04/2013 21:40:06.341 | |
Cancelling f1 | |
f2: Current time: Monday March 4 03/04/2013 21:40:11.357 | |
Got f1: Current time: Monday March 4 03/04/2013 21:40:11.361 |
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
package test; | |
import java.lang.InterruptedException; | |
import java.lang.Runnable; | |
import java.util.Calendar; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.Executor; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; |
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
$ cat seccomp-example.sh | |
#! /usr/bin/env bash | |
cat << EOF > /tmp/config | |
lxc.seccomp = /tmp/whitelist | |
EOF | |
cat << EOF > /tmp/whitelist | |
1 | |
whitelist | |
0 |
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
$ sudo aptitude versions lxc | grep 1.0.0 | |
p 1.0.0~beta1-5~r1+1 unstable 500 | |
p 1.0.0~beta1-5~r1+1 unstable 500 | |
p 1.0.0~beta1-5~r1+1 unstable 500 | |
p 1.0.0~beta1-5~r1+1 unstable 500 | |
$ sudo apt-get install lxc=1.0.0~beta1-5~r1+1 | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following extra packages will be installed: |
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
$ cat seccomp.sh | |
#! /usr/bin/env bash | |
cat << EOF > /tmp/config | |
lxc.seccomp = /tmp/whitelist | |
EOF | |
cat << EOF > /tmp/whitelist | |
1 | |
whitelist | |
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
Config contents: | |
lxc.seccomp = /tmp/whitelist | |
Whitelist contents: | |
1 | |
whitelist | |
0 | |
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
$ /bin/bash ulimiter.sh 40 forks.py | |
0: 9388 | |
2: 9390 | |
1: 9389 | |
3: 9391 | |
4: 9392 | |
6: 9394 | |
5: 9393 | |
7: 9395 | |
8: 9396 |
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
$ ./tags.rb | |
apple | |
edible |
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
$ sudo lxc-execute -n test -l DEBUG -o /tmp/lxc.log -- echo hello world | |
hello world | |
$ cat /tmp/lxc.log | |
lxc-execute 1391753212.665 INFO lxc_lsm - LSM security driver SELinux | |
lxc-execute 1391753212.665 DEBUG lxc_start - sigchild handler set | |
lxc-execute 1391753212.665 INFO lxc_console - no console for lxc-execute. | |
lxc-execute 1391753212.665 INFO lxc_start - 'test' is initialized | |
lxc-execute 1391753212.671 DEBUG lxc_start - Not dropping cap_sys_boot or watching utmp | |
lxc-execute 1391753212.671 INFO lxc_cgroup - cgroup driver cgroupfs initing for test | |
lxc-execute 1391753212.674 DEBUG lxc_conf - Set exec command to echo |
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
$ sudo lxc-create -n test -o /tmp/lxc.log | |
lxc-create: Error creating container test | |
$ cat /tmp/lxc.log | |
lxc-create 1391754787.424 ERROR lxc_create_ui - Error creating container test |