Skip to content

Instantly share code, notes, and snippets.

View peterlozano's full-sized avatar

Pedro Lozano peterlozano

View GitHub Profile
@peterlozano
peterlozano / lambda @ edge
Last active April 6, 2018 22:52
Redirect to www domain using AWS CloudFront Lambda @ Edge. Attach this function to the Viewer Request event.
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request;
if (request.headers['host'][0].value !== 'www.example.com') {
/*
* Generate HTTP redirect response with 302 status code and Location header.
*/
const response = {
status: '302',
statusDescription: 'Found',
@peterlozano
peterlozano / enable-ntfs-rw.sh
Created November 18, 2018 17:03
Enable NTFS write in Macos without using third party drivers or apps.
echo "LABEL=DRIVELABEL none ntfs rw,auto" >> /etc/fstab
@peterlozano
peterlozano / Readme.md
Created November 22, 2018 11:51
Bash aliases to copy/paste using Piknik

Install and configure https://github.com/jedisct1/piknik

Host ips need to be static or have a dns.

Add the bash aliases (either mac or linux) for easy copy/paste directly from clipboard to Piknik.