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
qemu-img convert -O raw source.vhd output.raw |
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
#/usr/bin/python | |
import time | |
import sys | |
import os | |
lines=[ | |
"Wake up Neo ...", | |
"The matrix has you", | |
"Follow the white rabbit ...", |
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
route delete 0.0.0.0 | |
route add 0.0.0.0 mask 0.0.0.0 192.168.1.253 |
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
require 'adhearsion' | |
require 'adhearsion/voip/asterisk/manager_interface' | |
include Adhearsion::VoIP::Asterisk::Manager | |
# You need to enable originate in manager.conf for the user. | |
# see Privilege column of 'manager show commands' | |
asterisk = ManagerInterface.connect :host => "127.0.0.1", :username => "user", :password => "pass" |
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 SubnetCalc | |
def self.dot_notation_to_prefix(netmask) | |
netmask = ipv4_to_binary(netmask).split(//) | |
netmask.select{ |i| i == "1"}.length | |
end | |
def self.ipv4_to_binary(ipv4addr) | |
ia = ipv4addr.to_s.split('.') | |
if ia.size != 4 |
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
import java.net.InetAddress; | |
public class reversedns | |
{ | |
public static void main(String args[]) | |
{ | |
try { | |
InetAddress addr = InetAddress.getByName("172.16.0.105"); | |
System.out.println(addr.getHostName()); |
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
require 'pp' | |
class LoggingLevel | |
ONE = 1 | |
TWO = 2 | |
DOCUMENTS = 4 | |
ATTENDANCE = 8 | |
DATABASE = 16 | |
@@modification_time = nil |
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 AMISession | |
# http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+Originate | |
# http://www.the-asterisk-book.com/unstable/asterisk-manager-api.html | |
def initialize(host, port, user, secret) | |
begin | |
@s = TCPSocket.open("127.0.0.1", 5038) |
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
import gtk | |
import time | |
class ClickButtonApp(object): | |
def __init__(self): | |
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) | |
self.window.connect("destroy", self.quit) | |
self.button = gtk.Button("When ready, click for 10 seconds.") | |
self.button.connect("clicked", self.do_click) |