Skip to content

Instantly share code, notes, and snippets.

View m1aw's full-sized avatar

António Ferreira m1aw

View GitHub Profile

Keybase proof

I hereby claim:

  • I am m1aw on github.
  • I am m1aw (https://keybase.io/m1aw) on keybase.
  • I have a public key ASD4RKzMEU27WwRD2GDMP7dV_Wf59oM_-hA9jWSZ1R4shAo

To claim this, I am signing this object:

@m1aw
m1aw / nginxproxy.md
Created July 24, 2016 01:47 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@m1aw
m1aw / FileClient.java
Created June 22, 2016 01:19 — forked from carl-olin/FileClient.java
Simple java file transfer
package client;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.Socket;
public class FileClient {
private Socket s;
@m1aw
m1aw / rasterize.js
Created June 8, 2016 14:08
Rasterize a kibana panel with phantom
"use strict";
var page = require('webpage').create(),
system = require('system'),
address, output, size, pageWidth, pageHeight;
var waitTime = 10 * 1000;
if (system.args.length != 3) {
console.log('Usage: rasterize.js URL filename');
phantom.exit(1);
@m1aw
m1aw / gist:bc180c36203ef077ffd8
Last active August 29, 2015 14:02
My custom PS1 prompts for linux
as user:
PS1="\[$(tput setaf 5)\]@\h:\[$(tput setaf 7)\] \W\[$(tput setaf 6)\]\\$ \[$(tput sgr0)\]"
as root:
PS1="\[$(tput setaf 5)\]@\h:\[$(tput setaf 7)\] \W\[$(tput setaf 1)\]\\$ \[$(tput sgr0)\]"