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 fcntl, struct, socket | |
def getHwAddr(ifname): | |
'Return MAC address of given NIC' | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
try: | |
info = fcntl.ioctl(s.fileno(), 0x8927, | |
struct.pack('256s', bytes(ifname[:15], 'ascii'))) | |
return ''.join(['%02x:' % char for char in info[18:24]])[:-1] | |
except OSError: |
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
bootstate=0 | |
title=Loading ESXi installer | |
prefix=/esxi50/ | |
kernel=tboot.b00 | |
#kernelopt=runweasel | |
modules=b.b00 --- useropts.gz --- k.b00 --- a.b00 --- ata-pata.v00 --- ata-pata.v01 --- ata-pata.v02 --- ata-pata.v03 --- ata-pata.v04 --- ata-pata.v05 --- ata-pata.v06 --- ata-pata.v07 --- block-cc.v00 --- ehci-ehc.v00 --- s.v00 --- weaselin.i00 --- ima-qla4.v00 --- ipmi-ipm.v00 --- ipmi-ipm.v01 --- ipmi-ipm.v02 --- misc-cni.v00 --- misc-dri.v00 --- net-be2n.v00 --- net-bnx2.v00 --- net-bnx2.v01 --- net-cnic.v00 --- net-e100.v00 --- net-e100.v01 --- net-enic.v00 --- net-forc.v00 --- net-igb.v00 --- net-ixgb.v00 --- net-nx-n.v00 --- net-r816.v00 --- net-r816.v01 --- net-s2io.v00 --- net-sky2.v00 --- net-tg3.v00 --- ohci-usb.v00 --- sata-ahc.v00 --- sata-ata.v00 --- sata-sat.v00 --- sata-sat.v01 --- sata-sat.v02 --- sata-sat.v03 --- scsi-aac.v00 --- scsi-adp.v00 --- scsi-aic.v00 --- scsi-bnx.v00 --- scsi-fni.v00 --- scsi-hps.v00 --- scsi-ips.v00 --- scsi-lpf.v00 --- scsi-meg.v00 --- scsi-meg.v01 --- scsi-meg.v02 --- |
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 ( | |
"time" | |
"github.com/jinzhu/gorm" | |
_ "github.com/mattn/go-sqlite3" | |
) | |
func main() { |
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
# Install basic packages | |
sudo apt-get update | |
sudo apt-get install zsh vim git curl wget | |
# pyenv installer | |
sudo apt-get install libreadline-dev libbz2-dev libsqlite3-dev | |
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash | |
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 | |
# -*- coding: utf-8 -*-. | |
import exceptions | |
import requests | |
import tempfile | |
from bs4 import BeautifulSoup | |
def main(): | |
module = AnsibleModule( |
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
x = 0 | |
def f(): | |
""" 適当にTrueが返る | |
>>> sys.stdout.write("magic comment:"); f() # doctest:+ELLIPSIS | |
magic comment:... | |
True | |
""" | |
for s in range(0, 2): |
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
from parsimonious.grammar import Grammar | |
conf = """diag read interface-id 1 | |
enable | |
! | |
interfae vlan 1 | |
! | |
interface ip hoo | |
interface id | |
interface route |
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
Param([string]$interfaceName, [string]$ip, [int]$prefixLength, [string]$gateway, [string[]]$dnsServers, [string]$serverName, [string]$ntpServer) | |
# Utility functions | |
function SetIPAddress ([string]$interfaceName, [string]$ip, [int]$prefixLength, [string]$gateway){ | |
Get-NetAdapter $interface | New-NetIPAddress -IPAddress $ip -PrefixLength $prefixlength -DefaultGateway $gateway | |
} | |
function SetDNS ([string]$interface, [string[]]$dnsServers){ | |
Get-NetAdapter $interface | Set-DnsClientServerAddress -ServerAddresses $dnsServers | |
} | |
function DisableIPv6 ([string]$interface) { |
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 math | |
def is_prime(x): | |
if x < 0: | |
x = -x | |
if x < 2: | |
return False | |
# check the case: x=2,3 | |
if x % 2 == 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
ans = 0 | |
arr = """37107287533902102798797998220837590246510135740250 | |
46376937677490009712648124896970078050417018260538 | |
74324986199524741059474233309513058123726617309629 | |
91942213363574161572522430563301811072406154908250 | |
23067588207539346171171980310421047513778063246676 | |
89261670696623633820136378418383684178734361726757 | |
28112879812849979408065481931592621691275889832738 | |
44274228917432520321923589422876796487670272189318 | |
47451445736001306439091167216856844588711603153276 |
OlderNewer