This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Syncs new lines in a remote log file to a local file. | |
# Downloads remote file, and prints all lines that are | |
# not yet printed | |
source=$1 | |
# Find the name for the locally copied file | |
hash=`echo "$source" | md5sum | cut -d " " -f 1` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import gamin | |
import time | |
from os.path import expanduser | |
import threading | |
import thread | |
import os | |
import Queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env /usr/bin/python | |
import os, errno, shutil, sys | |
from pipes import quote | |
script_dir = os.path.realpath(os.path.dirname(__file__)) | |
output_dir = script_dir + "/outerr" | |
tmp_dir = script_dir + "/tmppppppp" | |
book_dir = os.path.realpath(sys.argv[1]) | |
book_name = os.path.basename(book_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name tkbodycode.dev; | |
root /home/lape/workspace/tkbodycode/wordpress; | |
index index.php; | |
location / { | |
try_files $uri $uri/ /index.php; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
print "="*80 | |
#import sys | |
b = 24 | |
a = 32 | |
for i in range(1, min(a, b)): | |
if (a % i == 0 and b % i == 0): | |
gcd = i | |
#print "Found common divisor" + str(gcd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
caption string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %Y-%m-%d %c" | |
caption always | |
hardstatus off | |
shell "bash" | |
startup_message off | |
vbell off | |
altscreen on | |
attrcolor b ".I" | |
defbce "on" | |
termcapinfo xterm* 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
FIFO=/tmp/recast-fifo | |
rm $FIFO | |
mkfifo $FIFO | |
(while true; do cat $FIFO | pv | nc -u 127.0.0.1 14999; NC_PID_1=$!; done) & | |
TCP_PULL_PID=$! | |
(while true; do nc 0.0.0.0 14888 >$FIFO; NC_PID_2=$!; done) & | |
UDP_PUSH_PID=$! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Keeps a tunnel to 'remote.example.com' open | |
After=network.target | |
[Service] | |
User=autossh | |
# -p [PORT] | |
# -l [user] | |
# -M 0 --> no monitoring | |
# -N Just open the connection and do nothing (not interactive) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace So\ProphecyTest; | |
use PHPUnit\Framework\TestCase; | |
class SimpleRecord { | |
private $value = 'default-one'; | |
} | |
class MagicRecord { | |
public function __get($prop) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Flush and Delete Old Settings ... | |
iptables -X | |
iptables -F | |
iptables -t nat -F | |
### " ALL MYSQL TRAFFIC FROM Y, PORT (3306) TO Z PORT (3306) ...." | |
# iptables -t nat -A PREROUTING -p tcp -d db-host.com --dport 3306 -j DNAT --to-destination 192.168.5.1:4041 | |
iptables -t nat -A OUTPUT -p tcp -d db-host.com --dport 3306 -j DNAT --to-destination 192.168.5.1:4041 | |
#iptables -A FORWARD -p tcp -d db-host.com --dport 3306 -j ACCEPT |
OlderNewer