Skip to content

Instantly share code, notes, and snippets.

View pangyuteng's full-sized avatar

pangyuteng

View GitHub Profile
@pangyuteng
pangyuteng / ssh-airplane-wifi.md
Last active October 20, 2019 18:12 — forked from guillochon/ssh-airplane-wifi.md
Instructions on how to SSH on airplane WiFi that blocks port 22

Using SSH through airplane WiFi that blocks port 22 (via GCP and Ubuntu)

SUMMARY

Open WIFI often allow only traffic via http and https ports. This gist contains steps to allow you to ssh to a machine by first creating a VM, switching the ssh port to listen to port 80. So now, you can ssh (port 80) into the VM, in order to ssh (port 22) into your desired machine.

original gist by guillochon, this Fork contains reformatted steps, and I switched OS from CentOs to Ubuntu... just as an exercise to get famaliarized with GCP.

https://gist.github.com/guillochon/eeaa54b328952d260472c14c559f698a

Estimated time to complete the below steps is 5 to 10 minutes (assuming the internet connection is good, and GCP is operating smoothly).
@pangyuteng
pangyuteng / keras_spatial_bias.py
Last active November 13, 2019 19:09 — forked from N-McA/keras_spatial_bias.py
Concatenates the (x, y) coordinate normalised to 0-1 to each spatial location in the image. Allows a network to learn spatial bias. Has been explored in at least one paper, "An Intriguing Failing of Convolutional Neural Networks and the CoordConv Solution" https://arxiv.org/abs/1807.03247
class ConcatSpatialCoordinate(Layer):
def __init__(self, **kwargs):
"""Concatenates the (x, y) coordinate normalised to 0-1 to each spatial location in the image.
Allows a network to learn spatial bias. Has been explored in at least one paper,
"An Intriguing Failing of Convolutional Neural Networks and the CoordConv Solution"
https://arxiv.org/abs/1807.03247
Improves performance where spatial bias is appropriate.
Works with dynamic shapes.
@pangyuteng
pangyuteng / Dockerfile
Last active January 29, 2024 06:09
build gdcm from source inside Docker container
FROM ubuntu:18.04
RUN apt-get update && apt-get install -yq \
autotools-dev \
build-essential \
ca-certificates \
vim curl wget \
cmake g++
WORKDIR /opt/sources
@pangyuteng
pangyuteng / augment.py
Last active September 20, 2024 00:24
keras sample data generator, augmentation of keypoints and mask with albumentations
# sample code to augment image,mask and keypoints with albumentations
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import albumentations as A
image = np.random.rand(256,256)
image[64:128,64:128]+=0.5
mask = np.zeros((256,256))
@pangyuteng
pangyuteng / wsb-sentiment.ipynb
Last active March 21, 2023 17:06
sentiment analysis with data from r/wallstreetbets
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pangyuteng
pangyuteng / README.md
Last active July 20, 2023 22:31
rdp with reverse tunnel

rdp with reverse tunnel

TARGET (within VPN) -- INTERMEDIATE -- LAPTOP

If you want to connect to TARGET and are not able to setup vpn from LAPTOP to TARGET. You can try RDP with the below setup via an intermediate server (in the cloud, or local server at home).

  • run below in TARGET:
@pangyuteng
pangyuteng / README.md
Last active April 17, 2024 08:59
compute suv from pet
** PLEASE NOTE ***
there are many other solutions for computing SUV, see below link for more info.
https://qibawiki.rsna.org/index.php/Standardized_Uptake_Value_(SUV)

This gist contains code to perform the below with python (3.7).

+ download data from TCIA via tcia-rest api. (download.py, tciaclient.py)
@pangyuteng
pangyuteng / Dockerfile
Last active January 28, 2021 14:24 — forked from yochze/Dockerfile
Dockerfile to build Tensorflow 1.15.0 using nvidia-docker
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
# install python 3.7 and pip
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
software-properties-common \
pkg-config \
rsync \
@pangyuteng
pangyuteng / .gitignore
Last active April 5, 2023 16:57 — forked from davidlares/Dockerfile
Scaling Nginx servers via Docker' (a Flask app)
**/__pycache__/*
@pangyuteng
pangyuteng / README.md
Last active April 19, 2025 17:06
new pc setup

new pc setup ( work windows OS)

just install the below only (work machine, win os) for git bash

  • wsltty (to use as main terminal, because copy-pasting works in terminal).

    • you'll first need to install wsl and docker-desktop