Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/bin/bash | |
| ### | |
| # chkconfig: 345 20 80 | |
| # description: Vert.x application service script | |
| # processname: java | |
| # | |
| # Installation (CentOS): | |
| # copy file to /etc/init.d | |
| # chmod +x /etc/init.d/my-vertx-application |
| #!/bin/bash | |
| set -o nounset | |
| set -o errexit | |
| set -o pipefail | |
| EXTRA_TAGS=${1} | |
| TSDB_CMD=$( /usr/bin/which tsdb ) | |
| START_TIME="1y-ago" | |
| END_TIME="45d-ago" |
| Locality-based Least connection scheduling module for nginx. | |
| Based on logic[1] from IPVS lblc module. | |
| [1] http://kb.linuxvirtualserver.org/wiki/Locality-Based_Least-Connection_Scheduling | |
| Configuration directives: | |
| lblc |
| # Thanks to http://ubuntuforums.org/showthread.php?t=1411273 for inspiration.. | |
| # But what a disgusting nasty hack! This prevents partman from running (and | |
| # mounts /target, creates /target/etc/fstab). d-i just can't cope with | |
| # installation to partitionless block device... which is disappointing, | |
| # because partitions are pointless for pvlinux guests. | |
| # | |
| # The hack works by ... wait for it... spawning a little while/sleep 1 script, | |
| # waits for the partman-base.postinst file to appear (the preseed/earl_command | |
| # hook is too early, and the partman/early_command is too late). Once it | |
| # appears we replace this with a bit more script which does what we wanted |
| USER='admin' | |
| PASS='admin' | |
| CLUSTER='dev' | |
| HOST=$(hostname -f):8080 | |
| function start(){ | |
| curl -u $USER:$PASS -i -H 'X-Requested-By: ambari' -X PUT -d \ | |
| '{"RequestInfo": {"context" :"Start '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' \ | |
| http://$HOST/api/v1/clusters/$CLUSTER/services/$1 | |
| } |
| To comment a single line use | |
| <%-# commented line -%> | |
| This also works | |
| <%# my comment %> | |
| To comment a whole block use a if false to surrond your code like this |
| #!/bin/bash | |
| ###filename: chknfs.sh | |
| ###usage: crontab */1 * * * * root /root/chknfs.sh > /dev/null 2>&1 | |
| keep="/data/.keep" | |
| if [ ! -f $keep ]; then | |
| umount -f /data && mount /data | |
| fi |
| #! /usr/local/bin/sh | |
| # Write email header to temp file | |
| ( | |
| echo "To: your@email" | |
| echo "Subject: System Temperatures INFO" | |
| echo " " | |
| ) > /var/cover | |
| # Define adastat function, which writes drive activity to temp file |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000This guide will explain how you can make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier.
We will also explain how the process can be automatically started each time you log in to your Mac and ensure the connection to the server is kept alive.