Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# Author: Eric Tang @TYO Lab
# twitter.com/_e_tang
if [ "x$1" == "x" ]
then
echo "A bucket name must be provided".
echo "Usage: $0 [bucket_name]"
exit
@e-tang
e-tang / nginx.conf
Created April 20, 2020 06:04
I had problems in setting up nginx with CORS and I am using it as a reverse proxy for a nodejs service (using loopback)
location ~ ^/api(/?)(.*)$ {
#
# The default response headers by LoopBack 4 includes:
# Access-Control-Allow-Origin: *
# Access-Control-Allow-Credentials: true
# which won't be enough to make Chrome/Firefox happy
# so we have to add the following
add_header 'Access-Control-Allow-Methods' 'HEAD,GET,POST,OPTIONS,PUT,DELETE,PATCH';
proxy_pass http://127.0.0.1:3000/$2$is_args$args;
}
@e-tang
e-tang / exportSpreadsheet.gs
Created April 1, 2020 08:04 — forked from Spencer-Easton/exportSpreadsheet.gs
Example on how to export a Google sheet to various formats, includes most PDF options
function exportSpreadsheet() {
//All requests must include id in the path and a format parameter
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export
//FORMATS WITH NO ADDITIONAL OPTIONS
//format=xlsx //excel
//format=ods //Open Document Spreadsheet
//format=zip //html zipped
@e-tang
e-tang / nginxproxy.md
Created December 26, 2019 01:19 — 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

@e-tang
e-tang / android-forensics-tools.md
Last active August 16, 2025 07:02
Provide a list of tools that can be used in Android forensics
# For Debug with Visual Studio Code
zend_extension=xdebug.so
xdebug.coverage_enable=0
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_host=localhost
@e-tang
e-tang / Dockerfile
Created May 18, 2019 11:12 — forked from michaelneu/Dockerfile
docker-compose configuration for PHP with NGINX and MySQL, including sendmail, MailDev and phpmyadmin
# see https://github.com/cmaessen/docker-php-sendmail for more information
FROM php:5-fpm
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mysql mysqli sysvsem
RUN pecl install xdebug-2.5.5 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@e-tang
e-tang / proguard-rules.pro
Created May 14, 2019 02:42 — forked from bkhezry/proguard-rules.pro
Proguard rules for popular libraries.
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\bkhezry\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
@e-tang
e-tang / Nvidia GTX 1080 Ti on MacBook Pro (Akitio Node) with TF.md Setup Nvidia GPU [GTX 1080 ti] + CUDA 8.0 on MacBook for Deep Learning
@e-tang
e-tang / README.md
Created January 9, 2018 11:09 — forked from gwpl/README.md
Adding Custom Page to ppd. Definition of S0929100 Cards for LabelWriter printers (including Dymo 450 LabelWriter), as this roll is missing in Linux Drivers (lw450.ppd and other .ppd files) and Macintosh dymo.ppd file. It's reconstructed by hand. I've send email to technical support, so let's work on this one until official specification for roll…

Definition of S0929100 Cards for LabelWriter printers (including Dymo 450 LabelWriter), as this roll is missing in Linux Drivers (lw450.ppd and other .ppd files) and Macintosh dymo.ppd file. It's reconstructed by hand. I've send email to technical support, so let's work on this one until official specification for roll will arrive.

Please note you need to add each line to appropriate section in .ppd file according to : http://stackoverflow.com/a/3112256/544721 (On my systems, lw450.ppd files were located in /usr/share/cups/model/lw450.ppd)

Update: When I tried to apply patch below on dymo-cups-drivers-1.4.0.5 (dymo-cups-drivers-1.4.0.tar.gz), it turned out that there is already another definition of w144h252 page. Testing: