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
# burn your 4 cores | |
for i in 1 2 3 4; do while : ; do : ; done & done |
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
addrs bits pref mask | |
1 0 /32 255.255.255.255 | |
2 1 /31 255.255.255.254 | |
4 2 /30 255.255.255.252 | |
8 3 /29 255.255.255.248 | |
16 4 /28 255.255.255.240 | |
32 5 /27 255.255.255.224 | |
64 6 /26 255.255.255.192 | |
128 7 /25 255.255.255.128 |
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
# File Transfer model #3 | |
# | |
# In which the client requests each chunk individually, using | |
# command pipelining to give us a credit-based flow control. | |
import os | |
import sys | |
from threading import Thread | |
import zmq |
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
import multiprocessing | |
def thread_func(): | |
print "thread in" | |
while True: | |
pass | |
if __name__ == "__main__": | |
t1 = multiprocessing.Process(target = thread_func) | |
t1.start() |
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 python | |
import sys | |
import threading | |
import Queue | |
import commands | |
import time | |
# thread class to run a command |
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
import java.io.IOException; | |
import java.io.InputStream; | |
import com.jcraft.jsch.Channel; | |
import com.jcraft.jsch.ChannelExec; | |
import com.jcraft.jsch.JSch; | |
import com.jcraft.jsch.JSchException; | |
import com.jcraft.jsch.Session; | |
public class Exec { |
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
def get_interface_name | |
interfaces = {} | |
puts 'Valid network interfaces detected are:' | |
interfaces_with_mac = `ifconfig -a | grep -i hwaddr | awk '{ if( match($1, /^eth/) ) {print $1, $5} }'`.lines.map(&:chomp) | |
interfaces_with_mac.each_with_index do |x, index| | |
interfaces[index] = x.split[0] | |
puts " #{index}) #{x.split[0]} ( #{x.split[1]} )" | |
end | |
print 'Please choose an interface to configure: ' |
NewerOlder