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
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 8000
This 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.
# Enable noatime on local ext3/4 & xfs filesystems | |
fstab = File.open('/etc/fstab',"r") | |
newlines = Array.new | |
needremount = Array.new | |
ihaveswap = false | |
fstab.each do |line| | |
# Tokenize each fstab line with a space separator | |
tokens = line.split | |
if tokens[2] == "swap" |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: