Skip to content

Instantly share code, notes, and snippets.

View tapasbose's full-sized avatar

Tapas Bose tapasbose

View GitHub Profile
@tapasbose
tapasbose / VPVR.pine
Created April 19, 2025 18:10 — forked from 4skinSkywalker/VPVR.pine
Volume Profile Visible Range in Pine Script
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Fr3d0C0rl30n3
//@version=4
study("Fr3d0's Volume Profile Visible Range", "VPVR", overlay=true, max_boxes_count=500)
DEFAULT_COLOR = color.new(color.gray, 0)
BORDER_COLOR = color.new(color.black, 80)
BUY_COLOR = color.new(color.green, 0)
SELL_COLOR = color.new(color.red, 0)
@tapasbose
tapasbose / SSHFS
Last active June 22, 2020 09:48
Mount Remote Directory - SSHFS
mkdir /local_path
sshfs remote_user@remote_host:/remote_path /local_path -o IdentityFile=id_file_path
sudo fusermount -u /local_path
@tapasbose
tapasbose / generate-ssh-key.sh
Created May 20, 2019 07:02 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@tapasbose
tapasbose / gist:4604b7ced7aa566aba7afaaaa464ccb6
Created September 6, 2018 12:52
WebService calling using JAX-WS
String url = "<wsdl_url_without?wsdl>";
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setAddress(url);
factory.setServiceClass(YourWSInterface.class);
YourWSInterface yourWS = YourWSInterface.class.cast(factory.create());
Client client = ClientProxy.getClient(yourWS);
if (client != null) {
HTTPConduit conduit = (HTTPConduit) client.getConduit();
@tapasbose
tapasbose / gist:c9a4983409d6fd25de7820675cd76a10
Created September 5, 2018 07:17
Eclipse File Search Not Contains String
(?s)\A((?!SearchText).)*\Z
@tapasbose
tapasbose / gist:fb09f575276f3dd22a80677eef3e799d
Created August 7, 2018 12:15
TomEE Remote Client - Listing resources
# Enable remote EJB lookup in tomme/conf/system.properties
tomee.remote.support = true
# Add maven dependency
<dependency>
<groupId>org.apache.tomee</groupId>
<artifactId>openejb-client</artifactId>
<version>${tomee.version}</version>
</dependency>
<dependency>
@tapasbose
tapasbose / command
Created May 6, 2018 19:22
Sort and list video files ascending order based on their resolution
find . \( -name "*.mp4" -o -name "*.mkv" \) -exec sh -c 'echo `mediainfo --Inform="Video;%Width%x%Height%" "$1"`\\t`mediainfo --Inform="General;%FolderName%/%FileName%.%FileExtension%" "$1"`' _ {} \; | sort -n

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@tapasbose
tapasbose / ClassLoaderLeakExample.java
Created October 28, 2017 08:48 — forked from dpryden/ClassLoaderLeakExample.java
Example of a ClassLoader leak in Java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,