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
$Username = "su" | |
$Password = "password" | |
$group = "Administrators" | |
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME" | |
$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username } | |
if ($existing -eq $null) { |
@version:3.2 | |
# =============================================================================================== | |
# Configuration file for syslog-ng, customized for remote logging | |
# =============================================================================================== | |
# Options | |
# Note about $HOST / HOST | |
# Description: The name of the source host where the message originates from. | |
# If the message traverses several hosts and the chain_hostnames() option is on, the first host in the chain is used. | |
# If the keep_hostname() option is disabled (keep_hostname(no)), the value of the $HOST macro will be the DNS hostname of the host that sent the message to syslog-ng OSE (that is, the DNS hostname of the last hop). In this case the $HOST and $HOST_FROM macros will have the same value. |
// ==UserScript== | |
// @name AngularJS Injector | |
// @namespace http://joshkra.me/ | |
// @version 0.1 | |
// @description Binds $inject method to window | |
// @author jkjustjoshing | |
// @match *://*/* | |
// ==/UserScript== | |
// This userscript creates an $inject() method on the window object that can be used to |
Alfred Custom Searches for Jira and Confluence | |
j - Jira issue number search - https://YOURCOMPANY.atlassian.net/issues/?jql=text%20~%20"{query}" | |
j+ - Jira issue full text search - https://YOURCOMPANY.atlassian.net/QuickSearch.jspa?searchString={query} | |
c+ - Confluence text search - https://YOURCOMPANY.atlassian.net/wiki/dosearchsite.action?queryString={query} | |
# Aliases | |
Set-Alias subl "C:\Program Files\Sublime Text 3\sublime_text.exe" | |
Set-Alias ie "C:\Program Files\Internet Explorer\iexplore.exe" | |
Set-Alias winscp "C:\Program Files (x86)\WinSCP\WinSCP.exe" | |
# Functions | |
function rdp { mstsc /control /v:$args } | |
function pssh { Enter-PSSession -Computername $args[0] -Credential etamgroep\dadmin8 } |
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
Get-ChildItem -Path "$($env:WINDIR)\Microsoft.NET\Framework*" | % {Get-ChildItem -Path "$($_.PSPath)" | ? {$_.Name.StartsWith('v') -and $_.PSIsContainer -eq $true -and ((Test-Path -Path "$($_.FullName)\mscorlib.dll" -PathType Leaf) -eq $true)}} | Select @{Name="Version";Expression={$_.Name.TrimStart('v')}},@{Name="Bitness";Expression={if (!$_.Parent.ToString().TrimStart('Framework')) {[int]32} else {[int]$_.Parent.ToString().TrimStart('Framework')}}} |
; Create a shortcut to this file in Windows for each AnyConnect VPN configuration you need | |
; Each shortcut can have a different host, user, and pass defined (3 command line args) | |
; Usage: AutoHotKey.exe AnyConnect.ahk hostname username password | |
#SingleInstance force | |
if 0 < 3 ; The left side of a non-expression if-statement is always the name of a variable. | |
{ | |
MsgBox This script requires at least 3 incoming parameters but it only received %0%. | |
ExitApp | |
} |
Batch file to map your Android phone as network drive in Windows.
@ECHO OFF | |
REM.-- Prepare the Command Processor | |
SETLOCAL ENABLEEXTENSIONS | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
set psexec="\\192.168.22.252\tmp\psexec.exe" | |
set nircmd="\\192.168.22.252\tmp\nircmd.exe" | |
set user=administrator | |
set pass=password | |
set savedir="\\192.168.22.252\tmp\test.png" |