start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/bash | |
# As the "bufferbloat" folks have recently re-discovered and/or more widely | |
# publicized, congestion avoidance algorithms (such as those found in TCP) do | |
# a great job of allowing network endpoints to negotiate transfer rates that | |
# maximize a link's bandwidth usage without unduly penalizing any particular | |
# stream. This allows bulk transfer streams to use the maximum available | |
# bandwidth without affecting the latency of non-bulk (e.g. interactive) | |
# streams. |
import socket | |
import struct | |
import json | |
def unpack_varint(s): | |
d = 0 | |
for i in range(5): | |
b = ord(s.recv(1)) | |
d |= (b & 0x7F) << 7*i | |
if not b & 0x80: |
<?php | |
if(isset($_POST['zipcode']) && is_numeric($_POST['zipcode'])){ | |
$zipcode = $_POST['zipcode']; | |
}else{ | |
$zipcode = '50644'; | |
} | |
$result = file_get_contents('http://weather.yahooapis.com/forecastrss?p=' . $zipcode . '&u=f'); | |
$xml = simplexml_load_string($result); | |
//echo htmlspecialchars($result, ENT_QUOTES, 'UTF-8'); |
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.
Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<properties> | |
<property name="name">app</property> | |
<property name="pattern">%d{yyyy-MM-dd HH:mm:ss.SSS} | %-5.5p | %-10.10t | %-20.20C:%-5.5L | %msg%n</property> | |
<!-- | |
It will look like that: | |
2013-04-03 07:37:51.993 | WARN | main | lnetgateway.Server:56 | My app is logging stuff | |
--> | |
</properties> |
# This is the main configuration file for Spigot. | |
# As you can see, there's tons to configure. Some options may impact gameplay, so use | |
# with caution, and make sure you know what each option does before configuring. | |
# For a reference for any variable inside this file, check out the Spigot wiki at | |
# http://www.spigotmc.org/wiki/spigot-configuration/ | |
# | |
# If you need help with the configuration or have any questions related to Spigot, | |
# join us at the IRC or drop by our forums and leave a post. | |
# | |
# IRC: #spigot @ irc.esper.net ( http://webchat.esper.net/?channel=spigot ) |
# goes in /etc/nginx/sites-available & link in ../sites-enabled | |
upstream graphite { | |
server unix:///tmp/uwsgi.sock; | |
} | |
server { | |
listen 9002; | |
server_name localhost; |