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
##################### | |
# | |
# Use this with or without the .gitattributes snippet with this Gist | |
# create a fixle.sh file, paste this in and run it. | |
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF) | |
# This Gist normalizes handling by forcing everything to use Unix style. | |
##################### | |
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF |
var util = require("util"); | |
var EventEmitter = require("events").EventEmitter; | |
function PerformanceMetrics() { | |
EventEmitter.call(this); | |
} | |
util.inherits(PerformanceMetrics, EventEmitter); |
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
// * iOS zooms on form element focus. This script prevents that behavior. | |
// * <meta name="viewport" content="width=device-width,initial-scale=1"> | |
// If you dynamically add a maximum-scale where no default exists, | |
// the value persists on the page even after removed from viewport.content. | |
// So if no maximum-scale is set, adds maximum-scale=10 on blur. | |
// If maximum-scale is set, reuses that original value. | |
// * <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=2.0,maximum-scale=1.0"> | |
// second maximum-scale declaration will take precedence. | |
// * Will respect original maximum-scale, if set. | |
// * Works with int or float scale values. |
""" | |
Sorl Thumbnail Engine that accepts background color | |
--------------------------------------------------- | |
Created on Sunday, February 2012 by Yuji Tomita | |
""" | |
from PIL import Image, ImageColor | |
from sorl.thumbnail.engines.pil_engine import Engine | |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
# open Terminal.app | |
# sudo crontab -e | |
MAILTO=email@address.com | |
# networksetup -setairportnetwork <network> <device name> [password] | |
0 9 * * 1-5 /usr/sbin/networksetup -setairportnetwork AirPort "3G" "password" | |
0 17 * * 1-5 /usr/sbin/networksetup -setairportnetwork AirPort "DSL" "password" |
import csv | |
from github2.client import Github | |
# api settings for github | |
git_username = 'your_git_username' | |
git_api_token = 'your_git_api_token' | |
git_repo = 'username/repo_name' | |
# import all issues as this story type | |
pivotal_story_type = 'Bug' |
from __future__ import print_function | |
""" | |
Utilities for 256 color support in terminals. | |
Adapted from: | |
http://stackoverflow.com/questions/1403353/256-color-terminal-library-for-ruby | |
The color palette is indexed as follows: | |
0-15: System colors |