Skip to content

Instantly share code, notes, and snippets.

View nanofaroque's full-sized avatar
💭
Please don't disturb me.

Omar Faroque (Anik) nanofaroque

💭
Please don't disturb me.
View GitHub Profile
@nanofaroque
nanofaroque / entrypoint-from-ssm-env-vars.sh
Created July 10, 2022 18:24 — forked from PeteGoo/entrypoint-from-ssm-env-vars.sh
Helpful SSM Parameter Store scripts
#!/bin/bash
# To use just set a variable with SSM_<target_env_var>=<ssm_parameter_store_path>
# e.g. SSM_database_password=prod/myservice/database-password
function get_parameter {
SSM_ENV_VAR_NAME=$1
ENV_VAR_NAME=`echo "$SSM_ENV_VAR_NAME" | cut -c5-`
SSM_PARAM_NAME="${!SSM_ENV_VAR_NAME}"
@nanofaroque
nanofaroque / iterm2-solarized.md
Created October 7, 2021 02:31 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@nanofaroque
nanofaroque / nginxproxy.md
Created June 27, 2018 21:35 — 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

@nanofaroque
nanofaroque / gist:a959ac1bbb3af1a614ab293e477b355f
Created June 22, 2016 02:20 — forked from archeg/gist:8333021
Example of code that uses HID for Android to connect to the device through USB.
package com.company.app.PlatformMethods;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Set;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
@nanofaroque
nanofaroque / JamodJ2ModTCP
Created April 29, 2016 14:43 — forked from zho/JamodJ2ModTCP
J2mod / Jamod read 4 TCP slave sample
import com.ghgande.j2mod.modbus.io.ModbusTCPTransaction;
import com.ghgande.j2mod.modbus.msg.ReadMultipleRegistersRequest;
import com.ghgande.j2mod.modbus.msg.ReadMultipleRegistersResponse;
import com.ghgande.j2mod.modbus.net.TCPMasterConnection;
import java.net.InetAddress;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*