Here are several different ways to test a TCP port without telnet.
BASH (man page)
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C
$ cat < /dev/tcp/127.0.0.1/23
#!/bin/bash | |
# check dyndns name of a host and reset iptables if change was detected | |
HOSTNAME=<hostname-to-check.dyndns.org> | |
LOGFILE=/var/run/check_home_ip | |
Current_IP=$(/usr/bin/dig +short $HOSTNAME) | |
if [ $LOGFILE = "" ] ; then | |
iptables-restore </etc/iptables_rules |
var inputs = document.getElementsByTagName('input'); | |
for (var i=0; i < inputs.length; i++) { | |
if (inputs[i].getAttribute('type').toLowerCase() === 'password') { | |
inputs[i].setAttribute('onpaste', ''); | |
} | |
} |
Here are several different ways to test a TCP port without telnet.
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C
$ cat < /dev/tcp/127.0.0.1/23
SMARTCARD CLOCK FREQUENCY: /dev/sci0 3570000 | |
BOXKEY: /dev/sci0 12 34 56 78 | |
TRY ALL CHIDS: /dev/sci0 | |
SMARTCARD CLOCK FREQUENCY: /dev/sci1 3570000 | |
BOXKEY: /dev/sci1 12 34 56 78 |
------------------------------------------------------------------------------- | |
-- HTTP Accept-Language header handler -- | |
-- @originalAuthor: f.ghibellini@gmail.com -- | |
-- @originalRepository: https://github.com/fghibellini/nginx-http-accept-lang-- | |
-- @modifiedBy: marian.hello@mapilary.com -- | |
-- @gist: https://gist.github.com/mauron85/47ed1075262d9e020fe2 -- | |
-- @license: MIT -- | |
-- @requires: -- | |
-- @description: -- | |
-- returns language with greatest quality -- |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
## | |
# Switch the TP-LINK HS100 wlan smart plug on and off, query for status | |
# Tested with firmware 1.0.8 | |
# | |
# Credits to Thomas Baust for the query/status/emeter commands | |
# | |
# Author George Georgovassilis, https://github.com/ggeorgovassilis/linuxscripts | |
# |
gradle.taskGraph.afterTask {task -> | |
StringBuffer taskDetails = new StringBuffer() | |
taskDetails << "-------------\nname:$task.name group:$task.group : $task.description\nconv:$task.convention.plugins\ninputs:" | |
task.inputs.files.each{ it -> | |
taskDetails << "${it.absolutePath}\n" | |
} | |
taskDetails << "outputs:\n" | |
task.outputs.files.each{ it -> | |
taskDetails << "${it.absolutePath}\n" | |
} |
### editor | |
export ALTERNATE_EDITOR=emacs | |
export EDITOR="emacsclient -tc -a emacs" | |
export VISUAL="emacsclient -c -a emacs" | |
# emacsclient as difftool | |
function ediff () { | |
if [ "X${2}" = "X" ]; then | |
echo "USAGE: ediff <FILE 1> <FILE 2>" | |
else | |
quoted1=${1//\\/\\\\}; quoted1=${quoted1//\"/\\\"} |
#!/usr/bin/env bash | |
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/ | |
# This script starts emacs daemon if it is not running, opens whatever file | |
# you pass in and changes the focus to emacs. Without any arguments, it just | |
# opens the current buffer or *scratch* if nothing else is open. The following | |
# example will open ~/.bashrc | |
# ec ~/.bashrc |