#Creating Bonding interfaces on Linux
##Configuration Files
###/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=none ONBOOT=yes #settings for bond MASTER=bond0
| #!/bin/sh | |
| SHORTCUT="[Desktop Entry] | |
| Name=Sublime Text 2 | |
| Comment=Edit text files | |
| Exec=/usr/local/share/sublime-text-2/sublime_text | |
| Icon=/usr/local/share/sublime-text-2/Icon/128x128/sublime_text.png | |
| Terminal=false | |
| Type=Application | |
| Encoding=UTF-8 | |
| Categories=Utility;TextEditor;" |
| #!/usr/bin/python | |
| import argparse, urllib2, threading | |
| parser = argparse.ArgumentParser(description="Threaded Web Stress Tester") | |
| parser.add_argument('-c', '--count', | |
| action="store", | |
| dest="count", | |
| default=1000, |
| import sys | |
| import subprocess | |
| import tempfile | |
| import urllib | |
| text = sys.stdin.read() | |
| chart_url_template = ('http://chart.apis.google.com/chart?' | |
| 'cht=qr&chs=300x300&chl={data}&chld=H|0') | |
| chart_url = chart_url_template.format(data=urllib.quote(text)) |
#Creating Bonding interfaces on Linux
##Configuration Files
###/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=none ONBOOT=yes #settings for bond MASTER=bond0
| $rand = New-Object System.Random | |
| 1..10 | ForEach {$pass = $pass + [char]$rand.next(33,122)} |
| $path = "folder" | |
| $propflag = "None" | |
| $inhflag = [System.Security.AccessControl.InheritanceFlags]::ContainerInherit -bor [System.Security.AccessControl.InheritanceFlags]::ObjectInherit | |
| $user = "DOMAIN\user" | |
| $acl = get-acl $path | |
| $rule = New-Object System.Security.AccessControl.FileSystemAccessRule $user,"FullControl",$inhflag,$propflag,"Allow" | |
| $acl.SetAccessRule($rule) | |
| $acl | Set-Acl $path |
| # hello.txt is a file in the current directory | |
| # The group everyone will be added to allow it full control | |
| $group = "Everyone" | |
| $control = "FullControl" | |
| $yesno = "Allow" | |
| $acl = get-acl hello.txt | |
| $rule = New-Object System.Security.AccessControl.FileSystemAccessRule $group,$control,$yesno | |
| $acl.SetAccessRule($rule) |
| import threading | |
| theVar = 1 | |
| class MyThread(threading.Thread): | |
| def run(self): | |
| global theVar | |
| print 'This is thread ' + str(theVar) + ' speaking' | |
| print 'Hello and goodbye' | |
| theVar = theVar + 1 |
| from socket import * | |
| HOST = 'localhost' | |
| PORT = 2600 | |
| ADDR = (HOST,PORT) | |
| BUFFER = 4096 | |
| cli = socket(AF_INET,SOCK_STREAM) | |
| cli.connect((ADDR)) |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <sys/types.h> | |
| #include <unistd.h> | |
| int main() | |
| { | |
| setuid( 0 ); | |
| system( "/path/to/script.sh" ); |