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 | |
function package-version { | |
apt-cache policy $1 | grep Installed | awk -F ' ' '{print $2}' | |
} | |
function kernel-current-version { | |
major=$(uname -r | awk -F '.' '{print $1}') | |
minor=$(uname -r | awk -F '.' '{print $2}') | |
if [ $(uname -r | grep rc) ]; then | |
rc="rc$(uname -r | awk -F '-' '{print $2}' | awk -F 'rc' '{print $2}')" |
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 | |
while getopts "h" opt; do | |
case $opt in | |
h ) echo "usage: $0 [-h]"; | |
echo "this is just a style template."; | |
exit 0 | |
;; | |
esac | |
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
#!/usr/bin/env python | |
import sys | |
import socket | |
import getopt | |
import threading | |
import subprocess | |
# define some global variables |
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 socket | |
target_host = raw_input("target host: ") | |
target_port = int(raw_input("target port: ")) | |
# create a socket object | |
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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 socket | |
import threading | |
bind_ip = raw_input("bind ip: ") | |
bind_port = int(raw_input("bind port: ")) | |
# create a socket object | |
server = socket.socket(socket.AF_INET,socket.SOCK_STREAM) |
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/python | |
import socket | |
import threading | |
bind_ip = "0.0.0.0" | |
bind_port = 9999 | |
# create a socket object | |
server = socket.socket(socket.AF_INET,socket.SOCK_STREAM) |
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/python | |
import socket | |
target_host = raw_input("target host: ") | |
target_port = int(raw_input("target port: ")) | |
# create a socket object | |
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |
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 socket | |
target_host = raw_input("target host: ") | |
target_port = int(raw_input("target port: ")) | |
# create a socket object | |
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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/python | |
import socket | |
target_host = "www.google.com" | |
target_port = 80 | |
# create a socket object | |
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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
_testAbc () | |
{ | |
for abc in "$(which scp)"; | |
do | |
if [[ -e "$abc" ]]; then | |
echo -e "true\n$abc"; | |
fi; | |
done | |
} | |
# _testAbc # |