Using Python to check if remote port is open and accessible.
Usage:
- Open a Python prompt
- Run the script in is_port_open.py
- Call isOpen with a host and a port parameter. Example: isOpen("www.google.com", 80)
#!/bin/sh | |
spawn telnet 1.3.3.184 4998 | |
expect "Escape character is '^]'." | |
send "setstate,1:2,1\r" | |
expect "setstate,1:2,1" |
#!/bin/sh | |
# \ | |
exec tclsh "$0" ${1+"$@"} | |
package require Expect | |
set exp::winnt_debug 1 | |
puts stdout "Connecting to iTach and turning it ON\n" | |
spawn plink -telnet 1.3.3.184 -P 4998 |
<html> | |
<head> | |
<script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/rgbcolor.js"></script> | |
<script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/canvg.js"></script> | |
<script> | |
function getImgData(chartContainer) { | |
var chartArea = chartContainer.getElementsByTagName('iframe')[0]. | |
contentDocument.getElementById('chartArea'); | |
var svg = chartArea.innerHTML; | |
var doc = chartContainer.ownerDocument; |
class BaseWithInit(object): | |
def __init__(self): | |
print "Init BaseWithInit" | |
class ClassWithoutInit(BaseWithInit): | |
pass |
set PROMPT=$T $P$G |
channels = {1: 'SVT1', 2: 'SVT2', 3: 'TV3', 4: 'Kanal 4'} | |
str(map(str, channels.keys())) |
s"[${p.channels.map(id => s"'$id'").mkString(",")}]", |
Using Python to check if remote port is open and accessible.
Usage:
#!/bin/bash | |
cd ~ | |
default_download_dir=$(cat $HOME/.config/user-dirs.dirs | grep XDG_DOWNLOAD_DIR= | awk -F '=' '{print $2}' | tr -d '"') | |
echo "Default download dir is: ${default_download_dir}" | |
download_dir=${1:-$default_download_dir} | |
download_dir=$(eval echo $download_dir) # Expand environment variables | |
echo "Searching for the latest idea*.tar.gz in download dir: ${download_dir}" |
private static Timer logStreamProgress(CountingInputStream countingInputStream) { | |
final TimerTask timerTask = new TimerTask() { | |
int counter = 0; | |
@Override | |
public void run() { | |
LOGGER.info("Loaded {} in {} seconds", byteCountToDisplaySize(countingInputStream.getByteCount()), counter); | |
counter++; | |
} | |
}; |