This file contains hidden or 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
import "stdlib/native" | |
export function main() { | |
let url = http.parseURL("http://example.com/") | |
let proxy = httputil.newSingleHostReverseProxy(url) | |
let server = http.newServer() | |
server.address = ":9999" | |
server.handler = (w, r) => { | |
r.url.host = url.host |
This file contains hidden or 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
/** | |
* ------------------------------------------------------------------ | |
* A simple TCP proxy. | |
* | |
* Configuration example: | |
* | |
* { | |
* "rules": [ | |
* { "local": ":99995", "remote": "127.0.0.18:22" }, | |
* { "local": ":99996", "remote": "127.0.0.19:22" }, |
This file contains hidden or 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 iptable rules | |
iptables -F | |
# Allowing DNS lookups (tcp, udp port 53) | |
iptables -A OUTPUT -p tcp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT | |
iptables -A INPUT -p tcp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT | |
iptables -A OUTPUT -p udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT | |
iptables -A INPUT -p udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT | |
# Allow web traffic |
This file contains hidden or 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
iptables -F | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT | |
iptables -P OUTPUT ACCEPT |
This file contains hidden or 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 iptable rules | |
iptables -F | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
# Allowing DNS lookups (tcp, udp port 53) | |
iptables -A OUTPUT -p tcp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT | |
iptables -A INPUT -p tcp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT |
This file contains hidden or 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
<% if(client) { %> | |
<h2><%= client.name %></h2> | |
<% } %> |
This file contains hidden or 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
import "stdlib/native"; | |
function main() { | |
let s = http.newServer(); | |
s.address = ":8081"; | |
s.handler = zipHandler | |
s.start(); | |
} | |
function zipHandler(w: http.Response, r: http.Request) { |
This file contains hidden or 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
class YieldTable { | |
element: HTMLElement; | |
constructor(data: Data) { | |
this.element = S.create("div", "amura_yield_table") | |
this.parseValues(data) | |
this.render(data) | |
} | |
private parseValues(data: Data) { |
This file contains hidden or 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
import "stdlib/native" | |
import * as web from "stdlib/web"; | |
export function getPluginInfo() { | |
return { | |
name: "@@Buscador", | |
description: "@@Añade un buscador global en la barra superior." | |
} | |
} |
This file contains hidden or 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
let data = { "email_address": time.unixNano() + "@prueba.com", "status": "subscribed" }; | |
let r = http.newRequest("POST", "https://us19.api.mailchimp.com/3.0/lists/1652876acb/members", data) | |
r.setBasicAuth("xx", "xx") | |
r.execute() | |
r = http.newRequest("GET", "https://us19.api.mailchimp.com/3.0/lists/1652876acb/members", data) | |
r.setBasicAuth("xxx", "xx") | |
let res = json.unmarshal(r.execute()) | |
fmt.println(res.total_items) |